001package jmri.jmrix.lenz;
002
003/**
004 * Interface for XNetPortController objects.
005 *
006 * @author Paul Bender Copyright (C) 2010
007 */
008public interface XNetPortController extends jmri.jmrix.PortAdapter {
009
010    /**
011     * Check that this object is ready to operate. This is a question of
012     * configuration, not transient hardware status.
013     */
014    @Override
015    boolean status();
016
017    /**
018     * Can the port accept additional characters?
019     * <p>
020     * This might go false for short
021     * intervals, but it might also stick off if something goes wrong.
022     * @return true if OK to send, else false.
023     */
024    boolean okToSend();
025
026    /**
027     * We need a way to say if the output buffer is empty or not.
028     * @param s true to set buffer empty, else false.
029     */
030    void setOutputBufferEmpty(boolean s);
031
032    /**
033     * Indicate the command station is currently providing a timeslot to this
034     * port controller. 
035     *
036     * @return true if the command station is currently providing a timeslot.
037     */
038    boolean hasTimeSlot();
039
040    /**
041     * Set a variable indicating whether or not the command station is 
042     * providing a timeslot.
043     * <p>
044     * This method should be called with the paramter set to false if  
045     * a "Command Station No Longer Providing a timeslot for communications"
046     * (01 05 04) is received.
047     * <p>
048     * This method should be called with the parameter set to true if
049     * a "Command Station is providing a timeslot for communications again."
050     * (01 07 06) is received.
051     * 
052     * @param timeslot true if a timeslot is being sent, false otherwise.
053     */
054    void setTimeSlot(boolean timeslot);
055
056}