Merge pull request #7661 from EnsilicaEdd/fix_lorawan_incomplete_connect

Clear CONN_IN_PROGRESS flag after incomplete connect()
pull/7675/head
Cruz Monrreal 2018-08-01 21:36:59 -05:00 committed by GitHub
commit 35fb35a3b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

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