| 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_GATT_NOTIFY_SESSION_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_BLUEZ_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_BLUEZ_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "device/bluetooth/bluetooth_gatt_notify_session.h" | 11 #include "device/bluetooth/bluetooth_gatt_notify_session.h" |
| 12 #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h" | 12 #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h" |
| 13 | 13 |
| 14 namespace device { | 14 namespace device { |
| 15 | 15 |
| 16 class BluetoothAdapter; | 16 class BluetoothAdapter; |
| 17 | 17 |
| 18 } // namespace device | 18 } // namespace device |
| 19 | 19 |
| 20 namespace chromeos { | 20 namespace bluez { |
| 21 | 21 |
| 22 class BluetoothRemoteGattCharacteristicChromeOS; | 22 class BluetoothRemoteGattCharacteristicBlueZ; |
| 23 | 23 |
| 24 // BluetoothGattNotifySessionChromeOS implements | 24 // BluetoothGattNotifySessionBlueZ implements |
| 25 // BluetoothGattNotifySession for the Chrome OS platform. | 25 // BluetoothGattNotifySession for the Chrome OS platform. |
| 26 class BluetoothGattNotifySessionChromeOS | 26 class BluetoothGattNotifySessionBlueZ |
| 27 : public device::BluetoothGattNotifySession, | 27 : public device::BluetoothGattNotifySession, |
| 28 public bluez::BluetoothGattCharacteristicClient::Observer { | 28 public bluez::BluetoothGattCharacteristicClient::Observer { |
| 29 public: | 29 public: |
| 30 ~BluetoothGattNotifySessionChromeOS() override; | 30 ~BluetoothGattNotifySessionBlueZ() override; |
| 31 | 31 |
| 32 // BluetoothGattNotifySession overrides. | 32 // BluetoothGattNotifySession overrides. |
| 33 std::string GetCharacteristicIdentifier() const override; | 33 std::string GetCharacteristicIdentifier() const override; |
| 34 bool IsActive() override; | 34 bool IsActive() override; |
| 35 void Stop(const base::Closure& callback) override; | 35 void Stop(const base::Closure& callback) override; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 friend class BluetoothRemoteGattCharacteristicChromeOS; | 38 friend class BluetoothRemoteGattCharacteristicBlueZ; |
| 39 | 39 |
| 40 explicit BluetoothGattNotifySessionChromeOS( | 40 explicit BluetoothGattNotifySessionBlueZ( |
| 41 scoped_refptr<device::BluetoothAdapter> adapter, | 41 scoped_refptr<device::BluetoothAdapter> adapter, |
| 42 const std::string& device_address, | 42 const std::string& device_address, |
| 43 const std::string& service_identifier, | 43 const std::string& service_identifier, |
| 44 const std::string& characteristic_identifier, | 44 const std::string& characteristic_identifier, |
| 45 const dbus::ObjectPath& characteristic_path); | 45 const dbus::ObjectPath& characteristic_path); |
| 46 | 46 |
| 47 // bluez::BluetoothGattCharacteristicClient::Observer overrides. | 47 // bluez::BluetoothGattCharacteristicClient::Observer overrides. |
| 48 void GattCharacteristicRemoved(const dbus::ObjectPath& object_path) override; | 48 void GattCharacteristicRemoved(const dbus::ObjectPath& object_path) override; |
| 49 void GattCharacteristicPropertyChanged( | 49 void GattCharacteristicPropertyChanged( |
| 50 const dbus::ObjectPath& object_path, | 50 const dbus::ObjectPath& object_path, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 // The GATT service that the characteristic belongs to. | 62 // The GATT service that the characteristic belongs to. |
| 63 std::string service_id_; | 63 std::string service_id_; |
| 64 | 64 |
| 65 // Identifier of the associated characteristic. | 65 // Identifier of the associated characteristic. |
| 66 std::string characteristic_id_; | 66 std::string characteristic_id_; |
| 67 | 67 |
| 68 // D-Bus object path of the associated characteristic. This is used to filter | 68 // D-Bus object path of the associated characteristic. This is used to filter |
| 69 // observer events. | 69 // observer events. |
| 70 dbus::ObjectPath object_path_; | 70 dbus::ObjectPath object_path_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySessionChromeOS); | 72 DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySessionBlueZ); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace chromeos | 75 } // namespace bluez |
| 76 | 76 |
| 77 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_CHROMEOS_H_ | 77 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_BLUEZ_H_ |
| OLD | NEW |