Esempio n. 1
0
 public void close() {
   if (socket != null) {
     socket.close();
   }
   if (input != null) {
     input.close();
   }
 }
Esempio n. 2
0
 public void setEventAcquisitionEnabled(boolean enable) throws HardwareInterfaceException {
   if (input != null) {
     input.setPaused(enable);
   }
   if (isOpen()) {
     String s = enable ? "t+\n" : "t-\n";
     byte[] b = s.getBytes();
     try {
       DatagramPacket d = new DatagramPacket(b, b.length, client);
       socket.send(d);
     } catch (Exception e) {
       log.warning(e.toString());
     }
   }
 }
Esempio n. 3
0
    public void open() throws HardwareInterfaceException {
      try {
        if (socket != null) {
          socket.close();
        }
        socket = new DatagramSocket(CONTROL_PORT);
        socket.setSoTimeout(100);

        input = new AEUnicastInput(DATA_PORT);
        input.setSequenceNumberEnabled(false);
        input.setAddressFirstEnabled(true);
        input.setSwapBytesEnabled(false);
        input.set4ByteAddrTimestampEnabled(true);
        input.setTimestampsEnabled(false);
        input.setBufferSize(1200);
        input.setTimestampMultiplier(1);
        input.setPort(DATA_PORT);
        input.open();
      } catch (IOException ex) {
        throw new HardwareInterfaceException(ex.toString());
      }
    }
Esempio n. 4
0
 public void setAEBufferSize(int AEBufferSize) {
   if (input == null) {
     return;
   }
   input.setBufferSize(AEBufferSize);
 }
Esempio n. 5
0
 public int getAEBufferSize() {
   if (input == null) {
     return 0;
   }
   return input.getBufferSize();
 }
Esempio n. 6
0
 public AEPacketRaw getEvents() {
   if (input == null) {
     return null;
   }
   return input.readPacket();
 }
Esempio n. 7
0
 public AEPacketRaw acquireAvailableEventsFromDriver() throws HardwareInterfaceException {
   if (input == null) {
     throw new HardwareInterfaceException("no input connection");
   }
   return input.readPacket();
 }