This information should only be used to determine
advanced properties or showing the correct icon
to the user.
+
+ string Mode [readonly]
+
+ If the service type is WiFi, then this property is
+ present and contains the mode of the network. The
+ possible values are "managed" or "adhoc".
+
+ string Security [readonly]
+
+ If the service type is WiFi, then this property is
+ present and contains the security method or key
+ management setting.
+
+ Possible values are "none", "wep", "wpa" and "wpa2".
+
+ uint8 Strength [readonly]
+
+ Indicates the signal strength of the service. This
+ is a normalized value between 0 and 100.
char *path;
char *type;
char *name;
- GSList *networks;
+ char *mode;
+ char *security;
+ connman_uint8_t strength;
+ struct connman_network *network;
};
static GHashTable *groups = NULL;
connman_dbus_dict_append_variant(&dict, "Name",
DBUS_TYPE_STRING, &group->name);
+ if (group->mode != NULL)
+ connman_dbus_dict_append_variant(&dict, "Mode",
+ DBUS_TYPE_STRING, &group->mode);
+
+ if (group->security != NULL)
+ connman_dbus_dict_append_variant(&dict, "Security",
+ DBUS_TYPE_STRING, &group->security);
+
+ if (group->strength > 0)
+ connman_dbus_dict_append_variant(&dict, "Strength",
+ DBUS_TYPE_BYTE, &group->strength);
+
dbus_message_iter_close_container(&array, &dict);
return reply;
g_dbus_unregister_interface(connection, group->path,
CONNMAN_SERVICE_INTERFACE);
+ g_free(group->security);
+ g_free(group->mode);
g_free(group->name);
g_free(group->type);
g_free(group->path);
DBG("device %p", device);
- name = g_strdup_printf("device%d", connman_device_get_index(device));
+ name = g_strdup_printf("%s_%d", __connman_device_get_type(device),
+ connman_device_get_index(device));
group = lookup_group(name);
g_free(name);
DBG("device %p", device);
- name = g_strdup_printf("device%d", connman_device_get_index(device));
+ name = g_strdup_printf("%s_%d", __connman_device_get_type(device),
+ connman_device_get_index(device));
group = lookup_group(name);
g_free(name);
group->type = g_strdup(__connman_network_get_type(network));
group->name = g_strdup(connman_network_get_string(network, "Name"));
+ group->strength = connman_network_get_uint8(network, "Strength");
+
+ if (group->network == NULL) {
+ group->network = network;
+
+ group->mode = g_strdup(connman_network_get_string(network,
+ "WiFi.Mode"));
+ group->security = g_strdup(connman_network_get_string(network,
+ "WiFi.Security"));
+ }
+
return 0;
}
if (group == NULL)
return -EINVAL;
+ if (group->network == network) {
+ g_free(group->security);
+ group->security = NULL;
+
+ g_free(group->mode);
+ group->mode = NULL;
+
+ group->network = NULL;
+ }
+
return 0;
}