22 #ifndef LELY_COAPP_SDO_ERROR_HPP_ 23 #define LELY_COAPP_SDO_ERROR_HPP_ 29 #include <system_error> 44 TOGGLE = UINT32_C(0x05030000),
48 NO_CS = UINT32_C(0x05040001),
56 NO_MEM = UINT32_C(0x05040005),
64 NO_OBJ = UINT32_C(0x06020000),
66 NO_PDO = UINT32_C(0x06040041),
73 PARAM = UINT32_C(0x06040043),
75 COMPAT = UINT32_C(0x06040047),
85 NO_SUB = UINT32_C(0x06090011),
95 NO_SDO = UINT32_C(0x060a0023),
97 ERROR = UINT32_C(0x08000000),
99 DATA = UINT32_C(0x08000020),
115 NO_OD = UINT32_C(0x08000023),
117 NO_VAL = UINT32_C(0x08000024)
123 SdoError(uint8_t
id, uint16_t idx, uint8_t subidx, ::std::error_code ec);
124 SdoError(uint8_t
id, uint16_t idx, uint8_t subidx, ::std::error_code ec,
125 const ::std::string& what_arg);
126 SdoError(uint8_t
id, uint16_t idx, uint8_t subidx, ::std::error_code ec,
127 const char* what_arg);
128 SdoError(uint8_t
id, uint16_t idx, uint8_t subidx,
int ev);
129 SdoError(uint8_t
id, uint16_t idx, uint8_t subidx,
int ev,
130 const ::std::string& what_arg);
131 SdoError(uint8_t
id, uint16_t idx, uint8_t subidx,
int ev,
132 const char* what_arg);
136 id() const noexcept {
159 const ::std::error_category&
SdoCategory() noexcept;
182 ::std::error_code ec) noexcept;
195 uint8_t
id, uint16_t idx, uint8_t subidx, ::std::error_code ec,
196 const ::std::string& what_arg) noexcept;
210 ::std::error_code ec,
211 const char* what_arg) noexcept;
218 [[noreturn]]
inline void 220 ::std::error_code ec) {
222 throw SdoError(
id, idx, subidx, ec);
224 throw ::std::system_error(ec);
233 [[noreturn]]
inline void 235 const ::std::string& what_arg) {
237 throw SdoError(
id, idx, subidx, ec, what_arg);
239 throw ::std::system_error(ec, what_arg);
248 [[noreturn]]
inline void 250 const char* what_arg) {
252 throw SdoError(
id, idx, subidx, ec, what_arg);
254 throw ::std::system_error(ec, what_arg);
268 #endif // LELY_COAPP_SDO_ERROR_HPP_ General parameter incompatibility reason.
Data cannot be transferred or stored to the application because of the present device state...
Maximum value is less than minimum value (download only).
Invalid value for parameter (download only).
SdoErrc sdo_errc(::std::error_code ec)
Returns the SDO abort code corresponding to an error code.
Invalid block size (block mode only).
Attempt to write a read only object.
Access failed due to a hardware error.
Resource not available: SDO connection.
void throw_sdo_error(uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code ec)
Throws a lely::canopen::SdoError with the specified attributes if ec is an SDO error (ec...
Unsupported access to an object.
uint16_t idx() const noexcept
Returns the object index.
Data cannot be transferred or stored to the application because of local control. ...
The mask to get/set the toggle bit from an NMT state.
Sub-index does not exist.
No data available. (NO_DATA is a macro defined in <netdb.h>)
Data cannot be transferred or stored to the application.
SdoErrc
The SDO abort codes.
Data type does not match, length of service parameter too high.
Data type does not match, length of service parameter does not match.
CRC error (block mode only).
Invalid sequence number (block mode only).
Object dictionary dynamic generation fails or no object dictionary is present (e.g.
::std::exception_ptr make_sdo_exception_ptr(uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code ec) noexcept
Creates an std::exception_ptr that holds a reference to a lely::canopen::SdoError with the specified ...
Object cannot be mapped to the PDO.
uint8_t id() const noexcept
Returns the node-ID.
Object does not exist in the object dictionary.
Client/server command specifier not valid or unknown.
uint8_t subidx() const noexcept
Returns the object sub-index.
Value of parameter written too low (download only).
::std::error_code make_error_code(SdoErrc e) noexcept
Creates an error code corresponding to an SDO abort code.
Data type does not match, length of service parameter too low.
The number and length of the objects to be mapped would exceed the PDO length.
General internal incompatibility in the device.
This header file is part of the Lely libraries; it contains the compiler feature definitions.
const ::std::error_category & SdoCategory() noexcept
Returns a reference to the error category object for SDO abort codes.
::std::error_condition make_error_condition(SdoErrc e) noexcept
Creates an error condition corresponding to an SDO abort code.
Attempt to read a write only object.
The type of exception thrown when an SDO abort code is received.
Value of parameter written too high (download only).