| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provi
der.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provi
der.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 VLOG(1) << "Cleaning up Bluetooth GATT characteristic: " | 99 VLOG(1) << "Cleaning up Bluetooth GATT characteristic: " |
| 100 << object_path_.value(); | 100 << object_path_.value(); |
| 101 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client = | 101 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client = |
| 102 static_cast<FakeBluetoothGattManagerClient*>( | 102 static_cast<FakeBluetoothGattManagerClient*>( |
| 103 bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient()); | 103 bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient()); |
| 104 fake_bluetooth_gatt_manager_client->UnregisterCharacteristicServiceProvider( | 104 fake_bluetooth_gatt_manager_client->UnregisterCharacteristicServiceProvider( |
| 105 this); | 105 this); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void FakeBluetoothGattCharacteristicServiceProvider::SendValueChanged( | 108 void FakeBluetoothGattCharacteristicServiceProvider::SendValueChanged( |
| 109 const std::vector<uint8_t>& value) { | 109 const dbus::ObjectPath& device_path, |
| 110 const std::vector<uint8_t>& value, |
| 111 bool indicate) { |
| 110 VLOG(1) << "Sent characteristic value changed: " << object_path_.value() | 112 VLOG(1) << "Sent characteristic value changed: " << object_path_.value() |
| 111 << " UUID: " << uuid_; | 113 << " UUID: " << uuid_; |
| 112 sent_value_ = value; | 114 sent_value_ = std::make_tuple(device_path.value(), value, indicate); |
| 113 } | 115 } |
| 114 | 116 |
| 115 void FakeBluetoothGattCharacteristicServiceProvider::GetValue( | 117 void FakeBluetoothGattCharacteristicServiceProvider::GetValue( |
| 116 const dbus::ObjectPath& device_path, | 118 const dbus::ObjectPath& device_path, |
| 117 const device::BluetoothLocalGattService::Delegate::ValueCallback& callback, | 119 const device::BluetoothLocalGattService::Delegate::ValueCallback& callback, |
| 118 const device::BluetoothLocalGattService::Delegate::ErrorCallback& | 120 const device::BluetoothLocalGattService::Delegate::ErrorCallback& |
| 119 error_callback) { | 121 error_callback) { |
| 120 VLOG(1) << "GATT characteristic value Get request: " << object_path_.value() | 122 VLOG(1) << "GATT characteristic value Get request: " << object_path_.value() |
| 121 << " UUID: " << uuid_; | 123 << " UUID: " << uuid_; |
| 122 // Check if this characteristic is registered. | 124 // Check if this characteristic is registered. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 195 |
| 194 return true; | 196 return true; |
| 195 } | 197 } |
| 196 | 198 |
| 197 const dbus::ObjectPath& | 199 const dbus::ObjectPath& |
| 198 FakeBluetoothGattCharacteristicServiceProvider::object_path() const { | 200 FakeBluetoothGattCharacteristicServiceProvider::object_path() const { |
| 199 return object_path_; | 201 return object_path_; |
| 200 } | 202 } |
| 201 | 203 |
| 202 } // namespace bluez | 204 } // namespace bluez |
| OLD | NEW |