Closed andrewtran1995 closed 4 years ago
I don't remember why I used -1 insted of specifying the mask bit by bit, but a value of -1 in binary means that all bits are set to 1.
You are free (and encouraged) to use OpenPods to make other open source apps :)
Question
I notice that when creating the scan filter for the Bluetooth LE scan to sniff out AirPods, the code sets the manufacturer data mask to
-1
for indices0
and1
. https://github.com/adolfintel/OpenPods/blob/7d8d286350dea24a50674d53ff61d5d85d320651/OpenPods/app/src/main/java/com/dosse/airpods/PodsService.java#L198 I'm a little confused how that works properly, given Android's documentation that the mask should essentially consist of booleans to determine if the mask is applied in that position or not. Would it be possible to get an explanation for how this works? Thanks in advance!Context
For context, I'm trying to build my own AirPod battery app (giving full credit of the battery information derivation to this repo): andrewtran1995/airpod-battery.
ScanFilter
enabled; noScanResult
returns with manufacturer-specific data of length27
.If it is more appropriate to take any of the above offline, please let me know. Thank you for the work you've done thus far, and providing your findings in this open source format! ❤️