| 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..4cb2e397aa86283a7305fb899c1c8473ed0b5c03 100644
|
| --- a/device/bluetooth/bluetooth_low_energy_win.cc
|
| +++ b/device/bluetooth/bluetooth_low_energy_win.cc
|
| @@ -469,7 +469,7 @@ bool CollectBluetoothLowEnergyDeviceInfo(
|
| device_info_handle, &device_info_data, result, error)) {
|
| // Only fail if not the GATT service device interface, which doesn't have a
|
| // friendly name.
|
| - if (device_info_data.ClassGuid !=
|
| + if (device_interface_data->InterfaceClassGuid !=
|
| GUID_BLUETOOTH_GATT_SERVICE_DEVICE_INTERFACE)
|
| return false;
|
| }
|
| @@ -837,5 +837,37 @@ 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);
|
| + 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);
|
| +}
|
| +
|
| +HRESULT BluetoothLowEnergyWrapper::WriteDescriptorValue(
|
| + base::FilePath& service_path,
|
| + const PBTH_LE_GATT_DESCRIPTOR descriptor,
|
| + PBTH_LE_GATT_DESCRIPTOR_VALUE new_value) {
|
| + base::File file(service_path, base::File::FLAG_OPEN | base::File::FLAG_READ |
|
| + base::File::FLAG_WRITE);
|
| + if (!file.IsValid())
|
| + return HRESULT_FROM_WIN32(ERROR_OPEN_FAILED);
|
| + return BluetoothGATTSetDescriptorValue(file.GetPlatformFile(), descriptor,
|
| + new_value, BLUETOOTH_GATT_FLAG_NONE);
|
| +}
|
| +
|
| } // namespace win
|
| } // namespace device
|
|
|