Luís Tavares Luís Tavares - 1 year ago 100
Java Question

Sending a String via Serial COMM

I'm developing a system with Gemalto BG5ST (a java modem).
I need to send a string sent via http GET request to the Serial Port.
This string is stored, but the problem is that I need the data to be int or byte in order to write in the Outputstream.

Is there anyway to go around this?

OutputStream outStream = null;
String strCOM = "comm:COM0;blocking=off;baudrate=115200";//autocts=off;autorts=off
CommConnection commConn = (CommConnection)
inStream = commConn.openInputStream();
outStream = commConn.openOutputStream();

Working with IDE 1.3 due to modem restrictions.

Answer Source

str.getBytes() - 1.1 version, used default charset

str.getBytes("UTF-8") - 1.1 version

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download