View Javadoc
1   package org.opentrafficsim.imb.transceiver;
2   
3   import org.opentrafficsim.imb.IMBException;
4   import org.opentrafficsim.imb.connector.Connector;
5   
6   import nl.tno.imb.TByteBuffer;
7   
8   /**
9    * Relay events between IMB domain and OTS domain.
10   * <p>
11   * Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
12   * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
13   * </p>
14   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
15   * initial version Oct 18, 2016 <br>
16   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
18   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
19   */
20  public interface Transceiver
21  {
22      /**
23       * Retrieve the id for the Transceiver channel, e.g. "GTU" or "Simulator Control".
24       * @return String; the id for the Transceiver channel, e.g. "GTU" or "Simulator Control".
25       */
26      String getId();
27  
28      /**
29       * Retrieve the IMB connector.
30       * @return Connector the IMB connector.
31       */
32      Connector getConnector();
33      
34      /**
35       * Handle an IMB message sent to OTS.
36       * @param imbEventName String; the IMB event name of the message that was received from IMB 
37       * @param imbPayload TByteBuffer; the packed IMB message payload
38       * @throws IMBException in case the IMB event cannot be handled by this Transceiver
39       */
40      void handleMessageFromIMB(String imbEventName, TByteBuffer imbPayload) throws IMBException;
41  }
42