CONNMAN_DEVICE_TYPE_WIMAX = CONNMAN_ELEMENT_SUBTYPE_WIMAX,
CONNMAN_DEVICE_TYPE_MODEM = CONNMAN_ELEMENT_SUBTYPE_MODEM,
CONNMAN_DEVICE_TYPE_BLUETOOTH = CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH,
+ CONNMAN_DEVICE_TYPE_VENDOR = 42,
};
enum connman_device_capabilities {
struct connman_device {
struct connman_element *element;
+ enum connman_device_type type;
unsigned long capabilities;
enum connman_device_policy policy;
enum connman_device_state state;
#include "connman.h"
+static const char *type2string(enum connman_device_type type)
+{
+ switch (type) {
+ case CONNMAN_DEVICE_TYPE_ETHERNET:
+ return "ethernet";
+ case CONNMAN_DEVICE_TYPE_WIFI:
+ return "wifi";
+ case CONNMAN_DEVICE_TYPE_WIMAX:
+ return "wimax";
+ case CONNMAN_DEVICE_TYPE_MODEM:
+ return "modem";
+ case CONNMAN_DEVICE_TYPE_BLUETOOTH:
+ return "bluetooth";
+ default:
+ return NULL;
+ }
+}
+
static int set_powered(struct connman_device *device, gboolean powered)
{
struct connman_device_driver *driver = device->driver;
struct connman_device *device = data;
DBusMessage *reply;
DBusMessageIter array, dict;
+ const char *str;
DBG("conn %p", conn);
DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+ str = type2string(device->type);
+ if (str != NULL)
+ connman_dbus_dict_append_variant(&dict, "Type",
+ DBUS_TYPE_STRING, &str);
+
connman_dbus_dict_append_variant(&dict, "Powered",
DBUS_TYPE_BOOLEAN, &device->powered);
return -ENOMEM;
device->element = element;
+ device->type = element->subtype;
connman_element_set_data(element, device);