Android Question USB serial port

RonkyOne

Member
Licensed User
Longtime User
hello,

I have to write to the COM 5 serial port (via USB) of a tablet (Freescale GPMB Mx6) but with the news that I find in the forum I do not identify the port.
Does anyone know how I can go about identifying the COM5 via USB?
 

agraham

Expert
Licensed User
Longtime User
I have to write to the COM 5 serial port (via USB) of a tablet
Sorry but this doesn't make sense. COM5 would seem to be Windows term. Android does not assign any identifier to a USB connected comport and has no support for it. You need a low level driver that understands the chip in the adapter to talk to it.
 
Upvote 0

RonkyOne

Member
Licensed User
Longtime User
umh,
i have a "jar" file for called API in eclipse,
how can I get to communicate with the serial port?,
I also have this documentation
is there any way to import this file into b4x
thanks in advance

Connect to Printer (COM/RS232) //
Open it prnDevice = new CustomAndroidFiscalAPI ().getPrinterDriverCOM(ProtocolType.Custom, strDevPort);
where “strDevPort” is a string with the hardware device serial port (example “/dev/ttys0”).
NOTE: the function getPrinterDriverCOM, opens the device port in R/W mode and with the current serial configuration, so must be set these paramethers before to open it. Example: how to set the device serial port to R/W
//Init COM port running linux commands (set the port in R/W mode)
try me().exec("chmod 666 " + strDevPort); }
catch (Exception e) {}
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
I don't know much about the Android kernel but from the very brief amount of data that looks like a very low level driver that possibly needs root access to change a device configuration. Also if it uses a device like “/dev/ttys0” it is assuming that there exists a driver for that device that can connect to a USB serial device - perhaps your device is using some specialised form of Android. It certainly looks nothing like how serial port access is usually achieved in Android.
 
Upvote 0
Top