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_CHROMEOS_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_CHROMEOS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // BluetoothGattNotifySessionChromeOS implements | 24 // BluetoothGattNotifySessionChromeOS implements |
25 // BluetoothGattNotifySession for the Chrome OS platform. | 25 // BluetoothGattNotifySession for the Chrome OS platform. |
26 class BluetoothGattNotifySessionChromeOS | 26 class BluetoothGattNotifySessionChromeOS |
27 : public device::BluetoothGattNotifySession, | 27 : public device::BluetoothGattNotifySession, |
28 public BluetoothGattCharacteristicClient::Observer { | 28 public BluetoothGattCharacteristicClient::Observer { |
29 public: | 29 public: |
30 virtual ~BluetoothGattNotifySessionChromeOS(); | 30 virtual ~BluetoothGattNotifySessionChromeOS(); |
31 | 31 |
32 // BluetoothGattNotifySession overrides. | 32 // BluetoothGattNotifySession overrides. |
33 virtual std::string GetCharacteristicIdentifier() const OVERRIDE; | 33 virtual std::string GetCharacteristicIdentifier() const override; |
34 virtual bool IsActive() OVERRIDE; | 34 virtual bool IsActive() override; |
35 virtual void Stop(const base::Closure& callback) OVERRIDE; | 35 virtual void Stop(const base::Closure& callback) override; |
36 | 36 |
37 private: | 37 private: |
38 friend class BluetoothRemoteGattCharacteristicChromeOS; | 38 friend class BluetoothRemoteGattCharacteristicChromeOS; |
39 | 39 |
40 explicit BluetoothGattNotifySessionChromeOS( | 40 explicit BluetoothGattNotifySessionChromeOS( |
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 // BluetoothGattCharacteristicClient::Observer overrides. | 47 // BluetoothGattCharacteristicClient::Observer overrides. |
48 virtual void GattCharacteristicRemoved( | 48 virtual void GattCharacteristicRemoved( |
49 const dbus::ObjectPath& object_path) OVERRIDE; | 49 const dbus::ObjectPath& object_path) override; |
50 virtual void GattCharacteristicPropertyChanged( | 50 virtual void GattCharacteristicPropertyChanged( |
51 const dbus::ObjectPath& object_path, | 51 const dbus::ObjectPath& object_path, |
52 const std::string& property_name) OVERRIDE; | 52 const std::string& property_name) override; |
53 | 53 |
54 // True, if this session is currently active. | 54 // True, if this session is currently active. |
55 bool active_; | 55 bool active_; |
56 | 56 |
57 // The Bluetooth adapter that this session is associated with. | 57 // The Bluetooth adapter that this session is associated with. |
58 scoped_refptr<device::BluetoothAdapter> adapter_; | 58 scoped_refptr<device::BluetoothAdapter> adapter_; |
59 | 59 |
60 // The Bluetooth address of the device hosting the characteristic. | 60 // The Bluetooth address of the device hosting the characteristic. |
61 std::string device_address_; | 61 std::string device_address_; |
62 | 62 |
63 // The GATT service that the characteristic belongs to. | 63 // The GATT service that the characteristic belongs to. |
64 std::string service_id_; | 64 std::string service_id_; |
65 | 65 |
66 // Identifier of the associated characteristic. | 66 // Identifier of the associated characteristic. |
67 std::string characteristic_id_; | 67 std::string characteristic_id_; |
68 | 68 |
69 // D-Bus object path of the associated characteristic. This is used to filter | 69 // D-Bus object path of the associated characteristic. This is used to filter |
70 // observer events. | 70 // observer events. |
71 dbus::ObjectPath object_path_; | 71 dbus::ObjectPath object_path_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySessionChromeOS); | 73 DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySessionChromeOS); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace chromeos | 76 } // namespace chromeos |
77 | 77 |
78 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_CHROMEOS_H_ | 78 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_CHROMEOS_H_ |
OLD | NEW |