Ok, can of worms but ok. Adam was messing around with client stuff here:
http://ecomodder.com/forum/showthrea...tml#post106367 , I was rooting for java so anyone could use it, have used rxtx a lot
Deploying JAVA with RXTX - Rxtx
just for example, here is a sample java prog that sends a character version of the serial bits to stdout and a hex converted version to stderr (9600, com2)
PHP Code:
import gnu.io.CommPortIdentifier;
import gnu.io.SerialPort;
import java.io.InputStream;
import java.io.OutputStream;
public class SerialMon {
static InputStream input;
static OutputStream output;
static char[] hexstr = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
static String toHex(int x){
return ""+hexstr[x/16]+hexstr[x%16];
}
public static void main(String[] args) throws Exception{
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(
"COM2");
SerialPort port = (SerialPort)portId.open("serial madness", 4000);
input = port.getInputStream();
output = port.getOutputStream();
port.setSerialPortParams(
9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
while(true){
while (input.available()>0){
int x = input.read();
System.out.print((char)x);
System.err.print(toHex(x));
}
}
}
}