Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc

Issue 2039773005: Add support in Chrome to send notifications to a specific device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 last_device_path_ = device_path;
115 last_value_ = value;
116 last_indicate_flag_ = indicate;
113 } 117 }
114 118
115 void FakeBluetoothGattCharacteristicServiceProvider::GetValue( 119 void FakeBluetoothGattCharacteristicServiceProvider::GetValue(
116 const dbus::ObjectPath& device_path, 120 const dbus::ObjectPath& device_path,
117 const device::BluetoothLocalGattService::Delegate::ValueCallback& callback, 121 const device::BluetoothLocalGattService::Delegate::ValueCallback& callback,
118 const device::BluetoothLocalGattService::Delegate::ErrorCallback& 122 const device::BluetoothLocalGattService::Delegate::ErrorCallback&
119 error_callback) { 123 error_callback) {
120 VLOG(1) << "GATT characteristic value Get request: " << object_path_.value() 124 VLOG(1) << "GATT characteristic value Get request: " << object_path_.value()
121 << " UUID: " << uuid_; 125 << " UUID: " << uuid_;
122 // Check if this characteristic is registered. 126 // Check if this characteristic is registered.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 197
194 return true; 198 return true;
195 } 199 }
196 200
197 const dbus::ObjectPath& 201 const dbus::ObjectPath&
198 FakeBluetoothGattCharacteristicServiceProvider::object_path() const { 202 FakeBluetoothGattCharacteristicServiceProvider::object_path() const {
199 return object_path_; 203 return object_path_;
200 } 204 }
201 205
202 } // namespace bluez 206 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.h ('k') | device/bluetooth/test/bluetooth_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698