| 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_REMOTE_GATT_CHARACTERISTIC_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ |
| 7 | 7 |
| 8 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" | 8 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, | 45 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, |
| 46 const base::Closure& callback, | 46 const base::Closure& callback, |
| 47 const ErrorCallback& error_callback) override; | 47 const ErrorCallback& error_callback) override; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicMac); | 49 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicMac); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 friend class BluetoothRemoteGattServiceMac; | 52 friend class BluetoothRemoteGattServiceMac; |
| 53 friend class BluetoothTestMac; | 53 friend class BluetoothTestMac; |
| 54 | 54 |
| 55 // Called by the BluetoothRemoteGattServiceMac instance when the |
| 56 // characteristics value has been read. |
| 57 void DidUpdateValue(NSError* error); |
| 58 // Returns true if the characteristic is readable. |
| 59 bool IsReadable() const; |
| 55 // Returns CoreBluetooth characteristic. | 60 // Returns CoreBluetooth characteristic. |
| 56 CBCharacteristic* GetCBCharacteristic() const; | 61 CBCharacteristic* GetCBCharacteristic() const; |
| 57 | 62 |
| 58 // gatt_service_ owns instances of this class. | 63 // gatt_service_ owns instances of this class. |
| 59 BluetoothRemoteGattServiceMac* gatt_service_; | 64 BluetoothRemoteGattServiceMac* gatt_service_; |
| 60 // A characteristic from CBPeripheral.services.characteristics. | 65 // A characteristic from CBPeripheral.services.characteristics. |
| 61 base::scoped_nsobject<CBCharacteristic> cb_characteristic_; | 66 base::scoped_nsobject<CBCharacteristic> cb_characteristic_; |
| 62 // Characteristic identifier. | 67 // Characteristic identifier. |
| 63 std::string identifier_; | 68 std::string identifier_; |
| 64 // Service UUID. | 69 // Service UUID. |
| 65 BluetoothUUID uuid_; | 70 BluetoothUUID uuid_; |
| 66 // Characteristic value. | 71 // Characteristic value. |
| 67 std::vector<uint8_t> value_; | 72 std::vector<uint8_t> value_; |
| 73 // True if a gatt read or write request is in progress. |
| 74 bool characteristic_value_read_or_write_in_progress_; |
| 75 // ReadRemoteCharacteristic request callbacks. |
| 76 std::pair<ValueCallback, ErrorCallback> read_characteristic_value_callbacks_; |
| 68 }; | 77 }; |
| 69 | 78 |
| 70 } // namespace device | 79 } // namespace device |
| 71 | 80 |
| 72 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ | 81 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ |
| OLD | NEW |