001package jmri.jmrix.loconet.locobufferusb;
002
003import jmri.jmrix.loconet.locobuffer.LocoBufferAdapter;
004import org.slf4j.Logger;
005import org.slf4j.LoggerFactory;
006
007/**
008 * Override {@link jmri.jmrix.loconet.locobuffer.LocoBufferAdapter} so that it refers to the
009 * (switch) settings on the LocoBuffer-USB.
010 *
011 * @author Bob Jacobsen Copyright (C) 2004, 2005
012 */
013public class LocoBufferUsbAdapter extends LocoBufferAdapter {
014
015    public LocoBufferUsbAdapter() {
016        super();
017        options.remove(option1Name);
018    }
019
020    @Override
021    protected void reportOpen(String portName) {
022        log.info("Connecting LocoBuffer-USB via {} {}", portName, currentSerialPort);
023    }
024
025    /**
026     * Always on flow control
027     */
028    @Override
029    protected void setLocalFlowControl() {
030        FlowControl flow = FlowControl.RTSCTS;
031        setFlowControl(currentSerialPort, flow);
032    }
033
034
035    /**
036     * {@inheritDoc}
037     */
038    @Override
039    public String[] validBaudRates() {
040        return new String[]{Bundle.getMessage("Baud57600")};
041    }
042
043    /**
044     * {@inheritDoc}
045     */
046    @Override
047    public int[] validBaudNumbers() {
048        return new int[]{57600};
049    }
050
051    @Override
052    public int defaultBaudIndex() {
053        return 0;
054    }
055
056    private final static Logger log = LoggerFactory.getLogger(LocoBufferUsbAdapter.class);
057
058}