diff options
author | Sven Gothel <[email protected]> | 2020-07-25 07:45:50 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-07-25 07:45:50 +0200 |
commit | 28ee10141fbd4874f8f78c0c699d5e62635f77f6 (patch) | |
tree | 757a93a731daef7abf8c6247125422d712c0a109 /examples | |
parent | 537b779c122605865f541a89a45b8d205dad5fb8 (diff) |
GATTCharacteristic: Add enableNotificationOrIndication(..)..; DIRECTBT_CHARACTERISTIC_VALUE_CACHE_NOTIFICATION_COMPATv2.1.15
GATTCharacteristic (Java/C++): Add enableNotificationOrIndication(..) and use it as default for BLE active addCharacteristicListener(..).
It is recommended to utilize notification over indication, as its link-layer handshake
and higher potential bandwidth may deliver material higher performance.
+++
Add setting BluetoothFactory.DIRECTBT_CHARACTERISTIC_VALUE_CACHE_NOTIFICATION_COMPAT
(and also document DEBUG and VERBOSE).
DIRECTBT_CHARACTERISTIC_VALUE_CACHE_NOTIFICATION_COMPAT
Have direct_bt provide compatibility to TinyB's BluetoothGattCharacteristic
API: BluetoothGattCharacteristic#getValue() value cache and
BluetoothGattCharacteristic#enableValueNotifications(BluetoothNotification) value notification.
DBTGattCharacteristic benefits from _disabled_ compatibility (and DEBUG)
performance wise, as no listener nor cache needs to be added in this case!
Diffstat (limited to 'examples')
-rw-r--r-- | examples/java/ScannerTinyB10.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/java/ScannerTinyB10.java b/examples/java/ScannerTinyB10.java index 78235138..0a9b3114 100644 --- a/examples/java/ScannerTinyB10.java +++ b/examples/java/ScannerTinyB10.java @@ -416,6 +416,9 @@ public class ScannerTinyB10 { System.setProperty("org.tinyb.verbose", "true"); } } + // Drop BluetoothGattCharacteristic value cache and notification compatibility using direct_bt. + System.setProperty("direct_bt.tinyb.characteristic.compat", "false"); + if( null == bluetoothManagerClazzName ) { bluetoothManagerClazzName = BluetoothFactory.DirectBTImplementationID.BluetoothManagerClassName; } |