tools/mesh: Add new info to stored remote nodes
authorInga Stotland <inga.stotland@intel.com>
Thu, 23 Sep 2021 03:25:48 +0000 (20:25 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
When adding a new remote node into configuration database,
initialize additional default properties:
"excluded": false
"security": "secure"
"configComplete": false

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/mesh/mesh-db.c

index d01bf32..e635f61 100644 (file)
@@ -1077,7 +1077,18 @@ bool mesh_db_add_node(uint8_t uuid[16], uint8_t num_els, uint16_t unicast,
        if (!add_u8_16(jnode, "UUID", uuid))
                goto fail;
 
+
+       if (!add_string(jnode, "security", "secure"))
+               goto fail;
+
+       if (!write_bool(jnode, "excluded", false))
+               goto fail;
+
+       if (!write_bool(jnode, "configComplete", false))
+               goto fail;
+
        jelements = init_elements(num_els);
+
        json_object_object_add(jnode, "elements", jelements);
 
        jnetkeys = json_object_new_array();