| Reply | « Previous Thread | Next Thread » |
|
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 |
|
What is the use case? Are you having a connection between two phones or between a phone and a PC?
Seppo Forum Nokia |
|
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? |
|
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(); |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|