Lely core libraries
2.2.5
|
A Client-SDO queue. More...
#include <sdo.hpp>
Data Structures | |
struct | Impl_ |
The internal implementation of the Client-SDO queue. More... | |
Public Member Functions | |
Sdo () | |
Default-constructs an invalid Client-SDO queue. | |
Sdo (CANNet *net, uint8_t id) | |
Constructs a Client-SDO queue for a Client-SDO from the predefined connection set (the default SDO). More... | |
Sdo (CANNet *net, CODev *dev, uint8_t num) | |
Constructs a Client-SDO queue for a pre-configured Client-SDO. More... | |
Sdo (COCSDO *sdo) | |
Constructs a Client-SDO queue from an existing Client-SDO service. More... | |
~Sdo () | |
Destructs the Client-SDO queue. More... | |
operator bool () const noexcept | |
Checks whether *this is a valid Client-SDO queue. | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value >::type | SubmitDownload (SdoDownloadRequest< T > &req) |
Queues an SDO download request. | |
template<class T , class F , class U = typename ::std::decay<T>::type> | |
typename ::std::enable_if< detail::is_canopen_type< U >::value >::type | SubmitDownload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, T &&value, F &&con, const ::std::chrono::milliseconds &timeout={}) |
Queues an SDO download request. More... | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value, bool >::type | CancelDownload (SdoDownloadRequest< T > &req, SdoErrc ac) |
Cancels an SDO download request. More... | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value, bool >::type | AbortDownload (SdoDownloadRequest< T > &req) |
Aborts an SDO download request. More... | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value >::type | SubmitUpload (SdoUploadRequest< T > &req) |
Queues an SDO upload request. | |
template<class T , class F > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value >::type | SubmitUpload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, F &&con, const ::std::chrono::milliseconds &timeout={}) |
Queues an SDO upload request. More... | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value, bool >::type | CancelUpload (SdoUploadRequest< T > &req, SdoErrc ac) |
Cancels an SDO upload request. More... | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value, bool >::type | AbortUpload (SdoUploadRequest< T > &req) |
Aborts an SDO upload request. More... | |
template<class T , class U = typename ::std::decay<T>::type> | |
typename ::std::enable_if< detail::is_canopen_type< U >::value, SdoFuture< void > >::type | AsyncDownload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, T &&value, const ::std::chrono::milliseconds &timeout={}) |
Queues an asynchronous SDO download request and creates a future which becomes ready once the request completes (or is canceled). More... | |
template<class T > | |
typename ::std::enable_if< detail::is_canopen_type< T >::value, SdoFuture< T > >::type | AsyncUpload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, const ::std::chrono::milliseconds &timeout={}) |
Queues an asynchronous SDO upload request and creates a future which becomes ready once the request completes (or is canceled). More... | |
void | Submit (detail::SdoRequestBase &req) |
Queues an LSS request. | |
bool | Cancel (detail::SdoRequestBase &req, SdoErrc ac) |
Cancels a pending SDO request. More... | |
::std::size_t | CancelAll (SdoErrc ac) |
Cancels all pending SDO requests and stops the ongoing request, if any. More... | |
bool | Abort (detail::SdoRequestBase &req) |
Aborts a pending SDO request. More... | |
::std::size_t | AbortAll () |
Aborts all pending SDO requests. More... | |
lely::canopen::Sdo::Sdo | ( | CANNet * | net, |
uint8_t | id | ||
) |
Constructs a Client-SDO queue for a Client-SDO from the predefined connection set (the default SDO).
In general, only a CANopen master is allowed to use the default SDO.
net | a pointer to a CAN network interface (from <lely/can/net.hpp>). |
id | the node-ID of the SDO server (in the range [1..127]). |
Constructs a Client-SDO queue for a pre-configured Client-SDO.
The SDO client parameter record MUST exist in the object dictionary (object 1280 to 12FF).
net | a pointer to a CAN network interface (from <lely/can/net.hpp>). |
dev | a pointer to a CANopen device (from <lely/co/dev.hpp>). |
num | the SDO number (in the range [1..128]). |
lely::canopen::Sdo::Sdo | ( | COCSDO * | sdo | ) |
Constructs a Client-SDO queue from an existing Client-SDO service.
It is the responsibility of the caller to ensure that the SDO service remains available during the lifetime of the queue.
sdo | a pointer to a CANopen Client-SDO service (from <lely/co/csdo.hpp>). |
|
default |
Destructs the Client-SDO queue.
Any ongoing or pending SDO requests are terminated with abort code SdoErrc::DATA_CTL.
|
inline |
Queues an SDO download request.
This function writes a value to a sub-object in a remote object dictionary.
exec | the executor used to execute the completion task. |
idx | the object index. |
subidx | the object sub-index. |
value | the value to be written. |
con | the confirmation function to be called on completion of the SDO request. |
timeout | the SDO timeout. If, after the request is initiated, the timeout expires before receiving a response from the server, the client aborts the transfer with abort code SdoErrc::TIMEOUT. |
|
inline |
|
inline |
|
inline |
Queues an SDO upload request.
This function reads the value of a sub-object in a remote object dictionary.
exec | the executor used to execute the completion task. |
idx | the object index. |
subidx | the object sub-index. |
con | the confirmation function to be called on completion of the SDO request. |
timeout | the SDO timeout. If, after the request is initiated, the timeout expires before receiving a response from the server, the client aborts the transfer with abort code SdoErrc::TIMEOUT. |
|
inline |
|
inline |
|
inline |
Queues an asynchronous SDO download request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
idx | the object index. |
subidx | the object sub-index. |
value | the value to be written. |
timeout | the SDO timeout. If, after the request is initiated, the timeout expires before receiving a response from the server, the client aborts the transfer with abort code SdoErrc::TIMEOUT. |
|
inline |
Queues an asynchronous SDO upload request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
idx | the object index. |
subidx | the object sub-index. |
timeout | the SDO timeout. If, after the request is initiated, the timeout expires before receiving a response from the server, the client aborts the transfer with abort code SdoErrc::TIMEOUT. |
bool lely::canopen::Sdo::Cancel | ( | detail::SdoRequestBase & | req, |
SdoErrc | ac | ||
) |
std::size_t lely::canopen::Sdo::CancelAll | ( | SdoErrc | ac | ) |
bool lely::canopen::Sdo::Abort | ( | detail::SdoRequestBase & | req | ) |
std::size_t lely::canopen::Sdo::AbortAll | ( | ) |