001package jmri.jmrix.sprog.pi.pisprognano; 002 003import jmri.jmrix.sprog.SprogConstants.SprogMode; 004 005 006/** 007 * Implements SerialPortAdapter for the Sprog system. 008 * <p> 009 * This connects an Pi-SPROG Nano via a serial com port or virtual USB serial 010 * com port. 011 * <p> 012 * The current implementation only handles the 115,200 baud rate, and does not use 013 * any other options at configuration time. 014 * 015 * @author Andrew Crosland Copyright (C) 2016 016 */ 017public class PiSprogNanoSerialDriverAdapter 018 extends jmri.jmrix.sprog.serialdriver.SerialDriverAdapter { 019 020 public PiSprogNanoSerialDriverAdapter() { 021 super(SprogMode.OPS, 115200); 022 options.put("TrackPowerState", new Option(Bundle.getMessage("OptionTrackPowerLabel"), 023 new String[]{Bundle.getMessage("PowerStateOff"), Bundle.getMessage("PowerStateOn")}, 024 true)); // first element (TrackPowerState) NOI18N 025 //Set the username to match name, once refactored to handle multiple connections or user setable names/prefixes then this can be removed 026 this.getSystemConnectionMemo().setUserName(Bundle.getMessage("PiSprogNanoCSTitle")); 027 } 028 029 /** 030 * {@inheritDoc} 031 * Currently only 115,200 bps 032 */ 033 @Override 034 public String[] validBaudRates() { 035 return new String[]{"115,200 bps"}; 036 } 037 038 /** 039 * {@inheritDoc} 040 */ 041 @Override 042 public int[] validBaudNumbers() { 043 return new int[]{115200}; 044 } 045 046 // private final static Logger log = LoggerFactory.getLogger(PiSprogNanoSerialDriverAdapter.class); 047 048}