Michael Koster / mbedEndpointNetworkMJK

Dependencies:   nsdl_lib Nanostack_lib

Fork of mbedEndpointNetwork by Michael Koster

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Thu Apr 09 03:07:58 2015 +0000
Parent:
6:f6288e89b02a
Child:
8:820d35246b82
Commit message:
updates

Changed in this revision

NSDL/nsdl_support.cpp Show annotated file Show diff for this revision Revisions of this file
NSDL/nsdl_support.h Show annotated file Show diff for this revision Revisions of this file
--- 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()
 {
--- a/NSDL/nsdl_support.h	Tue Feb 24 02:05:24 2015 +0000
+++ b/NSDL/nsdl_support.h	Thu Apr 09 03:07:58 2015 +0000
@@ -41,5 +41,6 @@
 void NSP_registration();
 extern "C" void nsdl_set_nsp_address(void);
 extern void utils_configure_endpoint(void);
+extern "C" bool nsdl_endpoint_is_registered(void);
 
 #endif // NSDL_SUPPORT_H