Bluetooth

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
I am trying to connect a device which has a bluetooth port. With Windows, the device is paired and fairly exchanges data with the computer. I have now a Samsung Galaxy Tab 2 7.0, with Android 4.04 to connect to the device and do the same job. I downloaded the serial example, and tried to send a command, in same way I did for Windows. I run the serialexample, press "connect" and appears the dialog to input the "pairing code". After inserting the code, I obtain Java.ioException:ConnectionRefused. It seems that the other device doesn't accept the connection, despite the code is of course correct.. (moreover it is the simple 0000, and difficult to wrongly write it)..Also, pairing the device in the Bluetooth section of Settings of the Galaxy Tablet, is successfull (apparently.. i.e. gives no error).
Any suggestions?? Thanks in advance.
 

Beja

Expert
Licensed User
Longtime User
Hi,
Try 1234 for the key.. if didn't work then connect the bluetooth module directly to a pc by serial port, and use AT commands to set the key to either 0000 or 1234 (or any other number). I think this should work.
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi guys
thanks for you answers. I tried another code, without results. The "0000" is factory set so it seems no way to change it.
About ConnectInsecure I have to understand the parameters to supply, other than MacAddress. It could help me to have some indications on what to insert for BluetoothAdmin and Port values that are requested.
Thanks a lot
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Works

Hi
great suggestion, kitcarlson. It works now. Actually I used 1 for the port and BluetoothAdmin object and I got it working. Great. Thanks a lot for your help.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi Beja, sorry for late reply. The device I am dealing with, is a Topographic total station, a fairly uncommon case. I asked to the instrument dealers about the pairing code, and their answer was that I previously reported. The job to be carried out is a measure campaign and I guess not big security issues. Anyway I will try to understand more. Thanks a lot for your advices.
 
Upvote 0
Top