WORKS

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sn_coap_parser_stub.c Source File

sn_coap_parser_stub.c

00001 /*
00002  * Copyright (c) 2011-2015 ARM Limited. All Rights Reserved.
00003  */
00004 
00005 /**
00006  *\file sn_coap_parser.c
00007  *
00008  * \brief CoAP Header parser
00009  *
00010  * Functionality: Parses CoAP Header
00011  *
00012  */
00013 
00014 #include "ns_types.h"
00015 #include "sn_nsdl.h"
00016 #include "sn_coap_protocol.h"
00017 #include "sn_coap_parser_stub.h"
00018 
00019 sn_coap_parser_def sn_coap_parser_stub;
00020 
00021 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)
00022 {
00023     return sn_coap_parser_stub.expectedHeader;
00024 }
00025 
00026 void sn_coap_parser_release_allocated_coap_msg_mem(struct coap_s *handle, sn_coap_hdr_s *freed_coap_msg_ptr)
00027 {
00028     if (freed_coap_msg_ptr != NULL) {
00029         if (freed_coap_msg_ptr->uri_path_ptr != NULL) {
00030             free(freed_coap_msg_ptr->uri_path_ptr);
00031         }
00032 
00033         if (freed_coap_msg_ptr->token_ptr != NULL) {
00034             free(freed_coap_msg_ptr->token_ptr);
00035         }
00036 
00037         if (freed_coap_msg_ptr->content_type_ptr != NULL) {
00038             free(freed_coap_msg_ptr->content_type_ptr);
00039         }
00040 
00041         if (freed_coap_msg_ptr->options_list_ptr != NULL) {
00042             if (freed_coap_msg_ptr->options_list_ptr->max_age_ptr != NULL) {
00043                 free(freed_coap_msg_ptr->options_list_ptr->max_age_ptr);
00044             }
00045 
00046             if (freed_coap_msg_ptr->options_list_ptr->proxy_uri_ptr != NULL) {
00047                 free(freed_coap_msg_ptr->options_list_ptr->proxy_uri_ptr);
00048             }
00049 
00050             if (freed_coap_msg_ptr->options_list_ptr->etag_ptr != NULL) {
00051                 free(freed_coap_msg_ptr->options_list_ptr->etag_ptr);
00052             }
00053 
00054             if (freed_coap_msg_ptr->options_list_ptr->uri_host_ptr != NULL) {
00055                 free(freed_coap_msg_ptr->options_list_ptr->uri_host_ptr);
00056             }
00057 
00058             if (freed_coap_msg_ptr->options_list_ptr->location_path_ptr != NULL) {
00059                 free(freed_coap_msg_ptr->options_list_ptr->location_path_ptr);
00060             }
00061 
00062             if (freed_coap_msg_ptr->options_list_ptr->uri_port_ptr != NULL) {
00063                 free(freed_coap_msg_ptr->options_list_ptr->uri_port_ptr);
00064             }
00065 
00066             if (freed_coap_msg_ptr->options_list_ptr->location_query_ptr != NULL) {
00067                 free(freed_coap_msg_ptr->options_list_ptr->location_query_ptr);
00068             }
00069 
00070             if (freed_coap_msg_ptr->options_list_ptr->observe_ptr != NULL) {
00071                 free(freed_coap_msg_ptr->options_list_ptr->observe_ptr);
00072             }
00073 
00074             if (freed_coap_msg_ptr->options_list_ptr->uri_query_ptr != NULL) {
00075                 free(freed_coap_msg_ptr->options_list_ptr->uri_query_ptr);
00076             }
00077 
00078             if (freed_coap_msg_ptr->options_list_ptr->block2_ptr != NULL) {
00079                 free(freed_coap_msg_ptr->options_list_ptr->block2_ptr);
00080             }
00081 
00082             if (freed_coap_msg_ptr->options_list_ptr->block1_ptr != NULL) {
00083                 free(freed_coap_msg_ptr->options_list_ptr->block1_ptr);
00084             }
00085             if (freed_coap_msg_ptr->options_list_ptr->accept_ptr != NULL) {
00086                 free(freed_coap_msg_ptr->options_list_ptr->accept_ptr);
00087             }
00088 
00089             free(freed_coap_msg_ptr->options_list_ptr);
00090         }
00091 
00092         free(freed_coap_msg_ptr);
00093         freed_coap_msg_ptr = NULL;
00094     }
00095 }