[Bluetooth] Fix Bluetooth LE advertising initialzation 79/117779/2
authorPawel Wasowski <p.wasowski2@partner.samsung.com>
Tue, 7 Mar 2017 10:14:14 +0000 (11:14 +0100)
committerPawel Wasowski <p.wasowski2@partner.samsung.com>
Tue, 7 Mar 2017 11:29:49 +0000 (12:29 +0100)
startAdvertise() could not obtain "uuids" field of BluetoothLEAdvertiseData and "uuid" of BluetoothLEServiceData.

[Verification] After a call to startAdvertise() in application's debug mode, the device becomes discoverable by other devices with its service and serviceData.

Change-Id: Iedf239e1e79df15b32f8c4de9df397635d789eb6
Signed-off-by: Pawel Wasowski <p.wasowski2@partner.samsung.com>
src/bluetooth/bluetooth_le_adapter.cc

index 7447289a46fb59531f333de16a3a1601c36058a9..b63fc3224be2648e630db9f3d47c9e81fa13ff61 100755 (executable)
@@ -105,7 +105,7 @@ class BluetoothLEServiceData : public ParsedDataHolder {
   static bool ParseUUID(const picojson::value& obj,
                         BluetoothLEServiceData* out) {
     LoggerD("Entered");
-    const auto& uuid = obj.get("serviceuuid");
+    const auto& uuid = obj.get("uuid");
     if (uuid.is<std::string>()) {
       out->uuid_ = uuid.get<std::string>();
     } else {
@@ -261,7 +261,7 @@ class BluetoothLEAdvertiseData : public ParsedDataHolder {
   static bool ParseServiceUUIDs(const picojson::value& obj,
                                 BluetoothLEAdvertiseData* out) {
     LoggerD("Entered");
-    const auto& service_uuids = obj.get("serviceuuids");
+    const auto& service_uuids = obj.get("uuids");
     if (service_uuids.is<picojson::array>()) {
       for (const auto& i : service_uuids.get<picojson::array>()) {
         if (i.is<std::string>()) {