Skip to contentSkip to conversation

Problems with InputStream and OutputStream

Bluez-users Johannes Lintner 3 participants 8 messages Aug 30, 2004 – Aug 31, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi Marcel,

ok, no problem.
The way, to start a server on the Handy I already tried, but I didn't had in mind, that this has to be so, but to have a completely new connenction between the devices (or has it to be so?).
The complete protocol is attached to the mail. The accosted lines exists (see attachment - would it be better to see the java-sources?).

On the pc runs a server, that is listening to a connection. A mobile phone searches for the device and the service, tries to connect an sends a 7byte long string ("String!"). This way works without any problems. Immediately after receiving, the server sends an 6byte long string("Handy!") to the phone, using the same connection. But the phone only receives an empty string.

Greetings Johannes

Signature · 2 lines
Supergünstige DSL-Tarife + WLAN-Router für 0,- EUR*
Jetzt zu GMX wechseln und sparen http://www.gmx.net/de/go/dsl
maintainer
#1 lore raw

Hi Johannes,

Quoted 3 lines

The way, to start a server on the Handy I already tried, but I didn't had in mind, that this has to be so, but to have a completely new connenction between the devices (or has it to be so?).

forget about that. I was confused and thought that you wanna connect from the PC to your phone,

Quoted 2 lines

The complete protocol is attached to the mail. The accosted lines exists (see attachment - would it be better to see the java-sources?).

If you put it into a tar then name it this way ;)

Quoted 6 lines

On the pc runs a server, that is listening to a connection. A mobile phone searches for the device and the service, tries to connect an sends a 7byte long string ("String!"). This way works without any problems. Immediately after receiving, the server sends an 6byte long string("Handy!") to the phone, using the same connection. But the phone only receives an empty string.

The string "Handy!" goes over the connection and right after that the Linux side closes the connection. Maybe that is the problem or it is the credit based flow control on the phone. I don't see any CFC problem, but I also didn't wrote the Bluetooth stack on the phone. I think it is a good idea to add a sleep(1) before you close the connection.

Some other information might be handy. What kernel do you use and what do you use as server on the Linux side? What kind of phone is this?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

author
#2 lore raw

Hi,

the relevant parts of the sources are attached (the important parts are the BTMidServ.java and the method doConnect() in BTServiceSearchUI.java). I hope the comments and Info-Messages will be enough declarations.

I use Debian Linux with a 2.6.7 Kernel and KDE version 3.2.3.
The phone is a Siemens SX1 with firmwareversion 10. It uses a Symbian OS Serie 60. The USB-dongle is from Acer and should be supported from BlueZ.

Greeting Johannes

Quoted 50 lines · Marcel Holtmann

Hi Johannes,

Quoted 5 lines

The way, to start a server on the Handy I already tried, but I didn't had in mind, that this has to be so, but to have a completely new connenction between the devices (or has it to be so?).

forget about that. I was confused and thought that you wanna connect from the PC to your phone,

Quoted 4 lines

The complete protocol is attached to the mail. The accosted lines exists (see attachment - would it be better to see the java-sources?).

If you put it into a tar then name it this way ;)

Quoted 8 lines

On the pc runs a server, that is listening to a connection. A mobile phone searches for the device and the service, tries to connect an sends a 7byte long string ("String!"). This way works without any problems. Immediately after receiving, the server sends an 6byte long string("Handy!") to the phone, using the same connection. But the phone only receives an empty string.

The string "Handy!" goes over the connection and right after that the Linux side closes the connection. Maybe that is the problem or it is the credit based flow control on the phone. I don't see any CFC problem, but I also didn't wrote the Bluetooth stack on the phone. I think it is a good idea to add a sleep(1) before you close the connection.

Some other information might be handy. What kernel do you use and what do you use as server on the Linux side? What kind of phone is this?

Regards

Marcel

maintainer
#3 lore raw

Hi Johannes,

Quoted 8 lines

the relevant parts of the sources are attached (the important parts are the BTMidServ.java and the method doConnect() in BTServiceSearchUI.java). I hope the comments and Info-Messages will be enough declarations.

