mesh: Emit PropertiesChanged when IV Index changes
authorInga Stotland <inga.stotland@intel.com>
Fri, 19 Jun 2020 21:26:53 +0000 (14:26 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
This adds emitting of PropertiesChanged signal whenever the
mesh IV index is updated to indicate that the vlaues of "IvIndex"
property has been modified.

Change-Id: I7ce2a982348e7ed92185bccd745c9050f778bc11
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/net.c
mesh/node.c
mesh/node.h

index 0e4a3522e9a4b135badfded4b98d706774cfae35..6d340b60d561cfd3b420184c4744dfed4ae39340 100644 (file)
@@ -2564,6 +2564,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;
 }
index bbdc1d909fd9c0a98b4db0e8b4d04b99319d0824..adff6f099f78df82fb5b5fdb82a5533de0e1a0b4 100644 (file)
@@ -2300,6 +2300,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,
index fcbd553446b74e973da539a04318b18bc9a0f822..b1a9cd54b3cad290bc303343bba31820c0aa4066 100644 (file)
@@ -102,3 +102,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);