OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_LOCAL_GATT_CHARACTERISTIC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // This method constructs a characteristic with UUID |uuid|, initial cached | 35 // This method constructs a characteristic with UUID |uuid|, initial cached |
36 // value |value|, properties |properties|, and permissions |permissions|. | 36 // value |value|, properties |properties|, and permissions |permissions|. |
37 // |value| will be cached and returned for read requests and automatically set | 37 // |value| will be cached and returned for read requests and automatically set |
38 // for write requests by default, unless an instance of | 38 // for write requests by default, unless an instance of |
39 // BluetoothRemoteGattService::Delegate has been provided to the associated | 39 // BluetoothRemoteGattService::Delegate has been provided to the associated |
40 // BluetoothRemoteGattService instance, in which case the delegate will handle | 40 // BluetoothRemoteGattService instance, in which case the delegate will handle |
41 // read and write requests. The service instance will contain this | 41 // read and write requests. The service instance will contain this |
42 // characteristic. | 42 // characteristic. |
43 // TODO(rkc): Investigate how to handle |PROPERTY_EXTENDED_PROPERTIES| | 43 // TODO(rkc): Investigate how to handle |PROPERTY_EXTENDED_PROPERTIES| |
44 // correctly. | 44 // correctly. |
45 static BluetoothLocalGattCharacteristic* Create( | 45 static base::WeakPtr<BluetoothLocalGattCharacteristic> Create( |
46 const BluetoothUUID& uuid, | 46 const BluetoothUUID& uuid, |
47 const std::vector<uint8_t>& value, | |
48 Properties properties, | 47 Properties properties, |
49 Permissions permissions, | 48 Permissions permissions, |
50 BluetoothLocalGattService* service); | 49 BluetoothLocalGattService* service); |
51 | 50 |
52 protected: | 51 protected: |
53 BluetoothLocalGattCharacteristic(); | 52 BluetoothLocalGattCharacteristic(); |
54 ~BluetoothLocalGattCharacteristic() override; | 53 ~BluetoothLocalGattCharacteristic() override; |
55 | 54 |
56 private: | 55 private: |
57 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristic); | 56 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristic); |
58 }; | 57 }; |
59 | 58 |
60 } // namespace device | 59 } // namespace device |
61 | 60 |
62 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_H_ | 61 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_H_ |
OLD | NEW |