Mesh: Add Node Reset API in FRWK
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-mesh.c
index 02525a1..07af058 100644 (file)
@@ -116,6 +116,25 @@ BT_EXPORT_API int bluetooth_mesh_network_destroy(bluetooth_mesh_network_t *netwo
        return result;
 }
 
+BT_EXPORT_API int bluetooth_mesh_node_reset(bluetooth_mesh_node_info_t *node)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(node, return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, node, sizeof(bluetooth_mesh_node_info_t));
+
+       BT_INFO("Mesh: Reset the Node");
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_MESH_NODE_RESET,
+                       in_param1, in_param2, in_param3, in_param4, &out_param);
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       return result;
+}
+
 BT_EXPORT_API int bluetooth_mesh_network_create(
        const char *net_name, bluetooth_mesh_node_t *node,
                uint16_t total_models, bluetooth_mesh_model_t **models,