001package jmri; 002 003import javax.annotation.Nonnull; 004 005/** 006 * Provide a DCC command station's basic ability: Sending DCC packets to the 007 * rails. 008 * <p> 009 * Note that this is separate from higher-level things like access to 010 * {@link jmri.Throttle} capability (e.g. via {@link jmri.ThrottleManager}), 011 * more convenient sending of accessory command messages via JMRI 012 * {@link jmri.Turnout} objects, programming via service mode 013 * ({@link jmri.Programmer}) or on-main programmers 014 * ({@link jmri.AddressedProgrammer}) etc. 015 * <p> 016 * System-specific implementations can be obtained via the 017 * {@link jmri.InstanceManager} class. 018 * 019 * @author Bob Jacobsen Copyright (C) 2003 020 */ 021public interface CommandStation { 022 023 /** 024 * Send a specific packet to the rails. 025 * 026 * @param packet Byte array representing the packet, including the 027 * error-correction byte. 028 * @param repeats Number of times to repeat the transmission. 029 * 030 * @return {@code true} if the operation succeeds, {@code false} otherwise. 031 */ 032 boolean sendPacket(@Nonnull byte[] packet, int repeats); 033 034 String getUserName(); 035 036 @Nonnull 037 String getSystemPrefix(); 038 039}