| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_CHROMEOS_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | |
| 16 #include "dbus/object_path.h" | 15 #include "dbus/object_path.h" |
| 17 #include "device/bluetooth/bluetooth_gatt_characteristic.h" | 16 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 18 #include "device/bluetooth/bluetooth_uuid.h" | 17 #include "device/bluetooth/bluetooth_uuid.h" |
| 18 #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_client.h" |
| 19 | 19 |
| 20 namespace device { | 20 namespace device { |
| 21 | 21 |
| 22 class BluetoothGattDescriptor; | 22 class BluetoothGattDescriptor; |
| 23 class BluetoothGattService; | 23 class BluetoothGattService; |
| 24 | 24 |
| 25 } // namespace device | 25 } // namespace device |
| 26 | 26 |
| 27 namespace chromeos { | 27 namespace chromeos { |
| 28 | 28 |
| 29 class BluetoothRemoteGattDescriptorChromeOS; | 29 class BluetoothRemoteGattDescriptorChromeOS; |
| 30 class BluetoothRemoteGattServiceChromeOS; | 30 class BluetoothRemoteGattServiceChromeOS; |
| 31 | 31 |
| 32 // The BluetoothRemoteGattCharacteristicChromeOS class implements | 32 // The BluetoothRemoteGattCharacteristicChromeOS class implements |
| 33 // BluetoothGattCharacteristic for remote GATT characteristics on the Chrome OS | 33 // BluetoothGattCharacteristic for remote GATT characteristics on the Chrome OS |
| 34 // platform. | 34 // platform. |
| 35 class BluetoothRemoteGattCharacteristicChromeOS | 35 class BluetoothRemoteGattCharacteristicChromeOS |
| 36 : public device::BluetoothGattCharacteristic, | 36 : public device::BluetoothGattCharacteristic, |
| 37 public BluetoothGattDescriptorClient::Observer { | 37 public bluez::BluetoothGattDescriptorClient::Observer { |
| 38 public: | 38 public: |
| 39 // device::BluetoothGattCharacteristic overrides. | 39 // device::BluetoothGattCharacteristic overrides. |
| 40 std::string GetIdentifier() const override; | 40 std::string GetIdentifier() const override; |
| 41 device::BluetoothUUID GetUUID() const override; | 41 device::BluetoothUUID GetUUID() const override; |
| 42 bool IsLocal() const override; | 42 bool IsLocal() const override; |
| 43 const std::vector<uint8>& GetValue() const override; | 43 const std::vector<uint8>& GetValue() const override; |
| 44 device::BluetoothGattService* GetService() const override; | 44 device::BluetoothGattService* GetService() const override; |
| 45 Properties GetProperties() const override; | 45 Properties GetProperties() const override; |
| 46 Permissions GetPermissions() const override; | 46 Permissions GetPermissions() const override; |
| 47 bool IsNotifying() const override; | 47 bool IsNotifying() const override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 71 friend class BluetoothRemoteGattServiceChromeOS; | 71 friend class BluetoothRemoteGattServiceChromeOS; |
| 72 | 72 |
| 73 typedef std::pair<NotifySessionCallback, ErrorCallback> | 73 typedef std::pair<NotifySessionCallback, ErrorCallback> |
| 74 PendingStartNotifyCall; | 74 PendingStartNotifyCall; |
| 75 | 75 |
| 76 BluetoothRemoteGattCharacteristicChromeOS( | 76 BluetoothRemoteGattCharacteristicChromeOS( |
| 77 BluetoothRemoteGattServiceChromeOS* service, | 77 BluetoothRemoteGattServiceChromeOS* service, |
| 78 const dbus::ObjectPath& object_path); | 78 const dbus::ObjectPath& object_path); |
| 79 ~BluetoothRemoteGattCharacteristicChromeOS() override; | 79 ~BluetoothRemoteGattCharacteristicChromeOS() override; |
| 80 | 80 |
| 81 // BluetoothGattDescriptorClient::Observer overrides. | 81 // bluez::BluetoothGattDescriptorClient::Observer overrides. |
| 82 void GattDescriptorAdded(const dbus::ObjectPath& object_path) override; | 82 void GattDescriptorAdded(const dbus::ObjectPath& object_path) override; |
| 83 void GattDescriptorRemoved(const dbus::ObjectPath& object_path) override; | 83 void GattDescriptorRemoved(const dbus::ObjectPath& object_path) override; |
| 84 void GattDescriptorPropertyChanged(const dbus::ObjectPath& object_path, | 84 void GattDescriptorPropertyChanged(const dbus::ObjectPath& object_path, |
| 85 const std::string& property_name) override; | 85 const std::string& property_name) override; |
| 86 | 86 |
| 87 // Called by dbus:: on unsuccessful completion of a request to read or write | 87 // Called by dbus:: on unsuccessful completion of a request to read or write |
| 88 // the characteristic value. | 88 // the characteristic value. |
| 89 void OnError(const ErrorCallback& error_callback, | 89 void OnError(const ErrorCallback& error_callback, |
| 90 const std::string& error_name, | 90 const std::string& error_name, |
| 91 const std::string& error_message); | 91 const std::string& error_message); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // invalidate its weak pointers before any other members are destroyed. | 141 // invalidate its weak pointers before any other members are destroyed. |
| 142 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicChromeOS> | 142 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicChromeOS> |
| 143 weak_ptr_factory_; | 143 weak_ptr_factory_; |
| 144 | 144 |
| 145 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicChromeOS); | 145 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicChromeOS); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 } // namespace chromeos | 148 } // namespace chromeos |
| 149 | 149 |
| 150 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_CHROMEOS_H_ | 150 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_CHROMEOS_H_ |
| OLD | NEW |