diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-09-29 19:45:55 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-09-29 19:45:55 +0000 |
commit | 7e656457c2ea1ff676a9125c189a7ec9101c36a1 (patch) | |
tree | 67d02d9856a8e1c1bb6eacf0c77dc1798bc8a259 /hcid/dbus-sdp.c | |
parent | d78dcb8b79e0db5dddab5f98cd825c69f0bf9938 (diff) |
GetRemoteServiceHandles:added service match
Diffstat (limited to 'hcid/dbus-sdp.c')
-rw-r--r-- | hcid/dbus-sdp.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/hcid/dbus-sdp.c b/hcid/dbus-sdp.c index 8502c42a..7fc4e451 100644 --- a/hcid/dbus-sdp.c +++ b/hcid/dbus-sdp.c @@ -931,15 +931,23 @@ DBusHandlerResult get_remote_svc_rec(DBusConnection *conn, DBusMessage *msg, voi static int remote_svc_handles_conn_cb(struct transaction_context *ctxt) { sdp_list_t *search = NULL; + const char *dst, *svc; uuid_t uuid; int err = 0; + uint32_t class; if (sdp_set_notify(ctxt->session, remote_svc_handles_completed_cb, ctxt) < 0) { err = -EINVAL; goto fail; } - sdp_uuid16_create(&uuid, PUBLIC_BROWSE_GROUP); + dbus_message_get_args(ctxt->rq, NULL, + DBUS_TYPE_STRING, &dst, + DBUS_TYPE_STRING, &svc, + DBUS_TYPE_INVALID); + + class = sdp_str2svclass(svc); + sdp_uuid16_create(&uuid, class); search = sdp_list_append(0, &uuid); /* Create/send the search request and set the callback to indicate the request completion */ @@ -959,14 +967,22 @@ fail: DBusHandlerResult get_remote_svc_handles(DBusConnection *conn, DBusMessage *msg, void *data) { struct hci_dbus_data *dbus_data = data; - const char *dst; + const char *dst, *svc; int err = 0; + uint32_t class; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &dst, + DBUS_TYPE_STRING, &svc, DBUS_TYPE_INVALID)) return error_invalid_arguments(conn, msg); + class = sdp_str2svclass(svc); + if (!class) { + error("Invalid service class name"); + return error_invalid_arguments(conn, msg); + } + if (find_pending_connect(dst)) return error_service_search_in_progress(conn, msg); |