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_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_BLUEZ_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_BLUEZ_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 class BluetoothGattService; | 27 class BluetoothGattService; |
28 | 28 |
29 } // namespace device | 29 } // namespace device |
30 | 30 |
31 namespace bluez { | 31 namespace bluez { |
32 | 32 |
33 class BluetoothRemoteGattDescriptorBlueZ; | 33 class BluetoothRemoteGattDescriptorBlueZ; |
34 class BluetoothRemoteGattServiceBlueZ; | 34 class BluetoothRemoteGattServiceBlueZ; |
35 | 35 |
36 // The BluetoothRemoteGattCharacteristicBlueZ class implements | 36 // The BluetoothRemoteGattCharacteristicBlueZ class implements |
37 // BluetoothGattCharacteristic for remote GATT characteristics on the Chrome OS | 37 // BluetoothGattCharacteristic for remote GATT characteristics for platforms |
38 // platform. | 38 // that use BlueZ. |
39 class BluetoothRemoteGattCharacteristicBlueZ | 39 class BluetoothRemoteGattCharacteristicBlueZ |
40 : public device::BluetoothGattCharacteristic, | 40 : public device::BluetoothGattCharacteristic, |
41 public bluez::BluetoothGattDescriptorClient::Observer { | 41 public bluez::BluetoothGattDescriptorClient::Observer { |
42 public: | 42 public: |
43 // device::BluetoothGattCharacteristic overrides. | 43 // device::BluetoothGattCharacteristic overrides. |
44 std::string GetIdentifier() const override; | 44 std::string GetIdentifier() const override; |
45 device::BluetoothUUID GetUUID() const override; | 45 device::BluetoothUUID GetUUID() const override; |
46 bool IsLocal() const override; | 46 bool IsLocal() const override; |
47 const std::vector<uint8_t>& GetValue() const override; | 47 const std::vector<uint8_t>& GetValue() const override; |
48 device::BluetoothGattService* GetService() const override; | 48 device::BluetoothGattService* GetService() const override; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 size_t num_notify_sessions_; | 127 size_t num_notify_sessions_; |
128 | 128 |
129 // Calls to StartNotifySession that are pending. This can happen during the | 129 // Calls to StartNotifySession that are pending. This can happen during the |
130 // first remote call to start notifications. | 130 // first remote call to start notifications. |
131 std::queue<PendingStartNotifyCall> pending_start_notify_calls_; | 131 std::queue<PendingStartNotifyCall> pending_start_notify_calls_; |
132 | 132 |
133 // True, if a Start or Stop notify call to bluetoothd is currently pending. | 133 // True, if a Start or Stop notify call to bluetoothd is currently pending. |
134 bool notify_call_pending_; | 134 bool notify_call_pending_; |
135 | 135 |
136 // Mapping from GATT descriptor object paths to descriptor objects owned by | 136 // Mapping from GATT descriptor object paths to descriptor objects owned by |
137 // this characteristic. Since the Chrome OS implementation uses object paths | 137 // this characteristic. Since the BlueZ implementation uses object paths |
138 // as unique identifiers, we also use this mapping to return descriptors by | 138 // as unique identifiers, we also use this mapping to return descriptors by |
139 // identifier. | 139 // identifier. |
140 typedef std::map<dbus::ObjectPath, BluetoothRemoteGattDescriptorBlueZ*> | 140 typedef std::map<dbus::ObjectPath, BluetoothRemoteGattDescriptorBlueZ*> |
141 DescriptorMap; | 141 DescriptorMap; |
142 DescriptorMap descriptors_; | 142 DescriptorMap descriptors_; |
143 | 143 |
144 // Note: This should remain the last member so it'll be destroyed and | 144 // Note: This should remain the last member so it'll be destroyed and |
145 // invalidate its weak pointers before any other members are destroyed. | 145 // invalidate its weak pointers before any other members are destroyed. |
146 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicBlueZ> | 146 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicBlueZ> |
147 weak_ptr_factory_; | 147 weak_ptr_factory_; |
148 | 148 |
149 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicBlueZ); | 149 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicBlueZ); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace bluez | 152 } // namespace bluez |
153 | 153 |
154 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_BLUEZ_H_ | 154 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_BLUEZ_H_ |
OLD | NEW |