summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* HCIHandler::le_enable_scan: Use 'filter_dup' (was disabled for debugging, ↵v2.2.14Sven Gothel2021-08-303-227/+207
| | | | oversight)
* Add support for Bluetooth 5.0 Adapter (using HCI extended scanning and ↵Sven Gothel2021-08-3019-207/+1434
| | | | | | | | | connecting if supported) On Bluetooth 5.0 Adapter where HCI extended scanning and connecting is suppored, the original HCI commands may fail via DISALLOWED. Tested adapter: Intel AX200 Bluetooth 5.0 (Wi-Fi 6 802.11ax (2.4Gbps) + BT 5.0)
* API Change C++/Java: BTGattChar::addCharListener(..): Use naive ↵v2.2.13Sven Gothel2021-08-2812-201/+337
| | | | | | | | | | | | | | | | | | | 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.
* Fix EUI48Sub::scanEUI48Sub(..): Fail on missing expected colon, i.e. after ↵Sven Gothel2021-08-254-4/+64
| | | | each two digits
* DBTAdapter.cxx: Fix JNIAdapterStatusListener::deviceConnected(..): ↵v2.2.12Sven Gothel2021-08-251-38/+29
| | | | | | NewObject(.., deviceClazzCtor, ..) used wrong argument order. Aligned Java BTDevice ctor using private method for JNIAdapterStatusListener::deviceFound(..) and JNIAdapterStatusListener::deviceConnected(..).
* Bump README.md for 2.2.11v2.2.11Sven Gothel2021-08-111-1/+2
|
* run-[dbt_|java-]scanner10.sh: Add [-setcap, -root] launch options, update ↵Sven Gothel2021-08-113-97/+217
| | | | setcap/capsh; README: Clean MD; Refine Direct-BT application launch options
* .gitignore: Add issues/Sven Gothel2021-08-111-0/+1
|
* Fix EUI48Sub Tests: An empty input string EUI48Sub results in a toString() ↵Sven Gothel2021-08-062-14/+22
| | | | ':', hinting its type.
* Bump READMEv2.2.10Sven Gothel2021-08-051-1/+2
|
* BTDeviceRegistry::DeviceQuery: No need for EUI48Sub string representation if ↵Sven Gothel2021-08-052-2/+2
| | | | address
* EUI48Sub::toString(): if 0 == length return ":", allowing fully functional ↵Sven Gothel2021-08-052-2/+4
| | | | EUI48Sub <-> string conversion
* BTDeviceRegistry::DeviceQuery: Use explicit enum type distinguishing address ↵Sven Gothel2021-08-053-26/+57
| | | | or name to allow empty EUI48Sub for all devices
* BTDeviceRegistry, BTSecurityRegistry: Expose universal pattern matching, fix ↵Sven Gothel2021-08-058-103/+506
| | | | | | | | | | | | | | | 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
* Bump README.md (v2.2.9)v2.2.9Sven Gothel2021-08-041-0/+12
|
* BTDeviceRegistry: Replace print*() to get*String() and clarify method names ↵Sven Gothel2021-08-045-75/+76
| | | | (C++ and Java)
* BTDeviceRegistry + BTSecurityRegistry: Expose underlying collection (C++ and ↵Sven Gothel2021-08-046-66/+209
| | | | Java)
* Eclipse: Add jaulib/java/jni in source pathv2.2.8Sven Gothel2021-08-031-0/+1
|
* DBTScanner10.java: Show -dbt_debug option 'hci.scan_ad_eir'Sven Gothel2021-08-031-1/+1
|
* Return HCIStatusCode::NOT_POWERED if !adapter.isPowered(), also show ↵Sven Gothel2021-08-032-7/+7
| | | | adapter.toString() in WARN_PRINT
* AdapterSetting: Add clrAdapterSettingMaskBit(..)Sven Gothel2021-08-031-0/+5
|
* Java JNI: Exceptions: Use jau::RuntimeException derivatives for all ↵Sven Gothel2021-08-032-3/+3
| | | | exceptions to preserve the backtrace
* jaulib: Java JNI: Exceptions: Use jau::RuntimeException derivatives for all ↵Sven Gothel2021-08-031-0/+0
| | | | exceptions to preserve the backtrace
* BTDeviceRegistry.[cpp/java]: Bring back unordered_set/HashSet for ↵Sven Gothel2021-08-013-48/+92
| | | | | | | 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).
* Update Examples doc root entry for dbt_scanner10.cpp and DBTScanner10.javaSven Gothel2021-07-312-4/+17
|
* dbt_scanner10/DBTScanner10: Extract BTDeviceRegistry and BTSecurityRegistry ↵Sven Gothel2021-07-3110-354/+883
| | | | | | | | | | | | | | 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)
* Java: EUI48Sub add: hash_code(), clear(), indexOf(), contains(), ↵Sven Gothel2021-07-312-53/+205
| | | | operator==() etc; EUI48[Sub]: Add static 'scanEUI48[Sub]'(string&) and static 'indexOf()'
* C++: EUI48Sub add: hash_code(), clear(), indexOf(), contains(), operator==() ↵Sven Gothel2021-07-302-37/+177
| | | | etc; EUI48[Sub]: Add static 'scanEUI48[Sub]'(string&) and static 'indexOf()'
* Fix DBTDevice.java regression (commit ↵Sven Gothel2021-07-292-7/+19
| | | | | | | e8e7f0958ed452a79eb2977555c2281b3ff3ba19): Call native getNameImpl() only if instance is valid. Bring back a cached name (name_cached), but only cach on ctor and getName() calls if viable, otherwise use it if instance is invalid.
* SMPKeyFile: Tightened Constraints: readAndApply(..) key file's ↵Sven Gothel2021-07-295-66/+110
| | | | | | | | | | | 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.
* BTAdapter::mgmtEvDeviceFoundHCI: Resolve all 6 code-path (discovered, ↵Sven Gothel2021-07-281-77/+133
| | | | | | | | | | | | | | | shared, update) + ------+------------+----------+----------+-------------------------------------------+ | # | discovered | shared | update | +-------+------------+----------+----------+-------------------------------------------+ | 1.1 | false | false | ignored | New undiscovered/unshared -> deviceFound(..) | 1.2 | false | true | ignored | Undiscovered but shared -> deviceFound(..) [deviceUpdated(..)] | 2.1.1 | true | false | name | Discovered but unshared, name changed -> deviceFound(..) | 2.1.2 | true | false | !name | Discovered but unshared, no name change -> Drop(1) | 2.2.1 | true | true | any | Discovered and shared, updated -> deviceUpdated(..) | 2.2.2 | true | true | none | Discovered and shared, not-updated -> Drop(2) +-------+------------+----------+-----------------------------------------------------+
* DBTDevice.java: Remove 'name' field: Use native name via JNI (resolve device ↵Sven Gothel2021-07-282-19/+6
| | | | update dependency)
* BTAdapter::mgmtEvDeviceFoundHCI: 2nd AD-EIR w/ event-type SCAN_RSP notified ↵Sven Gothel2021-07-281-2/+6
| | | | | | | | via AdapterStatusListener::deviceUpdated(..) (NAME) This resolves the problem to detect devices by their name, using active scanning. User shall also listen to deviceUpdated with updateMask EIRDataType::NAME set.
* HCIHandler: AD EIR Debug: Remove the byte stream (use btmon instead)Sven Gothel2021-07-281-5/+1
|
* Passthrough all paramter BTAdapter::startDiscovery(..) -> ↵Sven Gothel2021-07-2818-34/+123
| | | | | | | | | | | | | 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.
* Add EIR GAPFlags definition and string presentation for EInfoReportSven Gothel2021-07-283-11/+75
|
* Eclipse .cproject (Add other examples for refactoring/indexing), project not ↵Sven Gothel2021-07-281-0/+2
| | | | producing a working binary anyways
* Add BTAdapter::[getV|v]isibleAddressAndType[()] and ↵Sven Gothel2021-07-2820-54/+129
| | | | | | | | | | | | | | 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).
* Fix warning (=error) clang 11.0.1: Different comparison types: Must ↵Sven Gothel2021-07-281-10/+10
| | | | explicitly declare enum class name
* Bump jaulibSven Gothel2021-07-281-0/+0
|
* HCIHandler: Additionally dump AD EIR byte-hex stream if env.DEBUG_SCAN_AD_EIRSven Gothel2021-07-271-1/+5
|
* BTAdapter: Remove duplicate friend declarationSven Gothel2021-07-271-1/+0
|
* dbt_scanner10: Document important invocation optionsSven Gothel2021-07-272-10/+75
|
* Clarify EInfoReport ownership between MgmtEvtDeviceFound, HCIHandler and ↵Sven Gothel2021-07-278-37/+50
| | | | | | | | | | | | | | | BTAdapter; Add AD_EIR debug flag MgmtEvtDeviceFound changes: Stringent ownership - field eireport type `std::shared_ptr<EInfoReport>` -> `std::unique_ptr<EInfoReport>` - getEIR() returns immutable EInfoReport pointer BTAdapter::mgmtEvDeviceFoundHCI(): Cleanup confusion - Expect coming from HCIHandler (we only listen to it), ABORT otherwise - Cleanup confusion of ownership etc Debug: - HCIHandler env.DEBUG_SCAN_AD_EIR `direct_bt.debug.hci.scan_ad_eir`
* Merge remote-tracking branch 'sgothel-ict/master'Sven Gothel2021-07-271-2/+3
|\
| * BTGattHandler: discoverDescriptors keep iterating all characteristics after ↵Xerxes Rånby2021-07-231-2/+3
| | | | | | | | the first one is done
* | test_java.sh: Fix jar name usedSven Gothel2021-07-271-5/+6
|/
* Bump jaulib v0.4.1Sven Gothel2021-06-221-0/+0
|
* Bump jaulib v0.4.0Sven Gothel2021-06-201-0/+0
|
* scripts/run-java-scanner10.sh: Add 'JAVA_PROPS' var to allow passing Java ↵v2.2.7Sven Gothel2021-06-151-1/+3
| | | | properties.