6LowPAN mesh-based network support for mbedConnectorInterface. The Atmel-based mbed 6LowPAN shield is the assumed network hardware.
Dependencies: libnsdl Nanostack_lib
Diff: NSDL/nsdl_support.cpp
- Revision:
- 7:0e80a25afabc
- Parent:
- 4:2c8eeaf31699
- Child:
- 8:635a826f1de9
--- a/NSDL/nsdl_support.cpp Tue Feb 24 02:05:24 2015 +0000 +++ b/NSDL/nsdl_support.cpp Thu Apr 09 03:07:58 2015 +0000 @@ -18,6 +18,7 @@ uint8_t null_ep_type[] = ""; uint8_t null_lifetime_ptr[] = ""; bool nsdl_reg_update_needed = false; +bool endpoint_registered = false; extern int8_t coap_udp_socket; @@ -146,13 +147,20 @@ sn_nsdl_ep_parameters_s *endpoint_ptr = NULL; endpoint_ptr = nsdl_init_register_endpoint(endpoint_ptr, (uint8_t *)domain_name, (uint8_t*)endpoint_name, ep_type, lifetime_ptr); - if(sn_nsdl_register_endpoint(endpoint_ptr) != 0) + if(sn_nsdl_register_endpoint(endpoint_ptr) != 0) { DBG("NSP re-registering failed\r\n"); - else + endpoint_registered = false; + } + else { DBG("NSP re-registering OK\r\n"); + endpoint_registered = true; + } nsdl_clean_register_endpoint(&endpoint_ptr); } +bool nsdl_endpoint_is_registered(void) { + return endpoint_registered; +} void nsdl_init() {