-
Notifications
You must be signed in to change notification settings - Fork 4
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
Read and decode advertisement beacon data? #1
Comments
So, it's been a very long time since I looked at this code (oops!) - Other BLE debug tools seem to correctly differentiate between byte arrays and strings on characteristics, though. I seem to remember there being a descriptor or similar for basic type inference, but it's been north of 2 years since I've worked with BLE in any meaningful fashion. The repo you linked defines the advertisement schema in the readme - are you seeing a different byte count? |
thanks for your reply! |
No, I didn't have any BLE advert-heavy products at my disposal, so I can't say I had a chance to try. /r/powershell might have some suggestions on how to receive UWP events in NetFX - my guess is that you likely have to do some funny delegate marshaling and hand UWP an event handler through COM. (That being said, you're welcome to cut a PR to add new functions for collecting adverts if you'd like!) |
First of all, let me thank you for BLEPS, it has been very ispirational!
I've tried BLEPS and I've managed to use it to read BLE beacons, but as far as I understand, there is no way (limit of Powershell 5) to have working WinRT events trigger, so I've resorted to listening for a few seconds and then trying to parse the received payload.. but I only get a few bytes of not very meaningful data out of Read-BleCharacteristic pointed at the serviceUUID I'm monitoring.
(I've been trying to to parse sensor data from Mi Thermometers that is sent passively in BLE advertisement beacons., the data format is described here )
it seems to me that the data I'm receiving is signed (and possibly little-endian), while Read-Blecharacteristic returns and unsigned bytearray...
On a side note, I've read that using Powershell 7 it is now possible to have working UWP events trigger (tested, and it works!), so I've used
(library can be found here ) and it indeed works, but the returned data
$event.SourceArgs[1].Advertisement.DataSections
seem to output the same unsigned bytearray (even tho this time, the object has additional DataType property that maybe could be used to dictate the format of each bytearray.. maybe?)
The text was updated successfully, but these errors were encountered: