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 dbus::ObjectPath& device_path, | 109 const std::vector<uint8_t>& value) { |
110 const std::vector<uint8_t>& value, | |
111 bool indicate) { | |
112 VLOG(1) << "Sent characteristic value changed: " << object_path_.value() | 110 VLOG(1) << "Sent characteristic value changed: " << object_path_.value() |
113 << " UUID: " << uuid_; | 111 << " UUID: " << uuid_; |
114 last_device_path_ = device_path; | 112 sent_value_ = value; |
115 last_value_ = value; | |
116 last_indicate_flag_ = indicate; | |
117 } | 113 } |
118 | 114 |
119 void FakeBluetoothGattCharacteristicServiceProvider::GetValue( | 115 void FakeBluetoothGattCharacteristicServiceProvider::GetValue( |
120 const dbus::ObjectPath& device_path, | 116 const dbus::ObjectPath& device_path, |
121 const device::BluetoothLocalGattService::Delegate::ValueCallback& callback, | 117 const device::BluetoothLocalGattService::Delegate::ValueCallback& callback, |
122 const device::BluetoothLocalGattService::Delegate::ErrorCallback& | 118 const device::BluetoothLocalGattService::Delegate::ErrorCallback& |
123 error_callback) { | 119 error_callback) { |
124 VLOG(1) << "GATT characteristic value Get request: " << object_path_.value() | 120 VLOG(1) << "GATT characteristic value Get request: " << object_path_.value() |
125 << " UUID: " << uuid_; | 121 << " UUID: " << uuid_; |
126 // Check if this characteristic is registered. | 122 // Check if this characteristic is registered. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 193 |
198 return true; | 194 return true; |
199 } | 195 } |
200 | 196 |
201 const dbus::ObjectPath& | 197 const dbus::ObjectPath& |
202 FakeBluetoothGattCharacteristicServiceProvider::object_path() const { | 198 FakeBluetoothGattCharacteristicServiceProvider::object_path() const { |
203 return object_path_; | 199 return object_path_; |
204 } | 200 } |
205 | 201 |
206 } // namespace bluez | 202 } // namespace bluez |
OLD | NEW |