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

Unified Diff: device/bluetooth/bluetooth_task_manager_win.cc

Issue 1728163006: Implement BluetoothRemoteGattCharacteristicWin::GetDescriptors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 10 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_task_manager_win.h ('k') | device/bluetooth/test/bluetooth_test_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_task_manager_win.cc
diff --git a/device/bluetooth/bluetooth_task_manager_win.cc b/device/bluetooth/bluetooth_task_manager_win.cc
index 1ccc013dfaf5f17b415d8c3240ae8bd839ccd96f..c45f022a9ec91761c2d394adc2ba1ba7f7568067 100644
--- a/device/bluetooth/bluetooth_task_manager_win.cc
+++ b/device/bluetooth/bluetooth_task_manager_win.cc
@@ -58,14 +58,14 @@ bool BluetoothUUIDToWinBLEUUID(const device::BluetoothUUID& uuid,
return false;
if (uuid.format() == device::BluetoothUUID::kFormat16Bit) {
- out_win_uuid->IsShortUuid = true;
+ out_win_uuid->IsShortUuid = TRUE;
unsigned int data = 0;
int result = sscanf_s(uuid.value().c_str(), "%04x", &data);
if (result != 1)
return false;
out_win_uuid->Value.ShortUuid = data;
} else {
- out_win_uuid->IsShortUuid = false;
+ out_win_uuid->IsShortUuid = FALSE;
unsigned int data[11];
int result =
sscanf_s(uuid.value().c_str(),
@@ -791,6 +791,24 @@ void BluetoothTaskManagerWin::GetGattIncludedCharacteristics(
number_of_charateristics, hr));
}
+void BluetoothTaskManagerWin::GetGattIncludedDescriptors(
+ base::FilePath service_path,
+ BTH_LE_GATT_CHARACTERISTIC characteristic,
+ const GetGattIncludedDescriptorsCallback& callback) {
+ scoped_ptr<BTH_LE_GATT_DESCRIPTOR> win_descriptors_info;
+ uint16_t number_of_descriptors = 0;
+
+ HRESULT hr =
+ win::BluetoothLowEnergyWrapper::GetInstance()
+ ->ReadDescriptorsOfACharacteristic(
+ service_path, (PBTH_LE_GATT_CHARACTERISTIC)(&characteristic),
+ &win_descriptors_info, &number_of_descriptors);
+
+ ui_task_runner_->PostTask(
+ FROM_HERE, base::Bind(callback, base::Passed(&win_descriptors_info),
+ number_of_descriptors, hr));
+}
+
void BluetoothTaskManagerWin::PostGetGattIncludedCharacteristics(
const base::FilePath& service_path,
const BluetoothUUID& uuid,
@@ -803,4 +821,15 @@ void BluetoothTaskManagerWin::PostGetGattIncludedCharacteristics(
service_path, uuid, attribute_handle, callback));
}
+void BluetoothTaskManagerWin::PostGetGattIncludedDescriptors(
+ const base::FilePath& service_path,
+ const PBTH_LE_GATT_CHARACTERISTIC characteristic,
+ const GetGattIncludedDescriptorsCallback& callback) {
+ DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ bluetooth_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&BluetoothTaskManagerWin::GetGattIncludedDescriptors, this,
+ service_path, *characteristic, callback));
+}
+
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_task_manager_win.h ('k') | device/bluetooth/test/bluetooth_test_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698