No changes
Fork of nRF51822 by
Diff: source/nRF5xServiceDiscovery.cpp
- Revision:
- 529:7b8ca6778535
- Parent:
- 528:7144407893f0
- Child:
- 532:c8df45b865f7
--- a/source/nRF5xServiceDiscovery.cpp Wed Dec 02 13:14:18 2015 +0000 +++ b/source/nRF5xServiceDiscovery.cpp Wed Dec 02 13:14:18 2015 +0000 @@ -251,9 +251,9 @@ if (state == DISCOVER_SERVICE_UUIDS) { if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID)) { UUID::LongUUIDBytes_t uuid; - + /* Switch longUUID bytes to MSB */ for (unsigned i = 0; i < UUID::LENGTH_OF_LONG_UUID; i++) { - uuid[i] = response->handle_value[0].p_value[i]; + uuid[i] = response->handle_value[0].p_value[UUID::LENGTH_OF_LONG_UUID - 1 - i]; } unsigned serviceIndex = serviceUUIDDiscoveryQueue.dequeue(); @@ -266,9 +266,9 @@ } else if (state == DISCOVER_CHARACTERISTIC_UUIDS) { if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID + 1 /* props */ + 2 /* value handle */)) { UUID::LongUUIDBytes_t uuid; - + /* Switch longUUID bytes to MSB */ for (unsigned i = 0; i < UUID::LENGTH_OF_LONG_UUID; i++) { - uuid[i] = response->handle_value[0].p_value[3 + i]; + uuid[i] = response->handle_value[0].p_value[3 + UUID::LENGTH_OF_LONG_UUID - 1 - i]; } unsigned charIndex = charUUIDDiscoveryQueue.dequeue();