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 // Returns a description for the characteristic, that should be used for logs. |
| 108 std::string ToString() const; |
107 // Is true if the characteristic has been discovered with all its descriptors. | 109 // Is true if the characteristic has been discovered with all its descriptors. |
108 bool is_discovery_complete_; | 110 bool is_discovery_complete_; |
109 // gatt_service_ owns instances of this class. | 111 // gatt_service_ owns instances of this class. |
110 BluetoothRemoteGattServiceMac* gatt_service_; | 112 BluetoothRemoteGattServiceMac* gatt_service_; |
111 // A characteristic from CBPeripheral.services.characteristics. | 113 // A characteristic from CBPeripheral.services.characteristics. |
112 base::scoped_nsobject<CBCharacteristic> cb_characteristic_; | 114 base::scoped_nsobject<CBCharacteristic> cb_characteristic_; |
113 // Characteristic identifier. | 115 // Characteristic identifier. |
114 std::string identifier_; | 116 std::string identifier_; |
115 // Service UUID. | 117 // Service UUID. |
116 BluetoothUUID uuid_; | 118 BluetoothUUID uuid_; |
(...skipping 14 matching lines...) Expand all Loading... |
131 PendingNotifyCallbacks unsubscribe_from_notification_callbacks_; | 133 PendingNotifyCallbacks unsubscribe_from_notification_callbacks_; |
132 // Map of descriptors, keyed by descriptor identifier. | 134 // Map of descriptors, keyed by descriptor identifier. |
133 std::unordered_map<std::string, | 135 std::unordered_map<std::string, |
134 std::unique_ptr<BluetoothRemoteGattDescriptorMac>> | 136 std::unique_ptr<BluetoothRemoteGattDescriptorMac>> |
135 gatt_descriptor_macs_; | 137 gatt_descriptor_macs_; |
136 }; | 138 }; |
137 | 139 |
138 } // namespace device | 140 } // namespace device |
139 | 141 |
140 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ | 142 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ |
OLD | NEW |