Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which library should I use to communicate with serial port on Java ME?

I have some devices with Linux embedded and need to program a producer thread...

Thinking of doing it with JME, which library is the best to access serial port on this scenario?

like image 965
Milox Avatar asked Nov 22 '25 22:11

Milox


1 Answers

You can use CommConnection from a JME app to read/write data from/to a serial port. http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/CommConnection.html

For example

CommConnection cc = (CommConnection) Connector.open("comm:com0;baudrate=19200");

Before calling Connector.open you should check which serial ports are available with

String ports = System.getProperty("microedition.commports");
like image 81
Telmo Pimentel Mota Avatar answered Nov 24 '25 23:11

Telmo Pimentel Mota