From: "Collin R. Mulliner" <collin@betaversion.net>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] RFComm dynamic channel allocation
Date: Thu, 8 Jul 2004 15:02:56 +0200 [thread overview]
Message-ID: <20040708150256.242ad7f3@coredump> (raw)
In-Reply-To: <1085138236.2777.10.camel@baroque.rococosoft.com>
Hi,
does the dynamic rfcomm channel allocation work? I'm running 2.6.7-mh1
and I allways get channel 1, which is used (listend and connected) by a
other process. I don't get any error it just binds and listens on
channel 1.
cat /proc/bluetooth/rfcomm/sock
/* created thru: rfcomm listen /dev/rfcomm0 1 */
00:00:00:00:00:00 00:00:00:00:00:00 4 1
00:00:00:00:00:00 00:00:00:00:00:00 2 0
/* created thru: running my server */
xx:xx:xx:xx:xx:xx 00:00:00:00:00:00 4 1
my code:
server_sa.rc_family = AF_BLUETOOTH;
server_sa.rc_channel = channel;
server_sa.rc_bdaddr = self.addr;
if (bind(server, (struct sockaddr*) &server_sa, sizeof(server_sa)) < 0){
return(-1);
}
if (listen(server, 1) < 0) {
return(-1);
}
if (channel == 0) {
remote_len = sizeof(struct sockaddr_rc);
memset(&remote_sa, 0, sizeof(struct sockaddr_rc));
if (getsockname(server, (struct sockaddr*) &remote_sa, &remote_len) <
0) {
return(-1);
}
channel = remote_sa.rc_channel;
printf("bt_server(): channel %d\n", remote_sa.rc_channel); }
thanks ... Collin
--
Collin R. Mulliner <collin@betaversion.net>
BETAVERSiON Systems [www.betaversion.net]
info/pgp: finger collin@betaversion.net
To know recursion, you must first know recursion.
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
prev parent reply other threads:[~2004-07-08 13:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-21 11:17 RFComm dynamic channel allocation Stephen Crane
2004-07-08 13:02 ` Collin R. Mulliner [this message]
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=20040708150256.242ad7f3@coredump \
--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