AsyncStream: ttyS0 as java.io.InputStream / OutputStream ?

robotop

Member
Licensed User
Longtime User
Hello, my Android tablet has a serial port available (ttyS0) and I modified the rom adding the line chmod 777 /dev/ttyS0 to the device initialization script, so I suppose it will be available for input and output. My question is: how can I bind the /dev/ttyS0 to the java.io.InputStream and java.io_OutputStream that are required as parameters in the AStreams.Initialize method ? In other words, what will be the correct Astreams.Initialize(?InputStream?, False, ?OutputStream?, "SerPortEvent") syntax ?
Thank you in advance, bye
 
Last edited:

ManuelGG

Member
Licensed User
Longtime User
Thanks for your help but the "stty" command still does not work... I hope Erel will have time to address this issue and me some track to fix it...
 
Upvote 0

ManuelGG

Member
Licensed User
Longtime User
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi robotop

Does the "stty" in the Android ? :confused:
 
Upvote 0

robotop

Member
Licensed User
Longtime User
Hello Jinyistudio. The command "stty" is specific for Linux. You must have the "root" rights to use it. As I wrote at the beginning of this thread, I'm using a very old tablet based on Android 2.2 with heavy firmware modifications (Uberoid image + modifications of init.rc). Starting from Android 1.6 (my first tablet) going to Android 4.4 the Google OS suppressed many Linux commands. For serial ports, a "modern" approach will be the USB-Serial library; using this library you can control an external USB-to-serial interface without the need of "stty" for the baud rate, num. of bits, parity etc. Anyway, just to try what works and what doesn't, you can use an App called "terminal emulator" and play with the available Linux commands.
 
Last edited:
Upvote 0
Top