Hi all,

I am trying to build an app that takes measurements from the phone and sends the values through the serial port.
I managed to make it work in Android Nexus ONE using the following function:

private void writeSerialDirect(String msg) {
// TODO Auto-generated method stub
if (out == null) {
try {
FileOutputStream fstream = new FileOutputStream("/dev/ttyMSM0");
out = new OutputStreamWriter(fstream);
} catch (Exception e) {
e.printStackTrace();
}
}
try {
//out.flush();
out.write(msg);
out.flush();
} catch (Exception e) {
e.printStackTrace();
}
}

However, I cannot use it with Nexus S. I change "/dev/ttyMSMO" by "/dev/s3c2410_serial2", but it doesn't work. I know I changed the kernel of the Nexus ONE, do I have to change the kernel of the Nexus S to get access to write through the serial port? I have already rooted the phone, but it didn't solve the problem, I don't get data from the serial port of the Nexus S...
If anyone know how to do it, it would be really helpful for me.
Thanks a lot!!!