summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/device.h2
-rw-r--r--src/device.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h
index b282d032..6d172e80 100644
--- a/include/device.h
+++ b/include/device.h
@@ -78,6 +78,8 @@ extern void connman_device_set_interface(struct connman_device *device,
const char *interface);
extern const char *connman_device_get_interface(struct connman_device *device);
+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);
diff --git a/src/device.c b/src/device.c
index 0a7fe053..d74b6349 100644
--- a/src/device.c
+++ b/src/device.c
@@ -576,6 +576,19 @@ const char *connman_device_get_interface(struct connman_device *device)
}
/**
+ * connman_device_set_policy:
+ * @device: device structure
+ * @policy: power and connection policy
+ *
+ * Change power and connection policy of device
+ */
+void connman_device_set_policy(struct connman_device *device,
+ enum connman_device_policy policy)
+{
+ device->policy = policy;
+}
+
+/**
* connman_device_set_mode:
* @device: device structure
* @mode: network mode