blob: ece177c10b18860aadf52452514a750ea0e9f752 [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008-2017. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#pragma once
9
10#include <stdint.h>
11
12#ifdef WPI_ERRORS_DEFINE_STRINGS
13#define S(label, offset, message) \
14 const char* wpi_error_s_##label = message; \
15 const int wpi_error_value_##label = offset
16#else
17#define S(label, offset, message) \
18 extern const char* wpi_error_s_##label; \
19 const int wpi_error_value_##label = offset
20#endif
21
22/*
23 * Fatal errors
24 */
25S(ModuleIndexOutOfRange, -1,
26 "Allocating module that is out of range or not found");
27S(ChannelIndexOutOfRange, -1, "Allocating channel that is out of range");
28S(NotAllocated, -2, "Attempting to free unallocated resource");
29S(ResourceAlreadyAllocated, -3, "Attempted to reuse an allocated resource");
30S(NoAvailableResources, -4, "No available resources to allocate");
31S(NullParameter, -5, "A pointer parameter to a method is nullptr");
32S(Timeout, -6, "A timeout has been exceeded");
33S(CompassManufacturerError, -7, "Compass manufacturer doesn't match HiTechnic");
34S(CompassTypeError, -8,
35 "Compass type doesn't match expected type for HiTechnic compass");
36S(IncompatibleMode, -9, "The object is in an incompatible mode");
37S(AnalogTriggerLimitOrderError, -10,
38 "AnalogTrigger limits error. Lower limit > Upper Limit");
39S(AnalogTriggerPulseOutputError, -11,
40 "Attempted to read AnalogTrigger pulse output.");
41S(TaskError, -12, "Task can't be started");
42S(TaskIDError, -13, "Task error: Invalid ID.");
43S(TaskDeletedError, -14, "Task error: Task already deleted.");
44S(TaskOptionsError, -15, "Task error: Invalid options.");
45S(TaskMemoryError, -16, "Task can't be started due to insufficient memory.");
46S(TaskPriorityError, -17, "Task error: Invalid priority [1-255].");
47S(DriveUninitialized, -18, "RobotDrive not initialized for the C interface");
48S(CompressorNonMatching, -19,
49 "Compressor slot/channel doesn't match previous instance");
50S(CompressorAlreadyDefined, -20, "Creating a second compressor instance");
51S(CompressorUndefined, -21,
52 "Using compressor functions without defining compressor");
53S(InconsistentArrayValueAdded, -22,
54 "When packing data into an array to the dashboard, not all values added were "
55 "of the same type.");
56S(MismatchedComplexTypeClose, -23,
57 "When packing data to the dashboard, a Close for a complex type was called "
58 "without a matching Open.");
59S(DashboardDataOverflow, -24,
60 "When packing data to the dashboard, too much data was packed and the buffer "
61 "overflowed.");
62S(DashboardDataCollision, -25,
63 "The same buffer was used for packing data and for printing.");
64S(EnhancedIOMissing, -26, "IO is not attached or Enhanced IO is not enabled.");
65S(LineNotOutput, -27,
66 "Cannot SetDigitalOutput for a line not configured for output.");
67S(ParameterOutOfRange, -28, "A parameter is out of range.");
68S(SPIClockRateTooLow, -29, "SPI clock rate was below the minimum supported");
69S(JaguarVersionError, -30, "Jaguar firmware version error");
70S(JaguarMessageNotFound, -31, "Jaguar message not found");
71S(NetworkTablesReadError, -40, "Error reading NetworkTables socket");
72S(NetworkTablesBufferFull, -41, "Buffer full writing to NetworkTables socket");
73S(NetworkTablesWrongType, -42,
74 "The wrong type was read from the NetworkTables entry");
75S(NetworkTablesCorrupt, -43, "NetworkTables data stream is corrupt");
76S(SmartDashboardMissingKey, -43, "SmartDashboard data does not exist");
77S(CommandIllegalUse, -50, "Illegal use of Command");
78S(UnsupportedInSimulation, -80, "Unsupported in simulation");
79S(CameraServerError, -90, "CameraServer error");
80
81/*
82 * Warnings
83 */
84S(SampleRateTooHigh, 1, "Analog module sample rate is too high");
85S(VoltageOutOfRange, 2,
86 "Voltage to convert to raw value is out of range [-10; 10]");
87S(CompressorTaskError, 3, "Compressor task won't start");
88S(LoopTimingError, 4, "Digital module loop timing is not the expected value");
89S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1");
90S(IncorrectBatteryChannel, 6,
91 "Battery measurement channel is not correct value");
92S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-3");
93S(BadJoystickAxis, 8, "Joystick axis or POV is out of range");
94S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3");
95S(DriverStationTaskError, 10, "Driver Station task won't start");
96S(EnhancedIOPWMPeriodOutOfRange, 11,
97 "Driver Station Enhanced IO PWM Output period out of range.");
98S(SPIWriteNoMOSI, 12, "Cannot write to SPI port with no MOSI output");
99S(SPIReadNoMISO, 13, "Cannot read from SPI port with no MISO input");
100S(SPIReadNoData, 14, "No data available to read from SPI");
101S(IncompatibleState, 15,
102 "Incompatible State: The operation cannot be completed");
103
104#undef S