Lely core libraries
2.3.4
|
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 (__can_net *net, uint8_t id) | |
Constructs a Client-SDO queue for a Client-SDO from the predefined connection set (the default SDO). More... | |
Sdo (__can_net *net, __co_dev *dev, uint8_t num) | |
Constructs a Client-SDO queue for a pre-configured Client-SDO. More... | |
Sdo (__co_csdo *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< is_canopen< 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< is_canopen< U >::value >::type | SubmitDownload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, T &&value, F &&con, bool block=false, const ::std::chrono::milliseconds &timeout={}) |
Queues an SDO download request. More... | |
template<class T > | |
typename ::std::enable_if< is_canopen< T >::value, bool >::type | CancelDownload (SdoDownloadRequest< T > &req, SdoErrc ac) |
Cancels an SDO download request. More... | |
template<class T > | |
typename ::std::enable_if< is_canopen< T >::value, bool >::type | AbortDownload (SdoDownloadRequest< T > &req) |
Aborts an SDO download request. More... | |
void | SubmitDownloadDcf (SdoDownloadDcfRequest &req) |
Queues an SDO download DCF request. | |
template<class F > | |
void | SubmitDownloadDcf (ev_exec_t *exec, const uint8_t *begin, const uint8_t *end, F &&con, const ::std::chrono::milliseconds &timeout={}) |
Queues an SDO download DCF request. More... | |
template<class F > | |
void | SubmitDownloadDcf (ev_exec_t *exec, const char *path, F &&con, const ::std::chrono::milliseconds &timeout={}) |
Queues an SDO download DCF request. More... | |
bool | CancelDownloadDcf (SdoDownloadDcfRequest &req, SdoErrc ac) |
Cancels an SDO download request. More... | |
bool | AbortDownloadDcf (SdoDownloadDcfRequest &req) |
Aborts an SDO download DCF request. More... | |
template<class T > | |
typename ::std::enable_if< is_canopen< T >::value >::type | SubmitUpload (SdoUploadRequest< T > &req) |
Queues an SDO upload request. | |
template<class T , class F > | |
typename ::std::enable_if< is_canopen< T >::value >::type | SubmitUpload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, F &&con, bool block=false, const ::std::chrono::milliseconds &timeout={}) |
Queues an SDO upload request. More... | |
template<class T > | |
typename ::std::enable_if< is_canopen< T >::value, bool >::type | CancelUpload (SdoUploadRequest< T > &req, SdoErrc ac) |
Cancels an SDO upload request. More... | |
template<class T > | |
typename ::std::enable_if< is_canopen< 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< is_canopen< U >::value, SdoFuture< void > >::type | AsyncDownload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, T &&value, bool block=false, 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... | |
SdoFuture< void > | AsyncDownloadDcf (ev_exec_t *exec, const uint8_t *begin, const uint8_t *end, const ::std::chrono::milliseconds &timeout={}) |
Queues a series asynchronous SDO download requests, corresponding to the entries in the specified concise DCF, and creates a future which becomes ready once all requests complete (or an error occurs). More... | |
SdoFuture< void > | AsyncDownloadDcf (ev_exec_t *exec, const char *path, const ::std::chrono::milliseconds &timeout={}) |
Queues a series asynchronous SDO download requests, corresponding to the entries in the specified concise DCF, and creates a future which becomes ready once all requests complete (or an error occurs). More... | |
template<class T > | |
typename ::std::enable_if< is_canopen< T >::value, SdoFuture< T > >::type | AsyncUpload (ev_exec_t *exec, uint16_t idx, uint8_t subidx, bool block=false, 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 | ( | __can_net * | 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.h>). |
dev | a pointer to a CANopen device (from <lely/co/dev.h>). |
num | the SDO number (in the range [1..128]). |
lely::canopen::Sdo::Sdo | ( | __co_csdo * | 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.h>). |
|
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. |
block | a flag specifying whether the request should use a block SDO instead of a segmented (or expedited) SDO. |
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 download DCF request.
This function writes each entry in the specified concise DCF to a sub-object in a remote object dictionary.
exec | the executor used to execute the completion task. |
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. |
con | the confirmation function to be called when all SDO download requests are successfully completed, or when an error occurs. |
timeout | the SDO timeout. If, after a single 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 SDO download DCF request.
This function writes each entry in the specified concise DCF to a sub-object in a remote object dictionary.
exec | the executor used to execute the completion task. |
path | the path of the concise DCF. |
con | the confirmation function to be called when all SDO download requests are successfully completed, or when an error occurs. |
timeout | the SDO timeout. If, after a single 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. |
block | a flag specifying whether the request should use a block SDO instead of a segmented (or expedited) SDO. |
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. |
block | a flag specifying whether the request should use a block SDO instead of a segmented (or expedited) SDO. |
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. |
SdoFuture< void > lely::canopen::Sdo::AsyncDownloadDcf | ( | ev_exec_t * | exec, |
const uint8_t * | begin, | ||
const uint8_t * | end, | ||
const ::std::chrono::milliseconds & | timeout = {} |
||
) |
Queues a series asynchronous SDO download requests, corresponding to the entries in the specified concise DCF, and creates a future which becomes ready once all requests complete (or an error occurs).
exec | the executor used to execute the completion task. |
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. |
timeout | the SDO timeout. If, after a single request is initiated, the timeout expires before receiving a response from the server, the client aborts the transfer with abort code SdoErrc::TIMEOUT. |
SdoFuture< void > lely::canopen::Sdo::AsyncDownloadDcf | ( | ev_exec_t * | exec, |
const char * | path, | ||
const ::std::chrono::milliseconds & | timeout = {} |
||
) |
Queues a series asynchronous SDO download requests, corresponding to the entries in the specified concise DCF, and creates a future which becomes ready once all requests complete (or an error occurs).
exec | the executor used to execute the completion task. |
path | the path of the concise DCF. |
timeout | the SDO timeout. If, after a single 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. |
block | a flag specifying whether the request should use a block SDO instead of a segmented (or expedited) SDO. |
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 | ( | ) |