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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc

Issue 307453007: device/bluetooth: Implement GATT characteristic properties on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc
index bb175e3f375fb2df4f9006dd3ea056aed119443f..d60b390fc91c852a807a49e994faad7b3fc661e9 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc
@@ -93,9 +93,40 @@ BluetoothRemoteGattCharacteristicChromeOS::GetService() const {
device::BluetoothGattCharacteristic::Properties
BluetoothRemoteGattCharacteristicChromeOS::GetProperties() const {
- // TODO(armansito): Once BlueZ implements properties properly, return those
- // values here.
- return kPropertyNone;
+ BluetoothGattCharacteristicClient::Properties* properties =
+ DBusThreadManager::Get()->GetBluetoothGattCharacteristicClient()->
+ GetProperties(object_path_);
+ DCHECK(properties);
+
+ Properties props = kPropertyNone;
+ const std::vector<std::string>& flags = properties->flags.value();
+ for (std::vector<std::string>::const_iterator iter = flags.begin();
+ iter != flags.end();
+ ++iter) {
+ if (*iter == BluetoothGattCharacteristicClient::kFlagBroadcast)
+ props |= kPropertyBroadcast;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagRead)
+ props |= kPropertyRead;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagWriteWithoutResponse)
+ props |= kPropertyWriteWithoutResponse;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagWrite)
+ props |= kPropertyWrite;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagNotify)
+ props |= kPropertyNotify;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagIndicate)
+ props |= kPropertyIndicate;
+ if (*iter ==
+ BluetoothGattCharacteristicClient::kFlagAuthenticatedSignedWrites)
+ props |= kPropertyAuthenticatedSignedWrites;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagExtendedProperties)
+ props |= kPropertyExtendedProperties;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagReliableWrite)
+ props |= kPropertyReliableWrite;
+ if (*iter == BluetoothGattCharacteristicClient::kFlagWritableAuxiliaries)
+ props |= kPropertyWritableAuxiliaries;
+ }
+
+ return props;
}
device::BluetoothGattCharacteristic::Permissions

Powered by Google App Engine
This is Rietveld 408576698