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