-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[bluetooth] Add support for service data #10278
Conversation
What do you think @cpmeister? Will you review my suggestion? |
@Hilbrand, @kaikreuzer, @weymann it seams that @cpmeister has no time to do a review. Is there someone else who could do that? |
Hi @PRosenb! Yes, it is a pity that @cpmeister does not find the time as he is our BLE expert... |
Hi @kaikreuzer, thanks for having a look at my implementation. I'm currently moving overseas and have no access to my equipment at the moment. What do you mean with BLE units? |
With BLE units, I referred to "BLE GATT Units" that also have UUIDs assigned in the specification (see e.g. here.
As mentioned above, by concern is that this won't scale at all. The hope expressed in this post was that a lot of work/features that were done in the previous 3rd-party bluetooth binding can be ported over to this official one here. This binding used a dedicated GATT parser library and says in its README:
This was done in a very generic way, which would imho also be the best way to go here. |
I implemented a generic solution but cannot test it without a debugger due to ForbiddenClassException. @kaikreuzer have you seen that issue as well or know how to solve it? |
2cb7753
to
a6936d1
Compare
@kaikreuzer - are you interested in looking into this generic solution implemented by @PRosenb? Also there is a request for help, I don't know if you or anyone else would have the knowledge to be able to help. |
Thanks @jlaur for your comment. The The existing Generic Bluetooth Device Binding of openHAB is currently broken because it depends on bluetooth-gatt-parser. |
Yes, I definitely am, sorry for not commenting any earlier!
How about creating a fork of it in the openHAB organisation? Then we can fix it ourselves and release our own versions of it. |
I just did so. I included your pull request and released a version 2.0.0 under the new I will prepare a PR to update the Generic Bluetooth Device Binding to make use of this version. |
Here we go: #13128 |
Great, thank you @kaikreuzer |
a6936d1
to
351923f
Compare
Thanks for letting me know @jlaur, I rebased it but cannot test it at the moment because I'm overseas. I think review can still go ahead. |
@kaikreuzer - gentle reminder that this PR is ready for review. |
@PRosenb - should anything be mentioned in the README? |
Thanks @PRosenb, The code looks good to me in general. I currently cannot test it as I only have a BlueGiga stick at hand, but not a Linux/BlueZ setup. That also brings me to my only concern: The PR only adds support for BlueZ, but not for BlueGiga. I assume you do not have such a stick, so it will be too much to ask you for adding support. @cdjackson As you are the original author of the BlueGiga bundle: Do you happen to know if it is also possible to extract service data from scan notifications on it? From the code itself, I unfortunately do not see any clear path to do so. 😞 |
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
…ngStatus.ONLINE Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Sorry @kaikreuzer it's been a few years since I've looked at the BlueGiga stuff so I'm not sure to be honest. |
Thank you @kaikreuzer to review the code. BlueZ uses the built in Bluetooth chip of the Raspberry Pi. If you have such a device I guess it should work with openHABian. |
351923f
to
e304f38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have such a device I guess it should work with openHABian.
I certainly have, but I didn't take it with me on vacation. 😉
Ok, since you have tested it and the code is fine, we can merge - many thanks for your work!
I'll see if I can find any time to do some debugging with a BlueGiga stick - it would be really nice if this feature could likewise be supported there.
Great, thank you @kaikreuzer |
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Signed-off-by: Peter Rosenberg <prosenb.dev@gmail.com>
Bluetooth low energy allows broadcasters to advertise not only their presence but also
Service Data
. InService Data
, data of a Bluetooth Service's Characteristic can be advertised. Doing so allows a central like openHAB to receive data from a Bluetooth device without the need to connect to it. This helps to reduce power consumption on the peripheral.Supplement to the Bluetooth Core Specification, 1.11 SERVICE DATA, page 19
The aim of this pull request is to add basic support of
Service Data
to openHAB so that a temperature/humidity sensor broadcasting its value asService Data
is supported.I'm curious what you think about this idea in general @cpmeister and also on how I suggest to implement it. Input and feedback is very welcome.