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.
Hi Roshan-san,
Thank you again for your kind reply.
Now I understand what you said. You are trying to explain the way to select provisioned nodes from many devices using service UUID. I know it is not so difficult. Unprovisioned devices have the Mesh Provisioning Service, and provisioned nodes usually have the Mesh Proxy Service. This is what you are explaining, isn't it?
Again, please let me know if I have misunderstood something.
But, unfortunately, it is not what we want to do.
Probably, I wrote something ambiguous or misleading. I am sorry for my poor English or explanation.
Please let me explain what we want to do, using the use case I wrote above.
At the beginning, all devices are unprovisioned.
And, a provisioner needs to find the unprovisioned devices in the same room.
To achieve this, we want to use the URI hash carried on unprovisioned device beacon.
In this case, we assign a URI to the devices and the provisioner in the same room.
(Of course, we use different URIs for different rooms.)
I hope this clarifies what we want to do.
Please ask me anything, if you need.
Also, I found a similar Q&A in DevZone.
Identifying unprovisioned mesh device
In the Q&A, they also use URI to select a particular set of unprovisioned devices.
They use a provisioner on iOS, but the issue is very close to my question.
Please refer the Q&A, if something I wrote is unclear.
Anyway, I investigated the code you mentioned. The ScanFilter uses service UUIDs, device name, device address, and something related to the service. I am afraid I can't use this to achieve what we want to do.
It would be great if someone could tell me how I can read URI hash on unprovisioned device beacon in Android app using Android nRF Mesh Library.
Best regards,
Toshi
Hi Roshan-san,
Thank you again for your kind reply.
Now I understand what you said. You are trying to explain the way to select provisioned nodes from many devices using service UUID. I know it is not so difficult. Unprovisioned devices have the Mesh Provisioning Service, and provisioned nodes usually have the Mesh Proxy Service. This is what you are explaining, isn't it?
Again, please let me know if I have misunderstood something.
But, unfortunately, it is not what we want to do.
Probably, I wrote something ambiguous or misleading. I am sorry for my poor English or explanation.
Please let me explain what we want to do, using the use case I wrote above.
At the beginning, all devices are unprovisioned.
And, a provisioner needs to find the unprovisioned devices in the same room.
To achieve this, we want to use the URI hash carried on unprovisioned device beacon.
In this case, we assign a URI to the devices and the provisioner in the same room.
(Of course, we use different URIs for different rooms.)
I hope this clarifies what we want to do.
Please ask me anything, if you need.
Also, I found a similar Q&A in DevZone.
Identifying unprovisioned mesh device
In the Q&A, they also use URI to select a particular set of unprovisioned devices.
They use a provisioner on iOS, but the issue is very close to my question.
Please refer the Q&A, if something I wrote is unclear.
Anyway, I investigated the code you mentioned. The ScanFilter uses service UUIDs, device name, device address, and something related to the service. I am afraid I can't use this to achieve what we want to do.
It would be great if someone could tell me how I can read URI hash on unprovisioned device beacon in Android app using Android nRF Mesh Library.
Best regards,
Toshi