Merge pull request #82 from marcuschangarm/endian
WIP: UUID endian change
This commit is contained in:
commit
dada1de8fc
2 changed files with 4 additions and 6 deletions
|
@ -148,9 +148,8 @@ uint8_t custom_add_uuid_base(uint8_t const *const p_uuid_base)
|
|||
ble_uuid128_t base_uuid;
|
||||
uint8_t uuid_type = 0;
|
||||
|
||||
/* Reverse the bytes since ble_uuid128_t is LSB */
|
||||
for (unsigned i = 0; i < UUID::LENGTH_OF_LONG_UUID; i++) {
|
||||
base_uuid.uuid128[i] = p_uuid_base[UUID::LENGTH_OF_LONG_UUID - 1 - i];
|
||||
base_uuid.uuid128[i] = p_uuid_base[i];
|
||||
}
|
||||
|
||||
ASSERT_INT( ERROR_NONE, sd_ble_uuid_vs_add( &base_uuid, &uuid_type ), 0);
|
||||
|
@ -168,9 +167,8 @@ error_t custom_decode_uuid_base(uint8_t const *const p_uuid_base,
|
|||
{
|
||||
UUID::LongUUIDBytes_t uuid_base_le;
|
||||
|
||||
/* Reverse the bytes since ble_uuid128_t is LSB */
|
||||
for (uint8_t i = 0; i < UUID::LENGTH_OF_LONG_UUID; i++) {
|
||||
uuid_base_le[i] = p_uuid_base[UUID::LENGTH_OF_LONG_UUID - 1 - i];
|
||||
uuid_base_le[i] = p_uuid_base[i];
|
||||
}
|
||||
|
||||
ASSERT_STATUS( sd_ble_uuid_decode(UUID::LENGTH_OF_LONG_UUID, uuid_base_le, p_uuid));
|
||||
|
|
|
@ -254,7 +254,7 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_
|
|||
memcpy(uuid, response->handle_value[0].p_value, UUID::LENGTH_OF_LONG_UUID);
|
||||
|
||||
unsigned serviceIndex = serviceUUIDDiscoveryQueue.dequeue();
|
||||
services[serviceIndex].setupLongUUID(uuid);
|
||||
services[serviceIndex].setupLongUUID(uuid, UUID::LSB);
|
||||
|
||||
serviceUUIDDiscoveryQueue.triggerFirst();
|
||||
} else {
|
||||
|
@ -267,7 +267,7 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_
|
|||
memcpy(uuid, &(response->handle_value[0].p_value[3]), UUID::LENGTH_OF_LONG_UUID);
|
||||
|
||||
unsigned charIndex = charUUIDDiscoveryQueue.dequeue();
|
||||
characteristics[charIndex].setupLongUUID(uuid);
|
||||
characteristics[charIndex].setupLongUUID(uuid, UUID::LSB);
|
||||
|
||||
charUUIDDiscoveryQueue.triggerFirst();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue