summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-01-21 01:44:02 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-01-21 01:44:02 +0100
commit6e9987061ef9bc393309adfcdba155386d1802c4 (patch)
treecc13799b300bd5a2fd66dce5e010adc37e826977
parent0b95857f52f88596c45679351f6e80ef17d6fc58 (diff)
downloadconnman-6e9987061ef9bc393309adfcdba155386d1802c4.tar.gz
connman-6e9987061ef9bc393309adfcdba155386d1802c4.tar.bz2
connman-6e9987061ef9bc393309adfcdba155386d1802c4.zip
Add function to get device mode
-rw-r--r--include/device.h1
-rw-r--r--src/device.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h
index 350890fb..abd62cfb 100644
--- a/include/device.h
+++ b/include/device.h
@@ -83,6 +83,7 @@ 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 enum connman_device_mode connman_device_get_mode(struct connman_device *device);
extern int connman_device_set_powered(struct connman_device *device,
connman_bool_t powered);
diff --git a/src/device.c b/src/device.c
index 6e2575b4..ea72b251 100644
--- a/src/device.c
+++ b/src/device.c
@@ -893,6 +893,17 @@ void connman_device_set_mode(struct connman_device *device,
}
/**
+ * connman_device_get_mode:
+ * @device: device structure
+ *
+ * Get network mode of device
+ */
+enum connman_device_mode connman_device_get_mode(struct connman_device *device)
+{
+ return device->mode;
+}
+
+/**
* connman_device_set_powered:
* @device: device structure
* @powered: powered state