bitQuit_Android/app/src/main/java/com/tonydicola/bletest/app/MainActivity.java
@Override
        public void onLeScan(BluetoothDevice bluetoothDevice, int i, byte[] bytes) {
            // Check if the device has the UART service.
            if (parseUUIDs(bytes).contains(UART_UUID)) {
                // Found a device, stop the scan.
                adapter.stopLeScan(scanCallback);
                // Connect to the device.
                // Control flow will now go to the callback functions when BTLE events occur.
                gatt = bluetoothDevice.connectGatt(getApplicationContext(), false, callback);
            }
        }
// Called when a device is found.
Called when a device is found.
Called when a device is found .
@Override
        public void onLeScan(BluetoothDevice bluetoothDevice, int i, byte[] bytes) {
            if (parseUUIDs(bytes).contains(UART_UUID)) {
                adapter.stopLeScan(scanCallback);
                gatt = bluetoothDevice.connectGatt(getApplicationContext(), false, callback);
            }
        }
@ Override public void onLeScan ( BluetoothDevice bluetoothDevice , int i , byte [ ] bytes ) { if ( parseUUIDs ( bytes ) . contains ( UART_UUID ) ) { adapter . stopLeScan ( scanCallback ) ; gatt = bluetoothDevice . connectGatt ( getApplicationContext ( ) , false , callback ) ; } }
Called when a device is found.
Called when a device is found .
// Check if the device has the UART service. // Found a device, stop the scan. // Connect to the device. // Control flow will now go to the callback functions when BTLE events occur.