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?
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.
Hi, thanks for the detailed explanation. So I think you have misunderstood me here. You don't need to connect to a device to filter it. You can filter the unprovisioned devices based on the service the device is advertising with. Once you provision the device it will start advertising with a Mesh Proxy Service with which you can filter provisioned devices from unprovisioned devices. If you refer to our sample we use the mesh provisioning service to filter the unprovisioning service to filter the unprovisioned mesh devices and also Mesh Proxy Service to filter the provisioned mesh devices. You don't need to use the beacons here at all in my opinion. Please check here this should let you understand what's happenning. We set the Mesh Provisioning Service UUID and this filters out and returns only the unprovisioned mesh devices allowing you to connect and provision them etc.