Skip to content

Commit fb57800

Browse files
SidLeungsys_maker
authored and
sys_maker
committed
Jira 792, Support addition UUID types, git PR 386.
Features added: 1. Add the support for two addition UUID types, UUID16_SOME and UUID128_SOME. These types, practically, behaves the same as their related ALL types. Sandeep found that the Apple devices made use of these additional types and requested for their support. File mods: 1. BLEDeviceManager.cpp: - Add UUID16_SOME and UUID128_SOME at places checking for UUID types.
1 parent f610914 commit fb57800

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Diff for: libraries/CurieBLE/src/internal/BLEDeviceManager.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,13 @@ int BLEDeviceManager::advertisedServiceUuidCount(const BLEDevice* device) const
742742
return service_cnt;
743743
}
744744

745+
/* Sid, 2/15/2017. Sandeep reported that Apple devices may use
746+
BT_DATA_UUID16_SOME and BT_DATA_UUID128_SOME in addition to ALL.
747+
Practically, these types are same as ALL. */
745748
if (type == BT_DATA_UUID16_ALL ||
746-
type == BT_DATA_UUID128_ALL)
749+
type == BT_DATA_UUID128_ALL ||
750+
type == BT_DATA_UUID16_SOME ||
751+
type == BT_DATA_UUID128_SOME)
747752
{
748753
service_cnt++;
749754
}
@@ -791,7 +796,10 @@ String BLEDeviceManager::localName(const BLEDevice* device) const
791796
return temp;
792797
}
793798

794-
if (type == BT_DATA_NAME_COMPLETE)
799+
/* Sid, 2/15/2017. Support both forms of data name.
800+
*/
801+
if (type == BT_DATA_NAME_COMPLETE ||
802+
type == BT_DATA_NAME_SHORTENED)
795803
{
796804
if (len >= BLE_MAX_ADV_SIZE)
797805
{
@@ -862,14 +870,17 @@ String BLEDeviceManager::advertisedServiceUuid(const BLEDevice* device, int inde
862870
}
863871

864872
if (type == BT_DATA_UUID16_ALL ||
865-
type == BT_DATA_UUID128_ALL)
873+
type == BT_DATA_UUID128_ALL ||
874+
type == BT_DATA_UUID16_SOME ||
875+
type == BT_DATA_UUID128_SOME)
866876
{
867877
service_cnt++;
868878
}
869879

870880
if (index < service_cnt)
871881
{
872-
if (type == BT_DATA_UUID16_ALL)
882+
if (type == BT_DATA_UUID16_ALL ||
883+
type == BT_DATA_UUID16_SOME)
873884
{
874885
service_uuid.uuid.type = BT_UUID_TYPE_16;
875886
memcpy(&BT_UUID_16(&service_uuid.uuid)->val, &adv_data[2], 2);

0 commit comments

Comments
 (0)