extern "C" {
#endif
+#include <connman/network.h>
#include <connman/element.h>
/**
* SECTION:device
- * @title: Device driver premitives
- * @short_description: Functions for registering device drivers
+ * @title: Device premitives
+ * @short_description: Functions for handling devices
*/
enum connman_device_type {
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,
+ CONNMAN_DEVICE_TYPE_HSO,
};
-enum connman_device_capabilities {
- CONNMAN_DEVICE_CAPABILITY_SCANNING = (1 << 0),
+enum connman_device_mode {
+ CONNMAN_DEVICE_MODE_NO_NETWORK = 0,
+ CONNMAN_DEVICE_MODE_SINGLE_NETWORK = 1,
+ CONNMAN_DEVICE_MODE_MULTIPLE_NETWORKS = 2,
};
enum connman_device_policy {
CONNMAN_DEVICE_POLICY_UNKNOWN = 0,
CONNMAN_DEVICE_POLICY_IGNORE = 1,
- CONNMAN_DEVICE_POLICY_AUTO = 2,
- CONNMAN_DEVICE_POLICY_OFF = 3,
+ CONNMAN_DEVICE_POLICY_OFF = 2,
+ CONNMAN_DEVICE_POLICY_AUTO = 3,
+ CONNMAN_DEVICE_POLICY_MANUAL = 4,
};
-enum connman_device_state {
- CONNMAN_DEVICE_STATE_UNKNOWN = 0,
- CONNMAN_DEVICE_STATE_OFF = 1,
-};
-
-struct connman_device_driver;
+struct connman_device;
-struct connman_device {
- struct connman_element *element;
- unsigned long capabilities;
- enum connman_device_policy policy;
- enum connman_device_state state;
- gboolean powered;
+extern struct connman_device *connman_device_create(const char *node,
+ enum connman_device_type type);
+extern struct connman_device *connman_device_ref(struct connman_device *device);
+extern void connman_device_unref(struct connman_device *device);
- struct connman_device_driver *driver;
- void *driver_data;
+extern void connman_device_set_path(struct connman_device *device,
+ const char *path);
+extern const char *connman_device_get_path(struct connman_device *device);
+extern void connman_device_set_index(struct connman_device *device,
+ int index);
+extern int connman_device_get_index(struct connman_device *device);
+extern void connman_device_set_interface(struct connman_device *device,
+ const char *interface);
+extern const char *connman_device_get_interface(struct connman_device *device);
- GSList *networks;
-};
+extern void connman_device_set_policy(struct connman_device *device,
+ enum connman_device_policy policy);
+extern void connman_device_set_mode(struct connman_device *device,
+ enum connman_device_mode mode);
extern int connman_device_set_powered(struct connman_device *device,
gboolean powered);
+extern int connman_device_set_carrier(struct connman_device *device,
+ gboolean carrier);
+extern int connman_device_set_scanning(struct connman_device *device,
+ gboolean scanning);
+
+extern int connman_device_add_network(struct connman_device *device,
+ struct connman_network *network);
+extern struct connman_network *connman_device_get_network(struct connman_device *device,
+ const char *identifier);
+extern int connman_device_remove_network(struct connman_device *device,
+ const char *identifier);
+
+extern int connman_device_register(struct connman_device *device);
+extern void connman_device_unregister(struct connman_device *device);
+
+extern void *connman_device_get_data(struct connman_device *device);
+extern void connman_device_set_data(struct connman_device *device, void *data);
struct connman_device_driver {
const char *name;
int priority;
int (*probe) (struct connman_device *device);
void (*remove) (struct connman_device *device);
+ int (*enable) (struct connman_device *device);
+ int (*disable) (struct connman_device *device);
int (*scan) (struct connman_device *device);
};