}
static int set_network(struct supplicant_task *task,
- const unsigned char *network, int len,
- const char *passphrase)
+ const unsigned char *network, int len,
+ const char *security, const char *passphrase)
{
DBusMessage *message, *reply;
DBusMessageIter array, dict;
int __supplicant_connect(struct connman_element *element,
const unsigned char *ssid, int ssid_len,
- const char *passphrase)
+ const char *security, const char *passphrase)
{
struct supplicant_task *task;
select_network(task);
disable_network(task);
- set_network(task, ssid, ssid_len, passphrase);
+ set_network(task, ssid, ssid_len, security, passphrase);
enable_network(task);
int __supplicant_connect(struct connman_element *element,
const unsigned char *ssid, int ssid_len,
- const char *passphrase);
+ const char *security, const char *passphrase);
int __supplicant_disconnect(struct connman_element *element);
static int network_enable(struct connman_element *element)
{
- char *identifier, *passphrase = NULL;
+ char *identifier, *security = NULL, *passphrase = NULL;
unsigned char *ssid;
int ssid_len;
}
}
+ if (connman_element_get_static_property(element,
+ "WiFi.Security", &security) == FALSE)
+ connman_element_get_value(element,
+ CONNMAN_PROPERTY_ID_WIFI_SECURITY, &security);
+
connman_element_get_value(element,
CONNMAN_PROPERTY_ID_WIFI_PASSPHRASE, &passphrase);
- DBG("identifier %s passhprase %s", identifier, passphrase);
+ DBG("identifier %s security %s passhprase %s",
+ identifier, security, passphrase);
- if (__supplicant_connect(element, ssid, ssid_len, passphrase) < 0)
+ if (__supplicant_connect(element, ssid, ssid_len,
+ security, passphrase) < 0)
connman_error("Failed to initiate connect");
return 0;