001package jmri.jmrix.ieee802154.serialdriver;
002
003import jmri.jmrix.AbstractMRReply;
004import jmri.jmrix.ieee802154.IEEE802154Message;
005import jmri.jmrix.ieee802154.IEEE802154Reply;
006import jmri.jmrix.ieee802154.IEEE802154TrafficController;
007
008/**
009 * Traffic Controller interface for communicating with IEEE 802.15.4 devices
010 * directly using IEEE 802.15.4 formated messages.
011 *
012 * @author Paul Bender Copyright (C) 2013
013 */
014public class SerialTrafficController extends IEEE802154TrafficController {
015
016    /**
017     * Get a message of a specific length for filling in.
018     * <p>
019     * This is a default, null implementation, which must be overridden in an
020     * adapter-specific subclass.
021     */
022    @Override
023    public IEEE802154Message getIEEE802154Message(int length) {
024        return new IEEE802154Message(length);
025    }
026
027    /**
028     * <p>
029     * This is a default, null implementation, which must be overridden in an
030     * adapter-specific subclass.
031     */
032    @Override
033    protected AbstractMRReply newReply() {
034        return new IEEE802154Reply();
035    }
036
037    /*
038     * Build a new IEEE802154 Node.
039     * @return new IEEE802154Node.
040     */
041    @Override
042    public jmri.jmrix.ieee802154.IEEE802154Node newNode() {
043        return new SerialNode();
044    }
045
046}