lobaro / lobaro-coap

CoAP Implementation in C
MIT License
124 stars 47 forks source link

Improve `/.well-known/core` Handler #15

Open NZSmartie opened 7 years ago

NZSmartie commented 7 years ago

Regarding the default /.well-known/core handler; I think adding a CoAP_RemoveResource(...) to complement CoAP_CreateResource(...) would enable the application to remove the default handler and help by allowing the application to dynamically remove resources as they disappear from the device (for what ever reason).

Another idea is allowing the application layer to manually register WellKnown_GetHandler (Might rename it to CoAP_DefaultWellKnownHandler for clarity). Or possibly adding a flag to CoAP_Config_t to disable automatic registration of the default handler

otherwise, maybe a callback could be added to CoAP_ResOpts_t When it's not null, WellKnown_GetHandler will call that for generating a string (i.e. </example/resource>;ct="0 50 60";rt="example";if="sensor") per resource.

tothero commented 6 years ago

Will be added soon. We redesign the stack in a way that we use ONE linked list lib. With this improvement it's no problem to add it dynamically. Stay tuned.

niondir commented 6 years ago

"soon" is relativ. It's not clear when we find time to spend on this. So help is always welcome. We let you known in case we start on it.