Skip to contentSkip to conversation

core/gatt: Don't return an error if notification is already enabled

PATCH Applied Luiz Augusto von Dentz 1 participant 2 messages May 26, 2017 – May 29, 2017 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 core/gatt: Don't return an error if notification is already enabled

From: Luiz Augusto von Dentz <[email protected]>

In case the client is already subscribed and attempt to register again just return success as the handling should be the same as success.

---
 src/gatt-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/gatt-client.c +1 -1
index b86bfe6..6c67841 100644
@@ -1173,7 +1173,7 @@ static DBusMessage *characteristic_start_notify(DBusConnection *conn,
 	client = queue_find(chrc->notify_clients, match_notify_sender, sender);
 	if (client)
 		return client->notify_id ?
-				btd_error_failed(msg, "Already notifying") :
+				g_dbus_create_reply(msg, DBUS_TYPE_INVALID) :
 				btd_error_in_progress(msg);
 
 	client = notify_client_create(chrc, sender);
Signature · 1 line
2.9.4
author maintainer Applied
#1 lore raw

Hi,

Quoted 22 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

In case the client is already subscribed and attempt to register again just return success as the handling should be the same as success.

---
 src/gatt-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/gatt-client.c +1 -2
index b86bfe6..6c67841 100644
@@ -1173,7 +1173,7 @@ static DBusMessage *characteristic_start_notify(DBusConnection *conn,
        client = queue_find(chrc->notify_clients, match_notify_sender, sender);
        if (client)
                return client->notify_id ?
-                               btd_error_failed(msg, "Already notifying") :
+                               g_dbus_create_reply(msg, DBUS_TYPE_INVALID) :
                                btd_error_in_progress(msg);
 
        client = notify_client_create(chrc, sender);
--
Quoted 1 line

2.9.4

Applied.

Signature · 1 line
Luiz Augusto von Dentz