Я хочу континуульную читать RSSI после GATT является connected.code так:android bluetooth LE - Почему onReadRemoteRssi не работает?
final BluetoothDevice device = mBluetoothAdapter
.getRemoteDevice(address);
if (device == null) {
Log.w(TAG, "Device not found. Unable to connect.");
return false;
}
mBluetoothGatt = device.connectGatt(this, false, mGattCallback);
Log.d(TAG, "Trying to create a new connection.");
boolean readRssiFlag = mBluetoothGatt.readRemoteRssi();
Log.i(TAG,"readRssiFlag: "+readRssiFlag);
mGattCallback так:
private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
....
@Override
public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
Log.i(TAG,"rssi = " + rssi);
}
...
};
и onReadRemoteRssi не работает. скажите мне, как изменить код или другие решения для чтения rssi!
Спасибо за советы!