Chromium Code Reviews| 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 |
| 10 #include <string> | |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.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; |
| (...skipping 115 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(const std::string& error_name, |
|
scheib
2016/04/12 18:05:46
error_name should not be a string. We should not b
rkc
2016/04/13 22:47:25
Done.
| |
| 147 const std::string& error_message)>; | |
| 146 | 148 |
| 147 virtual ~BluetoothGattService(); | 149 virtual ~BluetoothGattService(); |
| 148 | 150 |
| 149 // Constructs a BluetoothGattService that can be locally hosted when the local | 151 // 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 | 152 // adapter is in the peripheral role. The resulting object can then be made |
| 151 // available by calling the "Register" method. This method constructs a | 153 // available by calling the "Register" method. This method constructs a |
| 152 // service with UUID |uuid|. Whether the constructed service is primary or | 154 // service with UUID |uuid|. Whether the constructed service is primary or |
| 153 // secondary is determined by |is_primary|. |delegate| is used to send certain | 155 // secondary is determined by |is_primary|. |delegate| is used to send certain |
| 154 // peripheral role events. If |delegate| is NULL, then this service will | 156 // peripheral role events. If |delegate| is NULL, then this service will |
| 155 // employ a default behavior when responding to read and write requests based | 157 // 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: | 225 protected: |
| 224 BluetoothGattService(); | 226 BluetoothGattService(); |
| 225 | 227 |
| 226 private: | 228 private: |
| 227 DISALLOW_COPY_AND_ASSIGN(BluetoothGattService); | 229 DISALLOW_COPY_AND_ASSIGN(BluetoothGattService); |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 } // namespace device | 232 } // namespace device |
| 231 | 233 |
| 232 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ | 234 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ |
| OLD | NEW |