From: Manuel Naranjo <manuel@aircable.net>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Rfcomm is not buffering received data?
Date: Mon, 26 Nov 2007 09:45:08 -0300 [thread overview]
Message-ID: <474ABFD4.3070906@aircable.net> (raw)
In-Reply-To: <474594B7.2070005@aircable.net>
Hello everyone,
I think this mail might got lost between all the spam we are getting
those days.
I'm starting to think that some how select() is not working for tty
devices. I had switched the tty device to raw mode (by using termios
calls). And still even though there's data on the tty buffer select
keeps returning 0. So far I'm using select as an sleep function, but
that's not it's purpose, not at all. Maybe I keep missing something?
BTW how's the state for server side rfcomm services? I mean you register
a service at a certain port via dbus, and you get locked (or you get a
function callback I don't know) when a connection was established and
you get the tty device name.
Thanks,
Manuel
> Hello guys,
>
> I've been able to fix this, by switching the tty node to raw mode. But
> still something is not working well, select returns 0 even though
> there's data in the buffer.
>
> Here's the fix if anyone wants to know:
> int fd = fileno(data->fd);
>
> struct termios tio;
>
> tcgetattr(fd, &tio);
>
> tcflush(fd, TCIOFLUSH);
>
> tio.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
> tio.c_iflag &= ~(BRKINT | ICRNL | ISTRIP | IXON);
> tio.c_cflag &= ~(CSIZE | PARENB);
> tio.c_cflag |= CS8;
> tio.c_oflag &= ~(OPOST);
>
> cfmakeraw(&tio);
>
> tio.c_cc[VMIN] = 0;
> tio.c_cc[VTIME] = 0;
>
> I think we should add a comment about this in the wiki, what do you think?
>
> Cheers,
> Manuel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
prev parent reply other threads:[~2007-11-26 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 12:30 [Bluez-devel] Rfcomm is not buffering received data? Manuel Naranjo
2007-11-22 14:39 ` Manuel Naranjo
2007-11-26 12:45 ` Manuel Naranjo [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=474ABFD4.3070906@aircable.net \
--to=manuel@aircable.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