Read error from /dev/rfcomm0

ramkumar gollamudi <[email protected]>
Newsgroups gmane.linux.bluez.user
Message-ID <[email protected]>
Hello,
I have a problem reading from the file /dev/rfcomm0 after the tty was created when a remote device connected to my linux PC which was executing the rfcomm listen command. 

rfcomm listen 0 1 testreadapp {}

When the remote device connected to this local device my test application "testreadapp" was launched by the rfcomm utility. In this testreadapp application I open the /dev/rfcomm0 file and attempt to do a file read. It consistently failed and the read() returned 0 bytes. 

On the contrary if I launched testwriteapp after the rfcomm listen command, the testwriteapp not only successfully opened the /dev/rfcomm0 file but also wrote into the file successful. The data then got transmitted across the bluetooth link and were received successfully by the remote device.

I have two questions....

1) How do I got my testreadapp to successfully read from the /dev/rfcomm0 file?
2) Both testreadapp and testwriteapp are currently implemented in C. Are there any issues if I implement them in Java? I understand that execvp does not pass the "{}" argument to java applications. Are there ways to get around the issue?

I will be greatly appreciative if somebody can please help me address this issues. Thanks very much.

-Cheers,
Ram

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.