@@ -69,9 +69,9 @@ extern const uint8_t COAP_MULTICAST_ADDR_SITE_LOCAL[16]; //!> ff05::fd, COAP sit
69
69
*
70
70
* Function that handles CoAP service message receiving and parsing
71
71
*
72
- * \param msg_id Id number of the current message .
72
+ * \param service_id Service handle .
73
73
* \param source_address IPv6 source address.
74
- * \param source_port Source port
74
+ * \param source_port Source port.
75
75
* \param response_ptr Pointer to CoAP header structure.
76
76
*
77
77
* \return 0 for success / -1 for failure
@@ -85,7 +85,7 @@ typedef int coap_service_response_recv(int8_t service_id, uint8_t source_address
85
85
*
86
86
* \param service_id Id number of the current service.
87
87
* \param source_address IPv6 source address.
88
- * \param source_port Source port
88
+ * \param source_port Source port.
89
89
* \param request_ptr Pointer to CoAP header structure.
90
90
*
91
91
* \return Status
@@ -98,8 +98,10 @@ typedef int coap_service_request_recv_cb(int8_t service_id, uint8_t source_addre
98
98
* Starts security service handling and fetches device password.
99
99
*
100
100
* \param service_id Id number of the current service.
101
- * \param address Address of sender
102
- * \param port Port of the device
101
+ * \param address Address of sender.
102
+ * \param port Port of the device.
103
+ * \param pw Pointer where to write the ecjpake password.
104
+ * \param pw_len Pointer where to write length of the ecjpake password.
103
105
*
104
106
* \return 0 for success / -1 for failure
105
107
*/
@@ -111,8 +113,8 @@ typedef int coap_service_security_start_cb(int8_t service_id, uint8_t address[st
111
113
* CoAP service security done callback function.
112
114
*
113
115
* \param service_id Id number of the current service.
114
- * \param address Address of sender
115
- * \param keyblock Security key (40 bits)
116
+ * \param address Address of sender.
117
+ * \param keyblock Security key (40 bits).
116
118
*
117
119
* \return 0 for success / -1 for failure
118
120
*/
@@ -147,23 +149,12 @@ extern void coap_service_delete( int8_t service_id );
147
149
*
148
150
* Closes secure connection (if present), but leaves socket open.
149
151
*
150
- * \param service_id Id number of the current service.
152
+ * \param service_id Id number of the current service.
153
+ * \param destimation_addr_ptr Connection destination address.
154
+ * \param port Connection destination port.
151
155
*/
152
156
extern void coap_service_close_secure_connection (int8_t service_id , uint8_t destination_addr_ptr [static 16 ], uint16_t port );
153
157
154
- /**
155
- * \brief Sets password for device
156
- *
157
- * \param service_id Service id
158
- * \param address Device address
159
- * \param port Device port
160
- * \param pw_ptr Pointer to password.
161
- * \param pw_len Lenght of password.
162
- *
163
- * \return 0 for success / -1 for failure
164
- */
165
- //int coap_service_security_key_set(int8_t service_id, uint8_t address[static 16], uint16_t port, uint8_t *pw_ptr, uint8_t pw_len);
166
-
167
158
/**
168
159
* \brief Virtual socket sent callback.
169
160
*
@@ -213,7 +204,6 @@ extern int16_t coap_service_virtual_socket_set_cb(int8_t service_id, coap_servic
213
204
*
214
205
* \param service_id Id number of the current service.
215
206
* \param *uri Uri address.
216
- * \param port port that Application wants to use for communicate with coap server.
217
207
* \param allowed_method Informs method that is allowed to use (used defines described above).
218
208
* \param *request_recv_cb CoAP service request receive callback function pointer.
219
209
*
@@ -240,7 +230,7 @@ extern int8_t coap_service_unregister_uri(int8_t service_id, const char *uri);
240
230
*
241
231
* \param service_id Id number of the current service.
242
232
* \param options Options defined above.
243
- * \param destination_addr IPv6 address.
233
+ * \param destination_addr IPv6 address.
244
234
* \param destination_port Destination port
245
235
* \param msg_type Message type can be found from sn_coap_header.
246
236
* \param msg_code Message code can be found from sn_coap_header.
@@ -261,15 +251,39 @@ extern uint16_t coap_service_request_send(int8_t service_id, uint8_t options, co
261
251
* Build and sends CoAP service response message.
262
252
*
263
253
* \param service_id Id number of the current service.
264
- * \param msg_id Message ID number.
265
254
* \param options Options defined above.
266
- * \param response_ptr Pointer to CoAP header structure.
255
+ * \param request_ptr Pointer to CoAP request message header structure.
256
+ * \param message_code Message code can be found from sn_coap_header.
257
+ * \param content_type Content type can be found from sn_coap_header.
258
+ * \param payload_ptr Pointer to message content.
259
+ * \param payload_len Lenght of the message.
267
260
*
268
261
* \return -1 For failure
269
262
*- 0 For success
270
263
*/
271
264
extern int8_t coap_service_response_send (int8_t service_id , uint8_t options , sn_coap_hdr_s * request_ptr , sn_coap_msg_code_e message_code , sn_coap_content_format_e content_type , const uint8_t * payload_ptr ,uint16_t payload_len );
272
265
266
+ /**
267
+ * \brief Sends CoAP service response
268
+ *
269
+ * Build and sends CoAP service response message based on CoAP request message id.
270
+ *
271
+ * \param service_id Id number of the current service.
272
+ * \param options Options defined above.
273
+ * \param msg_id Request messages ID.
274
+ * \param msg_type Message type can be found from sn_coap_header.
275
+ * \param message_code Message code can be found from sn_coap_header.
276
+ * \param content_type Content type can be found from sn_coap_header.
277
+ * \param payload_ptr Pointer to message content.
278
+ * \param payload_len Lenght of the message.
279
+ *
280
+ * \return -1 For failure
281
+ *- 0 For success
282
+ */
283
+ extern int8_t coap_service_response_send_by_msg_id (int8_t service_id , uint8_t options , uint16_t msg_id , sn_coap_msg_code_e message_code , sn_coap_content_format_e content_type , const uint8_t * payload_ptr ,uint16_t payload_len );
284
+
285
+
286
+
273
287
/**
274
288
* \brief Delete CoAP request transaction
275
289
*
@@ -316,7 +330,7 @@ extern int8_t coap_service_handshake_limits_set(uint8_t handshakes_max, uint8_t
316
330
* Configures the CoAP duplication message buffer size.
317
331
*
318
332
* \param service_id Id number of the current service.
319
- * \param size Buffer size (messages)
333
+ * \param size Buffer size (messages).
320
334
*
321
335
* \return -1 For failure
322
336
*- 0 For success
@@ -329,10 +343,10 @@ extern int8_t coap_service_set_duplicate_message_buffer(int8_t service_id, uint8
329
343
* Set DTLS certificates.
330
344
*
331
345
* \param service_id Id number of the current service.
332
- * \param cert Pointer to certificate chain
333
- * \param cert_len Certificate length
334
- * \param priv_key pointer to private key
335
- * \param priv_key_len length of private key
346
+ * \param cert Pointer to certificate chain.
347
+ * \param cert_len Certificate length.
348
+ * \param priv_key pointer to private key.
349
+ * \param priv_key_len length of private key.
336
350
*
337
351
* \return -1 For failure
338
352
*- 0 For success
0 commit comments