manager.Initialize
If manager.GetDevices.Length = 0 Then
Log("No connected usb devices.")
ToastMessageShow("No USB", True)
Else
Dim device As UsbDevice = manager.GetDevices(0) 'assuming that there is exactly one device
If manager.HasPermission(device) = False Then
ToastMessageShow("Please allow connection and click again.", True)
manager.RequestPermission(device)
Else
usbserial.Initialize("serial", device, -1)
usbserial.BaudRate = 115200
usbserial.DataBits = usbserial.DATA_BITS_8
usbserial.StartReading
Log("USB-Serial installiert")
ToastMessageShow("USB installiert.", True)
End If
End If