Mesh: Handle Multi-application init & deinit logic
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-mesh.c
index fa20b68..a1e2920 100644 (file)
@@ -98,6 +98,25 @@ BT_EXPORT_API int bluetooth_mesh_deinit(void)
        return BLUETOOTH_ERROR_NONE;
 }
 
+BT_EXPORT_API int bluetooth_mesh_network_unload(bluetooth_mesh_network_t *network)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(network, return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, network,  sizeof(bluetooth_mesh_network_t));
+
+       BT_INFO("Mesh: Network Unload");
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_MESH_NETWORK_UNLOAD,
+                       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_destroy(bluetooth_mesh_network_t *network)
 {
        int result;