extern mesh_h mesh;
extern void event_cb(mesh_event_e event_type, void* param);
-static char data_mesh_interface[MENU_DATA_SIZE + 1] = "mesh0";
-
static int run_mesh_create(MManager *mm, struct menu_data *menu)
{
int ret;
return RET_SUCCESS;
}
-static struct menu_data menu_mesh_enable[] = {
- { "1", "interface", NULL, NULL, data_mesh_interface },
- { "2", "enable", NULL, run_mesh_enable, NULL },
+static char mesh_interface[MENU_DATA_SIZE + 1] = "wlan0";
+static char gate_interface[MENU_DATA_SIZE + 1] = "eth0";
+static char softap_interface[MENU_DATA_SIZE + 1] = "wlan1";
+static int run_mesh_set_interface(MManager *mm, struct menu_data *menu)
+{
+ int ret;
+ msg("set_interfaces");
+
+ ret = mesh_set_interface(mesh, mesh_interface, gate_interface, softap_interface);
+ if (ret != 0) {
+ msg("Failed to set interface: [%s(0x%X)]",
+ mesh_error_to_string(ret), ret);
+ return RET_FAILURE;
+ }
+
+ return RET_SUCCESS;
+}
+
+static struct menu_data menu_mesh_interface[] = {
+ { "1", "mesh", NULL, NULL, mesh_interface },
+ { "2", "gate", NULL, NULL, gate_interface },
+ { "3", "softap", NULL, NULL, softap_interface },
+ { "4", "run", NULL, run_mesh_set_interface, NULL },
{ NULL, NULL, },
};
struct menu_data menu_mesh_device[] = {
- { "1", "create", NULL, run_mesh_create, NULL },
- { "2", "destroy", NULL, run_mesh_destroy, NULL },
- { "3", "enable", menu_mesh_enable, NULL, NULL },
+ { "1", "initialize", NULL, run_mesh_create, NULL },
+ { "2", "deinitialize", NULL, run_mesh_destroy, NULL },
+ { "3", "enable", NULL, run_mesh_enable, NULL },
{ "4", "disable", NULL, run_mesh_disable, NULL },
+ { "5", "set_inteface", menu_mesh_interface, NULL, NULL},
{ NULL, NULL, },
};