Sub Admin_DiscoveryFinished
ProgressDialogHide
If foundDevices.Size = 0 Then
' some code
Else
Dim l As List
l.Initialize
For i = 0 To foundDevices.Size - 1
Dim nm As NameAndMac
nm = foundDevices.Get(i)
l.Add(nm.Name)
Next
Dim res As Int
res = InputList(l, "Seleziona il dispositivo da connettere", -1)
If res <> DialogResponse.CANCEL Then
connectedDevice = foundDevices.Get(res)
Try
serial1.Connect(connectedDevice.Mac)
Catch
Log(LastException)
End Try
End If
End If
End Sub
Sub Serial1_Connected (Success As Boolean)
ProgressDialogHide
Log("connected: " & Success)
If Success = False Then
Log(LastException.Message)
If port < 100 Then
port = port + 1
serial1.Connect3(connectedDevice.Mac, port)
End If
Else
' do something (connected)
End If
End Sub