I use Debian Linux with a 2.6.7 Kernel and KDE version 3.2.3. The phone is a Siemens SX1 with firmwareversion 10. It uses a Symbian OS Serie 60.
The USB-dongle is from Acer and should be supported from BlueZ.

and what do you use on the Linux side? Please run a "hcitool info ..." as root for me.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#4 lore raw

Hi,

the BTMidServ runs on the Linux side as the server.

hcitool info throws an error, although my server is running.

   gotland:~# hcitool info 00027280B16F
   Requesting information ...
   Can't create connection: Input/output error

or

   gotland:~# hcitool info 00:02:72:80:B1:6F
   Device is not available or not connected.

the hci-interface is running

   gotland:~# hciconfig hci0
   hci0:   Type: USB
       BD Address: 00:02:72:80:B1:6F ACL MTU: 192:8  SCO MTU: 64:8
       UP RUNNING PSCAN ISCAN
       RX bytes:126 acl:0 sco:0 events:16 errors:0
       TX bytes:316 acl:0 sco:0 commands:14 errors:0

bye John

Quoted 22 lines · Marcel Holtmann

Hi Johannes,

Quoted 8 lines

the relevant parts of the sources are attached (the important parts are the BTMidServ.java and the method doConnect() in BTServiceSearchUI.java). I hope the comments and Info-Messages will be enough declarations.

I use Debian Linux with a 2.6.7 Kernel and KDE version 3.2.3.
The phone is a Siemens SX1 with firmwareversion 10. It uses a Symbian OS Serie 60. The USB-dongle is from Acer and should be supported from BlueZ.

and what do you use on the Linux side? Please run a "hcitool info ..." as root for me.

Regards

Marcel

maintainer
#5 lore raw

Hi Johannes,

Quoted 1 line

the BTMidServ runs on the Linux side as the server.

I thought you use some C code for the server. I am not a Java expert and actually I don't have fun reading Java source code.

Quoted 2 lines
    gotland:~# hcitool info 00:02:72:80:B1:6F
    Device is not available or not connected.

You must fill in the BD_ADDR of your phone.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#6 lore raw

HI,

Quoted 13 lines · Marcel Holtmann

Hi Johannes,

Quoted 3 lines

the BTMidServ runs on the Linux side as the server.

I thought you use some C code for the server. I am not a Java expert and actually I don't have fun reading Java source code.

Quoted 8 lines
Quoted 4 lines
   gotland:~# hcitool info 00:02:72:80:B1:6F
   Device is not available or not connected.

You must fill in the BD_ADDR of your phone.

thx, sure, the manual says remote device. my fault:

   gotland:~# hcitool info 00:01:E3:29:38:D8
   Requesting information ...
       BD Address:  00:01:E3:29:38:D8
       Device Name: Siemens SX1
       LMP Version: 1.1 (0x1) LMP Subversion: 0x55b
       Manufacturer: Infineon Technologies AG (9)
       Features: 0xef 0xfa 0x19 0x00 0x00 0x00 0x00 0x00
               <3-slot packets> <5-slot packets> <encryption> <slot offset>
               <role switch> <hold mode> <sniff mode> <RSSI> <SCO link>
               <HV2 packets> <HV3 packets> <u-law log> <A-law log> <CVSD>
               <transparent SCO>
Quoted 4 lines

Regards

Marcel

I have got an success. I let sleep() the connection for 2.5seconds, and I got nearly the complete string, only the last character was empty. I will try to hold the connection a little longer open. Then I will tell you.

THX John!

#7 lore raw
In reply to Marcel Holtmann
Quoted 18 lines · Marcel Holtmann

Hi Johannes,

Quoted 3 lines

the BTMidServ runs on the Linux side as the server.

I thought you use some C code for the server. I am not a Java expert and actually I don't have fun reading Java source code.

Quoted 4 lines
   gotland:~# hcitool info 00:02:72:80:B1:6F
   Device is not available or not connected.
Quoted 6 lines

You must fill in the BD_ADDR of your phone.

Regards

Marcel

Hi,

for 1500ms, the string arrives correct the phone, but the sign for a received emptystring (an 'y' with 2 dots on it, I will write it 'y:') is added to the end. The String I receive is: 'Handy!y:'
Do you have any ideas?

Greets John