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_SERVICE_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Returns the mac adapter. | 76 // Returns the mac adapter. |
77 BluetoothAdapterMac* GetMacAdapter() const; | 77 BluetoothAdapterMac* GetMacAdapter() const; |
78 // Returns CBPeripheral. | 78 // Returns CBPeripheral. |
79 CBPeripheral* GetCBPeripheral() const; | 79 CBPeripheral* GetCBPeripheral() const; |
80 // Returns CBService. | 80 // Returns CBService. |
81 CBService* GetService() const; | 81 CBService* GetService() const; |
82 // Returns a remote characteristic based on the CBCharacteristic. | 82 // Returns a remote characteristic based on the CBCharacteristic. |
83 BluetoothRemoteGattCharacteristicMac* GetBluetoothRemoteGattCharacteristicMac( | 83 BluetoothRemoteGattCharacteristicMac* GetBluetoothRemoteGattCharacteristicMac( |
84 CBCharacteristic* characteristic) const; | 84 CBCharacteristic* characteristic) const; |
85 | 85 |
| 86 // Returns a description for the service, that should be used for logs. |
| 87 std::string ToString() const; |
| 88 |
86 // bluetooth_device_mac_ owns instances of this class. | 89 // bluetooth_device_mac_ owns instances of this class. |
87 BluetoothLowEnergyDeviceMac* bluetooth_device_mac_; | 90 BluetoothLowEnergyDeviceMac* bluetooth_device_mac_; |
88 // A service from CBPeripheral.services. | 91 // A service from CBPeripheral.services. |
89 base::scoped_nsobject<CBService> service_; | 92 base::scoped_nsobject<CBService> service_; |
90 // Map of characteristics, keyed by characteristic identifier. | 93 // Map of characteristics, keyed by characteristic identifier. |
91 std::unordered_map<std::string, | 94 std::unordered_map<std::string, |
92 std::unique_ptr<BluetoothRemoteGattCharacteristicMac>> | 95 std::unique_ptr<BluetoothRemoteGattCharacteristicMac>> |
93 gatt_characteristic_macs_; | 96 gatt_characteristic_macs_; |
94 bool is_primary_; | 97 bool is_primary_; |
95 // Service identifier. | 98 // Service identifier. |
96 std::string identifier_; | 99 std::string identifier_; |
97 // Service UUID. | 100 // Service UUID. |
98 BluetoothUUID uuid_; | 101 BluetoothUUID uuid_; |
99 // Is true if the characteristics has been discovered. | 102 // Is true if the characteristics has been discovered. |
100 bool is_discovery_complete_; | 103 bool is_discovery_complete_; |
101 | 104 |
102 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceMac); | 105 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceMac); |
103 }; | 106 }; |
104 | 107 |
105 } // namespace device | 108 } // namespace device |
106 | 109 |
107 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ | 110 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ |
OLD | NEW |