Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 3 months ago.
How can I save Bonding information when I reset Board?(STM_WB55)
To Dear.
I use BLE::securityManager
and I call API like below.
but When I reset Board. Pairing flow restart.
I think "preserveBondingStateOnReset" is the function about My question.
but It is not working. is there another option?
error = _ble_interface.securityManager().init( true, enableBonding false, requireMITM SecurityManager::IO_CAPS_NONE, iocaps NULL, passkey true, signing NULL dbfilepath ); if(error) { printf("Error during security manager initialisation\r\n"); _event_queue.break_dispatch(); return; }
error= _ble_interface.securityManager().preserveBondingStateOnReset(true); if (error) { printf("Error during preserveBondingStateOnReset %d\r\n", error); }
_ble_interface.securityManager().setSecurityManagerEventHandler(this); error = gap.enablePrivacy(true);
if(error) { printf("Error enabling privacy.\r\n"); _event_queue.break_dispatch(); return; }
gap.setEventHandler(this);
if (!set_advertising_parameters()) { return; }
if (!set_advertising_data()) { return; } Gap::PeripheralPrivacyConfiguration_t configuration_p = { /* use_non_resolvable_random_address */ true, Gap::PeripheralPrivacyConfiguration_t::PERFORM_PAIRING_PROCEDURE }; _ble_interface.gap().setPeripheralPrivacyConfiguration(&configuration_p);
Gap::CentralPrivacyConfiguration_t configuration_c = { /* use_non_resolvable_random_address */ true, advertising MAC address fixed : ethan Gap::CentralPrivacyConfiguration_t::RESOLVE_AND_FORWARD }; _ble_interface.gap().setCentralPrivacyConfiguration(&configuration_c);