Timothy Beight / Mbed 2 deprecated 6_songs-from-the-cloud

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of 6_songs-from-the-cloud by MakingMusicWorkshop

Embed: (wiki syntax)

« Back to documentation index

sn_coap_parser.c File Reference

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_ssn_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:
*handlePointer to CoAP library handle
packet_data_lenis length of given Packet data to be parsed to CoAP message
*packet_data_ptris source for Packet data to be parsed to CoAP message
*coap_version_ptris 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_ptris source for Packet data to be parsed to CoAP message
*dst_coap_msg_ptris destination for parsed CoAP message
*coap_version_ptris destination for parsed CoAP specification version

Definition at line 176 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_lenis length of given Packet data to be parsed to CoAP message
*packet_data_ptris start of source for Packet data to be parsed to CoAP message
**packet_data_pptris source for Packet data to be parsed to CoAP message
*dst_coap_msg_ptris destination for parsed CoAP message

Definition at line 726 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:
*handlePointer to CoAP library handle
*freed_coap_msg_ptris pointer to released CoAP message

Definition at line 91 of file sn_coap_parser.c.