Hello,
I waste a lot of time belonging this error and still don't understand how felusb handles usb ports.
I just recompile an old application that uses felusb library for ptint into a thermal printer.
I use a device with many usb ports and the the device path for com1 is /dev/bus/usb/001/010.
this is the code I use to print and works with no change, with the same hardware, using the previous apk built with b4a 8.x with debug sign key
now crash with message "unsupported device" when I call
usbserial.Initialize("serial", device, -1)
the usbport I use is 0 I found it trying all values until device.DeviceName returns /dev/bus/usb/001/010
where I can find more information about the GetDevices's usbport parameters ?
why the new apk crashes and the old one works if I didn't change anything related to usb/serial handling?
I waste a lot of time belonging this error and still don't understand how felusb handles usb ports.
I just recompile an old application that uses felusb library for ptint into a thermal printer.
I use a device with many usb ports and the the device path for com1 is /dev/bus/usb/001/010.
this is the code I use to print and works with no change, with the same hardware, using the previous apk built with b4a 8.x with debug sign key
now crash with message "unsupported device" when I call
usbserial.Initialize("serial", device, -1)
the usbport I use is 0 I found it trying all values until device.DeviceName returns /dev/bus/usb/001/010
where I can find more information about the GetDevices's usbport parameters ?
why the new apk crashes and the old one works if I didn't change anything related to usb/serial handling?
B4X:
If manager.GetDevices.Length = 0 Then
' 'Log("No connected usb devices.")
Else
Dim device As UsbDevice = manager.GetDevices(usbport)
If manager.HasPermission(device) = False Then
ToastMessageShow("Conferma i permessi e riavvia.", True)
manager.RequestPermission(device)
Else
Log("Provo a stampare su porta "&usbport)
Log("DeviceClass "&device.DeviceClass)
Log("DeviceSubclass "&device.DeviceSubclass)
Log("DeviceName "&device.DeviceName)
Log("DeviceId "&device.DeviceId)
Log("VendorId "&device.VendorId)
Log("ProductId "&device.ProductId)
Log("InterfaceCount "&device.InterfaceCount)
usbserial.Initialize("serial", device, -1)
Log("inizializzatao il device ")
usbserial.BaudRate = 9600
usbserial.DataBits = usbserial.DATA_BITS_8
usbserial.Write(PrintBuffer.GetBytes("UTF8"))
'Sleep(1000)
End If
End If