Sub Scan
FoundDevices.Initialize 'process global Map variable
manager.Scan2(Null, False)
Sleep(10000)
manager.StopScan
CallSubDelayed2(Main, "AfterScan", FoundDevices)
End Sub
Sub Manager_DeviceFound (Name As String, Id As String, AdvertisingData As Map, RSSI As Double)
Log($"Device found: ${Name}"$)
FoundDevices.Put(Name, Id)
End Sub