private void updateScannerLiveData(final ScanResult result) {
        final ScanRecord scanRecord = result.getScanRecord();
        if (scanRecord != null) {
            if (scanRecord.getBytes() != null) {
                final byte[] beaconData = mMeshManagerApi.getMeshBeaconData(scanRecord.getBytes());
                if (beaconData != null) {
                    mScannerLiveData.deviceDiscovered(result, mMeshManagerApi.getMeshBeacon(beaconData));
                } else {
                    mScannerLiveData.deviceDiscovered(result);
                }
                mScannerStateLiveData.deviceFound();
            }
        }
    }
Broadcast receiver to monitor the changes in the bluetooth adapter
app/src/main/java/no/nordicsemi/android/nrfmesh/viewmodels/ScannerRepository.java