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 <unordered_map> | 10 #include <unordered_map> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 CBCharacteristic* GetCBCharacteristic() const; | 97 CBCharacteristic* GetCBCharacteristic() const; |
98 // Returns the mac adapter. | 98 // Returns the mac adapter. |
99 BluetoothAdapterMac* GetMacAdapter() const; | 99 BluetoothAdapterMac* GetMacAdapter() const; |
100 // Returns CoreBluetooth peripheral. | 100 // Returns CoreBluetooth peripheral. |
101 CBPeripheral* GetCBPeripheral() const; | 101 CBPeripheral* GetCBPeripheral() const; |
102 // Returns true if this characteristic has been fully discovered. | 102 // Returns true if this characteristic has been fully discovered. |
103 bool IsDiscoveryComplete() const; | 103 bool IsDiscoveryComplete() const; |
104 // Returns BluetoothRemoteGattDescriptorMac from CBDescriptor. | 104 // Returns BluetoothRemoteGattDescriptorMac from CBDescriptor. |
105 BluetoothRemoteGattDescriptorMac* GetBluetoothRemoteGattDescriptorMac( | 105 BluetoothRemoteGattDescriptorMac* GetBluetoothRemoteGattDescriptorMac( |
106 CBDescriptor* cb_descriptor) const; | 106 CBDescriptor* cb_descriptor) const; |
107 // Is true if the characteristic has been discovered with all its descriptors. | 107 // Is true if the characteristic has been discovered with all its descriptors |
| 108 // and discovery_pending_count_ is 0. |
108 bool is_discovery_complete_; | 109 bool is_discovery_complete_; |
| 110 // Increased each time DiscoverDescriptors() is called. And decreased when |
| 111 // DidDiscoverDescriptors() is called. |
| 112 int discovery_pending_count_; |
109 // gatt_service_ owns instances of this class. | 113 // gatt_service_ owns instances of this class. |
110 BluetoothRemoteGattServiceMac* gatt_service_; | 114 BluetoothRemoteGattServiceMac* gatt_service_; |
111 // A characteristic from CBPeripheral.services.characteristics. | 115 // A characteristic from CBPeripheral.services.characteristics. |
112 base::scoped_nsobject<CBCharacteristic> cb_characteristic_; | 116 base::scoped_nsobject<CBCharacteristic> cb_characteristic_; |
113 // Characteristic identifier. | 117 // Characteristic identifier. |
114 std::string identifier_; | 118 std::string identifier_; |
115 // Service UUID. | 119 // Service UUID. |
116 BluetoothUUID uuid_; | 120 BluetoothUUID uuid_; |
117 // Characteristic value. | 121 // Characteristic value. |
118 std::vector<uint8_t> value_; | 122 std::vector<uint8_t> value_; |
(...skipping 17 matching lines...) Expand all Loading... |
136 }; | 140 }; |
137 | 141 |
138 // Stream operator for logging. | 142 // Stream operator for logging. |
139 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( | 143 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( |
140 std::ostream& out, | 144 std::ostream& out, |
141 const BluetoothRemoteGattCharacteristicMac& characteristic); | 145 const BluetoothRemoteGattCharacteristicMac& characteristic); |
142 | 146 |
143 } // namespace device | 147 } // namespace device |
144 | 148 |
145 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ | 149 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ |
OLD | NEW |