Open millercentral opened 3 years ago
I've been using the getValueText(255) method from the ScanEntry class to obtain the manufacturer's data from a passive scan. I have a hacked-up example of what I am doing here:
https://github.com/doug-holtsinger/WirelessSensor/blob/master/Compute/src/AHRS-VISUAL/ahrs-ble.py
My application allows for the possibility of dropped packets though.
I have a device that broadcasts status using BLE Advertising broadcasts that updates a "Manufacturer" (0xFF) packet type twice over a couple seconds to provide data from two different sensors. The data of the given sensors themselves do not change that frequently. No connection to the device is needed/supported.
I want to build an integration for Home Assistant for this device and leverage bluepy to scan for the BLE broadcast messages, but I'm not sure what the correct coding pattern would be to scan long enough to receive both 0xFF advertisement updates? Would someone with more experience here be able to help with some simple sample code for this scenario?
Here is an example of the BLE broadcasts (as seen by bluetoothctl):