07-18-2008 06:31 AM - edited 07-18-2008 06:33 AM
I would like to get the BT address from the device (client), which is currently connected to my applet on BlackBerry Phone (server). Is it possible to get it?
I use JDE 4.3.0.
I register SPP Server
//Open a port to listen for incoming connections.
_port = new BluetoothSerialPort("My spp connection", BluetoothSerialPort.BAUD_115200, BluetoothSerialPort.DATA_FORMAT_PARITY_NONE | BluetoothSerialPort.DATA_FORMAT_STOP_BITS_1 | BluetoothSerialPort.DATA_FORMAT_DATA_BITS_8, BluetoothSerialPort.FLOW_CONTROL_NONE, 1024, 1024, this);
_deviceName = "unknown";
I established the BT connection from the PC to the registered port "My spp connecion".
Then I try to get the BT address in this way:
BluetoothSerialPortInfo info = _port.getSerialPortInfo();
System.out.println("Connected to device " + info.getDeviceName() + info.getDeviceAddress());
when I like to print the result I have ArrayIndexOutBoundsException
On a pop up debug I see correct _port._remoteAddress from the BT client, but I don't know how to get the access to this method.
Does anybody has expiernce in that case?
Thank you in advance
Solved! Go to Solution.
07-18-2008 09:53 AM
I'm using Bluetooth sample code.
Is it possible to get access to the BT address from this sample code using javax.bluetooth.RemoteDevice library or I have to rewrite all code using only javax.bluetooth.* library to implement spp connection and then I'll get access to the BT address?
Could you provide some example code?
07-18-2008 10:01 AM
07-29-2008 05:15 AM
I've implemented that and works fine. In next step I would like to get the device which is currently connect.
Retrieving all CACHED devices or PREKNOWN - I don't know which BT link is active now.
Is it possible to find out, by checking flags or other way - which device is currently connected to the handheld (Bluetooth link is active to a device)?
07-30-2008 04:59 AM
Is it possible to get an information, which devices are currently connect by Bluetooth to Handheld (Bluetooth link is active)?
In the Handheld in Set up Bluetooth menu - this information is show by bold device name. Is it possible somehow to get this information by applet, which devices from the paired device list are currently connect?
Do you have any ideas?
Thank you for your response