yeah, following is the code that talks to GPS thru serial port and it works fine for me
Note: i'm using IBM's Web Sphere Deveice Developer
private void connect() {
int ch;
InputStreamReader isr;
StreamConnection srlConn;
private final String protocol = "comm:0;baudrate=4800;bitsperchar=8;stopbits=1;parity=none;autorts=on;autocts=on;blocking=on";
try {
if(srlConn == null)
srlConn = (StreamConnection) Connector.open(specs, access, false);
if(isr == null)
isr = new InputStreamReader(srlConn.openInputStream());
} catch(IOException e) {}
while(true) {
try{ch = isr.read();}
catch(IOException ioe) {
// if ioe error = serial error line error then Ignore and continue;
// else break;
}
// other code goes here
}
}
Aamir