Skip to contentSkip to conversation

mesh: Add characteristic property name check

PATCH Applied Inga Stotland 3 participants 3 messages Sep 8, 2017 – Sep 11, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesh: Add characteristic property name check

If PropertyChanged signal is not emitted due to a change in characteristic's "Value" property, the characteristic does not need to be processed.

---
 mesh/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mesh/main.c +3 -2
index 42506a6..3a39d8f 100644
@@ -1295,8 +1295,9 @@ static void property_changed(GDBusProxy *proxy, const char *name,
 		rl_printf("Characteristic property changed %s\n",
 						g_dbus_proxy_get_path(proxy));
 
-		if ((connection.type == CONN_TYPE_PROVISION) ||
-							connection.session_open)
+		if ((strcmp(name, "Value") == 0) &&
+				((connection.type == CONN_TYPE_PROVISION) ||
+						connection.session_open))
 			process_mesh_characteristic(proxy);
 	}
 }
Signature · 1 line
2.9.5
#1 lore raw

Hi Inga,

This solves the issue.

Kind regards,

Jehudi

2017-09-09 0:19 GMT+02:00 Inga Stotland <[email protected]>:

Quoted 30 lines

If PropertyChanged signal is not emitted due to a change in characteristic's "Value" property, the characteristic does not need to be processed.

---
 mesh/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mesh/main.c +3 -3
index 42506a6..3a39d8f 100644
@@ -1295,8 +1295,9 @@ static void property_changed(GDBusProxy *proxy, const char *name,
                rl_printf("Characteristic property changed %s\n",
                                                g_dbus_proxy_get_path(proxy));
 
-               if ((connection.type == CONN_TYPE_PROVISION) ||
-                                                       connection.session_open)
+               if ((strcmp(name, "Value") == 0) &&
+                               ((connection.type == CONN_TYPE_PROVISION) ||
+                                               connection.session_open))
                        process_mesh_characteristic(proxy);
        }
 }
--

2.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#2 lore raw

Hi,

Quoted 24 lines · Laczen JMS

Hi Inga,

This solves the issue.

Kind regards,

Jehudi

2017-09-09 0:19 GMT+02:00 Inga Stotland <[email protected]>:

Quoted 15 lines

If PropertyChanged signal is not emitted due to a change in characteristic's "Value" property, the characteristic does not need to be processed.

---
 mesh/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mesh/main.c +0 -0
index 42506a6..3a39d8f 100644
@@ -1295,8 +1295,9 @@ static void property_changed(GDBusProxy *proxy, const char *name,
                rl_printf("Characteristic property changed %s\n",
                                                g_dbus_proxy_get_path(proxy));
 
Quoted 10 lines
Quoted 10 lines
mesh/main.c +3 -3
-               if ((connection.type == CONN_TYPE_PROVISION) ||
-                                                       connection.session_open)
+               if ((strcmp(name, "Value") == 0) &&
+                               ((connection.type == CONN_TYPE_PROVISION) ||
+                                               connection.session_open))
                        process_mesh_characteristic(proxy);
        }
 }
--

2.9.5

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz