/* This is a hacked version of SerialByteSource that does not * rely on javax.comm (and therefore does not do anything). */ package net.tinyos.packet; import java.util.*; import java.io.*; public class SerialByteSource extends StreamByteSource { private static final String errorMessage = "You are using a version of SerialByteSource which is just a stum with no functionality. This is provided to circumvent dependencies on javax.comm and means you cannot have Java code connecting directly to a serial port; use the C-based SerialForwarder app in tools/src/sf instead."; public SerialByteSource(String portName, int baudRate) { throw new RuntimeException(errorMessage); } public void openStreams() throws IOException { throw new RuntimeException(errorMessage); } public void closeStreams() throws IOException { throw new RuntimeException(errorMessage); } public String allPorts() { throw new RuntimeException(errorMessage); } public byte readByte() throws IOException { throw new RuntimeException(errorMessage); } //public void serialEvent(SerialPortEvent ev) { // throw new RuntimeException(errorMessage); //} }