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
add-type -path ".\Microsoft.Windows.SDK.NET.dll"
$Watcher=[Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher]::new()
Register-ObjectEvent -InputObject $Watcher -EventName Received -Action {
$Global:Event=$Event
}
$Watcher.Start()
sleep 5
$Watcher.Stop()
(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?)