WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
Errors.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7/**
8 * @defgroup hal_errors Error Defines
9 * @ingroup hal_capi
10 * @{
11 */
12
13#define HAL_ERR_CANSessionMux_InvalidBuffer_MESSAGE "CAN: Invalid Buffer"
14#define HAL_ERR_CANSessionMux_MessageNotFound_MESSAGE "CAN: Message not found"
15#define HAL_WARN_CANSessionMux_NoToken_MESSAGE "CAN: No token"
16#define HAL_ERR_CANSessionMux_NotAllowed_MESSAGE "CAN: Not allowed"
17#define HAL_ERR_CANSessionMux_NotInitialized_MESSAGE "CAN: Not initialized"
18#define HAL_WARN_CANSessionMux_TxQueueFull_MESSAGE \
19 "CAN: TX Queue full. Generally caused by a disconnected bus."
20#define HAL_WARN_CANSessionMux_SocketBufferFull_MESSAGE \
21 "CAN: Socket Buffer full. Generally caused by sending too many packets."
22
23#define HAL_SUCCESS 0
24
25#define HAL_VOLTAGE_OUT_OF_RANGE 1002
26#define HAL_VOLTAGE_OUT_OF_RANGE_MESSAGE \
27 "HAL: Voltage to convert to raw value is out of range [0; 5]"
28#define HAL_INCOMPATIBLE_STATE 1015
29#define HAL_INCOMPATIBLE_STATE_MESSAGE \
30 "HAL: Incompatible State: The operation cannot be completed"
31#define HAL_NO_AVAILABLE_RESOURCES -1004
32#define HAL_NO_AVAILABLE_RESOURCES_MESSAGE \
33 "HAL: No available resources to allocate"
34#define HAL_NULL_PARAMETER -1005
35#define HAL_NULL_PARAMETER_MESSAGE \
36 "HAL: A pointer parameter to a method is NULL"
37#define HAL_PARAMETER_OUT_OF_RANGE -1028
38#define HAL_PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range."
39#define HAL_RESOURCE_IS_ALLOCATED -1029
40#define HAL_RESOURCE_IS_ALLOCATED_MESSAGE "HAL: Resource already allocated"
41#define HAL_RESOURCE_OUT_OF_RANGE -1030
42#define HAL_RESOURCE_OUT_OF_RANGE_MESSAGE \
43 "HAL: The requested resource is out of range."
44#define HAL_COUNTER_NOT_SUPPORTED -1058
45#define HAL_COUNTER_NOT_SUPPORTED_MESSAGE \
46 "HAL: Counter mode not supported for encoder method"
47#define HAL_HANDLE_ERROR -1098
48#define HAL_HANDLE_ERROR_MESSAGE \
49 "HAL: A handle parameter was passed incorrectly"
50
51#define HAL_SERIAL_PORT_NOT_FOUND -1123
52#define HAL_SERIAL_PORT_NOT_FOUND_MESSAGE \
53 "HAL: The specified serial port device was not found"
54
55#define HAL_SERIAL_PORT_OPEN_ERROR -1124
56#define HAL_SERIAL_PORT_OPEN_ERROR_MESSAGE \
57 "HAL: The serial port could not be opened"
58
59#define HAL_SERIAL_PORT_ERROR -1125
60#define HAL_SERIAL_PORT_ERROR_MESSAGE \
61 "HAL: There was an error on the serial port"
62
63#define HAL_THREAD_PRIORITY_ERROR -1152
64#define HAL_THREAD_PRIORITY_ERROR_MESSAGE \
65 "HAL: Getting or setting the priority of a thread has failed"
66
67#define HAL_THREAD_PRIORITY_RANGE_ERROR -1153
68#define HAL_THREAD_PRIORITY_RANGE_ERROR_MESSAGE \
69 "HAL: The priority requested to be set is invalid"
70
71#define HAL_CAN_TIMEOUT -1154
72#define HAL_CAN_TIMEOUT_MESSAGE "HAL: CAN Receive has Timed Out"
73
74#define HAL_SIM_NOT_SUPPORTED -1155
75#define HAL_SIM_NOT_SUPPORTED_MESSAGE "HAL: Method not supported in sim"
76
77#define HAL_USE_LAST_ERROR -1156
78#define HAL_USE_LAST_ERROR_MESSAGE \
79 "HAL: Use HAL_GetLastError(status) to get last error"
80
81#define HAL_CAN_BUFFER_OVERRUN -35007
82#define HAL_CAN_BUFFER_OVERRUN_MESSAGE \
83 "HAL: CAN Output Buffer Full. Ensure a device is attached"
84
85/** @} */