nRF5 IoT SDK v0.9.0
Data Fields
coap_message_conf_t Struct Reference

Structure to hold a CoAP message configuration. More...

#include <coap_api.h>

Data Fields

coap_response_callback_t response_callback
 
uint8_t token [8]
 
uint8_t token_len
 
uint16_t id
 
coap_msg_type_t type
 
coap_msg_code_t code
 
coap_port_t port
 

Detailed Description

Structure to hold a CoAP message configuration.

The structure is used when calling the coap_message_new API function. All data supplied will be copied to the created message.

Field Documentation

coap_msg_code_t coap_message_conf_t::code

Message code (definitions found in coap_msg_code_t).

uint16_t coap_message_conf_t::id

Message ID. If 0 is given, the library will replace this number with an autogenerated value.

coap_port_t coap_message_conf_t::port
                                Transport layer variable to associate the message with an underlying Transport Layer socket descriptor. \

Will be populated by the library during creation of the message. \ A value of 0 will auto-select port according to the type of message sent. Requests will go on COAP_CLIENT_PORT, \ and response will go on COAP_SERVER_PORT.

coap_response_callback_t coap_message_conf_t::response_callback

Callback function to be called when a response matching the token is identified.

uint8_t coap_message_conf_t::token[8]

Message token. token_len must be set to indicate how many of the bytes should be used in the token.

uint8_t coap_message_conf_t::token_len

Token size in bytes.

coap_msg_type_t coap_message_conf_t::type

Message type: COAP_TYPE_CON, COAP_TYPE_NON, COAP_TYPE_ACK, or COAP_TYPE_RST.


This document was last updated on Tue Dec 1 2015.
Please send us your feedback about the documentation! For technical questions, visit the Nordic Developer Zone.