Comments (12)
The setupNotification
would return an Observable that will emit BleCharacteristicNotificationOfOtherTypeAlreadySetException
. (Long name...)
from rxandroidble.
Added support for the indications with commit: https://github.com/Polidea/RxAndroidBle/commit/f69ce78b18f635d23efc9b71e06c3e6e7d87d1c9.
A new release will be made after we will fix the bugs found. For the moment you can use the snapshot: compile 'com.polidea.rxandroidble:rxandroidble:1.1.0-SNAPSHOT'
.
from rxandroidble.
This is true, the library does not handle indications yet. You are welcome to open a pull request :)
from rxandroidble.
How much testing do you want to see? It looks like setupNotification
is heavily-tested, but much of that seems like it would be redundant to replicate.
from rxandroidble.
If you'd use same code don't duplicate tests. Just test what is new. Also I'd review the pull request itself for any bugs.
from rxandroidble.
With Paweł we will think how to handle situations where user would set a notification after setting indication to the same characteristic. Edge case - never the less needs to be addressed somehow. With your current proposal first setter would win and the second one would end up using the first one.
from rxandroidble.
@dariuszseweryn that is correct, and the reason that I haven't made a PR yet.
from rxandroidble.
What about adding an overwrite
parameter to setupNoticication
and setupIndication
methods?
When user would want to set a notification after setting indication to the same characteristic and overwrite is false
then nothing happens, otherwise a notification is set. The same would apply in other direction (setting indication after setting notification to the same characteristic).
from rxandroidble.
This is exactly what i'm needing. Your hack works great @mzgreen.
Is the overwrite parameter really needed? It seems like an overwrite could always happen and leave it up to the developer to check if a notification/indication is already set to the same characteristic.
from rxandroidble.
@cbodin Actually my idea with overwrite
was wrong. It could lead to unexpected behavior. One way would be to not allow to set notification
after setting indication
and vice-versa. There is no perfect solution that would make it easier for developer I think.
from rxandroidble.
We will go with emitting an exception when the indication is being set after notification was already setup (or vice-versa). We are discussing the best API still though. The code should be available within this week.
from rxandroidble.
Emitting exception directly when subscribing or throwing an exception when the setupNotification method is called?
from rxandroidble.
Related Issues (20)
- It is not possible to disconnect the Bluetooth while it is in the process of connecting. HOT 1
- BleGattCharacteristicException while readCharacteristic HOT 12
- scanResult.bleDevice.name not showing Ble updated name HOT 1
- BLUETOOTH_SCAN set usesPermissionFlags="neverForLocation",Is there a problem? HOT 2
- GenericFailure<CharacteristicValueUpdateError> HOT 11
- Send long bytes twice HOT 2
- Write request is not processed in the random order HOT 2
- Long Bytes Send HOT 8
- Creating a Fork HOT 2
- Set Preferred PHY / Read PHY HOT 2
- RxBleClient mulit connections HOT 4
- Is the library still maintained? HOT 3
- Android 14 breaking change HOT 15
- Google Pixel 5 loses bonding info after BT adapter cycle HOT 4
- Metode readcharacteristic not stream HOT 2
- Unable to readCharacteristic after writeCharacteristic HOT 5
- In the case of unsuccessful Bluetooth connection, actively disconnect without executing context. unregisterReceiver (receiver); At this point, there may be multiple Bluetooth broadcast registrarReceivers, which may crash on some Huawei phones due to a broadcast limit of approximately 1000. Suggest fixing this issue. HOT 2
- Can't scan after connect dispose/clear HOT 1
- Add `advertisingSid` property to `ScanResult` and `RxBleInternalScanResult` HOT 3
- BleGattCallbackTimeoutException when writing a characteristic with different data payload many times in a short period of time. HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxandroidble.