0

I have started to work with OpenThread with a Nordic DK. I am working with the BLE/Thread coap example that I modified in order to be a FTD instead of a MTD. Also, on one of my devices, the CoAP is configured as a server.

I figured out that when I pushed the button nRF52840 DK board programmed as a CoAP server, the light of the other board changes which means that the otCoapSendRequest function works.

Isn't it supposed to only works on a client device ?

Is it a normal or just a small bug in the OpenThread function ?

Book Of Zeus
  • 49,509
  • 18
  • 174
  • 171

2 Answers2

0

I can't speak for OpenThread in particular, but it is common in CoAP that server functions are enabled in addition to client functions rather switching between client and server mode – so it's not unexpected that client features still work even though you enabled server features.

This is because CoAP is designed to have much code shared between client and server. The Web of Things architecture calls the resulting client-server nodes "servients" (server-clients).

chrysn
  • 810
  • 6
  • 19
0

Thanks for your answer. I dug into the Nordic Code and found out that the CoAP init function creats services if the server mode is enable. In my code I switch from server to client on a randomly elected main device and this switch seems not to remove the services, I guess this combine with what you said explains what I have.