Skip to content
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

How to get Service Data? #95

Open
ApparentWindDirection opened this issue Nov 4, 2024 · 3 comments
Open

How to get Service Data? #95

ApparentWindDirection opened this issue Nov 4, 2024 · 3 comments

Comments

@ApparentWindDirection
Copy link

Some background:
I am trying to get readings from a BLE temperature sensor (Blue PUCK T-PROBE).
The readings are transmitted through advertising packets, encoded as a sequence of bytes inside the Service Data field for the standard temperature service with 16-bit UUID 2a6e. Apparently, this format is standardized in Environmental Sensing Service. Getting readings should be completely passive and doesn't require establishing a connection to the sensor. Indeed, it can be passively read both with nRF Connect and with custom code using win_ble.

I was unable to find a way to get readings with this library.
I've tried discovering services of the sensor without establishing a connection, but no success. Documentation is clear on that saying You need to first discover services before you are able to read and write to characteristics.. Yet the sensor isn't meant to be connected.
I've tried discovering services after connecting to the sensor. Discovery finishes successfully, but the list of discovered services doesn't contain the temperature service 2a6e. Apparently, parsing Service Data is the only way to get temperature readings. In any case, even if it would be possible to get them after a connection, reading a dozen of sensors (with a practical limit on the number of simultaneous connections in mind) doesn't seem reasonable.

Is there any way to retrieve raw bytes from Service Data fields in advertisement packets? Specifically, without a connection to the target device.

@rohitsangwan01
Copy link
Contributor

@ApparentWindDirection ServiceData is currently not exposed in scan results, because platform support for it is limited

@ApparentWindDirection
Copy link
Author

@rohitsangwan01 It is unfortunate that this feature is not available, since it precludes not only environmental sensors from the aforementioned standard, but a whole class of BLE devices from being used.
Is platform support limited, though? Quick googling shows that Service Data is available on Android, iOS & macOS, Windows, Linux and planned on Web. It is already better supported than unpair API.

@rohitsangwan01
Copy link
Contributor

@ApparentWindDirection Thank you for the feedback. We’ll look into adding support for this feature and aim to include it in an upcoming update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants