I'm using a non-os library version of simplelink library
For trying to save battery, I try to turn off nwp when I don't need network and turn it on when I need it.
But I see that sl_start will stuck sometime (I think that's sl_stop may not finish yet and cause the problem)
Is there anyway I can know if the sl_stop finished success.
I make my function wait for about 10 seconds, but sometimes it still stuck at sl_start.
Is there any suggestion to solve this problem.
This is my sample code :
static void resetting_network(network_state_machine_t *self, unsigned char event) { switch (event) { case enter_state_event: network_if_stop(); break; case tick_isr_event: if (self->super.timer_count >= TIME_TO_RESET_WIFI_NETWORK) { network_if_init(); MAP_change_to_state(&idle_connection); } break; default: break; } }
int16_t network_if_stop(){ CLR_STATUS_BIT_ALL(g_ulStatus); return sl_Stop(0); }