nsp resources for the mbed nsp lighting endpoint

Dependencies:   nsdl_lib

Dependents:   mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet mbed_nsp_endpoint_nxp

Committer:
ansond
Date:
Fri Sep 26 05:55:55 2014 +0000
Revision:
3:30c96bd77160
Parent:
0:b26c3526ee89
updates for new logger

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:b26c3526ee89 1 // Support functions for the NSDL library
ansond 0:b26c3526ee89 2
ansond 0:b26c3526ee89 3 #ifndef NSDL_SUPPORT_H
ansond 0:b26c3526ee89 4 #define NSDL_SUPPORT_H
ansond 0:b26c3526ee89 5
ansond 3:30c96bd77160 6 #include "Logger.h"
ansond 0:b26c3526ee89 7
ansond 0:b26c3526ee89 8 #ifndef CELLULAR_NETWORK
ansond 0:b26c3526ee89 9 #include "EthernetInterface.h"
ansond 0:b26c3526ee89 10 #endif
ansond 0:b26c3526ee89 11
ansond 0:b26c3526ee89 12 #include "mbed.h"
ansond 0:b26c3526ee89 13 #include <stdint.h>
ansond 0:b26c3526ee89 14 #include "sn_nsdl.h"
ansond 0:b26c3526ee89 15 #include "sn_coap_header.h"
ansond 0:b26c3526ee89 16 #include "sn_coap_protocol.h"
ansond 0:b26c3526ee89 17 #include "sn_nsdl_lib.h"
ansond 0:b26c3526ee89 18
ansond 0:b26c3526ee89 19 typedef uint8_t (*sn_grs_dyn_res_callback_t)(sn_coap_hdr_s *, sn_nsdl_addr_s *, sn_proto_info_s *);
ansond 0:b26c3526ee89 20 typedef void (*sn_update_observation_t)(sn_coap_hdr_s *,sn_coap_hdr_s *);
ansond 0:b26c3526ee89 21
ansond 0:b26c3526ee89 22 extern "C" void *nsdl_alloc(uint16_t size);
ansond 0:b26c3526ee89 23 extern "C" void nsdl_free(void* ptr_to_free);
ansond 0:b26c3526ee89 24 void nsdl_create_static_resource(sn_nsdl_resource_info_s *resource_structure, uint16_t pt_len, uint8_t *pt, uint16_t rpp_len, uint8_t *rpp_ptr, uint16_t if_len, uint8_t *if_ptr, uint8_t is_observable, uint8_t is_registered, uint8_t *rsc, uint16_t rsc_len);
ansond 0:b26c3526ee89 25 void nsdl_create_dynamic_resource(sn_nsdl_resource_info_s *resource_structure, uint16_t pt_len, uint8_t *pt, uint16_t rpp_len, uint8_t *rpp_ptr, uint16_t if_len, uint8_t *if_ptr, uint8_t is_observable, uint8_t is_registered, sn_grs_dyn_res_callback_t callback_ptr, int access_right);
ansond 0:b26c3526ee89 26 sn_nsdl_ep_parameters_s* nsdl_init_register_endpoint(sn_nsdl_ep_parameters_s *endpoint_structure, uint8_t* name, uint8_t* ypename_ptr, uint8_t *lifetime_ptr);
ansond 0:b26c3526ee89 27 void nsdl_clean_register_endpoint(sn_nsdl_ep_parameters_s **endpoint_structure);
ansond 0:b26c3526ee89 28 void nsdl_init();
ansond 0:b26c3526ee89 29 void nsdl_event_loop();
ansond 0:b26c3526ee89 30
ansond 0:b26c3526ee89 31 extern uint8_t _ep_type[];
ansond 0:b26c3526ee89 32 extern uint8_t _lifetime_ptr[];
ansond 0:b26c3526ee89 33 extern char _endpoint_name[PERSONALITY_NAME_LEN+1];
ansond 0:b26c3526ee89 34
ansond 0:b26c3526ee89 35 #ifdef CELLULAR_NETWORK
ansond 0:b26c3526ee89 36 #ifdef NETWORK_MUTEX
ansond 0:b26c3526ee89 37 #include "rtos.h"
ansond 0:b26c3526ee89 38 #endif
ansond 0:b26c3526ee89 39 #include "UDPSocket.h"
ansond 0:b26c3526ee89 40 #include "Endpoint.h"
ansond 0:b26c3526ee89 41 #endif
ansond 0:b26c3526ee89 42
ansond 0:b26c3526ee89 43 extern Endpoint nsp;
ansond 0:b26c3526ee89 44 extern UDPSocket server;
ansond 0:b26c3526ee89 45
ansond 0:b26c3526ee89 46 #ifndef CELLULAR_NETWORK
ansond 0:b26c3526ee89 47 #include "EthernetInterface.h"
ansond 0:b26c3526ee89 48 extern EthernetInterface ethernet;
ansond 0:b26c3526ee89 49 #endif
ansond 3:30c96bd77160 50 extern Logger *m_logger;
ansond 0:b26c3526ee89 51
ansond 0:b26c3526ee89 52 #endif // NSDL_SUPPORT_H