mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-04-07 17:37:06 +00:00
added simple serial port to be used by application motes
This commit is contained in:
parent
0845bf18d7
commit
3836b3e2e5
@ -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…
x
Reference in New Issue
Block a user