Android BLE, scan started, finds devices but does not connect with filter (ESP32 & Samsung)

For example you can do something like this in your onBatchScanResults()

@Override
        public void onBatchScanResults(List<ScanResult> results)
        {
            for (ScanResult result: results) {

                BluetoothDevice myDevice = result.getDevice();

                Log.i("Debug", "onBatchScanResults: " + myDevice.getName());

                if(myDevice.getName().equals("ESP32 UART Test")){
                    BluetoothGatt bluetoothGatt =  myDevice.connectGatt(getApplicationContext(), true, mGattCallback, BluetoothDevice.TRANSPORT_LE);
                }
            }
        }

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top