| 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..0c640a77f37bcafabb025262d70ddb77d1b459e0 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,22 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
|
| const std::vector<uint8_t>& new_value,
|
| const HResultCallback& callback);
|
|
|
| + // Post a task to register to receive value changed notifications from
|
| + // |characteristic| in service with |service_path|. |ccc_descriptor| is the
|
| + // Client Characteristic Configuration descriptor. |registered_callback| is
|
| + // the function to be invoked if the event occured. The operation result is
|
| + // returned asynchronously through |callback|.
|
| + void PostRegisterGattCharacteristicValueChangedEvent(
|
| + const base::FilePath& service_path,
|
| + const PBTH_LE_GATT_CHARACTERISTIC characteristic,
|
| + const PBTH_LE_GATT_DESCRIPTOR ccc_descriptor,
|
| + const GattEventRegistrationCallback& callback,
|
| + const GattCharacteristicValueChangedCallback& registered_callback);
|
| +
|
| + // Post a task to unregister from value change notifications. |event_handle|
|
| + // was returned by PostRegisterGattCharacteristicValueChangedEvent.
|
| + void PostUnregisterGattCharacteristicValueChangedEvent(PVOID event_handle);
|
| +
|
| private:
|
| friend class base::RefCountedThreadSafe<BluetoothTaskManagerWin>;
|
| friend class BluetoothTaskManagerWinTest;
|
| @@ -278,6 +295,13 @@ 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,
|
| + BTH_LE_GATT_DESCRIPTOR ccc_descriptor,
|
| + const GattEventRegistrationCallback& callback,
|
| + const GattCharacteristicValueChangedCallback& registered_callback);
|
| + void UnregisterGattCharacteristicValueChangedEvent(PVOID event_handle);
|
|
|
| // UI task runner reference.
|
| scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
|
|
|