OSDN Git Service

[bluetoothtb] Fix bug processing BT_PROPERTY_UUIDS
authorBailey Forrest <bcf@google.com>
Sat, 25 Aug 2018 00:04:00 +0000 (17:04 -0700)
committerBailey Forrest <bcf@google.com>
Sat, 25 Aug 2018 00:10:27 +0000 (17:10 -0700)
BT_PROPERTY_UUIDS returns an array of UUID objects

Bug: None
Test: Manual
Change-Id: I9ace472b8bddb5823dc7309528d94faba3d0dfe2

service/adapter.cc

index abda22d..2363127 100644 (file)
@@ -79,13 +79,13 @@ RemoteDeviceProps ParseRemoteDeviceProps(int num_properties,
           NOTREACHED() << "Negative length on BT_PROPERTY_UUIDS:";
           break;
         }
-        if (property->len % sizeof(Uuid::UUID128Bit) != 0) {
+        if (property->len % sizeof(Uuid) != 0) {
           NOTREACHED() << "Trailing bytes on BT_PROPERTY_UUIDS:";
         }
-        auto uuids = static_cast<const Uuid::UUID128Bit*>(property->val);
+        auto uuids = static_cast<const Uuid*>(property->val);
 
-        for (size_t i = 0; i < property->len / sizeof(Uuid::UUID128Bit); ++i) {
-          service_uuids.push_back(Uuid::From128BitLE(uuids[i]));
+        for (size_t i = 0; i < property->len / sizeof(Uuid); ++i) {
+          service_uuids.push_back(uuids[i]);
         }
         break;
       }