1

発生するイベントの典型的なシーケンスは次のとおりです。

  1. ホストデバイスはサービスを開きます(ホストデバイスはすべての着信接続を受け入れて開きます)
  2. リモートデバイスがホストデバイスに接続します。
  3. これで、ホストデバイスでスレーブ接続が開かれました。

ホストデバイスで、リモートデバイスのBluetoothアドレスを知りたい。
リモートからホストデバイスにいつでもデータとして渡すことができますが、データ転送なしで接続オブジェクトから何らかの方法で抽出できますか?

前もって感謝します...

4

1 に答える 1

3

私はこれがあなたを助けると思います

// 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);
于 2010-03-29T05:15:10.250 に答える