001package jmri.jmrix.powerline;
002
003import org.slf4j.Logger;
004import org.slf4j.LoggerFactory;
005
006/**
007 * Contains the data payload of a serial reply packet. Note that it's _only_ the
008 * payload.
009 *
010 * @author Bob Jacobsen Copyright (C) 2002, 2006, 2007, 2008 Converted to
011 * multiple connection
012 * @author kcameron Copyright (C) 2011
013 */
014abstract public class SerialReply extends jmri.jmrix.AbstractMRReply {
015
016    SerialTrafficController tc = null;
017
018    // create a new one
019    public SerialReply(SerialTrafficController tc) {
020        super();
021        this.tc = tc;
022        setBinary(true);
023    }
024
025    public SerialReply(SerialTrafficController tc, String s) {
026        super(s);
027        this.tc = tc;
028        setBinary(true);
029    }
030
031    public SerialReply(SerialTrafficController tc, SerialReply l) {
032        super(l);
033        this.tc = tc;
034        setBinary(true);
035    }
036
037    /**
038     * Is reply to poll message
039     * @return value of poll message
040     */
041    public int getAddr() {
042        log.error("getAddr should not be called", new Exception());
043        return getElement(0);
044    }
045
046    @Override
047    protected int skipPrefix(int index) {
048        // doesn't have to do anything
049        return index;
050    }
051
052    private final static Logger log = LoggerFactory.getLogger(SerialReply.class);
053
054}
055
056