Hi,
I', using Usb Serial library 2.4 and my usb ticket printer is recognized.
Demo example from library 2.4 prompt user to accept permissions but when code try to open the port it fails.
That could be wrong to get the error and app enter in the line: Log("Error opening USB port 1") ??
Printer is working with some serial over usb examples from Google Play.
Kind regards,
Abilio
-------------------------------------------------
The code:
If usb1.UsbPresent(1) = usb1.USB_NONE Then ' Ver_2.4
Log("Msgbox - no deviceddddd")
Msgbox("No USB device or accessory detected!", "Error")
Log("Msgbox - returned")
Return
EndIf
Log("Checking permission 1")
If (usb1.HasPermission(1)) Then ' Ver_2.4
Log(usb1.DeviceInfo(1))
Msgbox(usb1.DeviceInfo(1), "Device Information 1") ' Ver_2.4
Dim dev As Int
'dev = usb.Open(115200, 1) ' Ver_2.4
usb1.SetParameters(115200,usb1.DATABITS_8,usb1.STOPBITS_1,usb1.PARITY_NONE)
dev = usb1.Open(115200, 1) ' Ver_2.4
If dev <> usb1.USB_NONE Then
Log("Connected successfully! 1")
btnOpen.Enabled = False
btnClose.Enabled = True
btnSend.Enabled = True
astreams1.Initialize(usb1.GetInputStream, usb1.GetOutputStream, "astreams1")
Else
Log("Error opening USB port 1")
EndIf
Else
usb1.RequestPermission(1) ' Ver_2.4
EndIf
I', using Usb Serial library 2.4 and my usb ticket printer is recognized.
Demo example from library 2.4 prompt user to accept permissions but when code try to open the port it fails.
That could be wrong to get the error and app enter in the line: Log("Error opening USB port 1") ??
Printer is working with some serial over usb examples from Google Play.
Kind regards,
Abilio
-------------------------------------------------
The code:
If usb1.UsbPresent(1) = usb1.USB_NONE Then ' Ver_2.4
Log("Msgbox - no deviceddddd")
Msgbox("No USB device or accessory detected!", "Error")
Log("Msgbox - returned")
Return
EndIf
Log("Checking permission 1")
If (usb1.HasPermission(1)) Then ' Ver_2.4
Log(usb1.DeviceInfo(1))
Msgbox(usb1.DeviceInfo(1), "Device Information 1") ' Ver_2.4
Dim dev As Int
'dev = usb.Open(115200, 1) ' Ver_2.4
usb1.SetParameters(115200,usb1.DATABITS_8,usb1.STOPBITS_1,usb1.PARITY_NONE)
dev = usb1.Open(115200, 1) ' Ver_2.4
If dev <> usb1.USB_NONE Then
Log("Connected successfully! 1")
btnOpen.Enabled = False
btnClose.Enabled = True
btnSend.Enabled = True
astreams1.Initialize(usb1.GetInputStream, usb1.GetOutputStream, "astreams1")
Else
Log("Error opening USB port 1")
EndIf
Else
usb1.RequestPermission(1) ' Ver_2.4
EndIf