An incomplete connect (either abandoned with a disconnect() or just

failed of its own accord) would prevent futher connect()'s  due to the
CONN_IN_PROGRESS_FLAG remaining set.  This change clears that flag in
the two cases described.
pull/7661/head
Edd Inglis 2018-07-31 17:01:54 +01:00
parent 8292affb53
commit 88b2858af4
1 changed files with 2 additions and 0 deletions

View File

@ -1080,6 +1080,7 @@ void LoRaWANStack::process_shutdown_state(lorawan_status_t &op_status)
_device_current_state = DEVICE_STATE_SHUTDOWN;
op_status = LORAWAN_STATUS_DEVICE_OFF;
_ctrl_flags &= ~CONNECTED_FLAG;
_ctrl_flags &= ~CONN_IN_PROGRESS_FLAG;
send_event_to_application(DISCONNECTED);
}
@ -1160,6 +1161,7 @@ void LoRaWANStack::process_joining_state(lorawan_status_t &op_status)
bool can_continue = _loramac.continue_joining_process();
if (!can_continue) {
_ctrl_flags &= ~CONN_IN_PROGRESS_FLAG;
send_event_to_application(JOIN_FAILURE);
_device_current_state = DEVICE_STATE_IDLE;
return;