Commit 3d5789af authored by schneider's avatar schneider

fix(ble): Keep advertising in slected mode after connection closes

parent e86c7b6e
......@@ -600,7 +600,11 @@ static void bleProcMsg(bleMsg_t *pMsg)
break;
case DM_ADV_START_IND:
LOG_INFO("ble", "Advertisement started");
LOG_INFO("ble", "Advertisement started %u %u", advertising_mode, advertising_mode_target);
if(advertising_mode != advertising_mode_target) {
AppAdvStop();
}
break;
case DM_ADV_STOP_IND:
......@@ -648,6 +652,12 @@ static void bleProcMsg(bleMsg_t *pMsg)
pMsg->dm.connClose.reason);
break;
}
/* Stack overwrites advertising mode after connection close.
* Force our desired mode.
*/
advertising_mode = APP_MODE_NONE;
AppAdvStop();
bleClose(pMsg);
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment