[FL-2243] Restart BT advertising after forgetting devices #982

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich 2022-02-07 16:37:56 +03:00 committed by GitHub
parent 40479e1761
commit 3f6deecdae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View file

@ -43,10 +43,11 @@ bool bt_save_key_storage(Bt* bt) {
bool bt_delete_key_storage(Bt* bt) {
furi_assert(bt);
bool delete_succeed = false;
bool bt_is_active = furi_hal_bt_is_active();
furi_hal_bt_stop_advertising();
delete_succeed = furi_hal_bt_clear_white_list();
if(bt->bt_settings.enabled) {
if(bt_is_active) {
furi_hal_bt_start_advertising();
}

View file

@ -246,7 +246,7 @@ bool furi_hal_bt_change_app(FuriHalBtProfile profile, GapEventCallback event_cb,
return ret;
}
static bool furi_hal_bt_is_active() {
bool furi_hal_bt_is_active() {
return gap_get_state() > GapStateIdle;
}

View file

@ -246,7 +246,7 @@ bool furi_hal_bt_change_app(FuriHalBtProfile profile, GapEventCallback event_cb,
return ret;
}
static bool furi_hal_bt_is_active() {
bool furi_hal_bt_is_active() {
return gap_get_state() > GapStateIdle;
}

View file

@ -84,6 +84,12 @@ bool furi_hal_bt_change_app(FuriHalBtProfile profile, GapEventCallback event_cb,
*/
void furi_hal_bt_update_battery_level(uint8_t battery_level);
/** Checks if BLE state is active
*
* @return true if device is connected or advertising, false otherwise
*/
bool furi_hal_bt_is_active();
/** Start advertising
*/
void furi_hal_bt_start_advertising();