Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-client-c by
sn_coap_parser.c File Reference
CoAP Header parser. More...
Go to the source code of this file.
Functions | |
| static void | sn_coap_parser_header_parse (uint8_t **packet_data_pptr, sn_coap_hdr_s *dst_coap_msg_ptr, coap_version_e *coap_version_ptr) |
| Parses CoAP message's Header part from given Packet data. | |
| static int8_t | sn_coap_parser_payload_parse (uint16_t packet_data_len, uint8_t *packet_data_start_ptr, uint8_t **packet_data_pptr, sn_coap_hdr_s *dst_coap_msg_ptr) |
| Parses CoAP message's Payload part from given Packet data. | |
| sn_coap_hdr_s * | sn_coap_parser (struct coap_s *handle, uint16_t packet_data_len, uint8_t *packet_data_ptr, coap_version_e *coap_version_ptr) |
| Parses CoAP message from given Packet data. | |
| void | sn_coap_parser_release_allocated_coap_msg_mem (struct coap_s *handle, sn_coap_hdr_s *freed_coap_msg_ptr) |
| Releases memory of given CoAP message. | |
Detailed Description
CoAP Header parser.
Functionality: Parses CoAP Header
Definition in file sn_coap_parser.c.
Function Documentation
| sn_coap_hdr_s* sn_coap_parser | ( | struct coap_s * | handle, |
| uint16_t | packet_data_len, | ||
| uint8_t * | packet_data_ptr, | ||
| coap_version_e * | coap_version_ptr | ||
| ) |
Parses CoAP message from given Packet data.
- Parameters:
-
*handle Pointer to CoAP library handle packet_data_len is length of given Packet data to be parsed to CoAP message *packet_data_ptr is source for Packet data to be parsed to CoAP message *coap_version_ptr is destination for parsed CoAP specification version
- Returns:
- Return value is pointer to parsed CoAP message.
In following failure cases NULL is returned:
-Failure in given pointer (= NULL)
-Failure in memory allocation (malloc() returns NULL)
Definition at line 50 of file sn_coap_parser.c.
| static void sn_coap_parser_header_parse | ( | uint8_t ** | packet_data_pptr, |
| sn_coap_hdr_s * | dst_coap_msg_ptr, | ||
| coap_version_e * | coap_version_ptr | ||
| ) | [static] |
Parses CoAP message's Header part from given Packet data.
- Parameters:
-
**packet_data_ptr is source for Packet data to be parsed to CoAP message *dst_coap_msg_ptr is destination for parsed CoAP message *coap_version_ptr is destination for parsed CoAP specification version
Definition at line 174 of file sn_coap_parser.c.
| static int8_t sn_coap_parser_payload_parse | ( | uint16_t | packet_data_len, |
| uint8_t * | packet_data_ptr, | ||
| uint8_t ** | packet_data_pptr, | ||
| sn_coap_hdr_s * | dst_coap_msg_ptr | ||
| ) | [static] |
Parses CoAP message's Payload part from given Packet data.
- Parameters:
-
packet_data_len is length of given Packet data to be parsed to CoAP message *packet_data_ptr is start of source for Packet data to be parsed to CoAP message **packet_data_pptr is source for Packet data to be parsed to CoAP message *dst_coap_msg_ptr is destination for parsed CoAP message
Definition at line 727 of file sn_coap_parser.c.
| void sn_coap_parser_release_allocated_coap_msg_mem | ( | struct coap_s * | handle, |
| sn_coap_hdr_s * | freed_coap_msg_ptr | ||
| ) |
Releases memory of given CoAP message.
Note!!! Does not release Payload part
- Parameters:
-
*handle Pointer to CoAP library handle *freed_coap_msg_ptr is pointer to released CoAP message
Definition at line 89 of file sn_coap_parser.c.
Generated on Wed Jul 13 2022 17:43:56 by
1.7.2
