Serial I/O

Can I use java to do serial I/O with the Palm Pilot (java on both ends of the connection, using Java COMM on the PC)?Any pointers?
[151 byte] By [smileyxx] at [2007-9-26 3:09:49]
# 1

Yes, you can with the old KVM (CLDC + com.sun.kjava).

It uses the com.sun.cldc.io.palm.comm.Protocol class to provide serial I/O, but MIDP4Palm doesn't support serial I/O (version midp4palm-1.0 beta).

Use BlackBox from javacomm (sun impl) to watch the serial comm.

Claudio Miranda

examplets are:

public void writeToSerialPort(String message) {

OutputStream out = null;

try {

out = Connector.openOutputStream("comm:0;baudrate=9600;bitsperchar=8;stopbits=1;parity=none");

out.write(message.getBytes());

out.flush();

} catch (IOException ioe) {

System.err.println("1st IOException : " + ioe);

ioe.printStackTrace();

} finally {

try {

if (out != null) {

out.close();

}

} catch (IOException ioe) {

System.err.println(" nested IOException : " + ioe);

ioe.printStackTrace();

}

}

}

jrun at 2007-6-29 11:15:52 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Can the same thing be done with i85s nextel handset ? if so i want the connection string ie the code to connect
shailsb at 2007-6-29 11:15:52 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

> Yes, you can with the old KVM (CLDC + com.sun.kjava).

> It uses the com.sun.cldc.io.palm.comm.Protocol class

> to provide serial I/O, but MIDP4Palm doesn't support

> serial I/O (version midp4palm-1.0 beta).

The old com.sun.kjava is no longer supported. And yes, MIDP for Palm OS v1.0 does not provide an API for you to access the serial I/O through the serial cable of the Palm cradle.

> Use BlackBox from javacomm (sun impl) to watch the

> serial comm.

>

> Claudio Miranda

>

> examplets are:

>

> public void writeToSerialPort(String message) {

>OutputStream out = null;

>try {

> out =

> Connector.openOutputStream("comm:0;baudrate=9600;bitspe

> char=8;stopbits=1;parity=none");

> out.wri

> e(message.getBytes());

> out.flu

> h();

>} catch (IOException ioe) {

> System.

> rr.println("1st IOException : " + ioe);

> ioe.pri

> tStackTrace();

>} finally {

> &

> bsp; try {

> &

> bsp;if (out !=

> null) {

> &

> bsp;out.close();

> }

>} catch (IOException ioe) {

> System.

> rr.println(" nested IOException : " + ioe);

> ioe.pri

> tStackTrace();

>}

> }

>

> }

allenlai at 2007-6-29 11:15:52 > top of Java-index,Java Mobility Forums,Java ME Technologies...