Merge branch 'marcuschangarm-uuid' into develop

This commit is contained in:
Rohit Grover 2015-12-02 13:10:05 +00:00
commit 599b8ed7f8

View file

@ -251,10 +251,7 @@ 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];
}
memcpy(uuid, response->handle_value[0].p_value, UUID::LENGTH_OF_LONG_UUID);
unsigned serviceIndex = serviceUUIDDiscoveryQueue.dequeue();
services[serviceIndex].setupLongUUID(uuid);
@ -266,10 +263,8 @@ 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];
}
memcpy(uuid, &(response->handle_value[0].p_value[3]), UUID::LENGTH_OF_LONG_UUID);
unsigned charIndex = charUUIDDiscoveryQueue.dequeue();
characteristics[charIndex].setupLongUUID(uuid);