diff options
author | Sven Gothel <[email protected]> | 2021-10-29 05:49:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-29 05:49:43 +0200 |
commit | 88456111f8020081eeea719143f42584a62f8ac6 (patch) | |
tree | fb77f5cf0a287cb0b982ba7570231868579685a7 /examples/dbt_constants.hpp | |
parent | 4f0f232301a2a2ffc1e396e29ccf8ab423edece6 (diff) |
Add BTAdapter's Slave Peripheral SMP Key Management
To have full SMP key persitency in peripheral slave mode,
BTAdapter requires fine grained control over
- Passing stored keys to BTDevice's PairingData (w/o uploading them)
- Uploading BTDevice's PairingData to the adapter
This required interaction in certain places,
only enabled if adapter is BTRole::Slave (peripheral):
- BTAdapter::mgmtEvDeviceConnectedHCI()
Only issue unpairDevice() if not pre-paired.
Unpairing is required for new pairing to avoid DHKey Check failures!
- BTAdapter::mgmtEvDeviceDisconnectedHCI()
- First unpairDevice() will be issued via notifyDisconnect()
- Set and upload stored keys for disconnected device (if existing),
preparing for next connect.
- BTAdapter::sendDevicePairingState()
- SMPPairingState::COMPLETED && not SMPPairingState::PRE_PAIRED: Store keys
- SMPPairingState::COMPLETED && SMPPairingState::PRE_PAIRED: Refresh keys to BTDevice (set), no upload!
- SMPPairingState::FAILED: Remove and delete keys
+++
BTAdapter::setSMPKeyPath(path) allows user to enable the persistent key storage
by setting its local filesystem path.
It will also read all key files (SMPKeyBin) and if valid and matching with the adapter,
uploads them for pre-pairing.
See dbt_peripheral00.cpp:
adapter->setSMPKeyPath(ADAPTER_KEY_PATH);
+++
Diffstat (limited to 'examples/dbt_constants.hpp')
-rw-r--r-- | examples/dbt_constants.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/dbt_constants.hpp b/examples/dbt_constants.hpp index 2ff4aaa4..71d6f8f1 100644 --- a/examples/dbt_constants.hpp +++ b/examples/dbt_constants.hpp @@ -38,4 +38,6 @@ */ constexpr const char KEY_PATH[] = "keys"; +constexpr const char ADAPTER_KEY_PATH[] = "dbt_keys"; + #endif /* DBT_CONSTANTS_HPP */ |