Add functions for handling path value
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 25 Dec 2008 17:52:26 +0000 (18:52 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 25 Dec 2008 17:52:26 +0000 (18:52 +0100)
include/device.h
src/device.c

index 8b86096..88ec0fc 100644 (file)
@@ -59,6 +59,9 @@ extern struct connman_device *connman_device_create(const char *node,
 extern struct connman_device *connman_device_ref(struct connman_device *device);
 extern void connman_device_unref(struct connman_device *device);
 
+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);
index cd49b29..2ac98c0 100644 (file)
@@ -35,6 +35,7 @@ struct connman_device {
        gboolean powered;
        gboolean carrier;
        gboolean scanning;
+       char *path;
        char *interface;
 
        struct connman_device_driver *driver;
@@ -368,7 +369,34 @@ void connman_device_unref(struct connman_device *device)
 }
 
 /**
- * connman_device_set_interface:
+ * connman_device_set_path:
+ * @device: device structure
+ * @path: path name
+ *
+ * Set path name of device
+ */
+void connman_device_set_path(struct connman_device *device, const char *path)
+{
+       g_free(device->element.devpath);
+       device->element.devpath = g_strdup(path);
+
+       g_free(device->path);
+       device->path = g_strdup(path);
+}
+
+/**
+ * connman_device_get_path:
+ * @device: device structure
+ *
+ * Get path name of device
+ */
+const char *connman_device_get_path(struct connman_device *device)
+{
+       return device->path;
+}
+
+/**
+ * connman_device_set_index:
  * @device: device structure
  * @index: index number
  *