Index: device/bluetooth/test/bluetooth_test_bluez.cc |
diff --git a/device/bluetooth/test/bluetooth_test_bluez.cc b/device/bluetooth/test/bluetooth_test_bluez.cc |
index f1188ed64b99d7093cc892d977671510eaadb123..7f32881689ae5839d7b6fca806708b1456c8dd01 100644 |
--- a/device/bluetooth/test/bluetooth_test_bluez.cc |
+++ b/device/bluetooth/test/bluetooth_test_bluez.cc |
@@ -5,6 +5,7 @@ |
#include "device/bluetooth/test/bluetooth_test_bluez.h" |
#include <string> |
+#include <tuple> |
#include <utility> |
#include "base/bind.h" |
@@ -278,7 +279,8 @@ bool BluetoothTestBlueZ::SimulateLocalGattCharacteristicNotificationsRequest( |
return characteristic_provider->NotificationsChange(start); |
} |
-std::vector<uint8_t> BluetoothTestBlueZ::LastNotifactionValueForCharacteristic( |
+BluetoothTestBase::NotificationType |
+BluetoothTestBlueZ::LastNotifactionValueForCharacteristic( |
BluetoothLocalGattCharacteristic* characteristic) { |
bluez::BluetoothLocalGattCharacteristicBlueZ* characteristic_bluez = |
static_cast<bluez::BluetoothLocalGattCharacteristicBlueZ*>( |
@@ -291,8 +293,20 @@ std::vector<uint8_t> BluetoothTestBlueZ::LastNotifactionValueForCharacteristic( |
fake_bluetooth_gatt_manager_client->GetCharacteristicServiceProvider( |
characteristic_bluez->object_path()); |
- return characteristic_provider ? characteristic_provider->sent_value() |
- : std::vector<uint8_t>(); |
+ if (!characteristic_provider) |
+ return NotificationType(); |
+ |
+ bluez::BluetoothAdapterBlueZ* adapter_bluez = |
+ static_cast<bluez::BluetoothAdapterBlueZ*>(adapter_.get()); |
+ const NotificationType& value = characteristic_provider->sent_value(); |
+ |
+ std::string device_id; |
+ bluez::BluetoothDeviceBlueZ* device = |
+ adapter_bluez->GetDeviceWithPath(dbus::ObjectPath(std::get<0>(value))); |
+ if (device) |
+ device_id = device->GetIdentifier(); |
+ |
+ return make_tuple(device_id, std::get<1>(value), std::get<2>(value)); |
} |
std::vector<BluetoothLocalGattService*> |