-
Notifications
You must be signed in to change notification settings - Fork 2.1k
CoAP: add remote and local endpoint information to request and response handlers #16429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoAP: add remote and local endpoint information to request and response handlers #16429
Conversation
|
I'm wondering if it would be possible to extend @chrysn: You raised the issue with supporting to access the local endpoint in a way that doesn't block adding other transports such as TCP or OSCORE. Maybe you're interested in joining the discussion? |
|
Having it in coap_pkt_t would IMO be the preferable way. As @maribu said: this would become important for TCP and gcoap-integrated OSCORE support, and both of these need different mechanisms to access the message itself. (And then they would would eventually do the typing of the remote). Thing is, the handler interface is really a nanocoap thing (not Gcoap), so either we do it all the way through nanocoap (which then does become more complex even though it is supposed to be minimal), or we introduce a shim at pkt level (where a pkt is now always a nanocoap one with a socket (which nanocoap doesn't know of) attached, but could later become a tcpcoap one). I'm open to both, but all do come with severe API changes. Might call for a round table on further CoAP support in RIOT to set a direction here. |
|
Starting the wider discussion on https://forum.riot-os.org/t/coap-road-map-thread/3230 |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This PR adds a
const coap_ep_t *remoteandconst coap_ep_t *localto the CoAP response and request handlers.A
coap_ep_t *is actually avoid *because there is no full support for other sockets than UDP yet and maybe CoAP over TCP will be added some day.The handlers in the
gcoapexample are caested to(coap_handler_t)to gain compatibility and still deal withsock_udp_ep_t *.Testing procedure
examples/gcoapIssues/PRs references
Trying to solve #15686