private void write(LongCommand command, long x) throws IOException { this.lock.lock(); try { FTDI.write(Socket.buildLongMessage(command, x), this.port); } finally { this.lock.unlock(); } }
private String read() throws IOException { this.lock.lock(); try { return FTDI.read(this.port); } finally { this.lock.unlock(); } }
// write sends a command to the actuator. read pops a response off the queue. private void write(SimpleCommand command) throws IOException { this.lock.lock(); try { FTDI.write(Socket.buildSimpleMessage(command), this.port); } finally { this.lock.unlock(); } }