summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-10-02 17:51:28 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-10-02 17:51:28 -0300
commit737e08aa766744772b07bf1f35f3aa50d9bf63f0 (patch)
treed68172454e29a43c98bdc9cd7d78d0ee17ee0924 /network
parent357a15b5878b65edef89b00b2db5d128e85bd07e (diff)
Add code to emit PropertyChanged on network interface.
Diffstat (limited to 'network')
-rw-r--r--network/connection.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/network/connection.c b/network/connection.c
index 0f6f6c2d..b2f81991 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -137,10 +137,27 @@ static gboolean bnep_watchdog_cb(GIOChannel *chan, GIOCondition cond,
if (connection != NULL) {
const char *device = nc->dev;
+ gboolean connected = FALSE;
+ const char *property = "";
g_dbus_emit_signal(connection, nc->peer->path,
NETWORK_PEER_INTERFACE, "Disconnected",
DBUS_TYPE_STRING, &device,
DBUS_TYPE_INVALID);
+ dbus_connection_emit_property_changed(connection,
+ nc->peer->path,
+ NETWORK_PEER_INTERFACE,
+ "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
+ dbus_connection_emit_property_changed(connection,
+ nc->peer->path,
+ NETWORK_PEER_INTERFACE,
+ "Device",
+ DBUS_TYPE_STRING, &property);
+ dbus_connection_emit_property_changed(connection,
+ nc->peer->path,
+ NETWORK_PEER_INTERFACE,
+ "UUID",
+ DBUS_TYPE_STRING, &property);
}
info("%s disconnected", nc->dev);
@@ -165,6 +182,7 @@ static gboolean bnep_connect_cb(GIOChannel *chan, GIOCondition cond,
int sk;
DBusMessage *reply;
const char *pdev, *uuid;
+ gboolean connected;
if (cond & G_IO_NVAL)
return FALSE;
@@ -229,11 +247,21 @@ static gboolean bnep_connect_cb(GIOChannel *chan, GIOCondition cond,
DBUS_TYPE_STRING, &pdev,
DBUS_TYPE_INVALID);
+ connected = TRUE;
g_dbus_emit_signal(connection, nc->peer->path,
NETWORK_PEER_INTERFACE, "Connected",
DBUS_TYPE_STRING, &pdev,
DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INVALID);
+ dbus_connection_emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
+ dbus_connection_emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "Device",
+ DBUS_TYPE_BOOLEAN, &pdev);
+ dbus_connection_emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "UUID",
+ DBUS_TYPE_BOOLEAN, &uuid);
nc->state = CONNECTED;