If manager.GetDevices.Length = 0 Then
ToastMessageShow(" No Device ", True)
Else
Dim device As UsbDevice = manager.GetDevices(0) 'assuming that there is exactly one
If manager.HasPermission(device) = False Then
ToastMessageShow("Please allow connection and click again.", True)
manager.RequestPermission(device)
wait for '<----- here
'msgbox
Else If manager.HasPermission(device) = True Then
' usbserial.Initialize("serial", device, -1)
usbserial.Initialize2("serial", device, -1, "CDCSerialDevice")
usbserial.BaudRate = 115200
usbserial.DataBits = usbserial.DATA_BITS_8
usbserial.StartReading
ToastMessageShow("Done ", True)
End If
End If