This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

can not scan device

Hi, I'm using nRF52832 with sdk 13.1.0(softdevice 4.0.2). I had trouble to scan nRF52832 in android smart device.When i disconnect the device a long time when the status is lock screen,then the android device can not find the device(NRF52832).It also cannot find the other device.But I use the other android device to scan device is ok.Then i open the screen,everything will be ok.But i want to scan it when the status is lock screen.What should i do?

Parents
  • _

    scannerHuaWei = mBluetoothAdapter.getBluetoothLeScanner();
                callbackHuaWei = new ScanCallback() {
                    @Override
                    public void onScanResult(int callbackType, ScanResult result) {
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                connect(mBluetoothDeviceAddress);
                        }
                        super.onScanResult(callbackType, result);
                    }
    
                    @Override
                    public void onBatchScanResults(List<ScanResult> results) {
                        super.onBatchScanResults(results);
                    }
    
                    @Override
                    public void onScanFailed(int errorCode) {
                        super.onScanFailed(errorCode);
                    }
                };
    
Reply
  • _

    scannerHuaWei = mBluetoothAdapter.getBluetoothLeScanner();
                callbackHuaWei = new ScanCallback() {
                    @Override
                    public void onScanResult(int callbackType, ScanResult result) {
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                connect(mBluetoothDeviceAddress);
                        }
                        super.onScanResult(callbackType, result);
                    }
    
                    @Override
                    public void onBatchScanResults(List<ScanResult> results) {
                        super.onBatchScanResults(results);
                    }
    
                    @Override
                    public void onScanFailed(int errorCode) {
                        super.onScanFailed(errorCode);
                    }
                };
    
Children
No Data
Related