CoAP client observer


Alessio
 

Hi Robert, thanks for your interest in the topic! 
I will take a look at the pull!

Best

Alessio Galliazzo

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
    - Brian W. Kernighan


Il giorno lun 29 nov 2021 alle ore 15:52 Lubos, Robert <Robert.Lubos@...> ha scritto:

Hi Alessio,

 

Unfortunately I’m not aware of any other good resource for the client side of the Zephyr Observer API other than `coap_client` sample. When checking the sample though I’ve noticed that indeed it might be confusing for the users, as the observer part was oversimplified IMO, and not fully RFC-compliant.

 

I’ve posted a PR (https://github.com/zephyrproject-rtos/zephyr/pull/40734) which aims to improve the sample in this regard – it now shows how to register a response callback, which will be called for each notification.

 

Regards,

Robert

 

From: users@... <users@...> On Behalf Of Alessio via lists.zephyrproject.org
Sent: sobota, 27 listopada 2021 16:35
To: users@...
Subject: [Zephyr-users] CoAP client observer

 

Dear Sirs,

can anyone point me to some docs to read, some code examples or some tutorial about CoAP observer?

 

Starting from CoAP client example, I'm stuck in a point where I, from a client, can ask to a server to observe a topic but I never get notified about changes. Data packages are sent from the server (I can see that with wireshark) but seems that the callback is never called. Maybe I'm missing something...

 

Best


Alessio Galliazzo

 

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
    - Brian W. Kernighan


Lubos, Robert
 

Hi Alessio,

 

Unfortunately I’m not aware of any other good resource for the client side of the Zephyr Observer API other than `coap_client` sample. When checking the sample though I’ve noticed that indeed it might be confusing for the users, as the observer part was oversimplified IMO, and not fully RFC-compliant.

 

I’ve posted a PR (https://github.com/zephyrproject-rtos/zephyr/pull/40734) which aims to improve the sample in this regard – it now shows how to register a response callback, which will be called for each notification.

 

Regards,

Robert

 

From: users@... <users@...> On Behalf Of Alessio via lists.zephyrproject.org
Sent: sobota, 27 listopada 2021 16:35
To: users@...
Subject: [Zephyr-users] CoAP client observer

 

Dear Sirs,

can anyone point me to some docs to read, some code examples or some tutorial about CoAP observer?

 

Starting from CoAP client example, I'm stuck in a point where I, from a client, can ask to a server to observe a topic but I never get notified about changes. Data packages are sent from the server (I can see that with wireshark) but seems that the callback is never called. Maybe I'm missing something...

 

Best


Alessio Galliazzo

 

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
    - Brian W. Kernighan


Alessio
 

Dear Sirs,
can anyone point me to some docs to read, some code examples or some tutorial about CoAP observer?

Starting from CoAP client example, I'm stuck in a point where I, from a client, can ask to a server to observe a topic but I never get notified about changes. Data packages are sent from the server (I can see that with wireshark) but seems that the callback is never called. Maybe I'm missing something...

Best

Alessio Galliazzo

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
    - Brian W. Kernighan