Fixed endianness bug in nRF5xServiceDiscovery::processDiscoverUUIDResponse to be consistent with BLE API.
This commit is contained in:
parent
7b3015084c
commit
2725247316
1 changed files with 4 additions and 4 deletions
|
@ -251,9 +251,9 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_
|
|||
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[UUID::LENGTH_OF_LONG_UUID - 1 - i];
|
||||
uuid[i] = response->handle_value[0].p_value[i];
|
||||
}
|
||||
|
||||
unsigned serviceIndex = serviceUUIDDiscoveryQueue.dequeue();
|
||||
|
@ -266,9 +266,9 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_
|
|||
} 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 + UUID::LENGTH_OF_LONG_UUID - 1 - i];
|
||||
uuid[i] = response->handle_value[0].p_value[3 + i];
|
||||
}
|
||||
|
||||
unsigned charIndex = charUUIDDiscoveryQueue.dequeue();
|
||||
|
|
Loading…
Reference in a new issue