32 #include "sdo_error.h"
37 :
sdo_error(static_cast<uint32_t>(error_type),additional_information)
43 #define SDO_ERROR_CASE(t,msg) case static_cast<uint32_t>(type:: t ): m_message = msg ; m_type = type:: t ; break;
49 SDO_ERROR_CASE(toggle_bit,
"Toggle bit not alternated.")
50 SDO_ERROR_CASE(timeout,
"SDO protocol timed out.")
51 SDO_ERROR_CASE(command_specifier,
"Client/server command specifier not valid or unknown.")
52 SDO_ERROR_CASE(block_size,
"Invalid block size (block mode only).")
53 SDO_ERROR_CASE(sequence_number,
"Invalid sequence number (block mode only).")
54 SDO_ERROR_CASE(crc,
"CRC error (block mode only).")
55 SDO_ERROR_CASE(memory,
"Out of memory.")
56 SDO_ERROR_CASE(access,
"Unsupported access to an object.")
57 SDO_ERROR_CASE(write_only,
"Attempt to read a write only object.")
58 SDO_ERROR_CASE(read_only,
"Attempt to write a read only object.")
59 SDO_ERROR_CASE(not_in_dictionary,
"Object does not exist in the object dictionary.")
60 SDO_ERROR_CASE(no_mapping,
"Object cannot be mapped to the PDO.")
61 SDO_ERROR_CASE(pdo_length_exceeded,
"The number and length of the objects to be mapped whould exeed PDO length.")
62 SDO_ERROR_CASE(parameter_incompatibility,
"General parameter incompatibility reason.")
63 SDO_ERROR_CASE(internal_incompatibility,
"General internal incompatibility in the device.")
64 SDO_ERROR_CASE(hardware_error,
"Access failed due to a hardware error.")
65 SDO_ERROR_CASE(service_parameter,
"Data type does not match, length of service parameter does not match.")
66 SDO_ERROR_CASE(service_parameter_too_high,
"Data type does not match, length of service parameter too high.")
67 SDO_ERROR_CASE(service_parameter_too_low,
"Data type does not match, length of service parameter too low.")
68 SDO_ERROR_CASE(subindex,
"Sub-index does not exist.")
69 SDO_ERROR_CASE(value,
"Invalid value for parameter.")
70 SDO_ERROR_CASE(value_too_high,
"Value of parameter written too high.")
71 SDO_ERROR_CASE(value_too_low,
"Value of parameter written too low.")
72 SDO_ERROR_CASE(max_less_than_min,
"Maximum value is less than minimum value")
73 SDO_ERROR_CASE(sdo_connection,
"Resource not available: SDO connection")
74 SDO_ERROR_CASE(general,
"General error")
75 SDO_ERROR_CASE(transfer_or_storage,
"Data cannot be transferred or stored to the application.")
76 SDO_ERROR_CASE(transfer_or_storage_local_control,
"Data cannot be transferred or stored to the application because of local control.")
77 SDO_ERROR_CASE(transfer_or_storage_device_state,
"Data cannot be transferred or stored to the application because of the present device state.")
78 SDO_ERROR_CASE(no_dictionary,
"Object dictionary dynamic generation fails or no object dictionary is present (e.g. object dictionary is generated from file and generation fails because of a file error).")
79 SDO_ERROR_CASE(no_data,
"No data available.")
83 SDO_ERROR_CASE(response_timeout,
"Timeout while waiting for response.")
84 SDO_ERROR_CASE(segmented_download,
"Segmented download not yet supported.")
85 SDO_ERROR_CASE(response_command,
"Invalid response command.")
86 SDO_ERROR_CASE(response_toggle_bit,
"Toggle bit in response is not equal to toggle bit in request.")
89 SDO_ERROR_CASE(unknown,
"Unknown SDO error")
94 m_message =
"Unknown SDO error.";
95 m_type = type::unknown;
101 m_message =
"SDO Error: " + m_message + (additional_information.empty()?
"":
" "+additional_information);
106 return m_message.c_str();
virtual const char * what() const noexceptoverride
Returns error description.
sdo_error(type error_type, const std::string &additional_information="")
Constructor when type is known.
type get_type() const noexcept
Returns type of the error.
This type of exception is thrown when there are problems while accessing devices via SDO...
This is the base class of all types of exceptions thrown by the KaCanOpen library. It can be used directly like std::runtime_error if there isn't any more specific error class.
type
Exact type of the SDO error.