|
Lely core libraries 2.3.5
|
The CANopen device description. More...
#include <device.hpp>

Data Structures | |
| struct | Impl_ |
| The internal implementation of the CANopen device description. More... | |
Public Member Functions | |
| Device (const ::std::string &dcf_txt, const ::std::string &dcf_bin="", uint8_t id=0xff, util::BasicLockable *mutex=nullptr) | |
| Creates a new CANopen device description. | |
| uint8_t | netid () const noexcept |
| Returns the network-ID. | |
| uint8_t | id () const noexcept |
| Returns the node-ID. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value, T >::type | Read (uint16_t idx, uint8_t subidx) const |
| Submits an SDO upload request to the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value, T >::type | Read (uint16_t idx, uint8_t subidx, ::std::error_code &ec) const |
| Submits an SDO upload request to the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value >::type | Write (uint16_t idx, uint8_t subidx, const T &value) |
| Submits an SDO download request to the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value >::type | Write (uint16_t idx, uint8_t subidx, const T &value, ::std::error_code &ec) |
| Submits an SDO download request to the local object dictionary. | |
| void | Write (uint16_t idx, uint8_t subidx, const char *value) |
| Submits an SDO download request to the local object dictionary. | |
| void | Write (uint16_t idx, uint8_t subidx, const char *value, ::std::error_code &ec) |
| Submits an SDO download request to the local object dictionary. | |
| void | Write (uint16_t idx, uint8_t subidx, const char16_t *value) |
| Submits an SDO download request to the local object dictionary. | |
| void | Write (uint16_t idx, uint8_t subidx, const char16_t *value, ::std::error_code &ec) |
| Submits an SDO download request to the local object dictionary. | |
| void | Write (uint16_t idx, uint8_t subidx, const void *p, ::std::size_t n) |
| Submits an SDO download request to the local object dictionary. | |
| void | Write (uint16_t idx, uint8_t subidx, const void *p, ::std::size_t n, ::std::error_code &ec) |
| Submits an SDO download request to the local object dictionary. | |
| void | WriteDcf (const uint8_t *begin, const uint8_t *end) |
| Submits a series of SDO download requests to the local object dictionary. | |
| void | WriteDcf (const uint8_t *begin, const uint8_t *end, ::std::error_code &ec) |
| Submits a series of SDO download requests to the local object dictionary. | |
| void | WriteDcf (const char *path) |
| Submits a series of SDO download requests to the local object dictionary. | |
| void | WriteDcf (const char *path, ::std::error_code &ec) |
| Submits a series of SDO download requests to the local object dictionary. | |
| void | WriteEvent (uint16_t idx, uint8_t subidx) |
| Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped. | |
| void | WriteEvent (uint16_t idx, uint8_t subidx, ::std::error_code &ec) noexcept |
| Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | RpdoRead (uint8_t id, uint16_t idx, uint8_t subidx) const |
| Reads the value of a sub-object in a remote object dictionary by submitting an SDO upload request to the corresponding PDO-mapped sub-object in the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | RpdoRead (uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code &ec) const |
| Reads the value of a sub-object in a remote object dictionary by submitting an SDO upload request to the corresponding PDO-mapped sub-object in the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | TpdoRead (uint8_t id, uint16_t idx, uint8_t subidx) const |
| Submits an SDO upload request to a TPDO-mapped sub-object in the local object dictionary, which reads the value that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | TpdoRead (uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code &ec) const |
| Submits an SDO upload request to a TPDO-mapped sub-object in the local object dictionary, which reads the value that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value >::type | TpdoWrite (uint8_t id, uint16_t idx, uint8_t subidx, T value) |
| Writes a value to a sub-object in a remote object dictionary by submitting an SDO download request to the corresponding PDO-mapped sub-object in the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value >::type | TpdoWrite (uint8_t id, uint16_t idx, uint8_t subidx, T value, ::std::error_code &ec) |
| Writes a value to a sub-object in a remote object dictionary by submitting an SDO download request to the corresponding PDO-mapped sub-object in the local object dictionary. | |
| void | TpdoWriteEvent (uint8_t id, uint16_t idx, uint8_t subidx) |
| Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary. | |
| void | TpdoWriteEvent (uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code &ec) noexcept |
| Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary. | |
Protected Member Functions | |
| __co_dev * | dev () const noexcept |
| Returns a pointer to the internal CANopen device from <lely/co/dev.hpp>. | |
| const ::std::type_info & | Type (uint16_t idx, uint8_t subidx) const |
| Returns the type of a sub-object. | |
| const ::std::type_info & | Type (uint16_t idx, uint8_t subidx, ::std::error_code &ec) const noexcept |
| Returns the type of a sub-object. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value, T >::type | Get (uint16_t idx, uint8_t subidx) const |
| Reads the value of a sub-object. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value, T >::type | Get (uint16_t idx, uint8_t subidx, ::std::error_code &ec) const noexcept |
| Reads the value of a sub-object. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value >::type | Set (uint16_t idx, uint8_t subidx, const T &value) |
| Writes a CANopen value to a sub-object. | |
| template<class T> | |
| typename::std::enable_if< is_canopen< T >::value >::type | Set (uint16_t idx, uint8_t subidx, const T &value, ::std::error_code &ec) noexcept |
| Writes a CANopen value to a sub-object. | |
| void | Set (uint16_t idx, uint8_t subidx, const char *value) |
| Writes a VISIBLE_STRING to a sub-object. | |
| void | Set (uint16_t idx, uint8_t subidx, const char *value, ::std::error_code &ec) noexcept |
| Writes a VISIBLE_STRING to a sub-object. | |
| void | Set (uint16_t idx, uint8_t subidx, const char16_t *value) |
| Writes a UNICODE_STRING to a sub-object. | |
| void | Set (uint16_t idx, uint8_t subidx, const char16_t *value, ::std::error_code &ec) noexcept |
| Writes a UNICODE_STRING to a sub-object. | |
| void | Set (uint16_t idx, uint8_t subidx, const void *p, ::std::size_t n) |
| Writes an OCTET_STRING or DOMAIN value to a sub-object. | |
| void | Set (uint16_t idx, uint8_t subidx, const void *p, ::std::size_t n, ::std::error_code &ec) noexcept |
| Writes an OCTET_STRING or DOMAIN value to a sub-object. | |
| const char * | GetUploadFile (uint16_t idx, uint8_t subidx) const |
| Returns the value of the UploadFile attribute of a sub-object, if present. | |
| const char * | GetUploadFile (uint16_t idx, uint8_t subidx, ::std::error_code &ec) const noexcept |
| Returns the value of the UploadFile attribute of a sub-object, if present. | |
| void | SetUploadFile (uint16_t idx, uint8_t subidx, const char *filename) |
| Sets the value of the UploadFile attribute of a sub-object, if present. | |
| void | SetUploadFile (uint16_t idx, uint8_t subidx, const char *filename, ::std::error_code &ec) noexcept |
| Sets the value of the UploadFile attribute of a sub-object, if present. | |
| const char * | GetDownloadFile (uint16_t idx, uint8_t subidx) const |
| Returns the value of the DownloadFile attribute of a sub-object, if present. | |
| const char * | GetDownloadFile (uint16_t idx, uint8_t subidx, ::std::error_code &ec) const noexcept |
| Returns the value of the DownloadFile attribute of a sub-object, if present. | |
| void | SetDownloadFile (uint16_t idx, uint8_t subidx, const char *filename) |
| Sets the value of the DownloadFile attribute of a sub-object, if present. | |
| void | SetDownloadFile (uint16_t idx, uint8_t subidx, const char *filename, ::std::error_code &ec) noexcept |
| Sets the value of the DownloadFile attribute of a sub-object, if present. | |
| void | SetEvent (uint16_t idx, uint8_t subidx) |
| Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped. | |
| void | SetEvent (uint16_t idx, uint8_t subidx, ::std::error_code &ec) noexcept |
| Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | RpdoGet (uint8_t id, uint16_t idx, uint8_t subidx) const |
| Reads the value of a sub-object in a remote object dictionary by reading the corresponding PDO-mapped sub-object in the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | RpdoGet (uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code &ec) const noexcept |
| Reads the value of a sub-object in a remote object dictionary by reading the corresponding PDO-mapped sub-object in the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | TpdoGet (uint8_t id, uint16_t idx, uint8_t subidx) const |
| Reads the value of a TPDO-mapped sub-object in the local object dictionary that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type | TpdoGet (uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code &ec) const noexcept |
| Reads the value of a TPDO-mapped sub-object in the local object dictionary that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value >::type | TpdoSet (uint8_t id, uint16_t idx, uint8_t subidx, T value) |
| Writes a value to a sub-object in a remote object dictionary by writing to the corresponding PDO-mapped sub-object in the local object dictionary. | |
| template<class T> | |
| typename::std::enable_if< is_canopen_basic< T >::value >::type | TpdoSet (uint8_t id, uint16_t idx, uint8_t subidx, T value, ::std::error_code &ec) noexcept |
| Writes a value to a sub-object in a remote object dictionary by writing to the corresponding PDO-mapped sub-object in the local object dictionary. | |
| void | TpdoSetEvent (uint8_t id, uint16_t idx, uint8_t subidx) |
| Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary. | |
| void | TpdoSetEvent (uint8_t id, uint16_t idx, uint8_t subidx, ::std::error_code &ec) noexcept |
| Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary. | |
| void | UpdateRpdoMapping () |
| Updates the mapping from remote TPDO-mapped sub-objects to local RPDO-mapped sub-objects. | |
| void | UpdateTpdoMapping () |
| Updates the mapping from remote RPDO-mapped sub-objects to local TPDO-mapped sub-objects. | |
| void | RpdoWrite (uint8_t id, uint16_t idx, uint8_t subidx) |
| Invokes OnRpdoWrite() as if a value was written to an RPDO-mapped object in the local object dictionary. | |
The CANopen device description.
This class manages the object dictionary and device setttings such as the network-ID and node-ID.
Definition at line 45 of file device.hpp.
| lely::canopen::Device::Device | ( | const ::std::string & | dcf_txt, |
| const ::std::string & | dcf_bin = "", | ||
| uint8_t | id = 0xff, | ||
| util::BasicLockable * | mutex = nullptr ) |
Creates a new CANopen device description.
| dcf_txt | the path of the text EDS or DCF containing the device description. |
| dcf_bin | the path of the (binary) concise DCF containing the values of (some of) the objets in the object dictionary. If dcf_bin is empty, no concise DCF is loaded. |
| id | the node-ID (in the range [1..127, 255]). If id is 255 (unconfigured), the node-ID is obtained from the DCF. |
| mutex | an (optional) pointer to the mutex to be locked while the internal device description is accessed. The mutex MUST be unlocked when any member function is invoked. |
Definition at line 178 of file device.cpp.
| typename::std::enable_if< is_canopen< T >::value, T >::type lely::canopen::Device::Read | ( | uint16_t | idx, |
| uint8_t | subidx ) const |
Submits an SDO upload request to the local object dictionary.
This function reads the value of a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| lely::canopen::SdoError | on error. |
Definition at line 231 of file device.cpp.
| typename::std::enable_if< is_canopen< T >::value, T >::type lely::canopen::Device::Read | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| ::std::error_code & | ec ) const |
Submits an SDO upload request to the local object dictionary.
This function reads the value of a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 240 of file device.cpp.
| typename::std::enable_if< is_canopen< T >::value >::type lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const T & | value ) |
Submits an SDO download request to the local object dictionary.
This function writes a CANopen value to a sub-object while honoring all access and range checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| value | the value to be written. |
| lely::canopen::SdoError | on error. |
Definition at line 262 of file device.cpp.
| typename::std::enable_if< is_canopen< T >::value >::type lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const T & | value, | ||
| ::std::error_code & | ec ) |
Submits an SDO download request to the local object dictionary.
This function writes a CANopen value to a sub-object while honoring all access and range checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| value | the value to be written. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 270 of file device.cpp.
| void lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const char * | value ) |
Submits an SDO download request to the local object dictionary.
This function writes a VISIBLE_STRING to a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) string to be written. |
| lely::canopen::SdoError | on error. |
Definition at line 448 of file device.cpp.
| void lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const char * | value, | ||
| ::std::error_code & | ec ) |
Submits an SDO download request to the local object dictionary.
This function writes a VISIBLE_STRING to a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) string to be written. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 455 of file device.cpp.
| void lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const char16_t * | value ) |
Submits an SDO download request to the local object dictionary.
This function writes a UNICODE_STRING to a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) UCS-2 string to be written. |
| lely::canopen::SdoError | on error. |
Definition at line 461 of file device.cpp.
| void lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const char16_t * | value, | ||
| ::std::error_code & | ec ) |
Submits an SDO download request to the local object dictionary.
This function writes a UNICODE_STRING to a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) UCS-2 string to be written. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 468 of file device.cpp.
| void lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const void * | p, | ||
| ::std::size_t | n ) |
Submits an SDO download request to the local object dictionary.
This function writes an OCTET_STRING or DOMAIN value to a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| p | a pointer to the bytes to be written. |
| n | the number of bytes to write. |
| lely::canopen::SdoError | on error. |
Definition at line 496 of file device.cpp.
| void lely::canopen::Device::Write | ( | uint16_t | idx, |
| uint8_t | subidx, | ||
| const void * | p, | ||
| ::std::size_t | n, | ||
| ::std::error_code & | ec ) |
Submits an SDO download request to the local object dictionary.
This function writes an OCTET_STRING or DOMAIN value to a sub-object while honoring all access checks and executing any registered callback function.
| idx | the object index. |
| subidx | the object sub-index. |
| p | a pointer to the bytes to be written. |
| n | the number of bytes to write. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 503 of file device.cpp.
| void lely::canopen::Device::WriteDcf | ( | const uint8_t * | begin, |
| const uint8_t * | end ) |
Submits a series of SDO download requests to the local object dictionary.
This functions writes each entry in the specified concise DCF to a sub-object while honoring all access checks and executing any registered callback function.
| begin | a pointer the the first byte in a concise DCF (see object 1F22 in CiA 302-3 version 4.1.0). |
| end | a pointer to one past the last byte in the concise DCF. At most end - begin bytes are read. |
| lely::canopen::SdoError | on error. |
Definition at line 522 of file device.cpp.
| void lely::canopen::Device::WriteDcf | ( | const uint8_t * | begin, |
| const uint8_t * | end, | ||
| ::std::error_code & | ec ) |
Submits a series of SDO download requests to the local object dictionary.
This functions writes each entry in the specified concise DCF to a sub-object while honoring all access checks and executing any registered callback function.
| begin | a pointer the the first byte in a concise DCF (see object 1F22 in CiA 302-3 version 4.1.0). |
| end | a pointer to one past the last byte in the concise DCF. At most end - begin bytes are read. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 529 of file device.cpp.
| void lely::canopen::Device::WriteDcf | ( | const char * | path | ) |
Submits a series of SDO download requests to the local object dictionary.
This functions writes each entry in the specified concise DCF to a sub-object while honoring all access checks and executing any registered callback function.
| path | the path of the concise DCF. |
| lely::canopen::SdoError | on error. |
Definition at line 548 of file device.cpp.
| void lely::canopen::Device::WriteDcf | ( | const char * | path, |
| ::std::error_code & | ec ) |
Submits a series of SDO download requests to the local object dictionary.
This functions writes each entry in the specified concise DCF to a sub-object while honoring all access checks and executing any registered callback function.
| path | the path of the concise DCF. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 556 of file device.cpp.
| void lely::canopen::Device::WriteEvent | ( | uint16_t | idx, |
| uint8_t | subidx ) |
Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped.
| idx | the object index. |
| subidx | the object sub-index. |
| lely::canopen::SdoError | if the sub-object does not exist. |
Definition at line 575 of file device.cpp.
|
noexcept |
Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | if the sub-object does not exist, the SDO abort code is stored in ec. |
Definition at line 582 of file device.cpp.
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type lely::canopen::Device::RpdoRead | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx ) const |
Reads the value of a sub-object in a remote object dictionary by submitting an SDO upload request to the corresponding PDO-mapped sub-object in the local object dictionary.
This function honors all access checks of the local object dictionary and executes any registered callback function.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| lely::canopen::SdoError | on error. |
Definition at line 591 of file device.cpp.
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type lely::canopen::Device::RpdoRead | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx, | ||
| ::std::error_code & | ec ) const |
Reads the value of a sub-object in a remote object dictionary by submitting an SDO upload request to the corresponding PDO-mapped sub-object in the local object dictionary.
This function honors all access checks of the local object dictionary and executes any registered callback function.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 600 of file device.cpp.
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type lely::canopen::Device::TpdoRead | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx ) const |
Submits an SDO upload request to a TPDO-mapped sub-object in the local object dictionary, which reads the value that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO.
This function honors all access checks of the local object dictionary and executes any registered callback function.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| lely::canopen::SdoError | on error. |
Definition at line 613 of file device.cpp.
| typename::std::enable_if< is_canopen_basic< T >::value, T >::type lely::canopen::Device::TpdoRead | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx, | ||
| ::std::error_code & | ec ) const |
Submits an SDO upload request to a TPDO-mapped sub-object in the local object dictionary, which reads the value that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO.
This function honors all access checks of the local object dictionary and executes any registered callback function.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 622 of file device.cpp.
| typename::std::enable_if< is_canopen_basic< T >::value >::type lely::canopen::Device::TpdoWrite | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx, | ||
| T | value ) |
Writes a value to a sub-object in a remote object dictionary by submitting an SDO download request to the corresponding PDO-mapped sub-object in the local object dictionary.
This function honors all access checks of the local object dictionary and executes any registered callback function.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| value | the value to be written. |
| lely::canopen::SdoError | on error. |
Definition at line 635 of file device.cpp.
| typename::std::enable_if< is_canopen_basic< T >::value >::type lely::canopen::Device::TpdoWrite | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx, | ||
| T | value, | ||
| ::std::error_code & | ec ) |
Writes a value to a sub-object in a remote object dictionary by submitting an SDO download request to the corresponding PDO-mapped sub-object in the local object dictionary.
This function honors all access checks of the local object dictionary and executes any registered callback function.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| value | the value to be written. |
| ec | on error, the SDO abort code is stored in ec. |
Definition at line 643 of file device.cpp.
| void lely::canopen::Device::TpdoWriteEvent | ( | uint8_t | id, |
| uint16_t | idx, | ||
| uint8_t | subidx ) |
Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| lely::canopen::SdoError | if the sub-object does not exist. |
Definition at line 796 of file device.cpp.
|
noexcept |
Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| ec | if the sub-object does not exist, the SDO abort code is stored in ec. |
Definition at line 803 of file device.cpp.
|
protected |
Returns the type of a sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
std::type_info object representing the type, or typeid(void) if unknown.| lely::canopen::SdoError | if the sub-object does not exist. |
Definition at line 833 of file device.cpp.
|
protectednoexcept |
Returns the type of a sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | if the sub-object does not exist, the SDO abort code is stored in ec. |
std::type_info object representing the type, or typeid(void) if unknown. Definition at line 841 of file device.cpp.
|
protected |
Reads the value of a sub-object.
This function reads the value directly from the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| lely::canopen::SdoError | if the sub-object does not exist or the type does not match. |
Definition at line 904 of file device.cpp.
|
protectednoexcept |
Reads the value of a sub-object.
This function reads the value directly from the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | if the sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 913 of file device.cpp.
|
protected |
Writes a CANopen value to a sub-object.
This function writes the value directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| value | the value to be written. |
| lely::canopen::SdoError | if the sub-object does not exist or the type does not match. |
Definition at line 943 of file device.cpp.
|
protectednoexcept |
Writes a CANopen value to a sub-object.
This function writes the value directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| value | the value to be written. |
| ec | if the sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 951 of file device.cpp.
|
protected |
Writes a VISIBLE_STRING to a sub-object.
This function writes the string directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) string to be written. |
| lely::canopen::SdoError | if the sub-object does not exist or the type does not match. |
Definition at line 1144 of file device.cpp.
|
protectednoexcept |
Writes a VISIBLE_STRING to a sub-object.
This function writes the string directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) string to be written. |
| ec | if the sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 1151 of file device.cpp.
|
protected |
Writes a UNICODE_STRING to a sub-object.
This function writes the string directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) UCS-2 string to be written. |
| lely::canopen::SdoError | if the sub-object does not exist or the type does not match. |
Definition at line 1157 of file device.cpp.
|
protectednoexcept |
Writes a UNICODE_STRING to a sub-object.
This function writes the string directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| value | a pointer to the (null-terminated) UCS-2 string to be written. |
| ec | if the sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 1164 of file device.cpp.
|
protected |
Writes an OCTET_STRING or DOMAIN value to a sub-object.
This function writes the bytes directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| p | a pointer to the bytes to be written. |
| n | the number of bytes to write. |
| lely::canopen::SdoError | if the sub-object does not exist or the type does not match. |
Definition at line 1202 of file device.cpp.
|
protectednoexcept |
Writes an OCTET_STRING or DOMAIN value to a sub-object.
This function writes the bytes directly to the object dictionary and bypasses any access checks or registered callback functions.
| idx | the object index. |
| subidx | the object sub-index. |
| p | a pointer to the bytes to be written. |
| n | the number of bytes to write. |
| ec | if the sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 1209 of file device.cpp.
|
protected |
Returns the value of the UploadFile attribute of a sub-object, if present.
The returned value is valid until the next call to SetUploadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
nullptr if the UploadFile attribute does not exist.| lely::canopen::SdoError | if the sub-object does not exist. |
Definition at line 1235 of file device.cpp.
|
protectednoexcept |
Returns the value of the UploadFile attribute of a sub-object, if present.
The returned value is valid until the next call to SetUploadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | if the sub-object does not exist, the SDO abort code is stored in ec. |
nullptr on error or if the UploadFile attribute does not exist. Definition at line 1243 of file device.cpp.
|
protected |
Sets the value of the UploadFile attribute of a sub-object, if present.
This operation invalidates any value returned by a previous call to GetUploadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| filename | a pointer to the string to be copied to the UploadFile attribute. |
| lely::canopen::SdoError | if the sub-object does not exist or does not have the UploadFile attribute. |
Definition at line 1262 of file device.cpp.
|
protectednoexcept |
Sets the value of the UploadFile attribute of a sub-object, if present.
This operation invalidates any value returned by a previous call to GetUploadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| filename | a pointer to the string to be copied to the UploadFile attribute. |
| ec | if the sub-object does not exist or does not have the UploadFile attribute, the SDO abort code is stored in ec. |
Definition at line 1269 of file device.cpp.
|
protected |
Returns the value of the DownloadFile attribute of a sub-object, if present.
The returned value is valid until the next call to SetDownloadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
nullptr if the DownloadFile attribute does not exist.| lely::canopen::SdoError | if the sub-object does not exist. |
Definition at line 1293 of file device.cpp.
|
protectednoexcept |
Returns the value of the DownloadFile attribute of a sub-object, if present.
The returned value is valid until the next call to SetDownloadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | if the sub-object does not exist, the SDO abort code is stored in ec. |
nullptr on error or if the DownloadFile attribute does not exist. Definition at line 1301 of file device.cpp.
|
protected |
Sets the value of the DownloadFile attribute of a sub-object, if present.
This operation invalidates any value returned by a previous call to GetDownloadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| filename | a pointer to the string to be copied to the DownloadFile attribute. |
| lely::canopen::SdoError | if the sub-object does not exist or does not have the DownloadFile attribute. |
Definition at line 1320 of file device.cpp.
|
protectednoexcept |
Sets the value of the DownloadFile attribute of a sub-object, if present.
This operation invalidates any value returned by a previous call to GetDownloadFile() for the same sub-object.
| idx | the object index. |
| subidx | the object sub-index. |
| filename | a pointer to the string to be copied to the DownloadFile attribute. |
| ec | if the sub-object does not exist or does not have the DownloadFile attribute, the SDO abort code is stored in ec. |
Definition at line 1327 of file device.cpp.
|
protected |
Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped.
| idx | the object index. |
| subidx | the object sub-index. |
| lely::canopen::SdoError | if the sub-object does not exist. |
Definition at line 1353 of file device.cpp.
|
protectednoexcept |
Checks if the specified sub-object in the local object dictionary can be mapped into a PDO and, if so, triggers the transmission of every event-driven, asynchronous Transmit-PDO into which the sub-object is mapped.
| idx | the object index. |
| subidx | the object sub-index. |
| ec | if the sub-object does not exist, the SDO abort code is stored in ec. |
| lely::canopen::SdoError | on error. |
Definition at line 1360 of file device.cpp.
|
protected |
Reads the value of a sub-object in a remote object dictionary by reading the corresponding PDO-mapped sub-object in the local object dictionary.
This function reads the value directly from the local object dictionary and bypasses any access checks or registered callback functions.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| lely::canopen::SdoError | if the PDO-mapped sub-object does not exist or the type does not match. |
Definition at line 1383 of file device.cpp.
|
protectednoexcept |
Reads the value of a sub-object in a remote object dictionary by reading the corresponding PDO-mapped sub-object in the local object dictionary.
This function reads the value directly from the local object dictionary and bypasses any access checks or registered callback functions.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| ec | if the PDO-mapped sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 1392 of file device.cpp.
|
protected |
Reads the value of a TPDO-mapped sub-object in the local object dictionary that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO.
This function reads the value directly from the local object dictionary and bypasses any access checks or registered callback functions.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| lely::canopen::SdoError | if the PDO-mapped sub-object does not exist or the type does not match. |
Definition at line 1402 of file device.cpp.
|
protectednoexcept |
Reads the value of a TPDO-mapped sub-object in the local object dictionary that will be written to an RPDO-mapped sub-object in a remote object dictionary by a Transmit-PDO.
This function reads the value directly from the local object dictionary and bypasses any access checks or registered callback functions.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| ec | if the PDO-mapped sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 1411 of file device.cpp.
|
protected |
Writes a value to a sub-object in a remote object dictionary by writing to the corresponding PDO-mapped sub-object in the local object dictionary.
This function writes the value directly to the local object dictionary and bypasses any access and range checks or registered callback functions.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| value | the value to be written. |
| lely::canopen::SdoError | if the PDO-mapped sub-object does not exist or the type does not match. |
Definition at line 1421 of file device.cpp.
|
protectednoexcept |
Writes a value to a sub-object in a remote object dictionary by writing to the corresponding PDO-mapped sub-object in the local object dictionary.
This function writes the value directly to the local object dictionary and bypasses any access and range checks or registered callback functions.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| value | the value to be written. |
| ec | if the PDO-mapped sub-object does not exist or the type does not match, the SDO abort code is stored in ec. |
Definition at line 1429 of file device.cpp.
|
protected |
Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| lely::canopen::SdoError | if the PDO-mapped sub-object does not exist. |
Definition at line 1579 of file device.cpp.
|
protectednoexcept |
Triggers the transmission of every event-driven, asynchronous Transmit-PDO which is mapped into the specified sub-object in a remote object dictionary.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
| ec | if the PDO-mapped sub-object does not exist, the SDO abort code is stored in ec. |
Definition at line 1586 of file device.cpp.
|
protected |
Updates the mapping from remote TPDO-mapped sub-objects to local RPDO-mapped sub-objects.
The mapping is constructed from the RPDO communication and mapping parameters, and the Lely-specific objects 5800..59FF (Remote TPDO number and node-ID) and 5A00..5BFF (Remote TPDO mapping).
Definition at line 1594 of file device.cpp.
|
protected |
Updates the mapping from remote RPDO-mapped sub-objects to local TPDO-mapped sub-objects.
The mapping is constructed from the TPDO communication and mapping parameters, and the Lely-specific objects 5C00..5DFF (Remote RPDO number and node-ID) and 5E00..5FFF (Remote RPDO mapping).
Definition at line 1714 of file device.cpp.
|
protected |
Invokes OnRpdoWrite() as if a value was written to an RPDO-mapped object in the local object dictionary.
| id | the node-ID. |
| idx | the remote object index. |
| subidx | the remote object sub-index. |
Definition at line 1776 of file device.cpp.