From: "Collin R. Mulliner" <collin@betaversion.net>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] sdp seq of raw data
Date: Thu, 01 Dec 2005 01:39:38 -0800 [thread overview]
Message-ID: <1133429978.1037.22.camel@panic> (raw)
Hi Marcel and list,
I'm trying (for hours now) to put a raw binary string into a sdp
attribute so that it shows up like this:
---8<----
Data Sequence
Data : 0B 0X 09 06 a1 01 85 01 05 07 19 e0 29 e7 15 00 25 01 75 01
95 08 81 02 75 08 95 01 81 01 75 01 95 05
05 08 19 01 29 05 91 02 75 03 95 01 91 01 75 08 95 06 15 00 26 ff 00 05
------>8------
I have tryed two methods, both failed:
SEQ8 method:
unit8_t h_spec[] = { binary_crap };
uint8_t dtd2 = SDP_UNIT8;
uint8_t dtd_data = SDP_SEQ8;
void *dtds[2];
void *values[2];
// this is a other uint8 value which gets placed correctly
dtds[0] = &dtd2;
values[0] = &h_spec_leng;
for (i = 0; i < sizeof(h_spec); i++) {
h_spec_data_lst[i] = sdp_data_alloc(dtd2, &h_spec[i]);
h_spec_data_dtds[i] = &dtd_data;
}
// sometimes it crashes here...
h_spec_data_list = sdp_seq_alloc(h_spec_data_dtds,
(void**)h_spec_data_lst, sizeof(h_spec));
dtds[1] = &dtd_data;
values[1] = h_spec_data_list;
// sometimes it crashes here
h_spec_lst = sdp_seq_alloc(dtds, values, 2);
sdp_attr_add(sdp_record, SRV_ATTR_1, h_spec_lst);
// and sometimes the attributes added after this one don't get
displayed, and the binary string is only one byte long
TEXT_STR8 method:
works fine but can't use binary, because of strcpy/strlen in sdp part of
libbluetooth
I couldn't find any matching example in all the BlueZ code...
thanks ... Collin
--
Collin R. Mulliner <collin@betaversion.net>
BETAVERSiON Systems [www.betaversion.net]
info/pgp: finger collin@betaversion.net
It's a hardware problem!
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next reply other threads:[~2005-12-01 9:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-01 9:39 Collin R. Mulliner [this message]
2005-12-01 9:55 ` [Bluez-devel] sdp seq of raw data Marcel Holtmann
2005-12-01 10:03 ` Collin R. Mulliner
2005-12-01 10:46 ` Marcel Holtmann
2005-12-01 11:23 ` Collin R. Mulliner
2005-12-01 11:33 ` Marcel Holtmann
2005-12-01 11:50 ` Collin R. Mulliner
2005-12-02 19:42 ` Marcel Holtmann
2005-12-02 19:53 ` Steven Singer
2005-12-02 20:06 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1133429978.1037.22.camel@panic \
--to=collin@betaversion.net \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).