Closed Nilzor closed 1 week ago
@Nilzor Sincere apologies for our delay in responding to you. We much appreciate your report. The StarIoPort3.1 lib is provided in this repository and is therefore correct in reporting its location here.
Sorry, but this is the intended design - we do not consider assigning individual permissions to each of these ports when there are multiple ports, for example, in a USB hub.
We have designed our Android with the intention to allow USB connections between Android and our printers by stating the USB Vendor ID and USB Product ID of the product in the device_filter.xml. https://www.star-m.jp/products/s_print/sdk/starprnt_sdk/manual/android_java/en/configure_application.html#device-filter-xmlaccessory-filter-xml
Therefore, we would be very appreciated if you could continue to apply your current workaround.
I have also tested with the USB hub which has an Ethernet port (ELECOM DST-C09WH), but I could not find any difference in terms of authorisation, with or without Ethernet ports. If this perception is incorrect, we would be grateful if you could let us know.
Scope
This is probably a shortcoming in the StarIoPort3.1 lib that causes an error when used on Android devices. I couldn't find any place to report bugs for StarIOPort so I chose to do it here. Please forward if this is the wrong channel.
Description
I have a setup where a Samsung S21 phone is connected to a smart USB HUB which have multiple USB ports and an Ethernet port. A Star S230i is connected to one of the USB ports. StarIOPort probes for serial number of all USB devices when calling
getPort()
, even if I have specified which port is the Star Printer. This causes a security exception if the user has not granted permission for all USB peripherals, including the Realtek Etherenet chip in the HUB (even if no ethernet cable is connected). I think it should not be necessary to ask the user for permission to access an Ethernet port when using the Star printer.Stacktrace
This is the stacktrace I get by calling
StarIOPort.getPort("USB:1-4", portSettings, 10000, context)
Note that the port name "USB:1-4" does not match with the port actually requested serial number from (002/003 which would be "USB:2-3" I suppose)
Workaround
I ask the user for permission to access the Ethernet chip on port 002/003 prior to calling
getPort
.Device, printer and hub
The error was reproduces with both the two mentioned USB hubs, and I assume any hub that contains an Ethernet chip/connector.
Your development environment
Windows 10
To Reproduce
Expected behavior
That we'd be able to get a normal result from getPort and continue to access and use the printer through the SDK.