| 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 "chromeos/dbus/bluetooth_gatt_characteristic_service_provider.h" | 5 #include "chromeos/dbus/bluetooth_gatt_characteristic_service_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 weak_ptr_factory_.GetWeakPtr())); | 82 weak_ptr_factory_.GetWeakPtr())); |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual ~BluetoothGattCharacteristicServiceProviderImpl() { | 85 virtual ~BluetoothGattCharacteristicServiceProviderImpl() { |
| 86 VLOG(1) << "Cleaning up Bluetooth GATT characteristic: " | 86 VLOG(1) << "Cleaning up Bluetooth GATT characteristic: " |
| 87 << object_path_.value(); | 87 << object_path_.value(); |
| 88 bus_->UnregisterExportedObject(object_path_); | 88 bus_->UnregisterExportedObject(object_path_); |
| 89 } | 89 } |
| 90 | 90 |
| 91 // BluetoothGattCharacteristicServiceProvider override. | 91 // BluetoothGattCharacteristicServiceProvider override. |
| 92 virtual void SendValueChanged(const std::vector<uint8>& value) OVERRIDE { | 92 virtual void SendValueChanged(const std::vector<uint8>& value) override { |
| 93 VLOG(2) << "Emitting a PropertiesChanged signal for characteristic value."; | 93 VLOG(2) << "Emitting a PropertiesChanged signal for characteristic value."; |
| 94 dbus::Signal signal( | 94 dbus::Signal signal( |
| 95 dbus::kDBusPropertiesInterface, | 95 dbus::kDBusPropertiesInterface, |
| 96 dbus::kDBusPropertiesChangedSignal); | 96 dbus::kDBusPropertiesChangedSignal); |
| 97 dbus::MessageWriter writer(&signal); | 97 dbus::MessageWriter writer(&signal); |
| 98 dbus::MessageWriter array_writer(NULL); | 98 dbus::MessageWriter array_writer(NULL); |
| 99 dbus::MessageWriter dict_entry_writer(NULL); | 99 dbus::MessageWriter dict_entry_writer(NULL); |
| 100 dbus::MessageWriter variant_writer(NULL); | 100 dbus::MessageWriter variant_writer(NULL); |
| 101 | 101 |
| 102 // interface_name | 102 // interface_name |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 const dbus::ObjectPath& service_path) { | 466 const dbus::ObjectPath& service_path) { |
| 467 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { | 467 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { |
| 468 return new BluetoothGattCharacteristicServiceProviderImpl( | 468 return new BluetoothGattCharacteristicServiceProviderImpl( |
| 469 bus, object_path, delegate, uuid, flags, permissions, service_path); | 469 bus, object_path, delegate, uuid, flags, permissions, service_path); |
| 470 } | 470 } |
| 471 return new FakeBluetoothGattCharacteristicServiceProvider( | 471 return new FakeBluetoothGattCharacteristicServiceProvider( |
| 472 object_path, delegate, uuid, flags, permissions, service_path); | 472 object_path, delegate, uuid, flags, permissions, service_path); |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace chromeos | 475 } // namespace chromeos |
| OLD | NEW |