All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] bluetooth socket + rfcomm tty
@ 2005-01-24 21:13 Victor Shcherbatyuk
  2005-01-24 21:24 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Victor Shcherbatyuk @ 2005-01-24 21:13 UTC (permalink / raw)
  To: bluez-devel

Dear All,
 
Could not find it through the archives... 
I create a bluetooth socket and then create TTY (/dev/rfcomm0) based on it (like it is done in dund from bluez-utils). 
Is it still allowed to use the descriptor of the open socket to send/receive data through the channel? 
Cause when I send data to the _socket_ it looks like it is sent (like 
ATD1234 command to the phone, I see the phone starting to dial, though it 
stops half way for no reason), but when I'm trying to read from the socket 
select() returns that there is data to be read, but then read() blocks.

Thanks.

Kind regards,
       Victor.

P.S. Is there any way to check if read() is non-blocking (like ioctl() 
FIONREAD)?



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] bluetooth socket + rfcomm tty
  2005-01-24 21:13 Victor Shcherbatyuk
@ 2005-01-24 21:24 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-01-24 21:24 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Victor,

> Could not find it through the archives... 
> I create a bluetooth socket and then create TTY (/dev/rfcomm0) based on it (like it is done in dund from bluez-utils). 
> Is it still allowed to use the descriptor of the open socket to send/receive data through the channel? 
> Cause when I send data to the _socket_ it looks like it is sent (like 
> ATD1234 command to the phone, I see the phone starting to dial, though it 
> stops half way for no reason), but when I'm trying to read from the socket 
> select() returns that there is data to be read, but then read() blocks.

this is maybe possible, but it is not intended. When you converted a
socket into a TTY the socket should be closed. Otherwise we must
duplicate the incoming data and if one party is not reading the flow
control will be brocken and both parties are blocked.

> P.S. Is there any way to check if read() is non-blocking (like ioctl() 
> FIONREAD)?

Check the fcntl() manpage.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Bluez-devel] bluetooth socket + rfcomm tty
@ 2005-01-26 11:00 Victor Shcherbatyuk
  2005-01-26 17:34 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Victor Shcherbatyuk @ 2005-01-26 11:00 UTC (permalink / raw)
  To: bluez-devel

Hello Marcel,

Now I close the socket after converting to TTY. After this I open
"/dev/rfcomm0" with O_RDWR | O_NOCTTY and write ATD12345\n\r command to
it, then read the response (receive echo), and sleep, meanwhile phone
starts to dial the number, but then stops for no reason. If I do the
same with original (non-converted) socket (skipping converting to TTY),
everything is OK.

I've taken a look at hcidump output and it looks rather strange if I
compare it for both cases. In the case of file handle to converted TTY
all the data looks fragmented between ACL packets (like ATD1234 is not
sent in one packet, like in the case of non-converted socket, but piece
by piece in a number of packets) + there is a lot of activity from the
phone during the sleep phase when I do not do anything with the file
handle.

Regards,
    Victor.

P.S. I can send the output, but first check if it is really needed.
P.S.S running 2.6.10

-----Original Message-----
From: bluez-devel-admin@lists.sourceforge.net
[mailto:bluez-devel-admin@lists.sourceforge.net] On Behalf Of Marcel
Holtmann
Sent: Monday, January 24, 2005 10:25 PM
To: BlueZ Mailing List
Subject: Re: [Bluez-devel] bluetooth socket + rfcomm tty

Hi Victor,

> Could not find it through the archives...=20
> I create a bluetooth socket and then create TTY (/dev/rfcomm0) based
on it (like it is done in dund from bluez-utils).=20
> Is it still allowed to use the descriptor of the open socket to
send/receive data through the channel?=20
> Cause when I send data to the _socket_ it looks like it is sent (like=20
> ATD1234 command to the phone, I see the phone starting to dial, though
it=20
> stops half way for no reason), but when I'm trying to read from the
socket=20
> select() returns that there is data to be read, but then read()
blocks.

this is maybe possible, but it is not intended. When you converted a
socket into a TTY the socket should be closed. Otherwise we must
duplicate the incoming data and if one party is not reading the flow
control will be brocken and both parties are blocked.

> P.S. Is there any way to check if read() is non-blocking (like ioctl()

> FIONREAD)?

