6LowPAN mesh-based network support for mbedConnectorInterface. The Atmel-based mbed 6LowPAN shield is the assumed network hardware.

Dependencies:   libnsdl Nanostack_lib

Committer:
ansond
Date:
Thu Apr 09 03:07:58 2015 +0000
Revision:
7:0e80a25afabc
Parent:
4:2c8eeaf31699
updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:2a5a48a8b4d4 1 // Support functions for the NSDL library
ansond 0:2a5a48a8b4d4 2
ansond 0:2a5a48a8b4d4 3 #ifndef NSDL_SUPPORT_H
ansond 0:2a5a48a8b4d4 4 #define NSDL_SUPPORT_H
ansond 0:2a5a48a8b4d4 5
ansond 0:2a5a48a8b4d4 6 #include "mbed.h"
ansond 0:2a5a48a8b4d4 7 #include <stdint.h>
ansond 0:2a5a48a8b4d4 8
ansond 0:2a5a48a8b4d4 9 #include "sn_nsdl.h"
ansond 0:2a5a48a8b4d4 10 #include "sn_coap_header.h"
ansond 0:2a5a48a8b4d4 11 #include "sn_coap_protocol.h"
ansond 0:2a5a48a8b4d4 12 #include "sn_nsdl_lib.h"
ansond 0:2a5a48a8b4d4 13
ansond 0:2a5a48a8b4d4 14 #include "mbedConnectorInterface.h"
ansond 0:2a5a48a8b4d4 15
ansond 0:2a5a48a8b4d4 16 // ************************* MDS CONFIGURATION *********************************
ansond 0:2a5a48a8b4d4 17
ansond 0:2a5a48a8b4d4 18 extern uint8_t NSP_address_bytes[NSP_IP_ADDRESS_LENGTH]; // which MDS instance we want to bind to...
ansond 0:2a5a48a8b4d4 19 extern uint8_t endpoint_name[NODE_NAME_LENGTH]; // our NODE name
ansond 0:2a5a48a8b4d4 20 extern uint8_t domain_name[NSP_DOMAIN_LENGTH]; // our MDS domain name
ansond 0:2a5a48a8b4d4 21 extern uint8_t ep_type[NSP_ENDPOINT_TYPE_LENGTH]; // our NODE type
ansond 0:2a5a48a8b4d4 22 extern uint8_t lifetime_ptr[NSP_LIFE_TIME_LENGTH]; // MDS lifetime
ansond 0:2a5a48a8b4d4 23
ansond 0:2a5a48a8b4d4 24 // ************************* MDS CONFIGURATION *********************************
ansond 0:2a5a48a8b4d4 25
ansond 0:2a5a48a8b4d4 26
ansond 0:2a5a48a8b4d4 27 // callback template for PUT/GET
ansond 0:2a5a48a8b4d4 28 typedef uint8_t (*sn_grs_dyn_res_callback_t)(sn_coap_hdr_s *, sn_nsdl_addr_s *, sn_proto_info_s *);
ansond 0:2a5a48a8b4d4 29
ansond 0:2a5a48a8b4d4 30 // external methods
ansond 0:2a5a48a8b4d4 31 extern "C" void *nsdl_alloc(uint16_t size);
ansond 0:2a5a48a8b4d4 32 extern "C" void nsdl_free(void* ptr_to_free);
ansond 0:2a5a48a8b4d4 33 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);
ansond 0:2a5a48a8b4d4 34 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);
ansond 0:2a5a48a8b4d4 35 extern 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);
ansond 0:2a5a48a8b4d4 36 extern void nsdl_clean_register_endpoint(sn_nsdl_ep_parameters_s **endpoint_structure);
ansond 0:2a5a48a8b4d4 37 extern void nsdl_init();
ansond 0:2a5a48a8b4d4 38 extern void nsdl_event_loop();
ansond 0:2a5a48a8b4d4 39 extern void nsdl_run();
ansond 0:2a5a48a8b4d4 40 extern void nsdl_reg_update();
ansond 0:2a5a48a8b4d4 41 void NSP_registration();
ansond 4:2c8eeaf31699 42 extern "C" void nsdl_set_nsp_address(void);
ansond 4:2c8eeaf31699 43 extern void utils_configure_endpoint(void);
ansond 7:0e80a25afabc 44 extern "C" bool nsdl_endpoint_is_registered(void);
ansond 0:2a5a48a8b4d4 45
ansond 0:2a5a48a8b4d4 46 #endif // NSDL_SUPPORT_H