Hi, check here line number 168 will return a beacon if it's advertised and returns an UnprovisionedBeacon. However is there a reason for not using the Mesh Provisioning Service to filter unprovisioned devices?
private void updateScannerLiveData(final ScanResult result) { Log.d("glamo-log", "ScannerRepository.updateScannerLiveData() -- start!"); Log.d("glamo-log", "result is " + result.toString()); final ScanRecord scanRecord = result.getScanRecord(); if (scanRecord != null) { Log.d("glamo-log", "scanRecord is " + scanRecord.toString()); if (scanRecord.getBytes() != null) { Log.d("glamo-log", "scanRecord.getBytes() is " + scanRecord.getBytes().toString()); final byte[] beaconData = mMeshManagerApi.getMeshBeaconData(scanRecord.getBytes()); if (beaconData != null) { Log.d("glamo-log", "ScannerRepository.updateScannerLiveData() -- with beacon data!"); Log.d("glamo-log", "beaconData is " + beaconData.toString()); mScannerLiveData.deviceDiscovered(result, mMeshManagerApi.getMeshBeacon(beaconData)); } else { Log.d("glamo-log", "ScannerRepository.updateScannerLiveData() -- without beacon data!"); mScannerLiveData.deviceDiscovered(result); } Log.d("glamo-log", "ScannerRepository.updateScannerLiveData() -- device found!"); mScannerStateLiveData.deviceFound(); } } Log.d("glamo-log", "ScannerRepository.updateScannerLiveData() -- leave!"); }
I would recommend using the Mesh Provisioning Service to filter the device because this is the simplest approach as the scanner will handle the filtering for you and this is how we have implemented the sample app as well. I will have to take a look at the UnprovisionedBeacon but i am busy with some other tasks right now.
Thank you for the advice. I will learn about the Mesh Provisioning Service.
Here is the screen shot of unprovisioned device beacon captured with nRF Sniffer, just in case you need it.
Thank you for the advice. I will learn about the Mesh Provisioning Service.
Here is the screen shot of unprovisioned device beacon captured with nRF Sniffer, just in case you need it.