001package jmri.jmrix.marklin.tcpdriver;
002
003import jmri.jmrix.marklin.MarklinPortController;
004import jmri.jmrix.marklin.MarklinSystemConnectionMemo;
005import jmri.jmrix.marklin.MarklinTrafficController;
006
007/**
008 * Implements NetworkPortAdapter for the Marklin system network TCP connection.
009 * <p>
010 * This connects a Marklin command station via a TCP connection. 
011 *
012 * @author Bob Jacobsen Copyright (C) 2001, 2002, 2003, 2008, 2025
013 * @author Kevin Dickerson Copyright (C) 2012
014 */
015public class TcpDriverAdapter extends MarklinPortController {
016
017    public TcpDriverAdapter() {
018        super(new MarklinSystemConnectionMemo());
019        allowConnectionRecovery = true;
020        manufacturerName = jmri.jmrix.marklin.MarklinConnectionTypeList.MARKLIN;
021        m_port = 15731;
022    }
023
024    @Override //ports are fixed and not user set
025    public void setPort(int p) {
026    }
027
028    @Override //ports are fixed and not user set
029    public void setPort(String p) {
030    }
031
032    /**
033     * Set up all of the other objects to operate with a Marklin command station
034     * connected to this port.
035     */
036    @Override
037    public void configure() {
038        // connect to the traffic controller
039        MarklinTrafficController control = new MarklinTrafficController();
040        control.connectPort(this);
041        control.setAdapterMemo(this.getSystemConnectionMemo());
042        this.getSystemConnectionMemo().setMarklinTrafficController(control);
043        this.getSystemConnectionMemo().configureManagers();
044    }
045
046    @Override
047    public boolean status() {
048        return opened;
049    }
050
051    // private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TcpDriverAdapter.class);
052
053}