added simple serial port to be used by application motes
This commit is contained in:
parent
0845bf18d7
commit
3836b3e2e5
1 changed files with 37 additions and 0 deletions
|
@ -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 */
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue