-
Notifications
You must be signed in to change notification settings - Fork 222
Add (optional) company ID argument to BLE.setManufacturerData(....) #18
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
Conversation
fix format Co-Authored-By: per1234 <accounts@perglass.com>
fix format Co-Authored-By: per1234 <accounts@perglass.com>
Co-Authored-By: per1234 <accounts@perglass.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @konikoni428,
Thanks for submitting this pull request!
It looks fine, but it would be great it we could have both versions of the API for backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to maintain backwards compatibility here and support both the newer and older API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing out the problem.
Please check new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@konikoni428 thanks for updating, the latest changes look good!
@SimonePDA we'll have to update the following page accordingly: https://www.arduino.cc/en/Reference/ArduinoBLEBLEsetManufacturerData
There's a new syntax to be added:
BLE.setManufacturerData(companyId, data, length)
- companyId - (optional) 16-bit company id of manufacturer data (expected to be included in data array if not provided)
Add support to X-NUCLEO-IDB05A2
issue
ArduinoBLE referense sample code
Result of code execution
0x0201 -> companyId
0x03, 0x04, 0x05 -> manufacturerData
I think it ’s very confusing.
change
BLE.setManufacturerData(uint8_ uint8_t manufacturerData[], int manufacturerDataLength)
↓
BLE.setManufacturerData(const uint16_t companyId, const uint8_t manufacturerData[], int manufacturerDataLength)
use
0x1234 -> companyId
0x01, 0x02, 0x03, 0x04, 0x05 -> manufacturerData