diff --git a/RIOT b/RIOT index be39169..b38f48a 160000 --- a/RIOT +++ b/RIOT @@ -1 +1 @@ -Subproject commit be39169bd41f50e48c26f0b63312fe372b81147f +Subproject commit b38f48a72009141cbce3a0f01c09cc1a7ef0275b diff --git a/saul_cord_ep.c b/saul_cord_ep.c index b0998c7..06eedaa 100644 --- a/saul_cord_ep.c +++ b/saul_cord_ep.c @@ -52,7 +52,7 @@ static void _set_timer(void) * @param[in] event The event that occurred */ static void _notify(saul_cord_ep_event_t event) { - if(_cb != NULL) { + if (_cb != NULL) { _cb(event); } } @@ -93,23 +93,23 @@ static int register_rd(void) { puts("Registering with RD now, this may take a short while..."); if (cord_ep_register(&remote, regif) != CORD_EP_OK) { - _notify(SAUL_CORD_EP_REGISTERED); - return 1; - } - else { _notify(SAUL_CORD_EP_DEREGISTERED); - cord_ep_dump_status(); + return 1; } + _notify(SAUL_CORD_EP_REGISTERED); + return 0; } static void saul_cord_ep_register(void) { printf("DEBUG: RD-ADDRESS: %s\n", ip); - while(register_rd()){ + while (register_rd()) { puts("Try again to register to RD deamon"); } + + cord_ep_dump_status(); } static void *_reg_runner(void *arg) @@ -129,7 +129,7 @@ static void *_reg_runner(void *arg) _notify(SAUL_CORD_EP_UPDATED); } else { - _notify(SAUL_CORD_EP_DEREGISTERED); + _notify(SAUL_CORD_EP_DEREGISTERED); saul_cord_ep_register(); _set_timer(); }