I have a POS IBERICA brand printer, MODEL P80WIFI USB
With the following code the printer detects me but does not open the connection port.
What I can do?
With the following code the printer detects me but does not open the connection port.
What I can do?
B4X:
Sub ImprimirUSB
If usb.UsbPresent = usb.USB_NONE Then
Log("Msgbox - no device")
Msgbox("No USB device or accessory detected!", "Error")
Log("Msgbox - returned")
Return
End If
Log("Checking permission")
If (usb.HasPermission) Then
Msgbox(usb.DeviceInfo, "Device Information")
Dim dev As Int
Dim rFicheroParametros As TextReader
rFicheroParametros.Initialize(File.OpenInput(File.DirAssets, "prnusb.cfg"))
listaParamPRNUSB.Initialize
listaParamPRNUSB = rFicheroParametros.ReadList
rFicheroParametros.Close
dev = usb.Open(9600) ' I have tried various values
If dev <> usb.USB_DEVICE Then
MsgboxAsync("Error conncect USB ", "ERROR")
Return
End If
If dev <> usb.USB_NONE Then
Log("Connected successfully!")
'btnOpen.Enabled = False
'btnClose.Enabled = True
'btnSend.Enabled = True
astreams.Initialize(usb.GetInputStream, usb.GetOutputStream, "astreams")
Else
Log("Error opening USB port")
End If
Else
usb.RequestPermission
End If
End Sub