summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc
diff options
context:
space:
mode:
authorjamuraa <jamuraa@chromium.org>2014-10-01 09:48:04 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-01 16:48:20 +0000
commit7b39ecf6b2ceed6270d74d3e6727a0226fa88ea1 (patch)
tree5aaf109a1911b5c2fb668aee0a7f1dd7907d1e14 /chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc
parentd321a70a780e58ef1f803859263672678e656407 (diff)
downloadchromium_src-7b39ecf6b2ceed6270d74d3e6727a0226fa88ea1.zip
chromium_src-7b39ecf6b2ceed6270d74d3e6727a0226fa88ea1.tar.gz
chromium_src-7b39ecf6b2ceed6270d74d3e6727a0226fa88ea1.tar.bz2
First part of errors coming up from the dbus API
BUG=377232 Review URL: https://codereview.chromium.org/604023004 Cr-Commit-Position: refs/heads/master@{#297656}
Diffstat (limited to 'chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc')
-rw-r--r--chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc b/chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc
index 3567567..63f6b49 100644
--- a/chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc
+++ b/chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc
@@ -159,7 +159,12 @@ void FakeBluetoothGattCharacteristicClient::WriteValue(
}
DCHECK(heart_rate_control_point_properties_.get());
- if (value.size() != 1 || value[0] > 1) {
+ if (value.size() != 1) {
+ error_callback.Run("org.bluez.Error.InvalidValueLength",
+ "Invalid length for write");
+ return;
+ }
+ if (value[0] > 1) {
error_callback.Run("org.bluez.Error.Failed",
"Invalid value given for write");
return;
@@ -187,7 +192,7 @@ void FakeBluetoothGattCharacteristicClient::StartNotify(
}
if (heart_rate_measurement_properties_->notifying.value()) {
- error_callback.Run("org.bluez.Error.Busy",
+ error_callback.Run("org.bluez.Error.InProgress",
"Characteristic already notifying");
return;
}