robertoprato / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

IOException on BlueSoleil #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the 
problem?
 Opening a SSP connection on 
BlueCove 2.0.1 or 2.0.2 (on 
2.0.0 problem doesn't appear), 
and sending data to midlet:

    mStreamConnectionNotifier = 
(StreamConnectionNotifier)Connector.open("btspp:/
/11(...)111;name=name");
    mStreamConnection = 
mStreamConnectionNotifier.acceptAndOpen();
    mOutputStream = 
mStreamConnection.openDataOutputStream();
   (...)
   mOutputStream.write(bytes[])/
mOutputStream.writeInt()

What is the expected output? 
What do you see instead?
I expect stable connection, but 
after sending  some data (it 
could be 20MB or 200kb - totally 
random) i get IOException:
java.io.IOException:
         at 
com.intel.bluetooth.BluetoothStackBlueSoleil.connectionRfWrite(Native 
Method)
         at 
com.intel.bluetooth.BluetoothOutputStream.write(BluetoothOutputStream.java:50)
         at 
java.io.DataOutputStream.writeInt(Unknown 
Source)
         ...

I sent data in a few threads but 
any access to stream is 
synchronized. There is also 
opened input stream.

What version of the product are 
you using? On what operating 
system?
Windows XP Professional SP2,  
BlueSoleil 1.6.1.4 Release 
050606, Stack Version: 
05.04.05.20050408, 
java 1.6.0_03-b05, 
midlet on SE K800i

Please provide any additional 
information below.
On BlueCove 2.0.0 all works fine.
Regards, and btw great job.

Original issue reported on code.google.com by beny.th...@gmail.com on 23 Jan 2008 at 5:04

GoogleCodeExporter commented 8 years ago
Hi Beny
  I need a help here. I made no changed in the code other then error handling for
BlueSoleil interface between this version!!!!
 I tested the last version 2.0.2 and it can send data for as long as 20 minutes that
I tested.

  I used bluecove-tester application on phone SE W810i and on computer.
http://snapshot.bluecove.org/bluecove-examples/bluecove-tester/index.html

  In MIDlet there are data generators created specially to test this situations. 
  To use it you install midlet to the phone and start it as server. (Press 5)
  Then Start client application on the computer (AWT application)
 Press discovery in 20 sec it will find your phone and services
  Look for:  b10c0be1111111111111111111110001 (BlueCoveT RFCOMM long)
 Then In Menu More - > Client Connection
 Select  Service URL from drop down.
 In Data enter: 7, 100, 10, 90
  Near Send select from drop down as parseByte(text)
  Then send Button
  MIDlet will start sending data to computer. And computer will just log it on the
screen.

 Does it work fine for you?

 The command 7, 100, 10, 90  will turn  MIDlet  into traffic generator write
 10 is sleep in microseconds between each array sent; and 90 is size of the array to
send.

-- 
Vlad

Original comment by skarzhev...@gmail.com on 23 Jan 2008 at 10:23

GoogleCodeExporter commented 8 years ago
Minor correction for BlueSoleil before you press discovery
Go to More -> Configuration in filed discoveryUUID enter this value:
b10c0be1111111111111111111110001 

Original comment by skarzhev...@gmail.com on 24 Jan 2008 at 5:55

GoogleCodeExporter commented 8 years ago
Hi,  sorry for my response time;/
I've tested it on bluecove-tester application and there everything works fine.
Only thing I can suppose make difference is that I'm sending quite large byte 
arrays,
about 8 KB at once and i'm doing it almost without any delay (transmission 
speed up 
to 40-50 KB/s - I thing it's close to bluetooth maximum speed in normal 
condition.
Whem I only find time I will preprare very simple midlet-client and server 
application to ilustrate this problem.

Beny

Original comment by beny.th...@gmail.com on 27 Jan 2008 at 5:23

GoogleCodeExporter commented 8 years ago
We had this discussion about MS stack.
The same problem. The native buffer is only 8K and would not accept more.
BlueCove does not buffer any data in java.
You should try to send less than 8K in every call to write function.
This may solve your problem.

Original comment by skarzhev...@gmail.com on 28 Jan 2008 at 4:32

GoogleCodeExporter commented 8 years ago
I've thought about this, so i have tried to divide my data into 2Kb arrays at 
pass 
and after every one  I  flushed the stream,  but  it works exactly the same 
way. 
Only strange thing that on  bluecove-2.0.0  it works fine. I noticed  that dll 
libraries changed betwen newer versions,  mayby any bug in native code?

Original comment by beny.th...@gmail.com on 28 Jan 2008 at 9:09