Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: nanoservice_client_1_12_X Nanostack_lib
Dependents: ipso_interop_mbed1
Fork of mbedEndpointNetwork_6LowPAN by
Revision 8:635a826f1de9, committed 2015-04-14
- Comitter:
- ansond
- Date:
- Tue Apr 14 21:52:31 2015 +0000
- Parent:
- 7:0e80a25afabc
- Child:
- 9:96361b5ace54
- Commit message:
- updates for re-registration
Changed in this revision
| NSDL/nsdl_support.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/NSDL/nsdl_support.cpp Thu Apr 09 03:07:58 2015 +0000
+++ b/NSDL/nsdl_support.cpp Tue Apr 14 21:52:31 2015 +0000
@@ -179,21 +179,26 @@
}
void nsdl_reg_update()
- {
+{
sn_nsdl_ep_parameters_s *endpoint_ptr = NULL;
// reg update should be invoked with null parameters if nothing is changing
endpoint_ptr = nsdl_init_register_endpoint(endpoint_ptr, (uint8_t *)null_ep_domain, (uint8_t*)null_ep_name, null_ep_type, null_lifetime_ptr);
- if(sn_nsdl_update_registration(endpoint_ptr) != 0)
+ if(sn_nsdl_update_registration(endpoint_ptr) != 0) {
DBG("NSP re-registering failed\r\n");
- else
+ endpoint_registered = false;
+ }
+ else {
DBG("NSP re-registering OK\r\n");
- nsdl_clean_register_endpoint(&endpoint_ptr);
+ endpoint_registered = true;
}
+ nsdl_clean_register_endpoint(&endpoint_ptr);
+}
+
void nsdl_reg_update_timeout()
- {
+{
nsdl_reg_update_needed = true;
- }
+}
void nsdl_event_loop()
{
@@ -206,11 +211,18 @@
while(1)
{
- // pc.DBG("checking reg timeout\r\n");
+ //pc.DBG("checking reg timeout\r\n");
if (nsdl_reg_update_needed)
{
nsdl_reg_update_needed = false;
- nsdl_reg_update();
+
+ if (nsdl_endpoint_is_registered())
+ nsdl_reg_update();
+ else
+ NSP_registration();
+
+ // wait just a bit...
+ //wait_ms(1000);
}
}
}
