diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-12-15 09:41:01 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-12-15 09:41:01 +0000 |
commit | 500eb89cd1adde32b00051aa4485466ee5142efc (patch) | |
tree | 159d4eef640504273f0c7fb4bf6a7afd5d184cfa /src | |
parent | 39cac86a40c1480d1b57b6d0dadfc942798b61d6 (diff) | |
download | mandi-500eb89cd1adde32b00051aa4485466ee5142efc.tar mandi-500eb89cd1adde32b00051aa4485466ee5142efc.tar.gz mandi-500eb89cd1adde32b00051aa4485466ee5142efc.tar.bz2 mandi-500eb89cd1adde32b00051aa4485466ee5142efc.tar.xz mandi-500eb89cd1adde32b00051aa4485466ee5142efc.zip |
send all events to listeners
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/wireless/plugin.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/wireless/plugin.c b/src/plugins/wireless/plugin.c index 74c0ef4..5708372 100644 --- a/src/plugins/wireless/plugin.c +++ b/src/plugins/wireless/plugin.c @@ -61,6 +61,21 @@ static void deinit(plugin_t *plugin, DBusConnection *connection) { close(plugin->fd); } +static void notify_event(DBusConnection *bus, char *event) { + DBusMessage *message; + message = dbus_message_new_signal(WIRELESS_PATH, + WIRELESS_INTERFACE, + "Event"); + + dbus_message_append_args(message, + DBUS_TYPE_STRING, + &event, + DBUS_TYPE_INVALID); + dbus_connection_send(bus, message, NULL); + dbus_connection_flush(bus); + dbus_message_unref(message); +} + static void handle_incoming(plugin_t *plugin, DBusConnection *connection) { struct wpa_ctrl *ctrl_conn = (struct wpa_ctrl *) plugin->priv; char buf[2048]; @@ -68,6 +83,7 @@ static void handle_incoming(plugin_t *plugin, DBusConnection *connection) { wpa_ctrl_recv(ctrl_conn, buf, &len); buf[len] = '\0'; printf("received event: %s\n", buf); + notify_event(connection, buf); } static DBusHandlerResult handle_message(DBusConnection *connection, DBusMessage *message, plugin_t *plugin) { |