Closed Hung6129 closed 1 year ago
Hello @Hung6129, Thanks for the report !
I can't tell when we can investigate on this. It might be a problem with our definitions of swift data class used as Flutter Method Channels args 🤔
Hi @R0m4in-dooz So in the https://github.com/NordicSemiconductor/IOS-nRF-Mesh-Library and https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library They scan for provisioned node in mesh network and the list only show the nodes that in the mesh network just done provisioning In the plugin you used this:
Future<void> _scanProvisionned() async {
setState(() {
_devices.clear();
});
await Permissions().checkAndAskPermissions();
_scanSubscription = widget.nrfMesh.scanForProxy().listen((device) async {
if (_devices.every((d) => d.id != device.id)) {
setState(() {
_devices.add(device);
});
}
});
setState(() {
isScanning = true;
});
return Future.delayed(const Duration(seconds: 20), _stopScan);
}
To get the provisioned node and reconnect to that node But it also show other nodes not in mesh network
And in READ_ME said that the we can Custom BLE features
Can you please show me or help me customize one BLE features that look like the nRF app to scan for provisioned node (only show node that provisioned in the mesh network and not show other node like the plugin)
Thanks <3
Hello @Hung6129, Your question seems unrelated to this issue but yes, the scan for provisioned nodes cannot know the network, it's your responsibility to check if it's a relevant node for the current managed network. The plugin provides the API to do this check, just use the following :
DiscoveredDevice device;
final sD = device.serviceData[meshProxyUuid]!;
if (await _meshManagerApi.nodeIdentityMatches(sD) ||
await _meshManagerApi.networkIdMatches(sD)) {
// node belongs to loaded mesh n/w
}
Hi @R0m4in-dooz Sorry abt the unrelated question, i am a junior dev and i have a task to re-creating nRF-Mesh app using flutter and lately i've been stuck at scanning for provisioned node so i have no chose to ask you :) Btw thanks for the suggest it work perfect
Ahah no worries. Glad I can help. Don't hesitate to open new issues so my answers are not lost here 👍 and if you want, you can edit the readme or the docs of the plugin with your discoveries too, I know the doc is not complete, sry 😅
Hello there,
A fix has been merged to master, you can use this for now before we publish a new release 👍
I'm just test on iOS, the example app https://github.com/OZEO-DOOZ/nrf_mesh_plugin/tree/master/example And after provisioning->nav to control module-> i press on the the device to use on/off function Then this happen in the termial
i think sth happened when calling element model, but i dont know where to find it i dont know much about swift so i hope you can check it out Thanks