Chromium Code Reviews| Index: device/bluetooth/bluetooth_task_manager_win.h |
| diff --git a/device/bluetooth/bluetooth_task_manager_win.h b/device/bluetooth/bluetooth_task_manager_win.h |
| index c8356a8a025ae234872b030dff8f759b65ba4fe5..436a1b7da244ae9eb8addd2a7fa5d1987a6e5260 100644 |
| --- a/device/bluetooth/bluetooth_task_manager_win.h |
| +++ b/device/bluetooth/bluetooth_task_manager_win.h |
| @@ -99,8 +99,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin |
| // discovery session, the "friendly" name may initially be "unknown" before |
| // the actual name is retrieved in subsequent poll events. |
| virtual void DevicesPolled(const ScopedVector<DeviceState>& devices) {} |
| - virtual void OnAttemptReadGattCharacteristic() {} |
| - virtual void OnAttemptWriteGattCharacteristic() {} |
| }; |
| explicit BluetoothTaskManagerWin( |
| @@ -135,6 +133,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin |
| typedef base::Callback<void(scoped_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE>, |
| HRESULT)> |
| ReadGattCharacteristicValueCallback; |
| + typedef base::Callback<void(scoped_ptr<std::vector<uint8_t>>)> |
| + GattCharacteristicValueChangedCallback; |
| + typedef base::Callback<void(PVOID, HRESULT)> GattEventRegistrationCallback; |
| // Get all included characteristics of a given service. The service is |
| // uniquely identified by its |uuid| and |attribute_handle| with service |
| @@ -170,6 +171,20 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin |
| const std::vector<uint8_t>& new_value, |
| const HResultCallback& callback); |
| + // Post register a given |characteristic|'s value change notification of a |
| + // service with |service_path|. |registered_callback| is the function to be |
| + // invoked if the event occured. The operation result is returned |
| + // asynchronously through |callback|. |
|
ortuno
2016/03/15 02:55:31
Post a task to register to receive value changed n
gogerald1
2016/03/15 18:28:23
Done.
|
| + void PostRegisterGattCharacteristicValueChangedEvent( |
| + const base::FilePath& service_path, |
| + const PBTH_LE_GATT_CHARACTERISTIC characteristic, |
| + const GattEventRegistrationCallback& callback, |
| + const GattCharacteristicValueChangedCallback& registered_callback); |
| + |
| + // Post unregister characteristic value change notification. |event_handle| |
|
ortuno
2016/03/15 02:55:31
Post a task to unregister from value change notifi
gogerald1
2016/03/15 18:28:23
Done.
|
| + // was returned by PostRegisterGattCharacteristicValueChangedEvent. |
| + void PostUnregisterGattCharacteristicValueChangedEvent(PVOID event_handle); |
| + |
| private: |
| friend class base::RefCountedThreadSafe<BluetoothTaskManagerWin>; |
| friend class BluetoothTaskManagerWinTest; |
| @@ -278,6 +293,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin |
| BTH_LE_GATT_CHARACTERISTIC characteristic, |
| std::vector<uint8_t> new_value, |
| const HResultCallback& callback); |
| + void RegisterGattCharacteristicValueChangedEvent( |
| + base::FilePath service_path, |
| + BTH_LE_GATT_CHARACTERISTIC characteristic, |
| + const GattEventRegistrationCallback& callback, |
| + const GattCharacteristicValueChangedCallback& registered_callback); |
| + void UnregisterGattCharacteristicValueChangedEvent(PVOID event_handle); |
| // UI task runner reference. |
| scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |