'******************************************************************
' Initialize the USB Ports
'******************************************************************
felAST_0.Initialize(Me,"felAST")
felAST_1.Initialize(Me,"felAST")
Dim Tmp,Tmp1 As Int
If manager.GetDevices.Length = 0 Then
Log("No connected usb devices.")
Else
device_0= manager.GetDevices(CH340_Port_0) 'first Channel
device_1= manager.GetDevices(CH340_Port_1) 'second Channel
If manager.HasPermission(device_0) = False Then
ToastMessageShow("Please allow connection and click again.", True)
manager.RequestPermission(device_0)
Else
usbserial_0.Initialize("serial", device_0, -1)
usbserial_0.BaudRate = 9600
usbserial_0.DataBits = usbserial_0.DATA_BITS_8
usbserial_0.StartReading
End If
If manager.HasPermission(device_1) = False Then
ToastMessageShow("Please allow connection and click again.", True)
manager.RequestPermission(device_1)
Else
usbserial_1.Initialize("serial", device_1, -1)
usbserial_1.BaudRate = 9600
usbserial_1.DataBits = usbserial_1.DATA_BITS_8
usbserial_1.StartReading
End If
End If