Lines Matching +full:resource +full:- +full:id

13 Zephyr comes with a batteries-included CoAP server, which uses services to listen for CoAP
23 .. code-block:: cfg
32 .. code-block:: c
33 :caption: ``sections-ram.ld``
41 .. code-block:: cmake
45 zephyr_linker_sources(DATA_SECTIONS sections-ram.ld)
54 .. code-block:: c
71 The following is an example of a CoAP resource registered with our service:
73 .. code-block:: c
77 static int my_get(struct coap_resource *resource, struct coap_packet *request,
83 uint16_t id;
88 id = coap_header_get_id(request);
95 COAP_RESPONSE_CODE_CONTENT, id);
106 return coap_resource_send(resource, &response, addr, addr_len, NULL);
109 static int my_put(struct coap_resource *resource, struct coap_packet *request,
127 As demonstrated in the example above, a CoAP resource handler can return response codes to let
136 .. code-block:: c
145 static int send_temperature(struct coap_resource *resource,
147 uint16_t age, uint16_t id, const uint8_t *token, uint8_t tkl,
162 id = coap_next_id();
166 COAP_RESPONSE_CODE_CONTENT, id);
187 return coap_resource_send(resource, &response, addr, addr_len, NULL);
190 static int temp_get(struct coap_resource *resource, struct coap_packet *request,
194 uint16_t id;
199 r = coap_resource_parse_observe(resource, request, addr);
201 id = coap_header_get_id(request);
204 return send_temperature(resource, addr, addr_len, r == 0 ? resource->age : 0,
205 id, token, tkl, true);
208 static void temp_notify(struct coap_resource *resource, struct coap_observer *observer)
210 send_temperature(resource, &observer->addr, sizeof(observer->addr), resource->age, 0,
211 observer->token, observer->tkl, false);
237 .. code-block:: c
260 printk("CoAP service %s started", net_event->service->name);
269 printk("CoAP service %s stopped", net_event->service->name);
283 ``.well-known/core`` GET requests by the server. This allows clients to get a list of hypermedia