001package jmri.jmrix.can.adapters.gridconnect.usblcc.serialdriver;
002
003import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
004
005/**
006 * Definition of objects to handle configuring a layout connection via a USB-LCC
007 * SerialDriverAdapter object.
008 *
009 * @author Bob Jacobsen Copyright (C) 2001, 2003
010 * @author Andrew Crosland 2008
011 * @author Andrew Crosland 2023
012 */
013@SuppressFBWarnings(value = "NM_SAME_SIMPLE_NAME_AS_SUPERCLASS", justification = "name assigned historically")
014public class ConnectionConfig extends jmri.jmrix.can.adapters.ConnectionConfig {
015
016    /**
017     * Create a connection configuration with a preexisting adapter. This is
018     * used principally when loading a configuration that defines this
019     * connection.
020     *
021     * @param p the adapter to create a connection configuration for
022     */
023    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
024        super(p);
025    }
026
027    // Needed for instantiation by reflection, do not remove.
028    /**
029     * Ctor for a connection configuration with no preexisting adapter.
030     * {@link #setInstance()} will fill the adapter member.
031     */
032    public ConnectionConfig() {
033        super();
034    }
035
036    @Override
037    public String name() {
038        return "CAN via SPROG DCC Ltd USB-LCC";
039    }
040
041    /**
042     * {@inheritDoc}
043     */
044    @Override
045    protected void setInstance() {
046        if (adapter == null) {
047            adapter = new SerialDriverAdapter();
048        }
049    }
050
051}