![]() |
Bioscara
DALSA's DIY SCARA Robot Arm.
|
Defining common return types. More...
#include <string>Go to the source code of this file.
Namespaces | |
| namespace | bioscara_hardware_drivers |
Macros | |
| #define | RETURN_ON_ERROR(x) |
| Macro which executes a function and returns from the calling function with the error code if the called function fails. | |
| #define | RETURN_ON_FALSE(a, err_code) |
| Macro which returns the calling function with specified error_code if the given condition is false. | |
| #define | RETURN_ON_NEGATIVE(a, err_code) |
| Macro which returns the calling function with specified error_code if the given condition is negative. | |
Enumerations | |
| enum class | bioscara_hardware_drivers::err_type_t { bioscara_hardware_drivers::OK = 0 , bioscara_hardware_drivers::ERROR = -1 , bioscara_hardware_drivers::NOT_HOMED = -2 , bioscara_hardware_drivers::NOT_ENABLED = -3 , bioscara_hardware_drivers::STALLED = -4 , bioscara_hardware_drivers::NOT_INIT = -5 , bioscara_hardware_drivers::COMM_ERROR = -6 , bioscara_hardware_drivers::INVALID_ARGUMENT = -101 , bioscara_hardware_drivers::INCORRECT_STATE = -109 } |
| Enum defining common error types. More... | |
Functions | |
| std::string | bioscara_hardware_drivers::error_to_string (err_type_t err) |
| Converts an error code to a string and returns it. | |
Defining common return types.
| #define RETURN_ON_ERROR | ( | x | ) |
Macro which executes a function and returns from the calling function with the error code if the called function fails.
Adapted from the ESP-IDF
| x | function to call |
| #define RETURN_ON_FALSE | ( | a, | |
| err_code | |||
| ) |
Macro which returns the calling function with specified error_code if the given condition is false.
Adapted from the ESP-IDF
| a | expression that evaluates to true or false |
| err_code | return code to return on false |
| #define RETURN_ON_NEGATIVE | ( | a, | |
| err_code | |||
| ) |
Macro which returns the calling function with specified error_code if the given condition is negative.
Adapted from the ESP-IDF
| a | expression that evaluates to a signed number |
| err_code | return code to return on false |