summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-05-01 16:55:37 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-05-01 16:55:37 +0000
commit66570ffe00f40c03ea3ae4fa7e62eea5697a7262 (patch)
tree2d1e25438fd2c6599817317e904cc4ffd3a58411
parentd9b667c2cae88ead3efa166fef6580170dc8936d (diff)
serial: added PortCreated signal
-rw-r--r--serial/manager.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/serial/manager.c b/serial/manager.c
index 6b10c13d..cbd1ea21 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -145,6 +145,7 @@ static int port_register(DBusConnection *conn,
const char *path, const char *owner)
{
struct serial_port *sp;
+ DBusMessage *signal;
if (!conn || !owner)
return -EINVAL;
@@ -162,6 +163,15 @@ static int port_register(DBusConnection *conn,
return -1;
}
+ signal = dbus_message_new_signal(SERIAL_MANAGER_PATH,
+ SERIAL_MANAGER_INTERFACE, "PortCreated");
+
+ dbus_message_append_args(signal,
+ DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_INVALID);
+
+ send_message_and_unref(conn, signal);
+
info("Registered serial port path:%s", path);
return 0;
@@ -220,8 +230,6 @@ static DBusHandlerResult create_port(DBusConnection *conn,
snprintf(port_path, PATH_LENGTH, SERIAL_PORT_PATH"%d", next_id++);
- /* FIXME: Send signal */
-
if (port_register(conn, port_path, dbus_message_get_sender(msg)) < 0) {
dbus_message_unref(reply);
return err_failed(conn, msg, "D-Bus path registration failed");