};
struct connman_network {
+ char *essid;
};
struct connman_iface {
enum connman_iface_flags flags;
enum connman_iface_state state;
enum connman_iface_policy policy;
+ struct connman_network network;
struct connman_ipv4 ipv4;
struct connman_iface_driver *driver;
}
str = g_key_file_get_string(keyfile, iface->identifier,
+ "Network.ESSID", NULL);
+ if (str != NULL) {
+ g_free(iface->network.essid);
+ iface->network.essid = str;
+ if (iface->driver->set_network)
+ iface->driver->set_network(iface, str);
+ }
+
+ str = g_key_file_get_string(keyfile, iface->identifier,
"IPv4.Method", NULL);
if (str != NULL) {
iface->ipv4.method = __connman_ipv4_string2method(str);
str = __connman_iface_policy2string(iface->policy);
g_key_file_set_string(keyfile, iface->identifier, "Policy", str);
+ if (iface->network.essid != NULL) {
+ g_key_file_set_string(keyfile, iface->identifier,
+ "Network.ESSID", iface->network.essid);
+ } else
+ g_key_file_remove_key(keyfile, iface->identifier,
+ "Network.ESSID", NULL);
+
if (iface->ipv4.method != CONNMAN_IPV4_METHOD_UNKNOWN) {
str = __connman_ipv4_method2string(iface->ipv4.method);
g_key_file_set_string(keyfile, iface->identifier,
struct connman_iface *iface = data;
DBusMessage *reply;
DBusMessageIter array, dict;
+ gboolean changed = FALSE;
DBG("conn %p", conn);
dbus_message_iter_get_basic(&value, &val);
if (g_strcasecmp(key, "ESSID") == 0) {
+ g_free(iface->network.essid);
+ iface->network.essid = g_strdup(val);
if (iface->driver->set_network)
iface->driver->set_network(iface, val);
+ changed = TRUE;
}
if (g_strcasecmp(key, "PSK") == 0) {
dbus_message_append_args(reply, DBUS_TYPE_INVALID);
+ if (changed == TRUE)
+ __connman_iface_store(iface);
+
return reply;
}
g_free(iface->udi);
g_free(iface->sysfs);
g_free(iface->identifier);
+ g_free(iface->network.essid);
g_free(iface->device.driver);
g_free(iface->device.vendor);
g_free(iface->device.product);
__connman_iface_init_via_inet(iface);
- __connman_iface_load(iface);
-
iface->driver = driver;
+ __connman_iface_load(iface);
+
conn = libhal_ctx_get_dbus_connection(ctx);
g_dbus_register_object(conn, iface->path, iface, device_free);