Lely core libraries
2.3.4
|
Go to the documentation of this file.
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)
125 const ::std::string& what_arg);
127 const char* what_arg);
130 const ::std::string& what_arg);
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_
uint16_t idx() const noexcept
Returns the object index.
@ TYPE_LEN_HI
Data type does not match, length of service parameter too high.
@ BLK_CRC
CRC error (block mode only).
uint8_t id() const noexcept
Returns the node-ID.
@ TOGGLE
Toggle bit not altered.
uint8_t subidx() const noexcept
Returns the object sub-index.
@ NO_OD
Object dictionary dynamic generation fails or no object dictionary is present (e.g.
@ TYPE_LEN
Data type does not match, length of service parameter does not match.
@ BLK_SEQ
Invalid sequence number (block mode only).
@ TIMEOUT
SDO protocol timed out.
@ NO_PDO
Object cannot be mapped to the PDO.
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.
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....
@ PDO_LEN
The number and length of the objects to be mapped would exceed the PDO length.
@ NO_CS
Client/server command specifier not valid or unknown.
@ NO_OBJ
Object does not exist in the object dictionary.
@ COMPAT
General internal incompatibility in the device.
@ TYPE_LEN_LO
Data type does not match, length of service parameter too low.
@ PARAM_LO
Value of parameter written too low (download only).
@ NO_READ
Attempt to read a write only object.
@ PARAM
General parameter incompatibility reason.
@ DATA_DEV
Data cannot be transferred or stored to the application because of the present device state.
@ PARAM_RANGE
Maximum value is less than minimum value (download only).
@ PARAM_HI
Value of parameter written too high (download only).
SdoErrc
The SDO abort codes.
@ BLK_SIZE
Invalid block size (block mode only).
@ PARAM_VAL
Invalid value for parameter (download only).
@ NO_WRITE
Attempt to write a read only object.
The type of exception thrown when an SDO abort code is received.
@ HARDWARE
Access failed due to a hardware error.
@ NO_ACCESS
Unsupported access to an object.
::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 ...
@ NO_SDO
Resource not available: SDO connection.
SdoErrc sdo_errc(::std::error_code ec)
Returns the SDO abort code corresponding to an error code.
@ DATA_CTL
Data cannot be transferred or stored to the application because of local control.
::std::error_code make_error_code(SdoErrc e) noexcept
Creates an error code corresponding to an SDO abort code.
@ NO_VAL
No data available. (NO_DATA is a macro defined in <netdb.h>)
@ DATA
Data cannot be transferred or stored to the application.
@ NO_SUB
Sub-index does not exist.