Start building the ssid list

This commit is contained in:
Jean-André Santoni 2016-09-21 23:08:45 +02:00 committed by twinaphex
parent 850c4beac3
commit d1ae577811
7 changed files with 40 additions and 7 deletions

View File

@ -170,6 +170,11 @@ static int deferred_push_updater_settings_list(menu_displaylist_info_t *info)
return deferred_push_dlist(info, DISPLAYLIST_UPDATER_SETTINGS_LIST);
}
static int deferred_push_wifi_settings_list(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_WIFI_SETTINGS_LIST);
}
static int deferred_push_network_settings_list(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_NETWORK_SETTINGS_LIST);
@ -752,6 +757,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_wifi_settings_list);
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_lakka_services_list);

View File

@ -66,6 +66,7 @@
#include "../list_special.h"
#include "../performance_counters.h"
#include "../core_info.h"
#include "../wifi/wifi_driver.h"
#ifdef HAVE_NETWORKING
static void print_buf_lines(file_list_t *list, char *buf,
@ -4012,6 +4013,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_USER_INTERFACE_SETTINGS_LIST:
case DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST:
case DISPLAYLIST_UPDATER_SETTINGS_LIST:
case DISPLAYLIST_WIFI_SETTINGS_LIST:
case DISPLAYLIST_NETWORK_SETTINGS_LIST:
case DISPLAYLIST_LAKKA_SERVICES_LIST:
case DISPLAYLIST_USER_SETTINGS_LIST:
@ -4658,10 +4660,31 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
0, 0, 0);
}
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_WIFI_SETTINGS_LIST:
{
unsigned i;
struct string_list *ssid_list = string_list_new();
driver_wifi_scan(ssid_list);
for (i = 0; i < ssid_list->size; i++)
{
const char *ssid = ssid_list->elems[i].data;
menu_entries_append_enum(info->list,
"Test",
msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT),
MENU_ENUM_LABEL_LOAD_CONTENT,
MENU_SETTING_ACTION, 0, 0);
}
}
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_NETWORK_SETTINGS_LIST:
{
unsigned user;
unsigned count = 0;

View File

@ -124,6 +124,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_USER_INTERFACE_SETTINGS_LIST,
DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST,
DISPLAYLIST_UPDATER_SETTINGS_LIST,
DISPLAYLIST_WIFI_SETTINGS_LIST,
DISPLAYLIST_NETWORK_SETTINGS_LIST,
DISPLAYLIST_LAKKA_SERVICES_LIST,
DISPLAYLIST_USER_SETTINGS_LIST,

View File

@ -39,14 +39,13 @@ static void connmanctl_stop(void *data)
(void)data;
}
static void connmanctl_scan(void *data, struct string_list *list)
static void connmanctl_scan(struct string_list *list)
{
(void)data;
union string_list_elem_attr attr;
attr.i = RARCH_FILETYPE_UNSET;
string_list_append(list, "LALA", attr);
string_list_append(list, "LOLO", attr);
}
wifi_driver_t wifi_connmanctl = {

View File

@ -38,9 +38,8 @@ static void nullwifi_stop(void *data)
(void)data;
}
static void nullwifi_scan(void *data, struct string_list *list)
static void nullwifi_scan(struct string_list **list)
{
(void)data;
}
wifi_driver_t wifi_null = {

View File

@ -100,7 +100,7 @@ void driver_wifi_scan(struct string_list *list)
{
if (wifi_driver && wifi_data && wifi_driver->scan)
{
return wifi_driver->scan(wifi_data, list);
wifi_driver->scan(list);
}
}

View File

@ -53,7 +53,7 @@ typedef struct wifi_driver
bool (*start)(void *data);
void (*stop)(void *data);
void (*scan)(void *data, struct string_list *list);
void (*scan)(struct string_list *list);
const char *ident;
} wifi_driver_t;