NSDL C library
Dependents: NSDL_HelloWorld_WiFi UbloxModemNanoServiceClient IOT-NSDL_HelloWorld LWM2M_NanoService_Ethernet ... more
Fork of nsdl_lib by
Note that use of this software requires acceptance of the Sensinode EULA: http://mbed.org/teams/Sensinode/code/nsdl_lib/wiki/EULA
sn_coap_header.h@1:01d723824294, 2013-10-09 (annotated)
- Committer:
- screamer
- Date:
- Wed Oct 09 14:18:21 2013 +0000
- Revision:
- 1:01d723824294
- Parent:
- 0:58c4f13c4b9a
- Child:
- 2:ab50a2ab6ec9
Added doxygen markup
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
terohoo | 0:58c4f13c4b9a | 1 | /** |
terohoo | 0:58c4f13c4b9a | 2 | * \file sn_coap_header.h |
terohoo | 0:58c4f13c4b9a | 3 | * |
terohoo | 0:58c4f13c4b9a | 4 | * \brief CoAP C-library User header interface header file |
terohoo | 0:58c4f13c4b9a | 5 | * |
terohoo | 0:58c4f13c4b9a | 6 | * Created on: Jun 30, 2011 |
terohoo | 0:58c4f13c4b9a | 7 | * Author: tero |
terohoo | 0:58c4f13c4b9a | 8 | * |
terohoo | 0:58c4f13c4b9a | 9 | * \note Supports draft-ietf-core-coap-18 |
terohoo | 0:58c4f13c4b9a | 10 | */ |
terohoo | 0:58c4f13c4b9a | 11 | |
terohoo | 0:58c4f13c4b9a | 12 | #ifndef SN_COAP_HEADER_H_ |
terohoo | 0:58c4f13c4b9a | 13 | #define SN_COAP_HEADER_H_ |
terohoo | 0:58c4f13c4b9a | 14 | |
terohoo | 0:58c4f13c4b9a | 15 | #ifdef __cplusplus |
terohoo | 0:58c4f13c4b9a | 16 | extern "C" { |
terohoo | 0:58c4f13c4b9a | 17 | #endif |
terohoo | 0:58c4f13c4b9a | 18 | |
terohoo | 0:58c4f13c4b9a | 19 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 20 | /* * * * DEFINES * * * */ |
terohoo | 0:58c4f13c4b9a | 21 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 22 | |
terohoo | 0:58c4f13c4b9a | 23 | /* * * * * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 24 | /* * * * ENUMERATIONS * * * */ |
terohoo | 0:58c4f13c4b9a | 25 | /* * * * * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 26 | |
screamer | 1:01d723824294 | 27 | /** |
screamer | 1:01d723824294 | 28 | * Enumeration for CoAP Version |
screamer | 1:01d723824294 | 29 | */ |
terohoo | 0:58c4f13c4b9a | 30 | typedef enum coap_version_ |
terohoo | 0:58c4f13c4b9a | 31 | { |
terohoo | 0:58c4f13c4b9a | 32 | COAP_VERSION_1 = 0x40, |
terohoo | 0:58c4f13c4b9a | 33 | COAP_VERSION_UNKNOWN = 0xFF |
terohoo | 0:58c4f13c4b9a | 34 | } coap_version_e; |
terohoo | 0:58c4f13c4b9a | 35 | |
screamer | 1:01d723824294 | 36 | /** |
screamer | 1:01d723824294 | 37 | * Enumeration for CoAP Message type, used in CoAP Header |
screamer | 1:01d723824294 | 38 | */ |
terohoo | 0:58c4f13c4b9a | 39 | typedef enum sn_coap_msg_type_ |
terohoo | 0:58c4f13c4b9a | 40 | { |
screamer | 1:01d723824294 | 41 | COAP_MSG_TYPE_CONFIRMABLE = 0x00, /**< User uses this for Reliable Request messages */ |
screamer | 1:01d723824294 | 42 | COAP_MSG_TYPE_NON_CONFIRMABLE = 0x10, /**< User uses this for Non-reliable Request and Response messages */ |
screamer | 1:01d723824294 | 43 | COAP_MSG_TYPE_ACKNOWLEDGEMENT = 0x20, /**< User uses this for Response to a Confirmable Request */ |
screamer | 1:01d723824294 | 44 | COAP_MSG_TYPE_RESET = 0x30 /**< User uses this to answer a Bad Request */ |
terohoo | 0:58c4f13c4b9a | 45 | } sn_coap_msg_type_e; |
terohoo | 0:58c4f13c4b9a | 46 | |
screamer | 1:01d723824294 | 47 | /** |
screamer | 1:01d723824294 | 48 | * Enumeration for CoAP Message code, used in CoAP Header |
screamer | 1:01d723824294 | 49 | */ |
terohoo | 0:58c4f13c4b9a | 50 | typedef enum sn_coap_msg_code_ |
terohoo | 0:58c4f13c4b9a | 51 | { |
terohoo | 0:58c4f13c4b9a | 52 | COAP_MSG_CODE_EMPTY = 0, |
terohoo | 0:58c4f13c4b9a | 53 | COAP_MSG_CODE_REQUEST_GET = 1, |
terohoo | 0:58c4f13c4b9a | 54 | COAP_MSG_CODE_REQUEST_POST = 2, |
terohoo | 0:58c4f13c4b9a | 55 | COAP_MSG_CODE_REQUEST_PUT = 3, |
terohoo | 0:58c4f13c4b9a | 56 | COAP_MSG_CODE_REQUEST_DELETE = 4, |
terohoo | 0:58c4f13c4b9a | 57 | |
terohoo | 0:58c4f13c4b9a | 58 | COAP_MSG_CODE_RESPONSE_CREATED = 65, |
terohoo | 0:58c4f13c4b9a | 59 | COAP_MSG_CODE_RESPONSE_DELETED = 66, |
terohoo | 0:58c4f13c4b9a | 60 | COAP_MSG_CODE_RESPONSE_VALID = 67, |
terohoo | 0:58c4f13c4b9a | 61 | COAP_MSG_CODE_RESPONSE_CHANGED = 68, |
terohoo | 0:58c4f13c4b9a | 62 | COAP_MSG_CODE_RESPONSE_CONTENT = 69, |
terohoo | 0:58c4f13c4b9a | 63 | COAP_MSG_CODE_RESPONSE_BAD_REQUEST = 128, |
terohoo | 0:58c4f13c4b9a | 64 | COAP_MSG_CODE_RESPONSE_UNAUTHORIZED = 129, |
terohoo | 0:58c4f13c4b9a | 65 | COAP_MSG_CODE_RESPONSE_BAD_OPTION = 130, |
terohoo | 0:58c4f13c4b9a | 66 | COAP_MSG_CODE_RESPONSE_FORBIDDEN = 131, |
terohoo | 0:58c4f13c4b9a | 67 | COAP_MSG_CODE_RESPONSE_NOT_FOUND = 132, |
terohoo | 0:58c4f13c4b9a | 68 | COAP_MSG_CODE_RESPONSE_METHOD_NOT_ALLOWED = 133, |
terohoo | 0:58c4f13c4b9a | 69 | COAP_MSG_CODE_RESPONSE_NOT_ACCEPTABLE = 134, |
terohoo | 0:58c4f13c4b9a | 70 | COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_INCOMPLETE = 136, /* Block */ |
terohoo | 0:58c4f13c4b9a | 71 | COAP_MSG_CODE_RESPONSE_PRECONDITION_FAILED = 140, |
terohoo | 0:58c4f13c4b9a | 72 | COAP_MSG_CODE_RESPONSE_REQUEST_ENTITY_TOO_LARGE = 141, |
terohoo | 0:58c4f13c4b9a | 73 | COAP_MSG_CODE_RESPONSE_UNSUPPORTED_CONTENT_FORMAT = 143, |
terohoo | 0:58c4f13c4b9a | 74 | COAP_MSG_CODE_RESPONSE_INTERNAL_SERVER_ERROR = 160, |
terohoo | 0:58c4f13c4b9a | 75 | COAP_MSG_CODE_RESPONSE_NOT_IMPLEMENTED = 161, |
terohoo | 0:58c4f13c4b9a | 76 | COAP_MSG_CODE_RESPONSE_BAD_GATEWAY = 162, |
terohoo | 0:58c4f13c4b9a | 77 | COAP_MSG_CODE_RESPONSE_SERVICE_UNAVAILABLE = 163, |
terohoo | 0:58c4f13c4b9a | 78 | COAP_MSG_CODE_RESPONSE_GATEWAY_TIMEOUT = 164, |
terohoo | 0:58c4f13c4b9a | 79 | COAP_MSG_CODE_RESPONSE_PROXYING_NOT_SUPPORTED = 165 |
terohoo | 0:58c4f13c4b9a | 80 | } sn_coap_msg_code_e; |
terohoo | 0:58c4f13c4b9a | 81 | |
screamer | 1:01d723824294 | 82 | /** |
screamer | 1:01d723824294 | 83 | * Enumeration for CoAP Option number, used in CoAP Header |
screamer | 1:01d723824294 | 84 | */ |
terohoo | 0:58c4f13c4b9a | 85 | typedef enum sn_coap_option_numbers_ |
terohoo | 0:58c4f13c4b9a | 86 | { |
terohoo | 0:58c4f13c4b9a | 87 | COAP_OPTION_IF_MATCH = 1, |
terohoo | 0:58c4f13c4b9a | 88 | COAP_OPTION_URI_HOST = 3, |
terohoo | 0:58c4f13c4b9a | 89 | COAP_OPTION_ETAG = 4, |
terohoo | 0:58c4f13c4b9a | 90 | COAP_OPTION_IF_NONE_MATCH = 5, |
terohoo | 0:58c4f13c4b9a | 91 | COAP_OPTION_OBSERVE = 6, |
terohoo | 0:58c4f13c4b9a | 92 | COAP_OPTION_URI_PORT = 7, |
terohoo | 0:58c4f13c4b9a | 93 | COAP_OPTION_LOCATION_PATH = 8, |
terohoo | 0:58c4f13c4b9a | 94 | COAP_OPTION_URI_PATH = 11, |
terohoo | 0:58c4f13c4b9a | 95 | COAP_OPTION_CONTENT_FORMAT = 12, |
terohoo | 0:58c4f13c4b9a | 96 | COAP_OPTION_MAX_AGE = 14, |
terohoo | 0:58c4f13c4b9a | 97 | COAP_OPTION_URI_QUERY = 15, |
terohoo | 0:58c4f13c4b9a | 98 | COAP_OPTION_ACCEPT = 17, |
terohoo | 0:58c4f13c4b9a | 99 | COAP_OPTION_LOCATION_QUERY = 20, |
terohoo | 0:58c4f13c4b9a | 100 | COAP_OPTION_BLOCK2 = 23, |
terohoo | 0:58c4f13c4b9a | 101 | COAP_OPTION_BLOCK1 = 27, |
terohoo | 0:58c4f13c4b9a | 102 | COAP_OPTION_PROXY_URI = 35, |
terohoo | 0:58c4f13c4b9a | 103 | COAP_OPTION_PROXY_SCHEME = 39, |
terohoo | 0:58c4f13c4b9a | 104 | COAP_OPTION_SIZE1 = 60 |
terohoo | 0:58c4f13c4b9a | 105 | // 128 = (Reserved) |
terohoo | 0:58c4f13c4b9a | 106 | // 132 = (Reserved) |
terohoo | 0:58c4f13c4b9a | 107 | // 136 = (Reserved) |
terohoo | 0:58c4f13c4b9a | 108 | } sn_coap_option_numbers_e; |
terohoo | 0:58c4f13c4b9a | 109 | |
screamer | 1:01d723824294 | 110 | /** |
screamer | 1:01d723824294 | 111 | * Enumeration for CoAP Content Format codes |
screamer | 1:01d723824294 | 112 | */ |
terohoo | 0:58c4f13c4b9a | 113 | typedef enum sn_coap_content_format_ |
terohoo | 0:58c4f13c4b9a | 114 | { |
terohoo | 0:58c4f13c4b9a | 115 | COAP_CT_NONE = -1, |
terohoo | 0:58c4f13c4b9a | 116 | COAP_CT_TEXT_PLAIN = 0, |
terohoo | 0:58c4f13c4b9a | 117 | COAP_CT_LINK_FORMAT = 40, |
terohoo | 0:58c4f13c4b9a | 118 | COAP_CT_XML = 41, |
terohoo | 0:58c4f13c4b9a | 119 | COAP_CT_OCTET_STREAM = 42, |
terohoo | 0:58c4f13c4b9a | 120 | COAP_CT_EXI = 47, |
terohoo | 0:58c4f13c4b9a | 121 | COAP_CT_JSON = 50, |
terohoo | 0:58c4f13c4b9a | 122 | } sn_coap_content_format_e; |
terohoo | 0:58c4f13c4b9a | 123 | |
screamer | 1:01d723824294 | 124 | /** |
screamer | 1:01d723824294 | 125 | * Enumeration for CoAP status, used in CoAP Header |
screamer | 1:01d723824294 | 126 | */ |
terohoo | 0:58c4f13c4b9a | 127 | typedef enum sn_coap_status_ |
terohoo | 0:58c4f13c4b9a | 128 | { |
screamer | 1:01d723824294 | 129 | COAP_STATUS_OK = 0, /**< Default value is OK */ |
screamer | 1:01d723824294 | 130 | COAP_STATUS_PARSER_ERROR_IN_HEADER = 1, /**< CoAP will send Reset message to invalid message sender */ |
screamer | 1:01d723824294 | 131 | COAP_STATUS_PARSER_DUPLICATED_MSG = 2, /**< CoAP will send Acknowledgement message to duplicated message sender */ |
screamer | 1:01d723824294 | 132 | COAP_STATUS_PARSER_BLOCKWISE_MSG_RECEIVING = 3, /**< User will get whole message after all message blocks received. |
screamer | 1:01d723824294 | 133 | User must release messages with this status. */ |
screamer | 1:01d723824294 | 134 | COAP_STATUS_PARSER_BLOCKWISE_ACK = 4, /**< Acknowledgement for sent Blockwise message received */ |
screamer | 1:01d723824294 | 135 | COAP_STATUS_PARSER_BLOCKWISE_MSG_REJECTED = 5, /**< Blockwise message received but not supported by compiling switch */ |
screamer | 1:01d723824294 | 136 | COAP_STATUS_PARSER_BLOCKWISE_MSG_RECEIVED = 6 /**< Blockwise message fully received and returned to app. |
screamer | 1:01d723824294 | 137 | User must take care of releasing whole payload of the blockwise messages */ |
terohoo | 0:58c4f13c4b9a | 138 | } sn_coap_status_e; |
terohoo | 0:58c4f13c4b9a | 139 | |
terohoo | 0:58c4f13c4b9a | 140 | |
terohoo | 0:58c4f13c4b9a | 141 | /* * * * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 142 | /* * * * STRUCTURES * * * */ |
terohoo | 0:58c4f13c4b9a | 143 | /* * * * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 144 | |
screamer | 1:01d723824294 | 145 | /** |
screamer | 1:01d723824294 | 146 | * Structure for CoAP Options |
screamer | 1:01d723824294 | 147 | */ |
terohoo | 0:58c4f13c4b9a | 148 | typedef struct sn_coap_options_list_ |
terohoo | 0:58c4f13c4b9a | 149 | { |
terohoo | 0:58c4f13c4b9a | 150 | |
terohoo | 0:58c4f13c4b9a | 151 | /* If-Match */ |
terohoo | 0:58c4f13c4b9a | 152 | /* If-None-Match */ |
terohoo | 0:58c4f13c4b9a | 153 | /* Size */ |
terohoo | 0:58c4f13c4b9a | 154 | /* Proxy-Scheme */ |
terohoo | 0:58c4f13c4b9a | 155 | |
screamer | 1:01d723824294 | 156 | uint8_t max_age_len; /**< 0-4 bytes. */ |
screamer | 1:01d723824294 | 157 | uint8_t *max_age_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 158 | |
screamer | 1:01d723824294 | 159 | uint16_t proxy_uri_len; /**< 1-1034 bytes. */ |
screamer | 1:01d723824294 | 160 | uint8_t *proxy_uri_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 161 | |
screamer | 1:01d723824294 | 162 | uint8_t etag_len; /**< 1-8 bytes. Repeatable */ |
screamer | 1:01d723824294 | 163 | uint8_t *etag_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 164 | |
screamer | 1:01d723824294 | 165 | uint16_t uri_host_len; /**< 1-255 bytes. */ |
screamer | 1:01d723824294 | 166 | uint8_t *uri_host_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 167 | |
screamer | 1:01d723824294 | 168 | uint16_t location_path_len; /**< 0-255 bytes. Repeatable */ |
screamer | 1:01d723824294 | 169 | uint8_t *location_path_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 170 | |
screamer | 1:01d723824294 | 171 | uint8_t uri_port_len; /**< 0-2 bytes. */ |
screamer | 1:01d723824294 | 172 | uint8_t *uri_port_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 173 | |
screamer | 1:01d723824294 | 174 | uint16_t location_query_len; /**< 0-255 bytes. Repeatable */ |
screamer | 1:01d723824294 | 175 | uint8_t *location_query_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 176 | |
terohoo | 0:58c4f13c4b9a | 177 | uint8_t observe; |
screamer | 1:01d723824294 | 178 | uint8_t observe_len; /**< 0-2 bytes. */ |
screamer | 1:01d723824294 | 179 | uint8_t *observe_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 180 | |
screamer | 1:01d723824294 | 181 | uint8_t accept_len; /**< 0-2 bytes. Repeatable */ |
screamer | 1:01d723824294 | 182 | uint8_t *accept_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 183 | |
screamer | 1:01d723824294 | 184 | uint16_t uri_query_len; /**< 1-255 bytes. Repeatable */ |
screamer | 1:01d723824294 | 185 | uint8_t *uri_query_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 186 | |
screamer | 1:01d723824294 | 187 | uint8_t block1_len; /**< 0-3 bytes. */ |
screamer | 1:01d723824294 | 188 | uint8_t *block1_ptr; /**< Not for User */ |
terohoo | 0:58c4f13c4b9a | 189 | |
screamer | 1:01d723824294 | 190 | uint8_t block2_len; /**< 0-3 bytes. */ |
screamer | 1:01d723824294 | 191 | uint8_t *block2_ptr; /**< Not for User */ |
terohoo | 0:58c4f13c4b9a | 192 | } sn_coap_options_list_s; |
terohoo | 0:58c4f13c4b9a | 193 | |
screamer | 1:01d723824294 | 194 | |
terohoo | 0:58c4f13c4b9a | 195 | /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ |
terohoo | 0:58c4f13c4b9a | 196 | /* !!! Main CoAP message struct !!! */ |
terohoo | 0:58c4f13c4b9a | 197 | /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ |
screamer | 1:01d723824294 | 198 | |
screamer | 1:01d723824294 | 199 | /** |
screamer | 1:01d723824294 | 200 | * Main CoAP message struct |
screamer | 1:01d723824294 | 201 | */ |
terohoo | 0:58c4f13c4b9a | 202 | typedef struct sn_coap_hdr_ |
terohoo | 0:58c4f13c4b9a | 203 | { |
screamer | 1:01d723824294 | 204 | sn_coap_status_e coap_status; /**< Used for telling to User special cases when parsing message */ |
terohoo | 0:58c4f13c4b9a | 205 | |
terohoo | 0:58c4f13c4b9a | 206 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 207 | /* * * * Header * * * */ |
terohoo | 0:58c4f13c4b9a | 208 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 209 | |
screamer | 1:01d723824294 | 210 | sn_coap_msg_type_e msg_type; /**< Confirmable, Non-Confirmable, Acknowledgement or Reset */ |
screamer | 1:01d723824294 | 211 | sn_coap_msg_code_e msg_code; /**< Empty: 0; Requests: 1-31; Responses: 64-191 */ |
screamer | 1:01d723824294 | 212 | uint16_t msg_id; /**< Message ID. Parser sets parsed message ID, builder sets message ID of built coap message */ |
terohoo | 0:58c4f13c4b9a | 213 | |
terohoo | 0:58c4f13c4b9a | 214 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 215 | /* * * * Options * * * */ |
terohoo | 0:58c4f13c4b9a | 216 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 217 | |
terohoo | 0:58c4f13c4b9a | 218 | /* Here are most often used Options */ |
terohoo | 0:58c4f13c4b9a | 219 | |
screamer | 1:01d723824294 | 220 | uint16_t uri_path_len; /**< 0-255 bytes. Repeatable. */ |
screamer | 1:01d723824294 | 221 | uint8_t *uri_path_ptr; /**< Must be set to NULL if not used. E.g: temp1/temp2 */ |
terohoo | 0:58c4f13c4b9a | 222 | |
screamer | 1:01d723824294 | 223 | uint8_t token_len; /**< 1-8 bytes. */ |
screamer | 1:01d723824294 | 224 | uint8_t *token_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 225 | |
terohoo | 0:58c4f13c4b9a | 226 | /* todo: COAP12 - content type ptr as a content_type_e */ |
screamer | 1:01d723824294 | 227 | uint8_t content_type_len; /**< 0-2 bytes. */ |
screamer | 1:01d723824294 | 228 | uint8_t *content_type_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 229 | |
terohoo | 0:58c4f13c4b9a | 230 | /* Here are not so often used Options */ |
screamer | 1:01d723824294 | 231 | sn_coap_options_list_s *options_list_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 232 | |
terohoo | 0:58c4f13c4b9a | 233 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 234 | /* * * * Payload * * * */ |
terohoo | 0:58c4f13c4b9a | 235 | /* * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 236 | |
screamer | 1:01d723824294 | 237 | uint16_t payload_len; /**< Must be set to zero if not used */ |
screamer | 1:01d723824294 | 238 | uint8_t *payload_ptr; /**< Must be set to NULL if not used */ |
terohoo | 0:58c4f13c4b9a | 239 | } sn_coap_hdr_s; |
terohoo | 0:58c4f13c4b9a | 240 | |
terohoo | 0:58c4f13c4b9a | 241 | /* * * * * * * * * * * * * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 242 | /* * * * EXTERNAL FUNCTION PROTOTYPES * * * */ |
terohoo | 0:58c4f13c4b9a | 243 | /* * * * * * * * * * * * * * * * * * * * * * */ |
terohoo | 0:58c4f13c4b9a | 244 | |
terohoo | 0:58c4f13c4b9a | 245 | extern void sn_coap_builder_and_parser_init(void* (*used_malloc_func_ptr)(uint16_t), void (*used_free_func_ptr)(void*)); |
terohoo | 0:58c4f13c4b9a | 246 | extern sn_coap_hdr_s *sn_coap_parser(uint16_t packet_data_len, uint8_t *packet_data_ptr, coap_version_e *coap_version_ptr); |
terohoo | 0:58c4f13c4b9a | 247 | extern int16_t sn_coap_builder(uint8_t *dst_packet_data_ptr, sn_coap_hdr_s *src_coap_msg_ptr); |
terohoo | 0:58c4f13c4b9a | 248 | extern uint16_t sn_coap_builder_calc_needed_packet_data_size(sn_coap_hdr_s *src_coap_msg_ptr); |
terohoo | 0:58c4f13c4b9a | 249 | extern void sn_coap_builder_release_allocated_send_msg_mem(sn_nsdl_transmit_s *freed_send_msg_ptr); |
terohoo | 0:58c4f13c4b9a | 250 | extern sn_coap_hdr_s *sn_coap_build_response(sn_coap_hdr_s *coap_packet_ptr, uint8_t msg_code); |
terohoo | 0:58c4f13c4b9a | 251 | extern void sn_coap_parser_release_allocated_coap_msg_mem(sn_coap_hdr_s *freed_coap_msg_ptr); |
terohoo | 0:58c4f13c4b9a | 252 | extern void sn_coap_packet_debug(sn_coap_hdr_s *coap_packet_ptr); |
terohoo | 0:58c4f13c4b9a | 253 | |
terohoo | 0:58c4f13c4b9a | 254 | #endif /* SN_COAP_HEADER_H_ */ |
terohoo | 0:58c4f13c4b9a | 255 | |
terohoo | 0:58c4f13c4b9a | 256 | #ifdef __cplusplus |
terohoo | 0:58c4f13c4b9a | 257 | } |
terohoo | 0:58c4f13c4b9a | 258 | #endif |