added simple serial port to be used by application motes

This commit is contained in:
fros4943 2010-02-03 15:11:28 +00:00
parent 0845bf18d7
commit 3836b3e2e5

View file

@ -0,0 +1,37 @@
package se.sics.cooja.interfaces;
import se.sics.cooja.Mote;
import se.sics.cooja.dialogs.SerialUI;
public class ApplicationSerialPort extends SerialUI {
private Mote mote;
public ApplicationSerialPort(Mote mote) {
this.mote = mote;
}
/**
* @param log Trigger log event from application
*/
public void triggerLog(String log) {
byte[] bytes = log.getBytes();
for (byte b: bytes) {
dataReceived(b);
}
dataReceived('\n');
}
public Mote getMote() {
return mote;
}
public void writeArray(byte[] s) {
/* Not implemented */
}
public void writeByte(byte b) {
/* Not implemented */
}
public void writeString(String s) {
/* Not implemented */
}
}