[FL-2204] Bluetooth forget devices (#967)

* bt: update connection parameters
* bt: set correct connection latency and timeout
* gui popup: add clean method
* furi_hal_bt: add connection parameters request, clear database
* bt: add forget bonded devices API
* bt_settings: add forget bonded devices GUI
* bt: rework pin code show with view port to hide view
* bt: support conn parameters for different profiles
* furi_hal_bt: sync f6 target
* target f6: fix build
* bt: format sources
* furi_hal_bt: update connection parameters
* bt: update connection params, fix GUI
* FuriHal: fix spelling
* Refactoring: rename _clean to _reset

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2022-01-21 20:32:03 +03:00
committed by GitHub
parent d4787e859e
commit 23ff6723cf
82 changed files with 471 additions and 116 deletions

25
firmware/targets/f6/furi_hal/furi_hal_bt.c Normal file → Executable file
View File

@@ -42,6 +42,13 @@ FuriHalBtProfileConfig profile_config[FuriHalBtProfileNumber] = {
.bonding_mode = true,
.pairing_method = GapPairingPinCodeShow,
.mac_address = FURI_HAL_BT_DEFAULT_MAC_ADDR,
.conn_param =
{
.conn_int_min = 0x08,
.conn_int_max = 0x18,
.slave_latency = 0,
.supervisor_timeout = 50,
},
},
},
[FuriHalBtProfileHidKeyboard] =
@@ -55,6 +62,14 @@ FuriHalBtProfileConfig profile_config[FuriHalBtProfileNumber] = {
.bonding_mode = true,
.pairing_method = GapPairingPinCodeVerifyYesNo,
.mac_address = FURI_HAL_BT_DEFAULT_MAC_ADDR,
// TODO optimize
.conn_param =
{
.conn_int_min = 0x12,
.conn_int_max = 0x1e,
.slave_latency = 6,
.supervisor_timeout = 700,
},
},
},
};
@@ -277,6 +292,16 @@ void furi_hal_bt_nvm_sram_sem_release() {
HAL_HSEM_Release(CFG_HW_BLE_NVM_SRAM_SEMID, 0);
}
bool furi_hal_bt_clear_white_list() {
furi_hal_bt_nvm_sram_sem_acquire();
tBleStatus status = aci_gap_clear_security_db();
if(status) {
FURI_LOG_E(TAG, "Clear while list failed with status %d", status);
}
furi_hal_bt_nvm_sram_sem_release();
return status != BLE_STATUS_SUCCESS;
}
void furi_hal_bt_dump_state(string_t buffer) {
if(furi_hal_bt_is_alive()) {
uint8_t HCI_Version;