char *app_uuid_path;
const meshcfg_app *app = (meshcfg_app*) data;
char *path = (char *) user_data;
- INFO("Mesh: proxy path compare: path [%s]", path);
- INFO("Mesh: App Path path [%s]", app->path);
if (!path)
return -1;
app_uuid_path = l_util_hexstring(app->uuid, 16);
- INFO("Mesh:App UUID string [%s]", app_uuid_path);
char **strings = g_strsplit(path, "node", 2);
- INFO("Mesh:String 0 [%s]", strings[0]);
- INFO("Mesh:String 1 [%s]", strings[1]);
ret = g_strcmp0(strings[1], app_uuid_path);
g_free(strings[0]);
g_free(strings[1]);
l_dbus_destroy(dbus);
dbus = NULL;
}
+
+ /* Reset Globals */
+ net_proxy = NULL;
+ agent_msg = NULL;
+ INFO("Mesh: Number of meshapps present in memory [%d]",
+ g_slist_length(mesh_apps));
}
/* To send stack event to hal-mesh handler */
INFO("Mesh: Leave Network Setup app path [%s]", app->path);
}
+static void __bt_hal_mesh_release_net_reply(
+ struct l_dbus_proxy *proxy,
+ struct l_dbus_message *msg, void *user_data)
+{
+ meshcfg_app *app;
+ app = (meshcfg_app*) user_data;
+
+ INFO("Mesh:Release Network Reply from Meshd: app path [%s]", app->path);
+ if (l_dbus_message_is_error(msg)) {
+ const char *name;
+
+ l_dbus_message_get_error(msg, &name, NULL);
+ ERR("Mesh: Failed to Release network: %s", name);
+
+ } else {
+ INFO("Mesh: Release Network: Success, cleanup app after proxy removed");
+ }
+}
+
+static void __bt_hal_mesh_release_net_setup(struct l_dbus_message *msg,
+ void *user_data)
+{
+ meshcfg_app *app = (meshcfg_app*) user_data;
+
+ l_dbus_message_set_arguments(msg, "t", l_get_be64(app->token.u8));
+ INFO("Mesh: Release Network Setup app path [%s]", app->path);
+}
+
static void __bt_hal_mesh_create_net_reply(
struct l_dbus_proxy *proxy,
struct l_dbus_message *msg, void *user_data)
return BT_STATUS_SUCCESS;
}
+bt_status_t _bt_hal_mesh_network_release(bt_uuid_t *net_uuid)
+{
+ GSList *l;
+ meshcfg_app *app;
+ INFO("Mesh: Release Network");
+ l = g_slist_find_custom(mesh_apps, net_uuid->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: Release Network");
+ /* Create CFG Network */
+ if (!l_dbus_proxy_method_call(net_proxy, "Release",
+ __bt_hal_mesh_release_net_setup,
+ __bt_hal_mesh_release_net_reply, app,
+ NULL)) {
+ ERR("Mesh: Network Release failed!!");
+ return BT_STATUS_FAIL;
+ }
+ } else {
+ ERR("Mesh: App not found!!");
+ return BT_STATUS_PARM_INVALID;
+ }
+ INFO("Mesh: Network Release Call issued successfully!!");
+ return BT_STATUS_SUCCESS;
+}
+
bt_status_t _bt_hal_mesh_network_destroy(bt_uuid_t *net_uuid)
{
GSList *l;