[PATCH BlueZ 1/3] mesh: Emit PropertiesChanged when IV Index changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds emitting of PropertiesChanged signal whenever the
mesh IV index is updated to indicate that the vlaues of "IvIndex"
property has been modified.
---
 mesh/net.c  | 2 ++
 mesh/node.c | 9 +++++++++
 mesh/node.h | 1 +
 3 files changed, 12 insertions(+)

diff --git a/mesh/net.c b/mesh/net.c
index 3ab948be5..b54c647cb 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2566,6 +2566,8 @@ static void update_iv_ivu_state(struct mesh_net *net, uint32_t iv_index,
 		rpl_init(net->node, iv_index);
 	}
 
+	node_property_changed(net->node, "IVIndex");
+
 	net->iv_index = iv_index;
 	net->iv_update = ivu;
 }
diff --git a/mesh/node.c b/mesh/node.c
index cf4d93aec..ee6d1833f 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -2280,6 +2280,15 @@ static void setup_node_interface(struct l_dbus_interface *iface)
 									NULL);
 }
 
+void node_property_changed(struct mesh_node *node, const char *property)
+{
+	struct l_dbus *bus = dbus_get_bus();
+
+	if (bus)
+		l_dbus_property_changed(dbus_get_bus(), node->obj_path,
+						MESH_NODE_INTERFACE, property);
+}
+
 bool node_dbus_init(struct l_dbus *bus)
 {
 	if (!l_dbus_register_interface(bus, MESH_NODE_INTERFACE,
diff --git a/mesh/node.h b/mesh/node.h
index b8b2b1b49..6c4542a78 100644
--- a/mesh/node.h
+++ b/mesh/node.h
@@ -99,3 +99,4 @@ struct mesh_agent *node_get_agent(struct mesh_node *node);
 const char *node_get_storage_dir(struct mesh_node *node);
 bool node_load_from_storage(const char *storage_dir);
 void node_finalize_new_node(struct mesh_node *node, struct mesh_io *io);
+void node_property_changed(struct mesh_node *node, const char *property);
-- 
2.26.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux