If manager.GetDevices.Length = 0 Then
ToastMessageShow(" No Device ", True)
Else
Dim device As UsbDevice = manager.GetDevices(0) 'assuming that there is exactly one
' Dim VendorId As Int = device.VendorId
' Dim ProductId As Int = device.ProductId
' VendorId = 0x1546
' ProductId = 0x01a8
If manager.HasPermission(device) = False Then
ToastMessageShow("Please allow connection and click again.", True)
manager.RequestPermission(device)
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