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 |