Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
sandeepmistry merged 6 commits into arduino-libraries:master from konikoni428:master
Sep 5, 2019

Conversation

Copy link
Contributor

@konikoni428 konikoni428 commented Sep 1, 2019

issue

ArduinoBLE referense sample code

 byte data[5] = { 0x01, 0x02, 0x03, 0x04, 0x05};
 BLE.setManufacturerData(data, 5);

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

 uint8_t data[5] = { 0x01, 0x02, 0x03, 0x04, 0x05};
 BLE.setManufacturerData(0x1234, data, 5);

0x1234 -> companyId
0x01, 0x02, 0x03, 0x04, 0x05 -> manufacturerData

konikoni428 and others added 3 commits September 3, 2019 17:58
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>
Copy link
Contributor

@sandeepmistry sandeepmistry left a 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.

void setAdvertisedServiceUuid(const char* advertisedServiceUuid);
void setAdvertisedService(const BLEService& service);
void setManufacturerData(const uint8_t manufacturerData[], int manufacturerDataLength);
void setManufacturerData(const uint16_t companyId, constuint8_t manufacturerData[], int manufacturerDataLength);
Copy link
Contributor

@sandeepmistry sandeepmistry Sep 3, 2019

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.

Copy link
Contributor Author

@konikoni428 konikoni428 Sep 4, 2019

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.

Copy link
Contributor

@sandeepmistry sandeepmistry left a 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!

@sandeepmistry sandeepmistry changed the title (削除) add setManufacturerData argument (削除ここまで) (追記) Add (optional) company ID argument to BLE.setManufacturerData(....) (追記ここまで) Sep 5, 2019
@sandeepmistry sandeepmistry merged commit b6a66a4 into arduino-libraries:master Sep 5, 2019
Copy link
Contributor

@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)

cparata added a commit to cparata/ArduinoBLE that referenced this pull request Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@per1234 per1234 per1234 requested changes

+1 more reviewer

@sandeepmistry sandeepmistry sandeepmistry approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /