| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BTGattChar::Listener and have implementation handle the BTGattChar association match for notifications
Turns out previous API and code moved the burden to user to only have the calling BTGattChar object to be matched,
which is not only not intuitive, but also a potential source of issues.
Now we provide a naive interface BTGattChar::Listener to be passed
and BTGattChar::addCharListener(..) wraps its instance in a BTGattCharListener to be delegated.
BTGattChar::removeCharListener(..) has been removed due to high implementation
burden on the Java side. This shall not cause harm to the user, as it isn't useful in a user application.
BTGattChar::removeAllAssociatedCharListener(..) is available on the C++ and Java side,
i.e. fixed API in C++ where we had BTGattChar::removeAllCharListener(..).
Tested and demonstrated in dbt_scanner10.cpp and DBTScanner10.java, as usual.
Both examples also print the service, characteristic and declaration in a more readable fashion.
|
|
|
|
| |
each two digits
|
|
|
|
| |
address
|
|
|
|
| |
EUI48Sub <-> string conversion
|
|
|
|
| |
or name to allow empty EUI48Sub for all devices
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
basic use cases
Universal methods use a 'matcher' interface (Java) or function pointer (C++),
which can be defined 'on the fly' using lambda expressions.
Basic use cases BTDeviceRegistry:
- use 'contains' in general to match for awaited, processed etc devices
Basic use cases BTDeviceRegistry:
- For getOrCreate() uses 'equals' for a 100% match
- For sec_level use getStartOf() with actual address and name
- For PASSKEY etc use getStartOf() with actual addess only - no fuzzy name
|
|
|
|
| |
(C++ and Java)
|
|
|
|
| |
Java)
|
|
|
|
|
|
|
| |
devicesInProcessing and devicesProcessed for O(1) processing.
Add hash_code()/hashCode() and equality operation to DeviceID using BDAddressAndType only,
allowing devicesInProcessing and devicesProcessed to be mostly operated within O(1).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to lib, support full EUI84Sub and name-sub pattern matching
Same naming-schema and functionality C++/Java
Due to using EUI48Sub and name-sub pattern matching,
we naturally had to drop the hash-set fast-lookup approach.
However, looking up device names via pattern-matching is essential
to handle device groups, i.e.
- specific security settings (level, passkey, ..)
- actually accepting them to connect (waitForDevices)
|
|
|
|
| |
operator==() etc; EUI48[Sub]: Add static 'scanEUI48[Sub]'(string&) and static 'indexOf()'
|
|
|
|
|
|
|
|
|
|
|
| |
BTSecurityLevel must be >= given minimum; Remove key file if invalid or failed otherwise
Drop paramter 'removeInvalidFile', since read(..) and readAndApply(..) shall always delete invalid files
or key files with non-matching BTSecurityLevel.
This ensures valid, usable and current key files.
This also resolved scenario reading a key file with BTSecurityLevel NONE, but requested higher BTSecurityLevel.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HCIHandler::le_set_scan_param(..): Add le_scan_active and filter_policy; Java: Add all.
Also changing order of parameter, allowing to use default values in a most reasonable sense.
Motivation: Expose `le_scan_active` to retrieve the AD EIR package with event-type SCAN_RSP,
which gets queried via active scanning only and usually holds the device name if supported.
TODO: Resolve propagating device found on SCAN_RSP message (name),
since SCAN_IND is received before (w/o name).
The 2nd SCAN_RSP is dropped, even though the BTDevice's name has changed properly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BTAdapter::get[Address->AddressAndType]() using BDAddressAndType, preparing for random address
Thoroughly changes
- 'EUI48 AdapterInfo::address' -> 'BDAddressAndType AdapterInfo::addressAndType'
- BTAdapter C++
- BTAdapter and its DBTAdapter/DBusAdapter implementations (Java)
Motivation:
- The adapter's address as initially reported by the system is always its public address, i.e. BDAddressType::BDADDR_LE_PUBLIC
- The adapter's visible BDAddressAndType might be set to BDAddressType::BDADDR_LE_RANDOM before scanning / discovery mode (TODO).
|
|
|
|
|
|
|
|
| |
Previous scheme : `bd_C0:26:DA:01:DA:B1:1.smpkey.bin'
FAT32 LFN scheme: `bd_C0_26_DA_01_DA_B1_1-smpkey.bin'
Tested interoperability with native and java test application.
|
|
|
|
|
|
|
|
|
| |
createAndWrite(..) and readAndApply(..) one-liner
Further:
- Bump to version 2
- Add creation timestamp (seconds since epoch)
- Convenient createAndWrite(..) and readAndApply(..) one-liner handle overwrite and remove-invalid use-case
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AdapterStatusListener
Completing BTDevice lifecycle handling comming 30b4e5f0c1f62c92c40a6ccceda8878f88a9521a
"AdapterStatusListener::deviceFound: Resolve sharedDevices persistence of found device via return value"
Fix leaked AdapterStatusListener: Turns out the introduced mechanism of not adding BTDevice's
to sharedDevices list, but keeping them in discoveredDevices (to avoid duplicate scan results),
did not consider removing its BTDevice bound AsapterStatusListener (here: DBTDevice.java).
Example:
- BTDevice found and instance C++/Java is created
- Java's BTDevice creates and adds its AdapterStatusListener
- All AdapterStatusListener::deviceFound(..) called
- User is not interested, all 'AdapterStatusListener::deviceFound(..)' return 'false'
- BTDevice remains in discoveredDevices, but not in sharedDevices.
* Subsequent clearance of discoveredDevices leaks the AdapterStatusListener: Not removed
* AdapterStatusListener::deviceUpdated(..) of the removed BTDevice eventually gets called,
but the BTDevice is already deleted
* The Java -> JNI call causes our exception: Null reference to native instance!
Hence all BTDevice lifecycle bound AdapterStatusListener shall be marked as such,
using a StatusListenerPair{AdapterStatusListener, weak_ptr<BTDevice>}.
This way, every removed discoveredDevice's BTDevice will remove
its associated AdapterStatusListener.
Further, every explicitly BTDevice::remove() will remove its associated AdapterStatusListener.
New 'BTDevice::addAdapterStatusListener(l)' (C++/Java) performs the required association.
+++
On the Java side the discoveredDevices are now only using a WeakReference<BTDevice>
to avoid leaking/holding BTDevice instances.
+++
This added complexity of 'StatusListenerPair' only exists, b/c discoveredDevices holds complete BTDevice instances.
We could have soothed this by just listing BDAddressAndType, but the current API
required to query 'List<BTDevice> discoveredDevices' ...
+++
BTDevice/BTAdapter:
- Use lock-free 'jau::sc_atomic_critical sync(sync_data)' whenever possible, instead of mutex-lock, i.e.
merely reading/copy data at an undeterministic point in time
---
DBTDevice
Misc
- Added BTUtil.fprintf_td(..), prepending elapsedTime()
- DBTDevice.java: sort method in proper groups: Unsupported, internal, ..
|
| |
|
|
|
|
|
|
| |
binding. Hint: Better use setPairingPasskey(passkey = 0) ..
.. since current experience exposed a roughly 3s immediate disconnect handshake with certain devices and/or Kernel BlueZ code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and uploading available LTKs
Moving the SMPKeyBin setup and key-upload for the BTDevice to public SMPKeyBin,
providing the proper setup and upload method.
One change compared to removed coding in Scanner10 example occured:
"BTSecurityLevel::ENC_ONLY is set to avoid a new SMP PairingMode negotiation,
which is undesired as this instances' stored LTK shall be used for PairingMode::PRE_PAIRED."
i.e.: 'device.setConnSecurity(BTSecurityLevel.ENC_ONLY, SMPIOCapability.NO_INPUT_NO_OUTPUT);'
This has been evaluate with a Secure Connections capable LE device
using BTSecurityLevel::ENC_AUTH_FIPS and SMPIOCapability::KEYBOARD_ONLY.
After initial pairing using a dynamic generated passkey,
we connected successfully and stored the LTKs and CSRKs with this connection parameter.
Thereafter reconnect after setting (BTSecurityLevel.ENC_ONLY, SMPIOCapability.NO_INPUT_NO_OUTPUT)
and uploading stored keys succeeded with Linux Kernel-BlueZ host implementation.
|
|
|
|
| |
not removed
|
|
|
|
|
|
|
| |
Unifying output.
Having a leading `0x` always for MSB-First only, unifies the output and hence clarifies semantics of shown results.
This is compatible with 'btmon' output.
|
|
|
|
|
|
|
| |
Note: "__pack(x)=x" still has issues, missing SMPLongTermKeyInfo and SMPSignatureResolvingKeyInfo,
as well as EUI48.
Funny, thought we had this fixed earlier..
|
| |
|
|
|
|
|
|
|
|
|
|
| |
SMPKeyBin stores device's BDAddressAndType, its security connection setup BTSecurityLevel + SMPIOCapability
and optionally the initiator and responder LTK and CSRK within one file.
Since the LTK and CSRK can be optionally set due to their availability per initiator and responder,
implementation supports mixed mode for certain devices,
e.g. LTK responder key only etc.
This was the final motivation to promote the storage demo code to the API.
|
|
|
|
|
|
|
|
|
|
|
| |
SMPIOCapability pairing mode - 'setConnSecurityAuto(const SMPIOCapability iocap_auto)'
See BTDevice::setConnSecurityAuto(..).
Added to C++ and Java.
SMPPDUMsg::Opcode::PAIRING_FAILED in hciSMPMsgCallback(..),
will no more lead to L2CAP reopening w/o encryption, but device left in failed pairing state connected.
|
|
|
|
| |
to reset values
|
|
|
|
| |
noexcept; Earmark in BTDevice.java for direct_bt.
|
| |
|
|
|
|
| |
are noexcept; Earmark in BTDevice.java for direct_bt.
|
| |
|
|
|
|
| |
removeDiscoveredDevices() for direct_bt
|
|
|
|
|
|
| |
BTManager.Settings:
- rename: isCharacteristicValueCacheNotificationSupported() -> isCharValueCacheNotificationSupported()
- property now: 'jau.direct_bt.characteristic.compat'
|
|
|
|
| |
(C++); Add same path to Java StringBuilder capacity
|
|
|
|
| |
and use it, same for SMPSignatureResolvingKeyInfo.
|
|
|
|
|
|
| |
BDAddressAndType; Tested reconnect reusing stored LTK
Same code in C++ dbt_scanner10.cpp and DBTScanner10.java.
|
| |
|
|
|
|
| |
driven adapter workflow
|
| |
|
|
|
|
|
|
| |
whether jaulib is used or not; BTFactory: Shorten names (API)
direct_bt.jar: Don't use jaulib.jar in its Class-Path (manifest)
|
| |
|
|
|
|
|
|
|
| |
extras) ..; direct-bt-fat* includes jaulib-fat (standalone)
direct-bt-fat.jar is with Tinyb
direct-bt-fat2.jar is ex Tinyb (merely testing size and encapsulation)
|
|
|
|
| |
EUI48Sub& other) (C++ and Java, both w/ unit tests)
|
|
|
|
| |
native lib loading. Added junit test facility (Java).
|
|
|
|
| |
Char] etc (align naming with direct_bt == java; reduce java code footprint and too long code lines)
|
|
|
|
| |
Upcoming API Cleanup (Drop TinyB only entries)
|
|
|
|
| |
6a748896188fdf3f885820ccd686393ea5215dbf (from cmake-modules)
|