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

manufacturerData of first returned peripheral record is null #605

Closed
rk85097 opened this issue Jan 27, 2020 · 3 comments
Closed

manufacturerData of first returned peripheral record is null #605

rk85097 opened this issue Jan 27, 2020 · 3 comments

Comments

@rk85097
Copy link

rk85097 commented Jan 27, 2020

Prerequisites

  • [ YES] I am running the latest version
  • [YES ] I checked the documentation and found no answer
  • [YES ] I checked to make sure that this issue has not already been filed - I have found another similar issue but it is not my case: manufacturerData always null #346

Expected Behavior

manufacturerData should not be null, regardless. When scanning for peripherals, then reading their manufacturerData, I expect it not to be null.

Current Behavior

When allowDuplicates scanOption is true, startDeviceScan will return multiple peripherals records of the same pheripheral and sometimes the first record will have manufacturerData null, which means ble-plx returns a peripheral on scanOption before getting initial scan response from peripheral causing manufacturerData to be empty.

Steps to Reproduce

  1. Scan for peripherals (startDeviceScan with allowDuplicates true)
  2. While scanning, read manufacturerData of first peripheral record
@rk85097 rk85097 added the bug label Jan 27, 2020
@rk85097 rk85097 changed the title Bug Report manufacturerData is null on first scan Jan 27, 2020
@rk85097 rk85097 changed the title manufacturerData is null on first scan manufacturerData of first returned peripheral record is null Jan 27, 2020
@rk85097
Copy link
Author

rk85097 commented Jan 27, 2020

TEMP-SOLUTION - Always take last peripheral record coming from startDeviceScan to insure manufacturer data is not empty.

@Cierpliwy
Copy link
Contributor

This can happen. Very often advertisement data is split into two packages and OS may report both of them after another without merging them. I'm talking about ADV_IND and SCAN_RSP. What you can do on firmware side is to make sure that manufacturer data is moved to the first packet ADV_IND and move less important advertisement data to the second one.

Another option is to wait for last record as you mentioned. It should have merged properties.

@stale
Copy link

stale bot commented Mar 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants