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

Fixed endianness bug in nRF5xServiceDiscovery::processDiscoverUUIDResponse so it is consistent with BLE API. #80

Merged
merged 1 commit into from
Dec 2, 2015

Conversation

marcuschangarm
Copy link
Contributor

In BLE::UUID, uuids are stored and handled little endian. This PR preserves the endianness returned by the Nordic Softdevice during discovery.

@rgrover
Copy link
Contributor

rgrover commented Dec 2, 2015

@pan- please comment on this.

for (unsigned i = 0; i < UUID::LENGTH_OF_LONG_UUID; i++) {
uuid[i] = response->handle_value[0].p_value[UUID::LENGTH_OF_LONG_UUID - 1 - i];
uuid[i] = response->handle_value[0].p_value[i];
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it is better to use memcpy instead of a for loop

@marcuschangarm
Copy link
Contributor Author

@pan- any comments to the PR, not the original code?

@pan-
Copy link
Member

pan- commented Dec 2, 2015

I'm not sure to understand, I'm talking about the PR, it can be improved if memcpy is used instead of for loop.
Beside that, I'm happy with it.

@marcuschangarm
Copy link
Contributor Author

I didn't put in the for-loop. If you want it removed, open an issue or make a pull request.

@rgrover rgrover merged commit 2725247 into ARMmbed:develop Dec 2, 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.

None yet

3 participants