summaryrefslogtreecommitdiff
path: root/src/error.c
diff options
context:
space:
mode:
authorArman Uguray <armansito@chromium.org>2014-12-19 13:35:53 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-12-23 12:59:28 -0200
commitd8eee67e0a49d69c135542b2f9c2cd981cde543f (patch)
tree4602ab88edf1b05bfb0fc0b112fbae6d5674bcc4 /src/error.c
parente8361d03a9a5d5c1d45696e78ac76803cf7832a7 (diff)
downloadbluez-d8eee67e0a49d69c135542b2f9c2cd981cde543f.tar.gz
core/gatt: Implement GattCharacteristic1.ReadValue
This patch implements the ReadValue method of org.bluez.GattCharacteristic1 and exposes the "Value" property based on what was cached during the most recent read. The property is hidden if the value is unknown.
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/error.c b/src/error.c
index 7692790ae..a80c1abed 100644
--- a/src/error.c
+++ b/src/error.c
@@ -33,10 +33,16 @@
DBusMessage *btd_error_invalid_args(DBusMessage *msg)
{
- return g_dbus_create_error(msg, ERROR_INTERFACE ".InvalidArguments",
+ return btd_error_invalid_args_str(msg,
"Invalid arguments in method call");
}
+DBusMessage *btd_error_invalid_args_str(DBusMessage *msg, const char *str)
+{
+ return g_dbus_create_error(msg, ERROR_INTERFACE ".InvalidArguments",
+ str);
+}
+
DBusMessage *btd_error_busy(DBusMessage *msg)
{
return g_dbus_create_error(msg, ERROR_INTERFACE ".InProgress",
@@ -88,7 +94,12 @@ DBusMessage *btd_error_does_not_exist(DBusMessage *msg)
DBusMessage *btd_error_not_authorized(DBusMessage *msg)
{
return g_dbus_create_error(msg, ERROR_INTERFACE ".NotAuthorized",
- "Operation Not Authorized");
+ "Operation Not Authorized");
+}
+
+DBusMessage *btd_error_not_permitted(DBusMessage *msg, const char *str)
+{
+ return g_dbus_create_error(msg, ERROR_INTERFACE ".NotPermitted", str);
}
DBusMessage *btd_error_no_such_adapter(DBusMessage *msg)