0

Context

I'm trying to dynamically create and access multiple CoAP ressources on the same server. Basically what is would like is something like get coap://ip/ressource/* and get all the data of ressource/1 ressource/n

Linked subject

I found the following CoAP: Group similar resources under one

"what's left is that you create a /TIME/ resource (the slash at the end does matter) and announce it in .well-known/core as ;if="core.b"."

Problem

I don't know how i can create a ressource with specific attributes from client

Experiment with libcoap

coap-client -m put coap://ip/ressource;if="core.b" doesn't return error but attributes is not created (used copper)

Damezumari
  • 17
  • 6

1 Answers1

0

That's entirely up to the server. Are you writing the server (if so, using which framework?) or just trying to make an existing server (if so, which?) behave as you like?

chrysn
  • 810
  • 6
  • 19
  • I am using libcoap server examples with libcoap client examples which will be used on thread nodes. So your response implies that it is probably not in native implémentations and that i should code the handlers of the examples to add the functionnality described in https://tools.ietf.org/html/draft-ietf-core-interfaces-14 ? – Damezumari Mar 31 '20 at 11:31
  • libcoap itself does not implement any of what core-interfaces describes, that is up to the implementation. You can set link attributes in the coap_resource_t you define for the resources, but that does not make them act like that. As long as you only need batch-like behavior, just write an explicit resource handler at the parent location. If you plan on following interfaces-14 to the letter, please see also my [recent comment on the question you linked](https://stackoverflow.com/questions/34893380/coap-group-similar-resources-under-one#comment107830151_51554198). – chrysn Apr 01 '20 at 14:00