Check the fcntl() manpage.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Address change | On the 31st of January 2005 TomTom will be moving to | =
Rembrandtplein 35 | 1017 CT Amsterdam | The Netherlands | T + 31 =
(0)20-8500 800 | F + 31 (0)20-8501 099



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Bluez-devel] bluetooth socket + rfcomm tty
  2005-01-26 11:00 [Bluez-devel] bluetooth socket + rfcomm tty Victor Shcherbatyuk
@ 2005-01-26 17:34 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-01-26 17:34 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Victor,

> Now I close the socket after converting to TTY. After this I open
> "/dev/rfcomm0" with O_RDWR | O_NOCTTY and write ATD12345\n\r command to
> it, then read the response (receive echo), and sleep, meanwhile phone
> starts to dial the number, but then stops for no reason. If I do the
> same with original (non-converted) socket (skipping converting to TTY),
> everything is OK.

if the socket way works, why don't you use it?

> I've taken a look at hcidump output and it looks rather strange if I
> compare it for both cases. In the case of file handle to converted TTY
> all the data looks fragmented between ACL packets (like ATD1234 is not
> sent in one packet, like in the case of non-converted socket, but piece
> by piece in a number of packets) + there is a lot of activity from the
> phone during the sleep phase when I do not do anything with the file
> handle.

What kind of phone is this?

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] bluetooth socket + rfcomm tty
@ 2005-01-29 17:03 Victor Shcherbatyuk
  2005-01-29 17:26 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Victor Shcherbatyuk @ 2005-01-29 17:03 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

I use TTY because I want to provide AT command communication and PPP over 
the same channel, in my case I send a number of AT commands, then start 
pppd over the channel (converted to TTY) and then, after it is finished, I 
want to send AT commands again. I want to do this all without reopening 
bluetooth connection with the phone, which is being closed when pppd 
finishes on TTY. I also can open a TTY from my application, so pppd can 
not close the connection on exit (cause there are still open descriptors) 
- but 
sending commands through an open TTY works strange to me... 

The phone is SonyEr T630, and so far is the most stable phone regarding communication using Bluez stack (Nokias, Siemens - hang or crash 
now and then).

Regards,
    Victor.

----- Original Message ----- 
From: "Marcel Holtmann" <marcel@holtmann.org>
To: "BlueZ Mailing List" <bluez-devel@lists.sourceforge.net>
Sent: Wednesday, January 26, 2005 18:34
Subject: RE: [Bluez-devel] bluetooth socket + rfcomm tty


> Hi Victor,
> 
>> Now I close the socket after converting to TTY. After this I open
>> "/dev/rfcomm0" with O_RDWR | O_NOCTTY and write ATD12345\n\r command to
>> it, then read the response (receive echo), and sleep, meanwhile phone
>> starts to dial the number, but then stops for no reason. If I do the
>> same with original (non-converted) socket (skipping converting to TTY),
>> everything is OK.
> 
> if the socket way works, why don't you use it?
> 
>> I've taken a look at hcidump output and it looks rather strange if I
>> compare it for both cases. In the case of file handle to converted TTY
>> all the data looks fragmented between ACL packets (like ATD1234 is not
>> sent in one packet, like in the case of non-converted socket, but piece
>> by piece in a number of packets) + there is a lot of activity from the
>> phone during the sleep phase when I do not do anything with the file
>> handle.
> 
> What kind of phone is this?
> 
> Regards
> 
> Marcel
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

-- 




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] bluetooth socket + rfcomm tty
  2005-01-29 17:03 Victor Shcherbatyuk
@ 2005-01-29 17:26 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-01-29 17:26 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Victor,

> I use TTY because I want to provide AT command communication and PPP over 
> the same channel, in my case I send a number of AT commands, then start 
> pppd over the channel (converted to TTY) and then, after it is finished, I 
> want to send AT commands again. I want to do this all without reopening 
> bluetooth connection with the phone, which is being closed when pppd 
> finishes on TTY. I also can open a TTY from my application, so pppd can 
> not close the connection on exit (cause there are still open descriptors) 
> - but 
> sending commands through an open TTY works strange to me... 

check if your TTY is set to raw mode and actually you should look at
dund, because this provides most of this functionality. And using pppd
you can also define post-connection scripts.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-29 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-26 11:00 [Bluez-devel] bluetooth socket + rfcomm tty Victor Shcherbatyuk
2005-01-26 17:34 ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2005-01-29 17:03 Victor Shcherbatyuk
2005-01-29 17:26 ` Marcel Holtmann
2005-01-24 21:13 Victor Shcherbatyuk
2005-01-24 21:24 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.