Add manual policy to device settings
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 28 Dec 2008 01:13:50 +0000 (02:13 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 28 Dec 2008 01:13:50 +0000 (02:13 +0100)
doc/device-api.txt
include/device.h
src/device.c

index 7d1b86f..6d8f348 100644 (file)
@@ -63,21 +63,29 @@ Properties  string Name [readonly]
 
                string Policy [readwrite]
 
-                       Setting of the device power policy. Possible values
-                       are "off", "ignore" and "auto".
+                       Setting of the device power and connection policy.
+                       Possible values are "ignore", "off", "auto"
+                       and "manual".
 
                        The policy defines on how the device is initialized
-                       when brought up. The actual device power state can
-                       be changed independently to this value.
+                       when brought up and how it connects. The actual
+                       device power state can be changed independently to
+                       this value.
 
                        If a device is switched off and the policy is changed
-                       to "auto", the device will be switched. For a current
-                       active device changing the policy to "off" results
-                       in powering down the device.
+                       to "auto" or "manual", the device will be switched
+                       on. For a current active device changing the policy
+                       to "off" results in powering down the device.
 
                        The "ignore" policy can be set for devices that are
                        detected, but managed by a different entity on the
-                       system. For example complex network setups.
+                       system. For example for complex network setups.
+
+                       Devices that can connect to various networks, the
+                       difference between "auto" or "manual" defines if
+                       known networks are connected automatically or not.
+                       For simple devices like Ethernet cards, setting
+                       the "manual" policy might fail.
 
                boolean Powered [readwrite]
 
index 172d959..b282d03 100644 (file)
@@ -56,8 +56,9 @@ enum connman_device_mode {
 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,
 };
 
 struct connman_device;
index 8f5def7..0a7fe05 100644 (file)
@@ -88,10 +88,12 @@ static const char *policy2string(enum connman_device_policy policy)
        switch (policy) {
        case CONNMAN_DEVICE_POLICY_IGNORE:
                return "ignore";
-       case CONNMAN_DEVICE_POLICY_AUTO:
-               return "auto";
        case CONNMAN_DEVICE_POLICY_OFF:
                return "off";
+       case CONNMAN_DEVICE_POLICY_AUTO:
+               return "auto";
+       case CONNMAN_DEVICE_POLICY_MANUAL:
+               return "manual";
        default:
                return NULL;
        }