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