Android Bluetooth Low Energy readRemoteRssi

Nie wiem, jak uzyskać wywołanie zwrotne „onReadRemoteRssi”.

Mój kod jest bardzo prosty:

final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
    BluetoothAdapter mBluetoothAdapter = bluetoothManager.getAdapter();
    BluetoothGatt gatt;

    mBluetoothAdapter.startLeScan(new LeScanCallback() {

        @Override
        public void onLeScan(BluetoothDevice device, int rssi, byte[] record) {
            gatt = device.connectGatt(getApplicationContext(), false, new BluetoothGattCallback() {
                @Override
                public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
                    super.onReadRemoteRssi(gatt, rssi, status);
                    Log.d(TAG, "rssi is : " + rssi);
                }
            });
        }
    });

    gatt.readRemoteRssi(); //returns true

Wywołanie zwrotne nigdy nie jest wywoływane. Czy ktokolwiek ma jakiś pomysł ?

Dzięki !

questionAnswers(3)

yourAnswerToTheQuestion