Chromium Code Reviews| Index: device/bluetooth/bluetooth_low_energy_win.cc |
| diff --git a/device/bluetooth/bluetooth_low_energy_win.cc b/device/bluetooth/bluetooth_low_energy_win.cc |
| index 92c9a97fcecc69f99eccc252ec6681086a18e86c..3a814c1ce36485d17ebec4e4b001956dd59b7162 100644 |
| --- a/device/bluetooth/bluetooth_low_energy_win.cc |
| +++ b/device/bluetooth/bluetooth_low_energy_win.cc |
| @@ -837,5 +837,25 @@ HRESULT BluetoothLowEnergyWrapper::WriteCharacteristicValue( |
| BLUETOOTH_GATT_FLAG_NONE); |
| } |
| +HRESULT BluetoothLowEnergyWrapper::RegisterGattEvents( |
| + base::FilePath& service_path, |
| + BTH_LE_GATT_EVENT_TYPE event_type, |
| + PVOID event_parameter, |
| + PFNBLUETOOTH_GATT_EVENT_CALLBACK callback, |
| + PVOID context, |
| + BLUETOOTH_GATT_EVENT_HANDLE* out_handle) { |
| + base::File file(service_path, base::File::FLAG_OPEN | base::File::FLAG_READ); |
|
ortuno
2016/03/07 18:48:45
I'm curious. If BluetoothLowEnergyWrapper is suppo
gogerald1
2016/03/07 22:52:49
Here open file opens a device in OS. It makes this
ortuno
2016/03/08 00:05:36
Ah that makes sense.
|
| + if (!file.IsValid()) |
| + return HRESULT_FROM_WIN32(ERROR_OPEN_FAILED); |
| + return BluetoothGATTRegisterEvent(file.GetPlatformFile(), event_type, |
| + event_parameter, callback, context, |
| + out_handle, BLUETOOTH_GATT_FLAG_NONE); |
| +} |
| + |
| +HRESULT BluetoothLowEnergyWrapper::UnregisterGattEvent( |
| + BLUETOOTH_GATT_EVENT_HANDLE event_handle) { |
| + return BluetoothGATTUnregisterEvent(event_handle, BLUETOOTH_GATT_FLAG_NONE); |
| +} |
| + |
| } // namespace win |
| } // namespace device |