001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2016-2017. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj.hal;
009
010/**
011 * A wrapper for the HALControlWord bitfield.
012 */
013public class ControlWord {
014  private boolean m_enabled;
015  private boolean m_autonomous;
016  private boolean m_test;
017  private boolean m_emergencyStop;
018  private boolean m_fmsAttached;
019  private boolean m_dsAttached;
020
021  void update(boolean enabled, boolean autonomous, boolean test, boolean emergencyStop,
022              boolean fmsAttached, boolean dsAttached) {
023    m_enabled = enabled;
024    m_autonomous = autonomous;
025    m_test = test;
026    m_emergencyStop = emergencyStop;
027    m_fmsAttached = fmsAttached;
028    m_dsAttached = dsAttached;
029  }
030
031  public boolean getEnabled() {
032    return m_enabled;
033  }
034
035  public boolean getAutonomous() {
036    return m_autonomous;
037  }
038
039  public boolean getTest() {
040    return m_test;
041  }
042
043  public boolean getEStop() {
044    return m_emergencyStop;
045  }
046
047  public boolean getFMSAttached() {
048    return m_fmsAttached;
049  }
050
051  public boolean getDSAttached() {
052    return m_dsAttached;
053  }
054}