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

ManufacturerSpecificData is not working properly #57

Closed
Ruifen9 opened this issue Jun 27, 2019 · 2 comments
Closed

ManufacturerSpecificData is not working properly #57

Ruifen9 opened this issue Jun 27, 2019 · 2 comments

Comments

@Ruifen9
Copy link

Ruifen9 commented Jun 27, 2019

I have a low-power Bluetooth device that advertisement data like this:
[
02 01 05 08 09 61 6e 74 68 65 72 6f
09 ff 11 02 11 02 d9 21 a3 38
1e ff 11 02 11 02 d9 21 a3 38 21 43 01 d9 00 10 19 44 45 4c 20 68 73 65 4d 20 47 53 54 42
4a 00 00 00 00 00 00 00 00 00
]
// result.getScanRecord().getManufacturerSpecificData()
//or
//result.getScanRecord().getManufacturerSpecificData(0x0211)

The ManufacturerSpecificData I read sometimes is like this:
[ 11 02 d9 21 a3 38 ] (When the signal is weak, more is like this)
, sometimes it is like this:
[
11 02 d9 21 a3 38 21 43 01 d9 00 10 19 44 45 4c 20 68 73 65 4d 20 47 53 54 42
4a 00 00 00 00 00 00 00 00 00
]
And I want to get all the advertisement data, but I didn't find the relevant method.
I hope I can get your reply, thank you.

@philips77
Copy link
Member

With this: https://developer.android.com/reference/android/bluetooth/le/ScanRecord.html#getBytes() method you may get all the data received, not only Manufacturer Data. I think, if the data are truncated, the only solution is to ignore such packet and wait for another.

@Ruifen9
Copy link
Author

Ruifen9 commented Jul 5, 2019

Thank you very much for your reply. This method will still get incomplete data, and most of them come from devices with weak signals.

@Ruifen9 Ruifen9 closed this as completed Jul 5, 2019
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