Exemplo n.º 1
0
 public void close() {
   if (socket != null) {
     socket.close();
   }
   if (input != null) {
     input.close();
   }
 }
Exemplo 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());
     }
   }
 }
Exemplo 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());
      }
    }
Exemplo n.º 4
0
 public void setAEBufferSize(int AEBufferSize) {
   if (input == null) {
     return;
   }
   input.setBufferSize(AEBufferSize);
 }
Exemplo n.º 5
0
 public int getAEBufferSize() {
   if (input == null) {
     return 0;
   }
   return input.getBufferSize();
 }
Exemplo n.º 6
0
 public AEPacketRaw getEvents() {
   if (input == null) {
     return null;
   }
   return input.readPacket();
 }
Exemplo n.º 7
0
 public AEPacketRaw acquireAvailableEventsFromDriver() throws HardwareInterfaceException {
   if (input == null) {
     throw new HardwareInterfaceException("no input connection");
   }
   return input.readPacket();
 }