Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Bluetoothデバイスの切断が発生した直後(最大1秒)に、通常は「デバイスが遠すぎる」シナリオで、Bluetoothデバイスの切断を検出する方法を探しています。現在、BroadcastReceiverを取得することで検出できますが、起動にBluetoothDevice.ACTION_ACL_DISCONNECTEDは約20秒かかります...自分でタイムアウトを設定する方が速いでしょうが、より低いレベルでそれを行う方法があるはずです。
BroadcastReceiver
BluetoothDevice.ACTION_ACL_DISCONNECTED
より高いレベルでやってみませんか?Bluetoothのタイムアウトにはしばらく時間がかかります。これはRFテクノロジーに固有のものです。
1秒に1回メッセージを送信するのはどうですか?返信がない場合->切断