-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is possible to subscribe to multiple characteristic notifications at once? Also to read? And to combine more read/notify operations? #61
Comments
Hello there. Question: Is possible to subscribe to multiple characteristic notifications at once? From what I understand you would like to map characteristics values into a POJO model in this scenario either to manually assign a characteristic value to a property or have a model that is very generic (a
I hope this answers your question. Best Regards |
Thanks! It helps! :) My main concern is that as I'm learning RxJava I missed that. |
Just have in mind that Android allows to setup only a finite number of notifications. |
Yeah I believe that are 4 for version below 4.4 and then incremented the value to 7 from 5.0! But thanks for the remainder :) |
I have another related question with what you have shared yesterday: I can subscribe perfectly to the notifications and I can map those to a pair to latter transform the bytes[] values to meaningful data. The same applies if I want to read those characteristics that allows reading with the following snippet of code:
I would like to upon the first connection: read an amount of characteristics that has the reading property and only after that subscribe to those notifications that have the notification property pretty much as you explained me yesterday. The thing is that when I do the first part the reading observable won't emit a finish a (Sorry to bother you again with more questions about RxJava than the library itself but I've been searching for examples and I can't find nothing valuable). Maybe the option is to use an observable that counts the emission of the first one and then after that chain through that to start listening notifications. How is the best option to achieve that? BTW I think that this answers would be good to create a Wiki and explain advanced usage of the library (providing more examples to the sample app). I would gladly do it. Thanks Edit 1: Updated the title to be more meaningful. |
Actually this kind of questions should go to stackoverflow.com with the tag |
Yeah, you're right :) (I'm going to create the question there and I'll update this comment with the link). Edit: Question is asked in StackOverflow. I'll close this 'non issue' issue. Thanks! |
Is there any possibility where I can subscribe to those characteristics that allow notifications in one row?
In the demos you only listen to one characteristic at a time but would be great to have in
RxBleDeviceServices
:As I'm quite new to RxJava (and your codebase) I don't know if is a good idea to do this (or even the approach) but I would gladly code it if I'm given more explanations on how to achieve it (or maybe I'm thinking a bad assumption and is already implemented).
The use case is that I have one object that acts as a model with different parameters and those parameters are filled with the notifications that each characteristic sends with the updated value. As I have 10 characteristics sending notifications, I have to setup every notification by hand, then listen to the change and then update the object.
Below is an example of what to achieve (don't look too much to the code as I know that is faulty)
The same could apply if I would like to read all the values at once by filtering those characteristics that allow reading.
Thanks :)
The text was updated successfully, but these errors were encountered: