summaryrefslogtreecommitdiff
path: root/src/gatt-client.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-04-05 17:27:39 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-04-08 14:41:01 +0300
commit0628449e0c754a1efdc3d180aae451caf0febf0a (patch)
tree2c966db25f074815b13c09b01085e0fd42f12560 /src/gatt-client.c
parent6aa37338ff72fa2b7bc71766f33e4979cd1526fd (diff)
downloadbluez-0628449e0c754a1efdc3d180aae451caf0febf0a.tar.gz
doc/gatt-api: Make Notifying property optional
If the characteristic does not support nofications nor indications the Notifying property can be omitted as it will never going to be used.
Diffstat (limited to 'src/gatt-client.c')
-rw-r--r--src/gatt-client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gatt-client.c b/src/gatt-client.c
index a018c8c94..52add1db9 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -707,6 +707,15 @@ static gboolean characteristic_get_notifying(const GDBusPropertyTable *property,
return TRUE;
}
+static gboolean
+characteristic_notifying_exists(const GDBusPropertyTable *property, void *data)
+{
+ struct characteristic *chrc = data;
+
+ return (chrc->props & BT_GATT_CHRC_PROP_NOTIFY ||
+ chrc->props & BT_GATT_CHRC_PROP_INDICATE);
+}
+
struct chrc_prop_data {
uint8_t prop;
char *str;
@@ -1225,7 +1234,8 @@ static const GDBusPropertyTable characteristic_properties[] = {
{ "Value", "ay", characteristic_get_value, NULL,
characteristic_value_exists,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
- { "Notifying", "b", characteristic_get_notifying, NULL, NULL,
+ { "Notifying", "b", characteristic_get_notifying, NULL,
+ characteristic_notifying_exists,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{ "Flags", "as", characteristic_get_flags, NULL, NULL,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },