Skip to content

Jira 792, Support addition UUID types, git PR 386. #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions libraries/CurieBLE/src/internal/BLEDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,13 @@ int BLEDeviceManager::advertisedServiceUuidCount(const BLEDevice* device) const
return service_cnt;
}

/* Sid, 2/15/2017. Sandeep reported that Apple devices may use
BT_DATA_UUID16_SOME and BT_DATA_UUID128_SOME in addition to ALL.
Practically, these types are same as ALL. */
if (type == BT_DATA_UUID16_ALL ||
type == BT_DATA_UUID128_ALL)
type == BT_DATA_UUID128_ALL ||
type == BT_DATA_UUID16_SOME ||
type == BT_DATA_UUID128_SOME)
{
service_cnt++;
}
Expand Down Expand Up @@ -791,7 +796,10 @@ String BLEDeviceManager::localName(const BLEDevice* device) const
return temp;
}

if (type == BT_DATA_NAME_COMPLETE)
/* Sid, 2/15/2017. Support both forms of data name.
*/
if (type == BT_DATA_NAME_COMPLETE ||
type == BT_DATA_NAME_SHORTENED)
{
if (len >= BLE_MAX_ADV_SIZE)
{
Expand Down Expand Up @@ -862,14 +870,17 @@ String BLEDeviceManager::advertisedServiceUuid(const BLEDevice* device, int inde
}

if (type == BT_DATA_UUID16_ALL ||
type == BT_DATA_UUID128_ALL)
type == BT_DATA_UUID128_ALL ||
type == BT_DATA_UUID16_SOME ||
type == BT_DATA_UUID128_SOME)
{
service_cnt++;
}

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);
Expand Down