Lely core libraries
2.2.5
|
The base class for CANopen LSS masters. More...
#include <lss_master.hpp>
Data Structures | |
struct | Impl_ |
Public Member Functions | |
LssMaster (ev_exec_t *exec, Node &node, io::CanControllerBase *ctrl=nullptr) | |
Creates a new CANopen LSS master. More... | |
LssMaster (Node &node, io::CanControllerBase *ctrl=nullptr) | |
Creates a new CANopen LSS master. | |
ev::Executor | GetExecutor () const noexcept |
Returns the default executor used to execute completion tasks of LSS requests. | |
Node & | GetNode () const noexcept |
Returns the CANopen master node. | |
io::CanControllerBase * | GetController () const noexcept |
Returns the pointer to the CAN controller for this node passed to the constructor (may be a null pointer). | |
::std::chrono::microseconds | GetInhibit () const |
Returns the inhibit time between successive CAN frames. More... | |
void | SetInhibit (const ::std::chrono::microseconds &inhibit) |
Sets the inhibit time between successive CAN frames. More... | |
::std::chrono::milliseconds | GetTimeout () const |
Returns the timeout when waiting for a slave to respond to an LSS request. More... | |
void | SetTimeout (const ::std::chrono::milliseconds &timeout) |
Sets the timeout when waiting for a slave to respond to an LSS request. More... | |
void | SubmitSwitch (detail::LssSwitchRequestBase &req, LssState state=LssState::WAITING) |
Queues an LSS 'switch state global' request. More... | |
template<class F > | |
void | SubmitSwitch (ev_exec_t *exec, LssState state, F &&con) |
Creates and queues an LSS 'switch state global' request. More... | |
template<class F > | |
void | SubmitSwitch (LssState state, F &&con) |
Equivalent to SubmitSwitch(nullptr, state, con) . | |
bool | CancelSwitch (detail::LssSwitchRequestBase &req) |
Cancels an LSS 'switch state global' request. More... | |
bool | AbortSwitch (detail::LssSwitchRequestBase &req) |
Aborts an LSS 'switch state global' request. More... | |
LssFuture< void > | AsyncSwitch (ev_exec_t *exec, LssState state=LssState::WAITING, detail::LssSwitchRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'switch state global' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< void > | AsyncSwitch (LssState state=LssState::WAITING, detail::LssSwitchRequestBase **preq=nullptr) |
Equivalent to AsyncSwitch(nullptr, state, preq) . | |
void | SubmitSwitchSelective (detail::LssSwitchSelectiveRequestBase &req, const LssAddress &address) |
Queues an LSS 'switch state selective' request. More... | |
template<class F > | |
void | SubmitSwitchSelective (ev_exec_t *exec, const LssAddress &address, F &&con) |
Creates and queues an LSS 'switch state selective' request. More... | |
template<class F > | |
void | SubmitSwitchSelective (const LssAddress &address, F &&con) |
Equivalent to SubmitSwitchSelective(nullptr, state, con) . | |
bool | CancelSwitchSelective (detail::LssSwitchSelectiveRequestBase &req) |
Cancels an LSS 'switch state selective' request. More... | |
bool | AbortSwitchSelective (detail::LssSwitchSelectiveRequestBase &req) |
Aborts an LSS 'switch state selective' request. More... | |
LssFuture< void > | AsyncSwitchSelective (ev_exec_t *exec, const LssAddress &address, detail::LssSwitchSelectiveRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'switch state selective' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< void > | AsyncSwitchSelective (const LssAddress &address, detail::LssSwitchSelectiveRequestBase **preq=nullptr) |
Equivalent to AsyncSwitchSelective(nullptr, address, preq) . | |
void | SubmitSetId (detail::LssSetIdRequestBase &req, uint8_t id) |
Queues an LSS 'configure node-ID' request. More... | |
template<class F > | |
void | SubmitSetId (ev_exec_t *exec, uint8_t id, F &&con) |
Creates and queues an LSS 'configure node-ID' request. More... | |
template<class F > | |
void | SubmitSetId (uint8_t id, F &&con) |
Equivalent to SubmitSetId(nullptr, id, con) . | |
bool | CancelSetId (detail::LssSetIdRequestBase &req) |
Cancels an LSS 'configure node-ID' request. More... | |
bool | AbortSetId (detail::LssSetIdRequestBase &req) |
Aborts an LSS 'configure node-ID' request. More... | |
LssFuture< void > | AsyncSetId (ev_exec_t *exec, uint8_t id, detail::LssSetIdRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'configure node-ID' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< void > | AsyncSetId (uint8_t id, detail::LssSetIdRequestBase **preq=nullptr) |
Equivalent to AsyncSetId(nullptr, id, preq) . | |
void | SubmitSetBitrate (detail::LssSetBitrateRequestBase &req, int bitrate) |
Queues an LSS 'configure bit timing parameters' request. More... | |
template<class F > | |
void | SubmitSetBitrate (ev_exec_t *exec, int bitrate, F &&con) |
Creates and queues an LSS 'configure bit timing parameters' request. More... | |
template<class F > | |
void | SubmitSetBitrate (int bitrate, F &&con) |
Equivalent to SubmitSetBitrate(nullptr, id, con) . | |
bool | CancelSetBitrate (detail::LssSetBitrateRequestBase &req) |
Cancels an LSS 'configure bit timing parameters' request. More... | |
bool | AbortSetBitrate (detail::LssSetBitrateRequestBase &req) |
Aborts an LSS 'configure bit timing parameters' request. More... | |
LssFuture< void > | AsyncSetBitrate (ev_exec_t *exec, int bitrate, detail::LssSetBitrateRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'configure bit timing parameters' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< void > | AsyncSetBitrate (int bitrate, detail::LssSetBitrateRequestBase **preq=nullptr) |
Equivalent to AsyncSetBitrate(nullptr, id, preq) . | |
void | SubmitSwitchBitrate (detail::LssSwitchBitrateRequestBase &req, int delay) |
Queues an LSS 'activate bit timing parameters' request. More... | |
template<class F > | |
void | SubmitSwitchBitrate (ev_exec_t *exec, int delay, F &&con) |
Creates and queues an LSS 'activate bit timing parameters' request. More... | |
template<class F > | |
void | SubmitSwitchBitrate (int delay, F &&con) |
Equivalent to SubmitSwitchBitrate(nullptr, id, con) . | |
bool | CancelSwitchBitrate (detail::LssSwitchBitrateRequestBase &req) |
Cancels an LSS 'activate bit timing parameters' request. More... | |
bool | AbortSwitchBitrate (detail::LssSwitchBitrateRequestBase &req) |
Aborts an LSS 'activate bit timing parameters' request. More... | |
LssFuture< void > | AsyncSwitchBitrate (ev_exec_t *exec, int delay, detail::LssSwitchBitrateRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'activate bit timing parameters' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< void > | AsyncSwitchBitrate (int delay, detail::LssSwitchBitrateRequestBase **preq=nullptr) |
Equivalent to AsyncSwitchBitrate(nullptr, id, preq) . | |
void | SubmitStore (detail::LssStoreRequestBase &req) |
Queues an LSS 'store configuration' request. More... | |
template<class F > | |
void | SubmitStore (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'store configuration' request. More... | |
template<class F > | |
void | SubmitStore (F &&con) |
Equivalent to SubmitStore(nullptr, con) . | |
bool | CancelStore (detail::LssStoreRequestBase &req) |
Cancels an LSS 'store configuration' request. More... | |
bool | AbortStore (detail::LssStoreRequestBase &req) |
Aborts an LSS 'store configuration' request. More... | |
LssFuture< void > | AsyncStore (ev_exec_t *exec, detail::LssStoreRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'store configuration' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< void > | AsyncStore (detail::LssStoreRequestBase **preq=nullptr) |
Equivalent to AsyncStore(nullptr, preq) . | |
void | SubmitGetVendorId (detail::LssGetVendorIdRequestBase &req) |
Queues an LSS 'inquire identity vendor-ID' request. More... | |
template<class F > | |
void | SubmitGetVendorId (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'inquire identity vendor-ID' request. More... | |
template<class F > | |
void | SubmitGetVendorId (F &&con) |
Equivalent to SubmitGetVendorId(nullptr, con) . | |
bool | CancelGetVendorId (detail::LssGetVendorIdRequestBase &req) |
Cancels an LSS 'inquire identity vendor-ID' request. More... | |
bool | AbortGetVendorId (detail::LssGetVendorIdRequestBase &req) |
Aborts an LSS 'inquire identity vendor-ID' request. More... | |
LssFuture< uint32_t > | AsyncGetVendorId (ev_exec_t *exec, detail::LssGetVendorIdRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'inquire identity vendor-ID' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< uint32_t > | AsyncGetVendorId (detail::LssGetVendorIdRequestBase **preq=nullptr) |
Equivalent to AsyncGetVendorId(nullptr, preq) . | |
void | SubmitGetProductCode (detail::LssGetProductCodeRequestBase &req) |
Queues an LSS 'inquire identity product-code' request. More... | |
template<class F > | |
void | SubmitGetProductCode (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'inquire identity product-code' request. More... | |
template<class F > | |
void | SubmitGetProductCode (F &&con) |
Equivalent to SubmitGetProductCode(nullptr, con) . | |
bool | CancelGetProductCode (detail::LssGetProductCodeRequestBase &req) |
Cancels an LSS 'inquire identity product-code' request. More... | |
bool | AbortGetProductCode (detail::LssGetProductCodeRequestBase &req) |
Aborts an LSS 'inquire identity product-code' request. More... | |
LssFuture< uint32_t > | AsyncGetProductCode (ev_exec_t *exec, detail::LssGetProductCodeRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'inquire identity product-code' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< uint32_t > | AsyncGetProductCode (detail::LssGetProductCodeRequestBase **preq=nullptr) |
Equivalent to AsyncGetProductCode(nullptr, preq) . | |
void | SubmitGetRevision (detail::LssGetRevisionRequestBase &req) |
Queues an LSS 'inquire identity revision-number' request. More... | |
template<class F > | |
void | SubmitGetRevision (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'inquire identity revision-number' request. More... | |
template<class F > | |
void | SubmitGetRevision (F &&con) |
Equivalent to SubmitGetRevision(nullptr, con) . | |
bool | CancelGetRevision (detail::LssGetRevisionRequestBase &req) |
Cancels an LSS 'inquire identity revision-number' request. More... | |
bool | AbortGetRevision (detail::LssGetRevisionRequestBase &req) |
Aborts an LSS 'inquire identity revision-number' request. More... | |
LssFuture< uint32_t > | AsyncGetRevision (ev_exec_t *exec, detail::LssGetRevisionRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'inquire identity revision-number' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< uint32_t > | AsyncGetRevision (detail::LssGetRevisionRequestBase **preq=nullptr) |
Equivalent to AsyncGetRevision(nullptr, preq) . | |
void | SubmitGetSerialNr (detail::LssGetSerialNrRequestBase &req) |
Queues an LSS 'inquire identity serial-number' request. More... | |
template<class F > | |
void | SubmitGetSerialNr (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'inquire identity serial-number' request. More... | |
template<class F > | |
void | SubmitGetSerialNr (F &&con) |
Equivalent to SubmitGetSerialNr(nullptr, con) . | |
bool | CancelGetSerialNr (detail::LssGetSerialNrRequestBase &req) |
Cancels an LSS 'inquire identity serial-number' request. More... | |
bool | AbortGetSerialNr (detail::LssGetSerialNrRequestBase &req) |
Aborts an LSS 'inquire identity serial-number' request. More... | |
LssFuture< uint32_t > | AsyncGetSerialNr (ev_exec_t *exec, detail::LssGetSerialNrRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'inquire identity serial-number' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< uint32_t > | AsyncGetSerialNr (detail::LssGetSerialNrRequestBase **preq=nullptr) |
Equivalent to AsyncGetSerialNr(nullptr, preq) . | |
void | SubmitGetId (detail::LssGetIdRequestBase &req) |
Queues an LSS 'inquire node-ID' request. More... | |
template<class F > | |
void | SubmitGetId (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'inquire node-ID' request. More... | |
template<class F > | |
void | SubmitGetId (F &&con) |
Equivalent to SubmitGetId(nullptr, con) . | |
bool | CancelGetId (detail::LssGetIdRequestBase &req) |
Cancels an LSS 'inquire node-ID' request. More... | |
bool | AbortGetId (detail::LssGetIdRequestBase &req) |
Aborts an LSS 'inquire node-ID' request. More... | |
LssFuture< uint8_t > | AsyncGetId (ev_exec_t *exec, detail::LssGetIdRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'inquire node-ID' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< uint8_t > | AsyncGetId (detail::LssGetIdRequestBase **preq=nullptr) |
Equivalent to AsyncGetId(nullptr, preq) . | |
void | SubmitIdNonConfig (detail::LssIdNonConfigRequestBase &req) |
Queues an LSS 'identify non-configured remote slave' request. More... | |
template<class F > | |
void | SubmitIdNonConfig (ev_exec_t *exec, F &&con) |
Creates and queues an LSS 'identify non-configured remote slave' request. More... | |
template<class F > | |
void | SubmitIdNonConfig (F &&con) |
Equivalent to SubmitIdNonConfig(nullptr, con) . | |
bool | CancelIdNonConfig (detail::LssIdNonConfigRequestBase &req) |
Cancels an LSS 'identify non-configured remote slave' request. More... | |
bool | AbortIdNonConfig (detail::LssIdNonConfigRequestBase &req) |
Aborts an LSS 'identify non-configured remote slave' request. More... | |
LssFuture< bool > | AsyncIdNonConfig (ev_exec_t *exec, detail::LssIdNonConfigRequestBase **preq=nullptr) |
Queues an asynchronous LSS 'identify non-configured remote slave' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< bool > | AsyncIdNonConfig (detail::LssIdNonConfigRequestBase **preq=nullptr) |
Equivalent to AsyncIdNonConfig(nullptr, preq) . | |
void | SubmitSlowscan (detail::LssSlowscanRequestBase &req, const LssAddress &lo, const LssAddress &hi) |
Queues an 'LSS Slowscan' request. More... | |
template<class F > | |
void | SubmitSlowscan (ev_exec_t *exec, const LssAddress &lo, const LssAddress &hi, F &&con) |
Creates and queues an 'LSS Slowscan' request. More... | |
template<class F > | |
void | SubmitSlowscan (F &&con) |
Equivalent to SubmitSlowscan(nullptr, con) . | |
bool | CancelSlowscan (detail::LssSlowscanRequestBase &req) |
Cancels an 'LSS Slowscan' request. More... | |
bool | AbortSlowscan (detail::LssSlowscanRequestBase &req) |
Aborts an 'LSS Slowscan' request. More... | |
LssFuture< LssAddress > | AsyncSlowscan (ev_exec_t *exec, const LssAddress &lo, const LssAddress &hi, detail::LssSlowscanRequestBase **preq=nullptr) |
Queues an asynchronous 'LSS Slowscan' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< LssAddress > | AsyncSlowscan (const LssAddress &lo, const LssAddress &hi, detail::LssSlowscanRequestBase **preq=nullptr) |
Equivalent to AsyncSlowscan(nullptr, lo, hi, preq) . | |
void | SubmitFastscan (detail::LssFastscanRequestBase &req, const LssAddress &address, const LssAddress &mask) |
Queues an 'LSS Fastscan' request. More... | |
template<class F > | |
void | SubmitFastscan (ev_exec_t *exec, const LssAddress &address, const LssAddress &mask, F &&con) |
Creates and queues an 'LSS Fastscan' request. More... | |
template<class F > | |
void | SubmitFastscan (F &&con) |
Equivalent to SubmitFastscan(nullptr, con) . | |
bool | CancelFastscan (detail::LssFastscanRequestBase &req) |
Cancels an 'LSS Fastscan' request. More... | |
bool | AbortFastscan (detail::LssFastscanRequestBase &req) |
Aborts an 'LSS Fastscan' request. More... | |
LssFuture< LssAddress > | AsyncFastscan (ev_exec_t *exec, const LssAddress &address={0, 0, 0, 0}, const LssAddress &mask={0, 0, 0, 0}, detail::LssFastscanRequestBase **preq=nullptr) |
Queues an asynchronous 'LSS Fastscan' request and creates a future which becomes ready once the request completes (or is canceled). More... | |
LssFuture< LssAddress > | AsyncFastscan (const LssAddress &address={0, 0, 0, 0}, const LssAddress &mask={0, 0, 0, 0}, detail::LssFastscanRequestBase **preq=nullptr) |
Equivalent to AsyncFastscan(nullptr, address, mask, preq) . | |
void | Submit (detail::LssRequestBase &req) |
Queues an LSS request. | |
bool | Cancel (detail::LssRequestBase &req) |
Cancels a pending LSS request. More... | |
::std::size_t | CancelAll () |
Cancels all pending LSS requests and stops the ongoing request, if any. More... | |
bool | Abort (detail::LssRequestBase &req) |
Aborts a pending LSS request. More... | |
::std::size_t | AbortAll () |
Aborts all pending LSS requests. More... | |
virtual void | OnStart (::std::function< void(::std::error_code ec)> res) noexcept |
The function invoked when the LSS master services are executed during the NMT startup process. More... | |
virtual void | OnSwitchBitrate (int bitrate, ::std::chrono::milliseconds delay, ::std::function< void(::std::error_code ec)> res) noexcept |
The function invoked when the master activates the bit rate of all CANopen devices in the network. More... | |
Protected Member Functions | |
void | lock () final |
Blocks until a lock can be obtained for the current execution agent (thread, process, task). More... | |
void | unlock () final |
Releases the lock held by the execution agent. Throws no exceptions. | |
void | SetTime () |
Update the CAN network time. More... | |
The base class for CANopen LSS masters.
This class inherits the mutex protecting the corresponding CANopen master node.
Definition at line 1350 of file lss_master.hpp.
|
explicit |
Creates a new CANopen LSS master.
exec | the executor used to execute LSS requests. If exec is a null pointer, the executor of the CANopen node is used. |
node | a CANopen master node. |
ctrl | a pointer to the CAN controller for node (can be a null pointer). |
Definition at line 187 of file lss_master.cpp.
std::chrono::microseconds lely::canopen::LssMaster::GetInhibit | ( | ) | const |
Returns the inhibit time between successive CAN frames.
Definition at line 208 of file lss_master.cpp.
void lely::canopen::LssMaster::SetInhibit | ( | const ::std::chrono::microseconds & | inhibit | ) |
Sets the inhibit time between successive CAN frames.
Definition at line 215 of file lss_master.cpp.
std::chrono::milliseconds lely::canopen::LssMaster::GetTimeout | ( | ) | const |
Returns the timeout when waiting for a slave to respond to an LSS request.
Definition at line 229 of file lss_master.cpp.
void lely::canopen::LssMaster::SetTimeout | ( | const ::std::chrono::milliseconds & | timeout | ) |
Sets the timeout when waiting for a slave to respond to an LSS request.
Definition at line 235 of file lss_master.cpp.
|
inline |
Queues an LSS 'switch state global' request.
This function switches all slave devices to the specified LSS state.
req | the request to be submitted. |
state | the desired state of the LSS slave devices. |
Definition at line 1431 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'switch state global' request.
This function switches all slave devices to the specified LSS state.
exec | the executor used to execute the completion task. |
state | the desired state of the LSS slave devices. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1448 of file lss_master.hpp.
|
inline |
Cancels an LSS 'switch state global' request.
Definition at line 1461 of file lss_master.hpp.
|
inline |
Aborts an LSS 'switch state global' request.
Definition at line 1467 of file lss_master.hpp.
LssFuture< void > lely::canopen::LssMaster::AsyncSwitch | ( | ev_exec_t * | exec, |
LssState | state = LssState::WAITING , |
||
detail::LssSwitchRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'switch state global' request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
state | the desired state of the LSS slave devices. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 248 of file lss_master.cpp.
|
inline |
Queues an LSS 'switch state selective' request.
This function switches the slave device with the specified LSS address to the LSS configuration state.
req | the request to be submitted. |
address | the address of the LSS slave device to be switched into the configuration state. |
Definition at line 1503 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'switch state selective' request.
This function switches the slave device with the specified LSS address to the LSS configuration state.
exec | the executor used to execute the completion task. |
address | the address of the LSS slave device to be switched into the configuration state. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1522 of file lss_master.hpp.
|
inline |
Cancels an LSS 'switch state selective' request.
Definition at line 1536 of file lss_master.hpp.
|
inline |
Aborts an LSS 'switch state selective' request.
Definition at line 1542 of file lss_master.hpp.
LssFuture< void > lely::canopen::LssMaster::AsyncSwitchSelective | ( | ev_exec_t * | exec, |
const LssAddress & | address, | ||
detail::LssSwitchSelectiveRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'switch state selective' request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
address | the address of the LSS slave device to be switched into the configuration state. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 263 of file lss_master.cpp.
|
inline |
Queues an LSS 'configure node-ID' request.
This function configures the pending node-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
req | the request to be submitted. |
id | the requested pending node-ID of the LSS slave device. |
Definition at line 1580 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'configure node-ID' request.
This function configures the pending node-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
id | the requested pending node-ID of the LSS slave device. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1598 of file lss_master.hpp.
|
inline |
Cancels an LSS 'configure node-ID' request.
Definition at line 1611 of file lss_master.hpp.
|
inline |
Aborts an LSS 'configure node-ID' request.
Definition at line 1617 of file lss_master.hpp.
LssFuture< void > lely::canopen::LssMaster::AsyncSetId | ( | ev_exec_t * | exec, |
uint8_t | id, | ||
detail::LssSetIdRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'configure node-ID' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
id | the requested pending node-ID of the LSS slave device. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 278 of file lss_master.cpp.
|
inline |
Queues an LSS 'configure bit timing parameters' request.
This function configures the pending bit rate of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
req | the request to be submitted. |
bitrate | the requested pending bit rate (in bit/s) of the LSS slave device. |
Definition at line 1655 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'configure bit timing parameters' request.
This function configures the pending bit rate of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
bitrate | the requested pending bit rate (in bit/s) of the LSS slave device. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1674 of file lss_master.hpp.
|
inline |
Cancels an LSS 'configure bit timing parameters' request.
Definition at line 1688 of file lss_master.hpp.
|
inline |
Aborts an LSS 'configure bit timing parameters' request.
Definition at line 1694 of file lss_master.hpp.
LssFuture< void > lely::canopen::LssMaster::AsyncSetBitrate | ( | ev_exec_t * | exec, |
int | bitrate, | ||
detail::LssSetBitrateRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'configure bit timing parameters' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
bitrate | the requested pending bit rate (in bit/s) of the LSS slave device. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 293 of file lss_master.cpp.
|
inline |
Queues an LSS 'activate bit timing parameters' request.
This function configures the pending bit rate of an LSS slave device. It is the responsibility of the caller to ensure that all slave devices are in the LSS configuration state.
req | the request to be submitted. |
delay | the requested pending bit rate (in bit/s) of the LSS slave device. |
Definition at line 1735 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'activate bit timing parameters' request.
This function activates the bit rate of all CANopen devices in the network. It is the responsibility of the caller to ensure that all slave devices are in the LSS configuration state.
exec | the executor used to execute the completion task. |
delay | the delay (in milliseconds) before and after the switch, during which CAN frames MUST NOT be sent. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1754 of file lss_master.hpp.
|
inline |
Cancels an LSS 'activate bit timing parameters' request.
Definition at line 1768 of file lss_master.hpp.
|
inline |
Aborts an LSS 'activate bit timing parameters' request.
Definition at line 1774 of file lss_master.hpp.
LssFuture<void> lely::canopen::LssMaster::AsyncSwitchBitrate | ( | ev_exec_t * | exec, |
int | delay, | ||
detail::LssSwitchBitrateRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'activate bit timing parameters' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that all slave devices are in the LSS configuration state.
exec | the executor used to execute the completion task. |
delay | the delay (in milliseconds) before and after the switch, during which CAN frames MUST NOT be sent. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
|
inline |
Queues an LSS 'store configuration' request.
This function configures the pending node-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
Definition at line 1811 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'store configuration' request.
This function configures the pending node-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1827 of file lss_master.hpp.
|
inline |
Cancels an LSS 'store configuration' request.
Definition at line 1840 of file lss_master.hpp.
|
inline |
Aborts an LSS 'store configuration' request.
Definition at line 1846 of file lss_master.hpp.
LssFuture< void > lely::canopen::LssMaster::AsyncStore | ( | ev_exec_t * | exec, |
detail::LssStoreRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'store configuration' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 308 of file lss_master.cpp.
|
inline |
Queues an LSS 'inquire identity vendor-ID' request.
This function inquires the vendor-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
Definition at line 1879 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'inquire identity vendor-ID' request.
This function inquires the vendor-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1895 of file lss_master.hpp.
|
inline |
Cancels an LSS 'inquire identity vendor-ID' request.
Definition at line 1908 of file lss_master.hpp.
|
inline |
Aborts an LSS 'inquire identity vendor-ID' request.
Definition at line 1914 of file lss_master.hpp.
LssFuture< uint32_t > lely::canopen::LssMaster::AsyncGetVendorId | ( | ev_exec_t * | exec, |
detail::LssGetVendorIdRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'inquire identity vendor-ID' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 320 of file lss_master.cpp.
|
inline |
Queues an LSS 'inquire identity product-code' request.
This function inquires the product code of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
Definition at line 1947 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'inquire identity product-code' request.
This function inquires the product code of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 1963 of file lss_master.hpp.
|
inline |
Cancels an LSS 'inquire identity product-code' request.
Definition at line 1976 of file lss_master.hpp.
|
inline |
Aborts an LSS 'inquire identity product-code' request.
Definition at line 1982 of file lss_master.hpp.
LssFuture< uint32_t > lely::canopen::LssMaster::AsyncGetProductCode | ( | ev_exec_t * | exec, |
detail::LssGetProductCodeRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'inquire identity product-code' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 337 of file lss_master.cpp.
|
inline |
Queues an LSS 'inquire identity revision-number' request.
This function inquires the revision number of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
Definition at line 2015 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'inquire identity revision-number' request.
This function inquires the revision number of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 2031 of file lss_master.hpp.
|
inline |
Cancels an LSS 'inquire identity revision-number' request.
Definition at line 2044 of file lss_master.hpp.
|
inline |
Aborts an LSS 'inquire identity revision-number' request.
Definition at line 2050 of file lss_master.hpp.
LssFuture< uint32_t > lely::canopen::LssMaster::AsyncGetRevision | ( | ev_exec_t * | exec, |
detail::LssGetRevisionRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'inquire identity revision-number' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 354 of file lss_master.cpp.
|
inline |
Queues an LSS 'inquire identity serial-number' request.
This function inquires the serial number of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
Definition at line 2083 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'inquire identity serial-number' request.
This function inquires the serial number of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 2099 of file lss_master.hpp.
|
inline |
Cancels an LSS 'inquire identity serial-number' request.
Definition at line 2112 of file lss_master.hpp.
|
inline |
Aborts an LSS 'inquire identity serial-number' request.
Definition at line 2118 of file lss_master.hpp.
LssFuture< uint32_t > lely::canopen::LssMaster::AsyncGetSerialNr | ( | ev_exec_t * | exec, |
detail::LssGetSerialNrRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'inquire identity serial-number' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 371 of file lss_master.cpp.
|
inline |
Queues an LSS 'inquire node-ID' request.
This function inquires the active node-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
Definition at line 2150 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'inquire node-ID' request.
This function inquires the active node-ID of an LSS slave device. It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 2166 of file lss_master.hpp.
|
inline |
Cancels an LSS 'inquire node-ID' request.
Definition at line 2179 of file lss_master.hpp.
|
inline |
Aborts an LSS 'inquire node-ID' request.
Definition at line 2185 of file lss_master.hpp.
LssFuture< uint8_t > lely::canopen::LssMaster::AsyncGetId | ( | ev_exec_t * | exec, |
detail::LssGetIdRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'inquire node-ID' request and creates a future which becomes ready once the request completes (or is canceled).
It is the responsibility of the caller to ensure that a single slave device is in the LSS configuration state.
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 388 of file lss_master.cpp.
|
inline |
Queues an LSS 'identify non-configured remote slave' request.
This function checks if there is an LSS slave device with an invalid (255) pending node-ID and no active node-ID.
Definition at line 2217 of file lss_master.hpp.
|
inline |
Creates and queues an LSS 'identify non-configured remote slave' request.
This function checks if there is an LSS slave device with an invalid (255) pending node-ID and no active node-ID.
exec | the executor used to execute the completion task. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 2232 of file lss_master.hpp.
|
inline |
Cancels an LSS 'identify non-configured remote slave' request.
Definition at line 2249 of file lss_master.hpp.
|
inline |
Aborts an LSS 'identify non-configured remote slave' request.
Definition at line 2255 of file lss_master.hpp.
LssFuture< bool > lely::canopen::LssMaster::AsyncIdNonConfig | ( | ev_exec_t * | exec, |
detail::LssIdNonConfigRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous LSS 'identify non-configured remote slave' request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 404 of file lss_master.cpp.
|
inline |
Queues an 'LSS Slowscan' request.
This function performs a binary search using the 'identify remote slave' service to obtain a single LSS address, followed by the 'switch state selective' service if a slave was found.
req | the request to be submitted. |
lo | the lower bound of the LSS address of the slave device. |
hi | the upper bound of the LSS address of the slave device. The vendor-ID and product code MUST be equal to those in lo. |
Definition at line 2291 of file lss_master.hpp.
|
inline |
Creates and queues an 'LSS Slowscan' request.
This function performs a binary search using the 'identify remote slave' service to obtain a single LSS address, followed by the 'switch state selective' service if a slave was found.
exec | the executor used to execute the completion task. |
lo | the lower bound of the LSS address of the slave device. |
hi | the upper bound of the LSS address of the slave device. The vendor-ID and product code MUST be equal to those in lo. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 2313 of file lss_master.hpp.
|
inline |
|
inline |
LssFuture< LssAddress > lely::canopen::LssMaster::AsyncSlowscan | ( | ev_exec_t * | exec, |
const LssAddress & | lo, | ||
const LssAddress & | hi, | ||
detail::LssSlowscanRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous 'LSS Slowscan' request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
lo | the lower bound of the LSS address of the slave device. |
hi | the upper bound of the LSS address of the slave device. The vendor-ID and product code MUST be equal to those in lo. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 421 of file lss_master.cpp.
|
inline |
Queues an 'LSS Fastscan' request.
This function scans the bits in an LSS address to find a single matching slave. If a slave is identified, it is switched to the LSS configuration state.
req | the request to be submitted. |
address | the bits of the LSS address of a slave device which are already known and can be skipped during scanning. |
mask | a mask specifying which bits in address are already known and can be skipped during scanning. If a bit in the mask is 1, the corresponding bit in address is not checked. |
Definition at line 2377 of file lss_master.hpp.
|
inline |
Creates and queues an 'LSS Fastscan' request.
This function scans the bits in an LSS address to find a single matching slave. If a slave is identified, it is switched to the LSS configuration state.
exec | the executor used to execute the completion task. |
address | the bits of the LSS address of a slave device which are already known and can be skipped during scanning. |
mask | a mask specifying which bits in address are already known and can be skipped during scanning. If a bit in the mask is 1, the corresponding bit in address is not checked. |
con | the confirmation function to be called on completion of the LSS request. |
Definition at line 2401 of file lss_master.hpp.
|
inline |
|
inline |
LssFuture< LssAddress > lely::canopen::LssMaster::AsyncFastscan | ( | ev_exec_t * | exec, |
const LssAddress & | address = {0, 0, 0, 0} , |
||
const LssAddress & | mask = {0, 0, 0, 0} , |
||
detail::LssFastscanRequestBase ** | preq = nullptr |
||
) |
Queues an asynchronous 'LSS Fastscan' request and creates a future which becomes ready once the request completes (or is canceled).
exec | the executor used to execute the completion task. |
address | the bits of the LSS address of a slave device which are already known and can be skipped during scanning. |
mask | a mask specifying which bits in address are already known and can be skipped during scanning. If a bit in the mask is 1, the corresponding bit in address is not checked. |
preq | the address at which to store a pointer to the request (can be a null pointer). |
Definition at line 440 of file lss_master.cpp.
bool lely::canopen::LssMaster::Cancel | ( | detail::LssRequestBase & | req | ) |
Cancels a pending LSS request.
If the request was canceled, the completion task is submitted for execution with ec == std::errc::operation_canceled
.
Definition at line 465 of file lss_master.cpp.
std::size_t lely::canopen::LssMaster::CancelAll | ( | ) |
Cancels all pending LSS requests and stops the ongoing request, if any.
The completion tasks of canceled requests are submitted for execution with ec == std::errc::operation_canceled
Definition at line 472 of file lss_master.cpp.
bool lely::canopen::LssMaster::Abort | ( | detail::LssRequestBase & | req | ) |
Aborts a pending LSS request.
The completion task is not submitted for execution.
Definition at line 479 of file lss_master.cpp.
std::size_t lely::canopen::LssMaster::AbortAll | ( | ) |
Aborts all pending LSS requests.
The completion tasks of aborted requests are not submitted for execution.
Definition at line 485 of file lss_master.cpp.
|
inlinevirtualnoexcept |
The function invoked when the LSS master services are executed during the NMT startup process.
The startup process is halted until all LSS requests complete.
The default implementation issues no LSS requests.
res | the function to onvoke on completion of the LSS requests. The arggument to res is the result: 0 on succes, or an error code on failure. |
Definition at line 2507 of file lss_master.hpp.
|
virtualnoexcept |
The function invoked when the master activates the bit rate of all CANopen devices in the network.
If GetController() returns a valid pointer to a CAN controller, the default implementation stops the controller after half a delay period has passed (to give the CAN channel time to send the LSS requests), sets the bit rate after another half of the delay period, and finally restarts the CAN controller after the second delay period.
bitrate | the new bit rate (in bit/s). |
delay | the delay before and after the switch, during which CAN frames MUST NOT be sent. |
res | the function to invoke once the new bit rate has been activated and the delay periods have passed. The argument to res is the result: 0 on succes, or an error code on failure. |
Definition at line 491 of file lss_master.cpp.
|
finalprotectedvirtual |
Blocks until a lock can be obtained for the current execution agent (thread, process, task).
If an exception is thrown, no lock is obtained.
Implements lely::util::BasicLockable.
Definition at line 539 of file lss_master.cpp.
|
protected |
Update the CAN network time.
The mutex inherited by this class MUST be locked for the duration of this call.
Definition at line 549 of file lss_master.cpp.