Exemplo n.º 1
0
 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();
   }
 }
Exemplo n.º 2
0
 private String read() throws IOException {
   this.lock.lock();
   try {
     return FTDI.read(this.port);
   } finally {
     this.lock.unlock();
   }
 }
Exemplo n.º 3
0
 // 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();
   }
 }