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

Side by Side Diff: device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider_impl.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/bluetooth_gatt_characteristic_service_provider_i mpl.h" 5 #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider_i mpl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 BluetoothGattCharacteristicServiceProviderImpl:: 107 BluetoothGattCharacteristicServiceProviderImpl::
108 ~BluetoothGattCharacteristicServiceProviderImpl() { 108 ~BluetoothGattCharacteristicServiceProviderImpl() {
109 VLOG(1) << "Cleaning up Bluetooth GATT characteristic: " 109 VLOG(1) << "Cleaning up Bluetooth GATT characteristic: "
110 << object_path_.value(); 110 << object_path_.value();
111 if (bus_) 111 if (bus_)
112 bus_->UnregisterExportedObject(object_path_); 112 bus_->UnregisterExportedObject(object_path_);
113 } 113 }
114 114
115 void BluetoothGattCharacteristicServiceProviderImpl::SendValueChanged( 115 void BluetoothGattCharacteristicServiceProviderImpl::SendValueChanged(
116 const std::vector<uint8_t>& value) { 116 const dbus::ObjectPath& /* device_path */,
117 const std::vector<uint8_t>& value,
118 bool /* indicate */) {
117 // Running a test, don't actually try to write to use DBus. 119 // Running a test, don't actually try to write to use DBus.
118 if (!bus_) 120 if (!bus_)
119 return; 121 return;
120 122
121 VLOG(2) << "Emitting a PropertiesChanged signal for characteristic value."; 123 VLOG(2) << "Emitting a PropertiesChanged signal for characteristic value.";
122 dbus::Signal signal(dbus::kDBusPropertiesInterface, 124 dbus::Signal signal(dbus::kDBusPropertiesInterface,
123 dbus::kDBusPropertiesChangedSignal); 125 dbus::kDBusPropertiesChangedSignal);
124 dbus::MessageWriter writer(&signal); 126 dbus::MessageWriter writer(&signal);
125 dbus::MessageWriter array_writer(NULL); 127 dbus::MessageWriter array_writer(NULL);
126 dbus::MessageWriter dict_entry_writer(NULL); 128 dbus::MessageWriter dict_entry_writer(NULL);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 method_call, kErrorFailed, "Failed to get/set characteristic value."); 417 method_call, kErrorFailed, "Failed to get/set characteristic value.");
416 response_sender.Run(std::move(error_response)); 418 response_sender.Run(std::move(error_response));
417 } 419 }
418 420
419 const dbus::ObjectPath& 421 const dbus::ObjectPath&
420 BluetoothGattCharacteristicServiceProviderImpl::object_path() const { 422 BluetoothGattCharacteristicServiceProviderImpl::object_path() const {
421 return object_path_; 423 return object_path_;
422 } 424 }
423 425
424 } // namespace bluez 426 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698