+
+ public void open(File serial_name) throws FileNotFoundException {
+ reader.open(serial_name);
+ serial_out = new FileOutputStream(serial_name);
+ }
+
+ public void open(CommPort c) throws IOException {
+ reader.open(c);
+ serial_out = c.getOutputStream();
+ }
+
+ public void connect(String port_name) throws IOException, NoSuchPortException, PortInUseException {
+ comm_port = new RXTXPort(port_name);
+ open(comm_port);
+ }
+
+ void init() {
+ reader = new AltosSerialReader();
+ }
+
+ public void add_monitor(LinkedBlockingQueue<String> q) {
+ reader.add_monitor(q);
+ }
+
+ public void remove_monitor(LinkedBlockingQueue<String> q) {
+ reader.remove_monitor(q);
+ }
+
+ public AltosSerial() {
+ init();
+ }
+
+ public AltosSerial(File serial_name) throws FileNotFoundException {
+ init();
+ open(serial_name);
+ }
+
+ public AltosSerial(CommPort comm_port) throws IOException {
+ init();
+ open(comm_port);
+ }