From: Gareth Bradley <gareth.bradley.nz@gmail.com>
To: bluez-users@lists.sourceforge.net
Subject: Re: [Bluez-users] SCO syncronization taking down USB dongle
Date: Wed, 15 Feb 2006 11:40:57 -1200 [thread overview]
Message-ID: <bd72c4b0602151540g7e85180fw573dbd29062c167f@mail.gmail.com> (raw)
In-Reply-To: <1139992509.26072.16.camel@localhost>
[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]
Thank you for your reply Marcel.
the dongle gets disconnected from the USB bus. What kind of dongle is
> this? Maybe you need to get yourself a better one, because a disconnect
> from the USB is nothing we can really work around.
I am unsure of the dongle's actual manufacturer, as it's just a DSE (our
Radio Shack equivilant) rebrand. I have since tried it with a Stollman
dongle, and am able to get the same result (crash).
I am able to get the USB crash with a test program, pasted below. The 'rlen
-= 1;' line is added to crash it. I am currently unable to test if this will
also crash on other platforms, such as on a PC or PDA. Should this be able
to take down the dongle?
The actual project runs with the number of bytes written to the headset
being regulated by the number read from the headset (though the sound is
from an external source, not straight back into the headset, like in the
example). Is this the correct way to regulate SCO data?
while(1){
FD_ZERO(&rfds);
FD_SET(serial_fd, &rfds);
FD_SET(sd, &rfds);
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
if((sel = select(maxfd + 1, &rfds, NULL, NULL, &timeout)) > 0) {
if(FD_ISSET(serial_fd, &rfds)){
memset(soundbuf, 0, sizeof(soundbuf));
rlen = read(serial_fd, soundbuf, sizeof(soundbuf));
if(rlen > 0){
wlen = write(serial_fd, "\r\nOK\r\n", 4);
}
}
if (FD_ISSET(sd, &rfds)) {
memset(soundbuf, 0, sizeof(soundbuf));
rlen = read(sd, soundbuf, sizeof(soundbuf));
rlen -= 1; // This line is able to enduce the crash
wlen = 0;
p = soundbuf;
while(rlen > sco_mtu){
wlen += write(sd, p, sco_mtu);
rlen -= sco_mtu;
p += sco_mtu;
}
wlen += write(sd, p, rlen);
}
}
}
> I notice that flow (and error) control appear on the Todo list, but is
> > there some way to guard against the whole dongle being taken down?
>
> It only protects the host stack and not the dongle. The flow control
> towards the HCI of the dongle is always used.
Thanks again for your input.
gjb.
[-- Attachment #2: Type: text/html, Size: 5006 bytes --]
prev parent reply other threads:[~2006-02-15 23:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-15 3:48 [Bluez-users] SCO syncronization taking down USB dongle Gareth Bradley
2006-02-15 8:35 ` Marcel Holtmann
2006-02-15 23:40 ` Gareth Bradley [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=bd72c4b0602151540g7e85180fw573dbd29062c167f@mail.gmail.com \
--to=gareth.bradley.nz@gmail.com \
--cc=bluez-users@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