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_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 std::vector<uint8_t>& GetValue() const override; | 39 std::vector<uint8_t>& GetValue() const override; |
40 BluetoothRemoteGattService* GetService() const override; | 40 BluetoothRemoteGattService* GetService() const override; |
41 Properties GetProperties() const override; | 41 Properties GetProperties() const override; |
42 Permissions GetPermissions() const override; | 42 Permissions GetPermissions() const override; |
43 bool IsNotifying() const override; | 43 bool IsNotifying() const override; |
44 std::vector<BluetoothRemoteGattDescriptor*> GetDescriptors() const override; | 44 std::vector<BluetoothRemoteGattDescriptor*> GetDescriptors() const override; |
45 BluetoothRemoteGattDescriptor* GetDescriptor( | 45 BluetoothRemoteGattDescriptor* GetDescriptor( |
46 const std::string& identifier) const override; | 46 const std::string& identifier) const override; |
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 StopNotifySession(BluetoothGattNotifySession* session, | |
50 const base::Closure& callback) override; | |
51 void ReadRemoteCharacteristic(const ValueCallback& callback, | 49 void ReadRemoteCharacteristic(const ValueCallback& callback, |
52 const ErrorCallback& error_callback) override; | 50 const ErrorCallback& error_callback) override; |
53 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, | 51 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, |
54 const base::Closure& callback, | 52 const base::Closure& callback, |
55 const ErrorCallback& error_callback) override; | 53 const ErrorCallback& error_callback) override; |
56 | 54 |
57 // Update included descriptors. | 55 // Update included descriptors. |
58 void Update(); | 56 void Update(); |
59 uint16_t GetAttributeHandle() const; | 57 uint16_t GetAttributeHandle() const; |
60 BluetoothRemoteGattServiceWin* GetWinService() { return parent_service_; } | 58 BluetoothRemoteGattServiceWin* GetWinService() { return parent_service_; } |
61 | 59 |
62 protected: | |
63 void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor, | |
64 const base::Closure& callback, | |
65 const ErrorCallback& error_callback) override; | |
66 void UnsubscribeFromNotifications( | |
67 BluetoothRemoteGattDescriptor* ccc_descriptor, | |
68 const base::Closure& callback, | |
69 const ErrorCallback& error_callback) override; | |
70 | |
71 private: | 60 private: |
72 void OnGetIncludedDescriptorsCallback( | 61 void OnGetIncludedDescriptorsCallback( |
73 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptors, | 62 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptors, |
74 uint16_t num, | 63 uint16_t num, |
75 HRESULT hr); | 64 HRESULT hr); |
76 void UpdateIncludedDescriptors(PBTH_LE_GATT_DESCRIPTOR descriptors, | 65 void UpdateIncludedDescriptors(PBTH_LE_GATT_DESCRIPTOR descriptors, |
77 uint16_t num); | 66 uint16_t num); |
78 | 67 |
79 // Checks if the descriptor with |uuid| and |attribute_handle| has already | 68 // Checks if the descriptor with |uuid| and |attribute_handle| has already |
80 // been discovered as included descriptor. | 69 // been discovered as included descriptor. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // GATT event handle returned by GattEventRegistrationCallback. | 124 // GATT event handle returned by GattEventRegistrationCallback. |
136 PVOID gatt_event_handle_; | 125 PVOID gatt_event_handle_; |
137 | 126 |
138 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicWin> weak_ptr_factory_; | 127 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicWin> weak_ptr_factory_; |
139 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicWin); | 128 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicWin); |
140 }; | 129 }; |
141 | 130 |
142 } // namespace device | 131 } // namespace device |
143 | 132 |
144 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ | 133 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ |
OLD | NEW |