summaryrefslogtreecommitdiffstats
path: root/examples/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-10-29 05:34:55 +0200
committerSven Gothel <[email protected]>2021-10-29 05:34:55 +0200
commit30f1f01c1ff567ecf7c24142a1ec8eff9bd7031c (patch)
tree3b2513b42011c0e8808238eff99f34ee8009e516 /examples/java
parentb01c83eb0102fc81fa03e0cef8adbfbf1bd432b9 (diff)
Move SMPKeyBin 'apply' to BTDevice, splitting functionality: setting + uploading keys (required for peripheral BTAdapter key management)
SMPKeyBin has the key apply action revoked. SMPKeyBin is reduced to store keys, address and security settings, as well adding persistence (read/write to filesystem). BTDevice::setSMPKeyBin(SMPKeyBin&) shall be used copy the key data over and BTDevice::uploadKeys() to upload them to the adapter for pre-pairing. See dbt_scanner10.cpp's use of convenient API (same efficiency as before) device->uploadKeys(KEY_PATH, req_sec_level, true /* verbose_ */); BTDevice::setSMPKeyBin(SMPKeyBin&) fully restored BTDevice's PairingData - keys - key caps - user security level and IOCaps +++ The reduced 'set<Name>Key(..)' methods only - copy the key to BTDevice's PairingData - set the KeyType bit for keys_<role>_[init|resp], fully restoring key caps
Diffstat (limited to 'examples/java')
-rw-r--r--examples/java/DBTScanner10.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/java/DBTScanner10.java b/examples/java/DBTScanner10.java
index f6f31b43..c34925e8 100644
--- a/examples/java/DBTScanner10.java
+++ b/examples/java/DBTScanner10.java
@@ -359,8 +359,8 @@ public class DBTScanner10 {
BTUtils.println(System.err, "****** Connecting Device: No SecurityDetail for "+device.toString());
}
final BTSecurityLevel req_sec_level = null != sec ? sec.getSecLevel() : BTSecurityLevel.UNSET;
- HCIStatusCode res = SMPKeyBin.readAndApply(KEY_PATH, device, req_sec_level, true /* verbose */);
- BTUtils.fprintf_td(System.err, "****** Connecting Device: SMPKeyBin::readAndApply(..) result %s\n", res.toString());
+ HCIStatusCode res = device.uploadKeys(KEY_PATH, req_sec_level, true /* verbose_ */);
+ BTUtils.fprintf_td(System.err, "****** Connecting Device: BTDevice::uploadKeys(...) result %s\n", res.toString());
if( HCIStatusCode.SUCCESS != res ) {
if( null != sec ) {
if( sec.isSecurityAutoEnabled() ) {