diff options
Diffstat (limited to 'device/bluetooth')
-rw-r--r-- | device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc | 23 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_remote_gatt_service_chromeos.h | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc index 81aaa3d..4f88edf 100644 --- a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc +++ b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc @@ -250,4 +250,27 @@ void BluetoothRemoteGattServiceChromeOS::GattCharacteristicRemoved( delete characteristic; } +void BluetoothRemoteGattServiceChromeOS::GattCharacteristicPropertyChanged( + const dbus::ObjectPath& object_path, + const std::string& property_name) { + if (characteristics_.find(object_path) == characteristics_.end()) { + VLOG(2) << "Properties of unknown characteristic changed"; + return; + } + + // We may receive a property changed event in certain cases, e.g. when the + // characteristic "Flags" property has been updated with values from the + // "Characteristic Extended Properties" descriptor. In this case, kick off + // a service changed observer event to let observers refresh the + // characteristics. + BluetoothGattCharacteristicClient::Properties* properties = + DBusThreadManager::Get()->GetBluetoothGattCharacteristicClient()-> + GetProperties(object_path); + DCHECK(properties); + if (property_name != properties->flags.name()) + return; + + NotifyServiceChanged(); +} + } // namespace chromeos diff --git a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.h b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.h index e490ffc..c9de5ce 100644 --- a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.h +++ b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.h @@ -113,6 +113,9 @@ class BluetoothRemoteGattServiceChromeOS const dbus::ObjectPath& object_path) OVERRIDE; virtual void GattCharacteristicRemoved( const dbus::ObjectPath& object_path) OVERRIDE; + virtual void GattCharacteristicPropertyChanged( + const dbus::ObjectPath& object_path, + const std::string& property_name) OVERRIDE; // Object path of the GATT service. dbus::ObjectPath object_path_; |