001package jmri.jmrix.can;
002
003/**
004 * Define interface for sending and receiving CAN messages
005 *
006 * @author Andrew Crosland Copyright (C) 2008
007 */
008public interface CanInterface {
009
010    void addCanListener(CanListener l);
011
012    void removeCanListener(CanListener l);
013
014    /**
015     * Test operational status of interface.
016     *
017     * @return true is interface implementation is operational.
018     */
019    boolean status();
020
021    /**
022     * Send a message through the interface.
023     *
024     * @param m Message to be sent.
025     * @param l Listener to be notified of reply.
026     */
027    void sendCanMessage(CanMessage m, CanListener l);
028
029    /**
030     * Send a reply through the interface.
031     *
032     * @param r Reply to be sent.
033     * @param l Listener to be notified of reply.
034     */
035    void sendCanReply(CanReply r, CanListener l);
036}