diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-06-09 17:01:55 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-06-09 17:01:55 +0000 |
commit | 3d3cdef8da6b3e1b14c3cdccda8c099cbad4f3ae (patch) | |
tree | 439996832d60de76a3c1204a65b836f7aab671ac /hcid | |
parent | d481a1e8d98363d244ff7e75912a4606e887d853 (diff) |
Append full record to discover service results
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-sdp.c | 2 | ||||
-rw-r--r-- | hcid/dbus-sdp.h | 2 | ||||
-rw-r--r-- | hcid/device.c | 16 |
3 files changed, 16 insertions, 4 deletions
diff --git a/hcid/dbus-sdp.c b/hcid/dbus-sdp.c index 4bf5b6f0..e9f130f8 100644 --- a/hcid/dbus-sdp.c +++ b/hcid/dbus-sdp.c @@ -245,7 +245,7 @@ static sdp_session_t *get_sdp_session(bdaddr_t *src, bdaddr_t *dst) return session; } -static void append_and_grow_string(void *data, const char *str) +void append_and_grow_string(void *data, const char *str) { sdp_buf_t *buff = data; int len; diff --git a/hcid/dbus-sdp.h b/hcid/dbus-sdp.h index 2a49db41..dd7bd1c8 100644 --- a/hcid/dbus-sdp.h +++ b/hcid/dbus-sdp.h @@ -40,3 +40,5 @@ DBusMessage *finish_remote_svc_transact(DBusConnection *conn, DBusMessage *msg, void *data); uint16_t sdp_str2svclass(const char *str); + +void append_and_grow_string(void *data, const char *str); diff --git a/hcid/device.c b/hcid/device.c index 57986f88..9dc7f4e9 100644 --- a/hcid/device.c +++ b/hcid/device.c @@ -61,6 +61,8 @@ #include "error.h" #include "glib-helper.h" #include "agent.h" +#include "dbus-sdp.h" +#include "sdp-xml.h" #define MAX_DEVICES 16 @@ -1266,13 +1268,21 @@ proceed: for (seq = recs; seq; seq = next) { sdp_record_t *rec = (sdp_record_t *) seq->data; - const char *val = ""; + sdp_buf_t result; if (!rec) break; - /* FIXME add the real record string */ - iter_append_record(&dict, rec->handle, val); + memset(&result, 0, sizeof(sdp_buf_t)); + + convert_sdp_record_to_xml(rec, &result, + append_and_grow_string); + + if (result.data) { + const char *val = result.data; + iter_append_record(&dict, rec->handle, val); + free(result.data); + } next = seq->next; } |