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_CHARACTERISTIC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 virtual Properties GetProperties() const = 0; | 131 virtual Properties GetProperties() const = 0; |
132 | 132 |
133 // Returns the bitmask of characteristic attribute permissions. | 133 // Returns the bitmask of characteristic attribute permissions. |
134 virtual Permissions GetPermissions() const = 0; | 134 virtual Permissions GetPermissions() const = 0; |
135 | 135 |
136 // Returns the list of GATT characteristic descriptors that provide more | 136 // Returns the list of GATT characteristic descriptors that provide more |
137 // information about this characteristic. | 137 // information about this characteristic. |
138 virtual std::vector<BluetoothGattDescriptor*> | 138 virtual std::vector<BluetoothGattDescriptor*> |
139 GetDescriptors() const = 0; | 139 GetDescriptors() const = 0; |
140 | 140 |
| 141 // Returns the GATT characteristic descriptor with identifier |identifier| if |
| 142 // it belongs to this GATT characteristic. |
| 143 virtual BluetoothGattDescriptor* GetDescriptor( |
| 144 const std::string& identifier) const = 0; |
| 145 |
141 // Adds a characteristic descriptor to the locally hosted characteristic | 146 // Adds a characteristic descriptor to the locally hosted characteristic |
142 // represented by this instance. This method only makes sense for local | 147 // represented by this instance. This method only makes sense for local |
143 // characteristics and won't have an effect if this instance represents a | 148 // characteristics and won't have an effect if this instance represents a |
144 // remote GATT service and will return false. This method takes ownership | 149 // remote GATT service and will return false. This method takes ownership |
145 // of |descriptor|. | 150 // of |descriptor|. |
146 virtual bool AddDescriptor(BluetoothGattDescriptor* descriptor) = 0; | 151 virtual bool AddDescriptor(BluetoothGattDescriptor* descriptor) = 0; |
147 | 152 |
148 // For locally hosted characteristics, updates the characteristic's value. | 153 // For locally hosted characteristics, updates the characteristic's value. |
149 // This will update the value that is visible to remote devices and send out | 154 // This will update the value that is visible to remote devices and send out |
150 // any notifications and indications that have been configured. This method | 155 // any notifications and indications that have been configured. This method |
(...skipping 27 matching lines...) Expand all Loading... |
178 BluetoothGattCharacteristic(); | 183 BluetoothGattCharacteristic(); |
179 virtual ~BluetoothGattCharacteristic(); | 184 virtual ~BluetoothGattCharacteristic(); |
180 | 185 |
181 private: | 186 private: |
182 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristic); | 187 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristic); |
183 }; | 188 }; |
184 | 189 |
185 } // namespace device | 190 } // namespace device |
186 | 191 |
187 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ | 192 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ |
OLD | NEW |