summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-08-09 10:48:02 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2010-08-09 17:16:57 (GMT)
commitae3b3b3ea9df42424964cb18df943747367271eb (patch)
tree06d09f6b5bed38143b9c7358405abb57a951da87
parentc686a4fa15d8e093638f249a16ed048c59798fb7 (diff)
downloadconnman-ae3b3b3ea9df42424964cb18df943747367271eb.zip
connman-ae3b3b3ea9df42424964cb18df943747367271eb.tar.gz
connman-ae3b3b3ea9df42424964cb18df943747367271eb.tar.bz2
Export devices blocked status
-rw-r--r--doc/device-lowlevel-api.txt9
-rw-r--r--src/device.c12
2 files changed, 21 insertions, 0 deletions
diff --git a/doc/device-lowlevel-api.txt b/doc/device-lowlevel-api.txt
index 9bae36c..f01751b 100644
--- a/doc/device-lowlevel-api.txt
+++ b/doc/device-lowlevel-api.txt
@@ -70,6 +70,15 @@ Properties string Address [readonly]
example would be modifications via the "ifconfig"
command line utility.
+ boolean Blocked [readonly]
+
+ Indicates if a device transmission capability is
+ blocked or not. This property is a translation of
+ the device rfkill status. If it is hard or soft
+ blocked, this property will be true.
+
+ Once a device is blocked, enabling it will fail.
+
uint16 ScanInterval [readwrite]
The scan interval describes the time in seconds
diff --git a/src/device.c b/src/device.c
index 39d86b5..813e3bc 100644
--- a/src/device.c
+++ b/src/device.c
@@ -194,6 +194,13 @@ static void powered_changed(struct connman_device *device)
DBUS_TYPE_BOOLEAN, &device->powered);
}
+static void blocked_changed(struct connman_device *device)
+{
+ connman_dbus_property_changed_basic(device->element.path,
+ CONNMAN_DEVICE_INTERFACE, "Blocked",
+ DBUS_TYPE_BOOLEAN, &device->blocked);
+}
+
int __connman_device_enable(struct connman_device *device)
{
int err;
@@ -333,6 +340,9 @@ static DBusMessage *get_properties(DBusConnection *conn,
connman_dbus_dict_append_basic(&dict, "Powered",
DBUS_TYPE_BOOLEAN, &device->powered);
+ connman_dbus_dict_append_basic(&dict, "Blocked",
+ DBUS_TYPE_BOOLEAN, &device->blocked);
+
if (device->driver && device->driver->scan)
connman_dbus_dict_append_basic(&dict, "Scanning",
DBUS_TYPE_BOOLEAN, &device->scanning);
@@ -1037,6 +1047,8 @@ int __connman_device_set_blocked(struct connman_device *device,
device->blocked = blocked;
+ blocked_changed(device);
+
if (device->offlinemode == TRUE)
return 0;