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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "device/bluetooth/bluetooth_export.h" |
14 #include "device/bluetooth/bluetooth_gatt_service.h" | 15 #include "device/bluetooth/bluetooth_gatt_service.h" |
15 #include "device/bluetooth/bluetooth_uuid.h" | 16 #include "device/bluetooth/bluetooth_uuid.h" |
16 | 17 |
17 namespace device { | 18 namespace device { |
18 | 19 |
19 class BluetoothGattDescriptor; | 20 class BluetoothGattDescriptor; |
20 class BluetoothGattNotifySession; | 21 class BluetoothGattNotifySession; |
21 | 22 |
22 // BluetoothGattCharacteristic represents a local or remote GATT characteristic. | 23 // BluetoothGattCharacteristic represents a local or remote GATT characteristic. |
23 // A GATT characteristic is a basic data element used to construct a GATT | 24 // A GATT characteristic is a basic data element used to construct a GATT |
24 // service. Hence, instances of a BluetoothGattCharacteristic are associated | 25 // service. Hence, instances of a BluetoothGattCharacteristic are associated |
25 // with a BluetoothGattService. There are two ways in which this class is used: | 26 // with a BluetoothGattService. There are two ways in which this class is used: |
26 // | 27 // |
27 // 1. To represent GATT characteristics that belong to a service hosted by a | 28 // 1. To represent GATT characteristics that belong to a service hosted by a |
28 // a remote device. In this case the characteristic will be constructed by | 29 // a remote device. In this case the characteristic will be constructed by |
29 // the subsystem. | 30 // the subsystem. |
30 // 2. To represent GATT characteristics that belong to a locally hosted | 31 // 2. To represent GATT characteristics that belong to a locally hosted |
31 // service. To achieve this, users can construct instances of | 32 // service. To achieve this, users can construct instances of |
32 // BluetoothGattCharacteristic directly and add it to the desired | 33 // BluetoothGattCharacteristic directly and add it to the desired |
33 // BluetoothGattService instance that represents a local service. | 34 // BluetoothGattService instance that represents a local service. |
34 class BluetoothGattCharacteristic { | 35 class BLUETOOTH_EXPORT BluetoothGattCharacteristic { |
35 public: | 36 public: |
36 // TODO(jamuraa): per chromium.org/developers/coding-style these should | 37 // TODO(jamuraa): per chromium.org/developers/coding-style these should |
37 // be MACRO_STYLE instead of kCamelCase. (crbug.com/418696) | 38 // be MACRO_STYLE instead of kCamelCase. (crbug.com/418696) |
38 | 39 |
39 // Values representing the possible properties of a characteristic, which | 40 // Values representing the possible properties of a characteristic, which |
40 // define how the characteristic can be used. Each of these properties serve | 41 // define how the characteristic can be used. Each of these properties serve |
41 // a role as defined in the Bluetooth Specification. | 42 // a role as defined in the Bluetooth Specification. |
42 // |PROPERTY_EXTENDED_PROPERTIES| is a special property that, if present, | 43 // |PROPERTY_EXTENDED_PROPERTIES| is a special property that, if present, |
43 // indicates that there is a characteristic descriptor (namely the | 44 // indicates that there is a characteristic descriptor (namely the |
44 // "Characteristic Extended Properties Descriptor" with UUID 0x2900) that | 45 // "Characteristic Extended Properties Descriptor" with UUID 0x2900) that |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 BluetoothGattCharacteristic(); | 206 BluetoothGattCharacteristic(); |
206 virtual ~BluetoothGattCharacteristic(); | 207 virtual ~BluetoothGattCharacteristic(); |
207 | 208 |
208 private: | 209 private: |
209 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristic); | 210 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristic); |
210 }; | 211 }; |
211 | 212 |
212 } // namespace device | 213 } // namespace device |
213 | 214 |
214 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ | 215 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CHARACTERISTIC_H_ |
OLD | NEW |