Diff between 6aa37338ff72fa2b7bc71766f33e4979cd1526fd and 0628449e0c754a1efdc3d180aae451caf0febf0a

Changed Files

File Additions Deletions Status
doc/gatt-api.txt +1 -1 modified
src/gatt-client.c +11 -1 modified

Full Patch

diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
index 232ffa0..ad2ab16 100644
--- a/doc/gatt-api.txt
+++ b/doc/gatt-api.txt
@@ -119,7 +119,7 @@ Properties	string UUID [read-only]
 			when a notification or indication is received, upon
 			which a PropertiesChanged signal will be emitted.
 
-		boolean Notifying [read-only]
+		boolean Notifying [read-only, optional]
 
 			True, if notifications or indications on this
 			characteristic are currently enabled.
diff --git a/src/gatt-client.c b/src/gatt-client.c
index a018c8c..52add1d 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 },