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 "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void StartNotifySession(const NotifySessionCallback& callback, | 47 void StartNotifySession(const NotifySessionCallback& callback, |
48 const ErrorCallback& error_callback) override; | 48 const ErrorCallback& error_callback) override; |
49 void ReadRemoteCharacteristic(const ValueCallback& callback, | 49 void ReadRemoteCharacteristic(const ValueCallback& callback, |
50 const ErrorCallback& error_callback) override; | 50 const ErrorCallback& error_callback) override; |
51 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, | 51 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, |
52 const base::Closure& callback, | 52 const base::Closure& callback, |
53 const ErrorCallback& error_callback) override; | 53 const ErrorCallback& error_callback) override; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicMac); | 55 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicMac); |
56 | 56 |
| 57 protected: |
| 58 void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor, |
| 59 const base::Closure& callback, |
| 60 const ErrorCallback& error_callback) override; |
| 61 void UnsubscribeFromNotifications( |
| 62 BluetoothRemoteGattDescriptor* ccc_descriptor, |
| 63 const base::Closure& callback, |
| 64 const ErrorCallback& error_callback) override; |
| 65 |
57 private: | 66 private: |
58 friend class BluetoothRemoteGattServiceMac; | 67 friend class BluetoothRemoteGattServiceMac; |
59 friend class BluetoothTestMac; | 68 friend class BluetoothTestMac; |
60 | 69 |
61 // Called by the BluetoothRemoteGattServiceMac instance when the | 70 // Called by the BluetoothRemoteGattServiceMac instance when the |
62 // characteristics value has been read. | 71 // characteristics value has been read. |
63 void DidUpdateValue(NSError* error); | 72 void DidUpdateValue(NSError* error); |
64 // Updates value_ and notifies the adapter of the new value. | 73 // Updates value_ and notifies the adapter of the new value. |
65 void UpdateValueAndNotify(); | 74 void UpdateValueAndNotify(); |
66 // Called by the BluetoothRemoteGattServiceMac instance when the | 75 // Called by the BluetoothRemoteGattServiceMac instance when the |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 PendingStartNotifyCall; | 110 PendingStartNotifyCall; |
102 std::vector<PendingStartNotifyCall> start_notify_session_callbacks_; | 111 std::vector<PendingStartNotifyCall> start_notify_session_callbacks_; |
103 // Flag indicates if GATT event registration is in progress. | 112 // Flag indicates if GATT event registration is in progress. |
104 bool start_notifications_in_progress_; | 113 bool start_notifications_in_progress_; |
105 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicMac> weak_ptr_factory_; | 114 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicMac> weak_ptr_factory_; |
106 }; | 115 }; |
107 | 116 |
108 } // namespace device | 117 } // namespace device |
109 | 118 |
110 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ | 119 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ |
OLD | NEW |