summaryrefslogtreecommitdiffstats
path: root/serial/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-09-26 15:05:37 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-09-26 15:05:37 +0000
commitff57b7e4bafc2437d7ef147044b24835f3a4f4d2 (patch)
tree5de9610d6decad5732c3d4037cb622f6385efc63 /serial/manager.c
parent4c18c3e4ffbd0bb6eeb7d0933acadc2f8200587b (diff)
serial: Added GetServiceName
Diffstat (limited to 'serial/manager.c')
-rw-r--r--serial/manager.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/serial/manager.c b/serial/manager.c
index 371c8a95..378434e4 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -559,10 +559,12 @@ static void record_reply(DBusPendingCall *call, void *data)
}
port_store(&pc->src, &dst, err, ch, svcname);
+
+ port_register(pc->conn, err, &pc->src, &dst, port_name,
+ path, svcname);
if (svcname)
g_free(svcname);
- port_register(pc->conn, err, &pc->src, &dst, port_name, path);
ports_paths = g_slist_append(ports_paths, g_strdup(path));
reply = dbus_message_new_method_return(pc->msg);
@@ -840,7 +842,7 @@ static DBusHandlerResult create_port(DBusConnection *conn,
snprintf(port_name, sizeof(port_name), "/dev/rfcomm%d", err);
port_store(&src, &dst, err, val, NULL);
- port_register(conn, err, &src, &dst, port_name, path);
+ port_register(conn, err, &src, &dst, port_name, path, NULL);
ports_paths = g_slist_append(ports_paths, g_strdup(path));
reply = dbus_message_new_method_return(msg);
@@ -2144,7 +2146,7 @@ static DBusSignalVTable manager_signals[] = {
static void parse_port(char *key, char *value, void *data)
{
- char path[MAX_PATH_LENGTH], port_name[16], dst_addr[18];
+ char path[MAX_PATH_LENGTH], port_name[16], dst_addr[18], *svc;
char *src_addr = data;
bdaddr_t dst, src;
int ch, id;
@@ -2156,6 +2158,10 @@ static void parse_port(char *key, char *value, void *data)
if (sscanf(value,"%d:", &ch) != 1)
return;
+ svc = strchr(value, ':');
+ if (svc && *svc)
+ svc++;
+
str2ba(dst_addr, &dst);
str2ba(src_addr, &src);
@@ -2164,7 +2170,8 @@ static void parse_port(char *key, char *value, void *data)
snprintf(port_name, sizeof(port_name), "/dev/rfcomm%d", id);
- if (port_register(connection, id, &src, &dst, port_name, path) < 0) {
+ if (port_register(connection, id, &src, &dst,
+ port_name, path, svc) < 0) {
rfcomm_release(id);
return;
}