3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-18 17:22:50 +01:00

client: Move Device.ConnectHiddenNetwork to station

This commit is contained in:
Denis Kenzior 2018-09-14 21:26:32 -05:00
parent b2e0a82225
commit 86e8b8c322
2 changed files with 27 additions and 25 deletions

View File

@ -616,26 +616,6 @@ static enum cmd_status cmd_connect(const char *device_name,
return CMD_STATUS_TRIGGERED;
}
static enum cmd_status cmd_connect_hidden_network(const char *device_name,
char **argv,
int argc)
{
const struct proxy_interface *proxy =
device_proxy_find_by_name(device_name);
if (!proxy)
return CMD_STATUS_INVALID_VALUE;
if (argc != 1)
return CMD_STATUS_INVALID_ARGS;
proxy_interface_method_call(proxy, "ConnectHiddenNetwork", "s",
check_errors_method_callback,
argv[0]);
return CMD_STATUS_TRIGGERED;
}
static char *get_networks_cmd_arg_completion(const char *text, int state)
{
static int index;
@ -688,11 +668,6 @@ static const struct command device_commands[] = {
cmd_connect,
"Connect to network", false,
connect_cmd_arg_completion },
{ "<wlan>", "connect-hidden",
"<\"network name\">",
cmd_connect_hidden_network,
"Connect to hidden network",
false },
{ }
};

View File

@ -185,6 +185,28 @@ static enum cmd_status cmd_list(const char *device_name, char **argv, int argc)
return CMD_STATUS_DONE;
}
static enum cmd_status cmd_connect_hidden_network(const char *device_name,
char **argv,
int argc)
{
const struct proxy_interface *station_i;
if (argc != 1)
return CMD_STATUS_INVALID_ARGS;
station_i = device_proxy_find(device_name, IWD_STATION_INTERFACE);
if (!station_i) {
display("No station on device: '%s'\n", device_name);
return CMD_STATUS_INVALID_VALUE;
}
proxy_interface_method_call(station_i, "ConnectHiddenNetwork", "s",
check_errors_method_callback,
argv[0]);
return CMD_STATUS_TRIGGERED;
}
static enum cmd_status cmd_disconnect(const char *device_name,
char **argv, int argc)
{
@ -221,6 +243,11 @@ static enum cmd_status cmd_scan(const char *device_name,
static const struct command station_commands[] = {
{ NULL, "list", NULL, cmd_list, "List Ad-Hoc devices", true },
{ "<wlan>", "connect-hidden",
"<\"network name\">",
cmd_connect_hidden_network,
"Connect to hidden network",
false },
{ "<wlan>", "disconnect",
NULL, cmd_disconnect, "Disconnect" },
{ "<wlan>", "scan", NULL, cmd_scan, "Scan for networks" },