summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-01-20 16:30:38 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-01-24 11:49:16 +0100
commit824447883b5136781bcec309b6adfae6c2c7b6b3 (patch)
treed95e89ffff616d1e9f4b690420b1afd0c7cbbf5a /src/technology.c
parentd9eb2d0c1032c34854528fca9d910d978c454997 (diff)
downloadconnman-824447883b5136781bcec309b6adfae6c2c7b6b3.tar.gz
connman-824447883b5136781bcec309b6adfae6c2c7b6b3.tar.bz2
connman-824447883b5136781bcec309b6adfae6c2c7b6b3.zip
technology: Add 'Connected' Technology property
Set Technology property 'Connected' to true if at least one service for the Technology is connected; false otherwise.
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/technology.c b/src/technology.c
index 1f3cdf53..3cf93324 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -59,6 +59,7 @@ struct connman_technology {
GSList *device_list;
int enabled;
char *regdom;
+ connman_bool_t connected;
connman_bool_t tethering;
char *tethering_ident;
@@ -421,6 +422,10 @@ static void append_properties(DBusMessageIter *iter,
connman_dbus_dict_append_basic(&dict, "Powered",
DBUS_TYPE_BOOLEAN, &powered);
+ connman_dbus_dict_append_basic(&dict, "Connected",
+ DBUS_TYPE_BOOLEAN,
+ &technology->connected);
+
connman_dbus_dict_append_basic(&dict, "Tethering",
DBUS_TYPE_BOOLEAN,
&technology->tethering);
@@ -1085,6 +1090,24 @@ int __connman_technology_set_offlinemode(connman_bool_t offlinemode)
return err;
}
+void __connman_technology_set_connected(enum connman_service_type type,
+ connman_bool_t connected)
+{
+ struct connman_technology *technology;
+
+ technology = technology_find(type);
+ if (technology == NULL)
+ return;
+
+ DBG("technology %p connected %d", technology, connected);
+
+ technology->connected = connected;
+
+ connman_dbus_property_changed_basic(technology->path,
+ CONNMAN_TECHNOLOGY_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
+}
+
int __connman_technology_add_rfkill(unsigned int index,
enum connman_service_type type,
connman_bool_t softblock,