Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1557)

Unified Diff: device/bluetooth/bluetooth_low_energy_win.cc

Issue 1749403002: Implement BluetoothRemoteGattCharacteristicWin::StartNotifySession and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win.h ('k') | device/bluetooth/bluetooth_low_energy_win_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8c6f72fc80e43e7d2e5a9099a6744e2938fa25eb 100644
--- a/device/bluetooth/bluetooth_low_energy_win.cc
+++ b/device/bluetooth/bluetooth_low_energy_win.cc
@@ -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
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win.h ('k') | device/bluetooth/bluetooth_low_energy_win_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698