char *name;
char *node;
char *interface;
+ unsigned int connections;
struct connman_device_driver *driver;
void *driver_data;
}
/**
+ * connman_device_get_name:
+ * @device: device structure
+ *
+ * Get unique name of device
+ */
+const char *connman_device_get_name(struct connman_device *device)
+{
+ return device->element.name;
+}
+
+/**
* connman_device_get_path:
* @device: device structure
*
g_dbus_send_message(connection, signal);
+ if (powered == FALSE)
+ return 0;
+
+ if (device->policy != CONNMAN_DEVICE_POLICY_AUTO)
+ return 0;
+
+ if (device->driver->scan)
+ device->driver->scan(device);
+
return 0;
}
return 0;
}
+static void connect_known_network(struct connman_device *device)
+{
+ DBG("device %p", device);
+}
+
/**
* connman_device_set_scanning:
* @device: device structure
g_dbus_send_message(connection, signal);
+ if (scanning == TRUE)
+ return 0;
+
+ if (device->connections > 0)
+ return 0;
+
+ if (device->policy != CONNMAN_DEVICE_POLICY_AUTO)
+ return 0;
+
+ connect_known_network(device);
+
return 0;
}
return NULL;
}
+void __connman_device_increase_connections(struct connman_device *device)
+{
+ device->connections++;
+}
+
+void __connman_device_decrease_connections(struct connman_device *device)
+{
+ device->connections--;
+}
+
/**
* connman_device_add_network:
* @device: device structure
GKeyFile *keyfile;
gchar *pathname, *data = NULL;
gsize length;
- const char *str;
+ char *str;
DBG("device %p", device);
g_free(data);
str = g_key_file_get_string(keyfile, "Configuration", "Policy", NULL);
- if (str != NULL)
+ if (str != NULL) {
device->policy = string2policy(str);
+ g_free(str);
+ }
g_key_file_free(keyfile);