struct connman_element *element = data;
DBusMessage *reply;
DBusMessageIter array, dict;
- const char *method = NULL;
+ const char *type = NULL, *method = NULL;
const char *address = NULL, *netmask = NULL, *gateway = NULL;
DBG("conn %p", conn);
DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+ connman_element_get_static_property(element, "Type", &type);
+
+ if (type != NULL)
+ connman_dbus_dict_append_variant(&dict, "Type",
+ DBUS_TYPE_STRING, &type);
+
if (element->devname != NULL)
connman_dbus_dict_append_variant(&dict, "Interface",
DBUS_TYPE_STRING, &element->devname);
enum connman_device_type type)
{
struct connman_device *device;
+ const char *str;
DBG("node %s type %d", node, type);
device->element.device = device;
device->element.destruct = device_destruct;
+ str = type2string(type);
+ if (str != NULL)
+ connman_element_add_static_property(&device->element,
+ "Type", DBUS_TYPE_STRING, &str);
+
device->type = type;
device->mode = CONNMAN_DEVICE_MODE_UNKNOWN;
device->policy = CONNMAN_DEVICE_POLICY_AUTO;
__connman_element_unlock(element);
+ if (found == FALSE && element->parent != NULL)
+ return connman_element_get_static_property(element->parent,
+ name, value);
+
return found;
}
} wifi;
};
+static const char *type2string(enum connman_network_type type)
+{
+ switch (type) {
+ case CONNMAN_NETWORK_TYPE_UNKNOWN:
+ case CONNMAN_NETWORK_TYPE_VENDOR:
+ break;
+ case CONNMAN_NETWORK_TYPE_WIFI:
+ return "wifi";
+ case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
+ case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
+ return "bluetooth";
+ case CONNMAN_NETWORK_TYPE_HSO:
+ return "cellular";
+ }
+
+ return NULL;
+}
+
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *data)
{
enum connman_network_type type)
{
struct connman_network *network;
+ const char *str;
DBG("identifier %s type %d", identifier, type);
network->element.network = network;
network->element.destruct = network_destruct;
+ str = type2string(type);
+ if (str != NULL)
+ connman_element_add_static_property(&network->element,
+ "Type", DBUS_TYPE_STRING, &str);
+
network->type = type;
network->identifier = g_strdup(identifier);