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 <vector> | 10 #include <vector> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 private: | 47 private: |
48 friend class BluetoothLowEnergyDeviceMac; | 48 friend class BluetoothLowEnergyDeviceMac; |
49 friend class BluetoothRemoteGattCharacteristicMac; | 49 friend class BluetoothRemoteGattCharacteristicMac; |
50 friend class BluetoothTestMac; | 50 friend class BluetoothTestMac; |
51 | 51 |
52 // Starts discovering characteristics by calling CoreBluetooth. | 52 // Starts discovering characteristics by calling CoreBluetooth. |
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 BluetoothRemoteGattServiceMac instance when the | 57 // Called by the BluetoothLowEnergyDeviceMac instance when the |
58 // characteristics value has been read. | 58 // characteristics value has been read. |
59 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error); | 59 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error); |
| 60 // Called by the BluetoothLowEnergyDeviceMac instance when the |
| 61 // characteristics value has been written. |
| 62 void DidWriteValue(CBCharacteristic* characteristic, NSError* error); |
60 // Returns true if the characteristics has been discovered. | 63 // Returns true if the characteristics has been discovered. |
61 bool IsDiscoveryComplete(); | 64 bool IsDiscoveryComplete(); |
62 | 65 |
63 // Returns the mac adapter. | 66 // Returns the mac adapter. |
64 BluetoothAdapterMac* GetMacAdapter() const; | 67 BluetoothAdapterMac* GetMacAdapter() const; |
65 // Returns CBPeripheral. | 68 // Returns CBPeripheral. |
66 CBPeripheral* GetCBPeripheral() const; | 69 CBPeripheral* GetCBPeripheral() const; |
67 // Returns CBService. | 70 // Returns CBService. |
68 CBService* GetService() const; | 71 CBService* GetService() const; |
69 // Returns a remote characteristic based on the CBCharacteristic. | 72 // Returns a remote characteristic based on the CBCharacteristic. |
(...skipping 15 matching lines...) Expand all Loading... |
85 BluetoothUUID uuid_; | 88 BluetoothUUID uuid_; |
86 // Is true if the characteristics has been discovered. | 89 // Is true if the characteristics has been discovered. |
87 bool is_discovery_complete_; | 90 bool is_discovery_complete_; |
88 | 91 |
89 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceMac); | 92 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceMac); |
90 }; | 93 }; |
91 | 94 |
92 } // namespace device | 95 } // namespace device |
93 | 96 |
94 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ | 97 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_ |
OLD | NEW |