views:

87

answers:

1

Here is a typical sequence of events that occur :

  1. Host device opens a service ( Host device accepts and opens all incoming connections)
  2. A remote device connects to host device.
  3. Now, we have a slave connection open at host device.

At host device, I want to know the bluetooth address of remote device.
I can always pass it as data from remote to host device, but can I extract it from connection object somehow without any data transfer?

Thanks in advance...

+3  A: 

i think this will help you

// retrieve the device that is at the other end of
// the Bluetooth Serial Port Profile connection,
// L2CAP connection, or OBEX over RFCOMM connection
RemoteDevice remote = 
    RemoteDevice.getRemoteDevice(
        javax.microedition.io.Connection c);
// retrieve the Bluetooth address of the remote device
String remoteAddress = remote.getBluetoothAddress();
// retrieve the name of the remote Bluetooth device
String remoteName = local.getFriendlyName(true);
Vivart