+static void __bt_hal_mesh_delete_node_setup(struct l_dbus_message *msg,
+ void *user_data)
+{
+ struct mesh_remote_node_info *node_info = \
+ (struct mesh_remote_node_info*) user_data;
+
+ l_dbus_message_set_arguments(msg, "qy",
+ node_info->unicast, node_info->num_elements);
+ INFO("Mesh: Delete Remote Node Setup params passed");
+ g_free(node_info);
+}
+
+static void __bt_hal_mesh_delete_node_reply(
+ struct l_dbus_proxy *proxy,
+ struct l_dbus_message *msg, void *user_data)
+{
+ INFO("Mesh: Delete Remote Node Reply from DBUS");
+}
+
+bt_status_t _bt_hal_mesh_node_delete(bt_uuid_t *network,
+ uint16_t unicast, uint16_t num_elements)
+{
+ GSList *l;
+ meshcfg_app *app;
+ struct mesh_remote_node_info *node_info;
+ INFO("Mesh: Delete Remote Node");
+ l = g_slist_find_custom(mesh_apps, network->uu, __mesh_compare_network_uuid);
+ if (l) {
+ app = l->data;
+ if (!__bt_mesh_proxy_check(app)) {
+ ERR("Mesh: Proxy check failed!!");
+ return BT_STATUS_FAIL;
+ }
+ INFO("Mesh: Delete Remote Node Unicast [0x%2.2x] Num els [%u]",
+ unicast, num_elements);
+
+ /* Delete Remote Node Request */
+ node_info = g_malloc0(sizeof(struct mesh_remote_node_info));
+ node_info->unicast = unicast;
+ node_info->num_elements = num_elements;
+
+ if (!l_dbus_proxy_method_call(app->mgmt_proxy, "DeleteRemoteNode",
+ __bt_hal_mesh_delete_node_setup,
+ __bt_hal_mesh_delete_node_reply, node_info,
+ l_free)) {
+ ERR("Mesh: Delete Remote Node Request failed!!");
+ g_free(node_info);
+ return BT_STATUS_FAIL;
+ }
+ } else {
+ ERR("Mesh: App not found!!");
+ return BT_STATUS_PARM_INVALID;
+ }
+ INFO("Mesh: Delete Remote Node Call issued successfully!!");
+ return BT_STATUS_SUCCESS;
+}
+