ボタンをクリックするだけで、接続されているBluetoothデバイスの現在のRSSI値を取得しようとしています。ただし、常に-32768のみが返されます。何が悪いのかわからない!ただし、初めて接続したときに、正しいRSSIを取得できました。
private Button.OnClickListener buttonRSSIOnClickListener = new Button.OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(BluetoothDevice.ACTION_FOUND);
short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
Toast.makeText(getApplicationContext()," RSSI: " + rssi + "dBm", Toast.LENGTH_SHORT).show();
}};
誰か助けてくれませんか?