summaryrefslogtreecommitdiffstats
path: root/sdpd
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-08-24 01:21:33 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-08-24 01:21:33 +0000
commiteb4d49890ca8a4d8f567e81fdf82b6903d30f326 (patch)
treee6b410172659468ab6ea07a89e373a24dbb9c55f /sdpd
parent853c689f23985da36de72d8c4be33f64fc00496d (diff)
Move the extended inquiry response creation into the SDP code
Diffstat (limited to 'sdpd')
-rw-r--r--sdpd/sdpd.h1
-rw-r--r--sdpd/service.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/sdpd/sdpd.h b/sdpd/sdpd.h
index ad7a2d4f..0a2bccf4 100644
--- a/sdpd/sdpd.h
+++ b/sdpd/sdpd.h
@@ -91,3 +91,4 @@ typedef void (*service_classes_callback_t) (const bdaddr_t *bdaddr, uint8_t valu
uint8_t get_service_classes(const bdaddr_t *bdaddr);
void set_service_classes_callback(service_classes_callback_t callback);
+void create_ext_inquiry_response(const char *name, uint8_t *data);
diff --git a/sdpd/service.c b/sdpd/service.c
index 7f8296f4..bbc7fcc8 100644
--- a/sdpd/service.c
+++ b/sdpd/service.c
@@ -139,6 +139,23 @@ void set_service_classes_callback(service_classes_callback_t callback)
service_classes_callback = callback;
}
+void create_ext_inquiry_response(const char *name, uint8_t *data)
+{
+ if (name) {
+ int len = strlen(name);
+
+ if (len > 48) {
+ len = 48;
+ data[1] = 0x08;
+ } else
+ data[1] = 0x09;
+
+ data[0] = len + 1;
+
+ memcpy(data + 2, name, len);
+ }
+}
+
void register_public_browse_group(void)
{
sdp_list_t *browselist;