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

Changed GapAdvertisingData.addData to take current fields into account when adding data. #108

Merged
merged 1 commit into from
Nov 24, 2015
Merged

Conversation

marcuschangarm
Copy link
Contributor

Resubmission of #101

if ((_payloadLen - dataLength + len) <= GAP_ADVERTISING_DATA_MAX_PAYLOAD) {
// remove old field
while (field + dataLength < &_payload[GAP_ADVERTISING_DATA_MAX_PAYLOAD]) {
*field = field[dataLength];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be *field = field[dataLength +1];?

@marcuschangarm
Copy link
Contributor Author

It was actually an off-by-2-error, dataLength + type field + length field. And I forgot to decrement _payloadLen.

I changed result to BLE_ERROR_NOT_IMPLEMENTED if the user tries to update a field that is not supported.

rgrover added a commit that referenced this pull request Nov 24, 2015
Changed GapAdvertisingData.addData to take current fields into account when adding data.
@rgrover rgrover merged commit b621641 into ARMmbed:develop Nov 24, 2015
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

Successfully merging this pull request may close these issues.

2 participants