You Are Here:

Community: Developer Discussion Boards

#1 Old 7610 serial port connection error EOFException - 2004-07-08, 10:32

Join Date: Jul 2004
Posts: 2
aae2kmitl
Offline
Registered User
i write program bluetooth use serial port connection (inputstream outputstream). i test with 6600 and 6230 it's work. but i test with 7610 it's not work.

server client
1. waiting for client
2. client connect to server
3. server accept and
open Data In/out stream
4. waiting data ( in.readUTF() )
5. open Data In/out stream
6. client writeUTF data1
7. waiting data ( in.readUTF() )
8. server receive data1
9. server writeUTF data2
10. waiting data (in.readUTF() )
11. client receive data2
12. client writeUTF data3
13. waiting data ( in.readUTF() )
14. server receive data3
15. server writeUTF data4
16. waiting data (in.readUTF() )
17. IOException - detail is
EOFException


client will receive data one time only. i don't understand.
after writeUTF i use out.flush(); but it still not work.

who khow this problem help me, please. Thank you very much
Reply With Quote

#2 Old 2004-07-15, 12:35

Join Date: Mar 2003
Posts: 1,200
seppo_fn's Avatar
seppo_fn
Offline
Forum Nokia Expert
What is the use case? Are you having a connection between two phones or between a phone and a PC?

Seppo
Forum Nokia
Reply With Quote

#3 Old 2004-08-18, 11:40

Join Date: Mar 2003
Posts: 2
mini-hopp
Offline
Registered User
Hello!

I have a similar problem.

I'm using a 7610 to connect to my PC (using Hyperterminal on the PC side). I'm able to make inquiries and connect to the serial port service but I get some strange errors during the communication.

The application work like this:
When I discover the service I get the connection URL
String serialPortUrl= servRecord[0].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);

Then I start a new thread to handle the reading process.
--
int bytesRead = 0;
StreamConnection conn = (StreamConnection)Connector.open(serialPortUrl);

in = conn.openInputStream();
byte[] tmpBuffer = new byte[1024];

while((bytesRead=in.read(tmpBuffer))>=0) {

// process input in buffer

}

MyMidlet.getDisplay().setCurrent(new Alert("Error", "Done. bytesRead="+bytesRead, null, AlertType.ERROR), this);
--
1. When I type characters one by one in hyperterminal the application (in the 7610) works just fine.

2. If I write some data in notepad, copy it to the clipboard and then paste it into hyperterminal I get one of these problems:
Problem 1. Some of the data is processed and then suddenly read() returns EndOfFile and the Alert box appears.
Problem 2. The JVM crashes and I get error codes like these: jes-228-java-comms@143ee9, jes-254-java-comms@143ee9, jes-f8-java-comms@143ee
If I type characters very fast in hyperterminal (instead of paste) I also get this kind of behaivor.

Does anyone have an idea of what is wrong?
Reply With Quote

#4 Old Re: 7610 serial port connection error EOFException - 2006-06-16, 16:10

Join Date: Jun 2006
Posts: 1
mijutu
Offline
Registered User
I've also noticed a bluetooth EOFException problem.

I made a simple C-program on the PC side and a midlet on the phone side.
6600 and 6630 work fine, but 7710, 9500 and 9300 all have the same problem:

InputStream.read() will throw EOFException when it should block.

On the pc, I use
socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
localaddr.rc_family=AF_BLUETOOTH;
localaddr.rc_bdaddr=*BDADDR_ANY;
localaddr.rc_channel=(uint8_t)10;
bind, listen, accept...

On the phone:
connection=Connector.open("btspp://"+macAddr+":10");
inputStream=((InputConnection)connection).openInputStream();
inputStream.read();
Reply With Quote

#5 Old 2008-01-18, 08:55

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
Found this very old thread in the archives, however, perhaps someone finds it with via a search or users have subscribed to it. As the issue presented in this thread sound similar to one of mine, please have a look at my workaround…
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia