Page 1 of 1

Coap observing with asynchronous get

Posted: Wed Feb 27, 2019 8:05 am
by leenowell
Hi all,

I have been looking at the coap library which is bundled with the IDF and managed to get the client server example working fine - it uses an asynchronous get. I modified the code to enable the client to "observe" changes and the initial get seems to work fine. The trouble is, when the resource is marked as dirty and it tries to send the update back to the client, I get a core dump.

It looks like the reason for this is that the handler receives a null request - I guess this may make sense since there wasn't an actual request from the client.

How should I deal with this? Creating a request PDU in the handler seems to partly work but because I don't have the original request I believe coap is rejecting it at the client because the id of the response matches my fake one rather than the one the client originally sent (as per the spec I believe).

Anyone have any ideas?

Thanks in advance

Lee.

Re: Coap observing with asynchronous get

Posted: Fri Mar 01, 2019 7:05 am
by leenowell
Any ideas anyone?