BLE mbed Endpoint network stack for mbedConnectorInterface. The stack makes use of a special BLE Socket abstraction to create socket() semantics over BLE.
Dependencies: libnsdl_m0 BLE_API Base64 nRF51822 SplitterAssembler
nsdl_support.h
00001 // Support functions for the NSDL library 00002 00003 #ifndef __NSDL_SUPPORT_H__ 00004 #define __NSDL_SUPPORT_H__ 00005 00006 #include "mbed.h" 00007 #include <stdint.h> 00008 00009 #include "sn_nsdl.h" 00010 #include "sn_coap_header.h" 00011 #include "sn_coap_protocol.h" 00012 #include "sn_nsdl_lib.h" 00013 00014 #include "mbedConnectorInterface.h" 00015 00016 // ************************* MDS CONFIGURATION ********************************* 00017 00018 extern uint8_t NSP_address_bytes[NSP_IP_ADDRESS_LENGTH]; // which MDS instance we want to bind to... 00019 extern uint8_t endpoint_name[NODE_NAME_LENGTH]; // our NODE name 00020 extern uint8_t domain_name[NSP_DOMAIN_LENGTH]; // our MDS domain name 00021 extern int nsp_port; // our MDS UDP port number 00022 extern uint8_t ep_type[NSP_ENDPOINT_TYPE_LENGTH]; // our NODE type 00023 extern uint8_t lifetime_ptr[NSP_LIFE_TIME_LENGTH]; // MDS lifetime 00024 00025 // ************************* MDS CONFIGURATION ********************************* 00026 00027 00028 #define MAIN_LOOP_SLEEP 2000 00029 00030 typedef uint8_t (*sn_grs_dyn_res_callback_t)(sn_coap_hdr_s *, sn_nsdl_addr_s *, sn_proto_info_s *); 00031 typedef void (*sn_update_observation_t)(sn_coap_hdr_s *,sn_coap_hdr_s *); 00032 00033 // external methods 00034 extern "C" void *nsdl_alloc(uint16_t size); 00035 extern "C" void nsdl_free(void* ptr_to_free); 00036 extern 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, uint8_t *rsc, uint16_t rsc_len); 00037 extern 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, uint8_t is_observable, sn_grs_dyn_res_callback_t callback_ptr, int access_right); 00038 extern "C" sn_nsdl_ep_parameters_s* nsdl_init_register_endpoint(sn_nsdl_ep_parameters_s *endpoint_structure, uint8_t *domain, uint8_t* name, uint8_t* ypename_ptr, uint8_t *lifetime_ptr); 00039 extern "C" void nsdl_clean_register_endpoint(sn_nsdl_ep_parameters_s **endpoint_structure); 00040 extern "C" void nsdl_init(); 00041 extern "C" void nsdl_event_loop(); 00042 extern "C" void nsdl_reg_update(); 00043 extern "C" void configure_endpoint(); 00044 extern void NSP_registration(); 00045 extern "C" void register_endpoint(bool init); 00046 extern void registration_update_thread(void const *args); 00047 extern "C" void nsdl_set_nsp_address(void); 00048 extern "C" bool nsdl_endpoint_is_registered(void); 00049 00050 #endif // __NSDL_SUPPORT_H__
Generated on Sun Jul 17 2022 05:11:06 by 1.7.2