From fd26c850f97850c348b424f93937daedae4da991 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Fri, 30 Dec 2016 11:46:37 -0500 Subject: [PATCH] Add support for "some" 16-bit + 128-bit UUID's and shortened name --- libraries/CurieBLE/src/internal/BLEDeviceManager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/CurieBLE/src/internal/BLEDeviceManager.cpp b/libraries/CurieBLE/src/internal/BLEDeviceManager.cpp index 930e9faf..4c849aca 100644 --- a/libraries/CurieBLE/src/internal/BLEDeviceManager.cpp +++ b/libraries/CurieBLE/src/internal/BLEDeviceManager.cpp @@ -732,7 +732,9 @@ int BLEDeviceManager::advertisedServiceUuidCount(const BLEDevice* device) const } if (type == BT_DATA_UUID16_ALL || - type == BT_DATA_UUID128_ALL) + type == BT_DATA_UUID16_SOME || + type == BT_DATA_UUID128_ALL || + type == BT_DATA_UUID128_SOME) { service_cnt++; } @@ -780,7 +782,8 @@ String BLEDeviceManager::localName(const BLEDevice* device) const return temp; } - if (type == BT_DATA_NAME_COMPLETE) + if (type == BT_DATA_NAME_COMPLETE || + type == BT_DATA_NAME_SHORTENED) { if (len >= BLE_MAX_ADV_SIZE) { @@ -851,6 +854,8 @@ String BLEDeviceManager::advertisedServiceUuid(const BLEDevice* device, int inde } if (type == BT_DATA_UUID16_ALL || + type == BT_DATA_UUID16_SOME || + type == BT_DATA_UUID128_ALL || type == BT_DATA_UUID128_ALL) { service_cnt++; @@ -858,7 +863,8 @@ String BLEDeviceManager::advertisedServiceUuid(const BLEDevice* device, int inde if (index < service_cnt) { - if (type == BT_DATA_UUID16_ALL) + if (type == BT_DATA_UUID16_ALL || + type == BT_DATA_UUID16_SOME) { service_uuid.uuid.type = BT_UUID_TYPE_16; memcpy(&BT_UUID_16(&service_uuid.uuid)->val, &adv_data[2], 2);