diff options
author | Sven Gothel <[email protected]> | 2021-09-24 15:08:32 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-09-24 15:08:32 +0200 |
commit | f9e393d68c5bcfa272e50a7a3fc4463d4f3ae51f (patch) | |
tree | 6b268d8c1462b2763cbdce42811824a372d6063b /examples | |
parent | a9070de1865145527d1200e924337882b41d5466 (diff) |
Add BTGattChar::removeCharListener() and add convenience BTGattChar::disableIndicationNotification(); On the Java ..
On the Java side the implementation had to be a little different.
The wrapping BTGattCharListener from addCharListener() can't be repeated as it holds the
native instance handle.
Here addCharListener() needs to return the wrapping BTGattCharListener object,
which the user shall reference if intending a later BTGattChar::removeCharListener().
This avoid maintaining a map(BTGattChar::Listener -> BTGattCharListener )
and hence the user takes the costs if desired only.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/java/DBTScanner10.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/java/DBTScanner10.java b/examples/java/DBTScanner10.java index b7c02c65..b1995f0b 100644 --- a/examples/java/DBTScanner10.java +++ b/examples/java/DBTScanner10.java @@ -511,7 +511,7 @@ public class DBTScanner10 { } }; final boolean enabledState[] = { false, false }; - final boolean addedCharPingPongListenerRes = char2.addCharListener(charPingPongListener, enabledState); + final boolean addedCharPingPongListenerRes = null != char2.addCharListener(charPingPongListener, enabledState); if( !QUIET ) { BTUtils.println(System.err, "Added CharPingPongListenerRes: "+addedCharPingPongListenerRes+", enabledState "+Arrays.toString(enabledState)); } @@ -560,7 +560,7 @@ public class DBTScanner10 { } } final boolean cccdEnableResult[] = { false, false }; - final boolean cccdRet = serviceChar.addCharListener( new MyGATTEventListener(i, j), cccdEnableResult ); + final boolean cccdRet = null != serviceChar.addCharListener( new MyGATTEventListener(i, j), cccdEnableResult ); if( !QUIET ) { printf(" [%02d.%02d] Characteristic-Listener: Notification(%b), Indication(%b): Added %b\n", i, j, cccdEnableResult[0], cccdEnableResult[1], cccdRet); |