Tx Power #984
-
Hi, I want to get Tx Power value to calculate the distance of each devices. So far I've found a way to get Tx Power information from platform_data.
Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
This would be a good one to add to Bleak so that users don't have to write platform-specific code (i.e. add a
There is nothing to decode. In the WinRT bindings, the property will be lower snake case ( |
Beta Was this translation helpful? Give feedback.
-
I'm actually writing a small module to allow BLE access on Android via Python when using the Beeware framework. The idea is to have a limited drop in replacement for Bleak, since the Python4Android code from Bleak does not work in Beeware (as discussed elsewhere). I just stumbled across the Tx Power thing. The code as used by Bleak for the Android platform nearly never returns tx_power, while the code for the Windows platform does. So I got different tx_power results from the same device depending on the platform I use. I did some reading and must come to the conclusion that To be consistent with the other backend APIs, the Android backend should not use And |
Beta Was this translation helpful? Give feedback.
-
I don't know if the name is really problematic. There are some BLE libraries around that use a method As for another Android backend in Bleak: It is not, that I have not thought about this. But as a hobby programmer, it's, for the moment, much easier for me to write a standalone module than trying to build this into the existing Bleak backend djungel ;-) |
Beta Was this translation helpful? Give feedback.
This would be a good one to add to Bleak so that users don't have to write platform-specific code (i.e. add a
tx_power
attribute to thebleak.backends.scanner.AdvertisementData
class and populate it as you have described). Would you be able to make a pull request to implement this?There is nothing to decode. In the WinRT bindings, the property will be lower snake case (
transmit_power_level_in_d_bm
).