Removes storing of bt peer key in internal flash for bad usb BLE

Co-authored-by: yocvito <nicolasmorel.dp@gmail.com>
This commit is contained in:
yocvito
2023-02-03 19:39:30 +01:00
committed by Willy-JL
parent 82f4a287cb
commit d6a1dc2e1f
4 changed files with 28 additions and 2 deletions

View File

@@ -445,6 +445,15 @@ GapPairing bt_get_profile_pairing_method(Bt* bt) {
return furi_hal_bt_get_profile_pairing_method(get_hal_bt_profile(bt->profile));
}
void bt_disable_peer_key_update(Bt *bt) {
UNUSED(bt);
furi_hal_bt_set_key_storage_change_callback(NULL, NULL);
}
void bt_enable_peer_key_update(Bt *bt) {
furi_hal_bt_set_key_storage_change_callback(bt_on_key_storage_change_callback, bt);
}
int32_t bt_srv(void* p) {
UNUSED(p);
Bt* bt = bt_alloc();

View File

@@ -52,6 +52,17 @@ bool bt_remote_rssi(Bt* bt, BtRssi* rssi);
void bt_set_profile_pairing_method(Bt* bt, GapPairing pairing_method);
GapPairing bt_get_profile_pairing_method(Bt* bt);
/** Stop saving new peer key to flash (in .bt.keys file)
*
*/
void bt_disable_peer_key_update(Bt *bt);
/** Enable saving peer key to internal flash (enable by default)
*
* @note This function should be called if bt_disable_peer_key_update was called before
*/
void bt_enable_peer_key_update(Bt *bt);
/** Disconnect from Central
*
* @param bt Bt instance