| 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_SERVICE_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/callback_forward.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "device/bluetooth/bluetooth_export.h" | 15 #include "device/bluetooth/bluetooth_export.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 BluetoothDevice; | 20 class BluetoothDevice; |
| 20 class BluetoothGattCharacteristic; | 21 class BluetoothGattCharacteristic; |
| 21 class BluetoothGattDescriptor; | 22 class BluetoothGattDescriptor; |
| 22 | 23 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 GATT_ERROR_FAILED, | 136 GATT_ERROR_FAILED, |
| 136 GATT_ERROR_IN_PROGRESS, | 137 GATT_ERROR_IN_PROGRESS, |
| 137 GATT_ERROR_INVALID_LENGTH, | 138 GATT_ERROR_INVALID_LENGTH, |
| 138 GATT_ERROR_NOT_PERMITTED, | 139 GATT_ERROR_NOT_PERMITTED, |
| 139 GATT_ERROR_NOT_AUTHORIZED, | 140 GATT_ERROR_NOT_AUTHORIZED, |
| 140 GATT_ERROR_NOT_PAIRED, | 141 GATT_ERROR_NOT_PAIRED, |
| 141 GATT_ERROR_NOT_SUPPORTED | 142 GATT_ERROR_NOT_SUPPORTED |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 // The ErrorCallback is used by methods to asynchronously report errors. | 145 // The ErrorCallback is used by methods to asynchronously report errors. |
| 145 typedef base::Closure ErrorCallback; | 146 using ErrorCallback = base::Callback<void(GattErrorCode error_code)>; |
| 146 | 147 |
| 147 virtual ~BluetoothGattService(); | 148 virtual ~BluetoothGattService(); |
| 148 | 149 |
| 149 // Constructs a BluetoothGattService that can be locally hosted when the local | 150 // Constructs a BluetoothGattService that can be locally hosted when the local |
| 150 // adapter is in the peripheral role. The resulting object can then be made | 151 // adapter is in the peripheral role. The resulting object can then be made |
| 151 // available by calling the "Register" method. This method constructs a | 152 // available by calling the "Register" method. This method constructs a |
| 152 // service with UUID |uuid|. Whether the constructed service is primary or | 153 // service with UUID |uuid|. Whether the constructed service is primary or |
| 153 // secondary is determined by |is_primary|. |delegate| is used to send certain | 154 // secondary is determined by |is_primary|. |delegate| is used to send certain |
| 154 // peripheral role events. If |delegate| is NULL, then this service will | 155 // peripheral role events. If |delegate| is NULL, then this service will |
| 155 // employ a default behavior when responding to read and write requests based | 156 // employ a default behavior when responding to read and write requests based |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 protected: | 224 protected: |
| 224 BluetoothGattService(); | 225 BluetoothGattService(); |
| 225 | 226 |
| 226 private: | 227 private: |
| 227 DISALLOW_COPY_AND_ASSIGN(BluetoothGattService); | 228 DISALLOW_COPY_AND_ASSIGN(BluetoothGattService); |
| 228 }; | 229 }; |
| 229 | 230 |
| 230 } // namespace device | 231 } // namespace device |
| 231 | 232 |
| 232 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ | 233 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ |
| OLD | NEW |