| Index: chromeos/dbus/bluetooth_gatt_characteristic_client.cc
|
| diff --git a/chromeos/dbus/bluetooth_gatt_characteristic_client.cc b/chromeos/dbus/bluetooth_gatt_characteristic_client.cc
|
| index 206b8d4961b59ddd117a2eb611f30bab339d4a5c..d9069edbacefa7a46baf05f239b3269b1bdef87c 100644
|
| --- a/chromeos/dbus/bluetooth_gatt_characteristic_client.cc
|
| +++ b/chromeos/dbus/bluetooth_gatt_characteristic_client.cc
|
| @@ -13,6 +13,13 @@
|
|
|
| namespace chromeos {
|
|
|
| +namespace {
|
| +
|
| +// TODO(armansito): Move this constant to cros_system_api.
|
| +const char kValueProperty[] = "Value";
|
| +
|
| +} // namespace
|
| +
|
| // static
|
| const char BluetoothGattCharacteristicClient::kNoResponseError[] =
|
| "org.chromium.Error.NoResponse";
|
| @@ -27,6 +34,7 @@ BluetoothGattCharacteristicClient::Properties::Properties(
|
| : dbus::PropertySet(object_proxy, interface_name, callback) {
|
| RegisterProperty(bluetooth_gatt_characteristic::kUUIDProperty, &uuid);
|
| RegisterProperty(bluetooth_gatt_characteristic::kServiceProperty, &service);
|
| + RegisterProperty(kValueProperty, &value);
|
| RegisterProperty(bluetooth_gatt_characteristic::kNotifyingProperty,
|
| ¬ifying);
|
| RegisterProperty(bluetooth_gatt_characteristic::kFlagsProperty, &flags);
|
| @@ -211,21 +219,6 @@ class BluetoothGattCharacteristicClientImpl
|
| VLOG(2) << "Remote GATT characteristic added: " << object_path.value();
|
| FOR_EACH_OBSERVER(BluetoothGattCharacteristicClient::Observer, observers_,
|
| GattCharacteristicAdded(object_path));
|
| -
|
| - // Connect the "ValueUpdated" signal.
|
| - dbus::ObjectProxy* object_proxy =
|
| - object_manager_->GetObjectProxy(object_path);
|
| - DCHECK(object_proxy);
|
| -
|
| - object_proxy->ConnectToSignal(
|
| - bluetooth_gatt_characteristic::kBluetoothGattCharacteristicInterface,
|
| - bluetooth_gatt_characteristic::kValueUpdatedSignal,
|
| - base::Bind(&BluetoothGattCharacteristicClientImpl::ValueUpdatedReceived,
|
| - weak_ptr_factory_.GetWeakPtr(),
|
| - object_path),
|
| - base::Bind(
|
| - &BluetoothGattCharacteristicClientImpl::ValueUpdatedConnected,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| // dbus::ObjectManager::Interface override.
|
| @@ -261,35 +254,6 @@ class BluetoothGattCharacteristicClientImpl
|
| property_name));
|
| }
|
|
|
| - // Called by dbus:: when a "ValueUpdated" signal is received.
|
| - void ValueUpdatedReceived(const dbus::ObjectPath& object_path,
|
| - dbus::Signal* signal) {
|
| - DCHECK(signal);
|
| - const uint8* bytes = NULL;
|
| - size_t length = 0;
|
| - dbus::MessageReader reader(signal);
|
| - if (!reader.PopArrayOfBytes(&bytes, &length)) {
|
| - LOG(WARNING) << "ValueUpdated signal has incorrect parameters: "
|
| - << signal->ToString();
|
| - return;
|
| - }
|
| -
|
| - std::vector<uint8> value;
|
| - if (bytes)
|
| - value.assign(bytes, bytes + length);
|
| -
|
| - FOR_EACH_OBSERVER(BluetoothGattCharacteristicClient::Observer,
|
| - observers_,
|
| - GattCharacteristicValueUpdated(object_path, value));
|
| - }
|
| -
|
| - // Called by dbus:: when the "ValueUpdated" signal is initially connected.
|
| - void ValueUpdatedConnected(const std::string& interface_name,
|
| - const std::string& signal_name,
|
| - bool success) {
|
| - LOG_IF(WARNING, !success) << "Failed to connect to the ValueUpdated signal";
|
| - }
|
| -
|
| // Called when a response for successful method call is received.
|
| void OnSuccess(const base::Closure& callback, dbus::Response* response) {
|
| DCHECK(response);
|
|
|