| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void DiscoverCharacteristics(); | 53 void DiscoverCharacteristics(); |
| 54 // Called by the BluetoothLowEnergyDeviceMac instance when the characteristics | 54 // Called by the BluetoothLowEnergyDeviceMac instance when the characteristics |
| 55 // has been discovered. | 55 // has been discovered. |
| 56 void DidDiscoverCharacteristics(); | 56 void DidDiscoverCharacteristics(); |
| 57 // Called by the BluetoothLowEnergyDeviceMac instance when the descriptors has | 57 // Called by the BluetoothLowEnergyDeviceMac instance when the descriptors has |
| 58 // been discovered. | 58 // been discovered. |
| 59 void DidDiscoverDescriptors(CBCharacteristic* characteristic); | 59 void DidDiscoverDescriptors(CBCharacteristic* characteristic); |
| 60 // Sends notification if this service is ready with all characteristics | 60 // Sends notification if this service is ready with all characteristics |
| 61 // discovered. | 61 // discovered. |
| 62 void SendNotificationIfComplete(); | 62 void SendNotificationIfComplete(); |
| 63 // Called by the BluetoothLowEnergyDeviceMac instance when the | |
| 64 // characteristics value has been read. | |
| 65 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error); | |
| 66 // Called by the BluetoothLowEnergyDeviceMac instance when the | |
| 67 // characteristics value has been written. | |
| 68 void DidWriteValue(CBCharacteristic* characteristic, NSError* error); | |
| 69 // Called by the BluetoothLowEnergyDeviceMac instance when the notify session | |
| 70 // has been started or failed. | |
| 71 void DidUpdateNotificationState(CBCharacteristic* characteristic, | |
| 72 NSError* error); | |
| 73 // Returns true if the characteristics has been discovered. | 63 // Returns true if the characteristics has been discovered. |
| 74 bool IsDiscoveryComplete() const; | 64 bool IsDiscoveryComplete() const; |
| 75 | 65 |
| 76 // Returns the mac adapter. | 66 // Returns the mac adapter. |
| 77 BluetoothAdapterMac* GetMacAdapter() const; | 67 BluetoothAdapterMac* GetMacAdapter() const; |
| 78 // Returns CBPeripheral. | 68 // Returns CBPeripheral. |
| 79 CBPeripheral* GetCBPeripheral() const; | 69 CBPeripheral* GetCBPeripheral() const; |
| 80 // Returns CBService. | 70 // Returns CBService. |
| 81 CBService* GetService() const; | 71 CBService* GetService() const; |
| 82 // Returns a remote characteristic based on the CBCharacteristic. | 72 // Returns a remote characteristic based on the CBCharacteristic. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 107 }; | 97 }; |
| 108 | 98 |
| 109 // Stream operator for logging. | 99 // Stream operator for logging. |
| 110 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( | 100 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( |
| 111 std::ostream& out, | 101 std::ostream& out, |
| 112 const BluetoothRemoteGattServiceMac& service); | 102 const BluetoothRemoteGattServiceMac& service); |
| 113 | 103 |
| 114 } // namespace device | 104 } // namespace device |
| 115 | 105 |
| 116 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ | 106 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ |
| OLD | NEW |