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