24 #ifndef LELY_COAPP_LSS_MASTER_HPP_ 25 #define LELY_COAPP_LSS_MASTER_HPP_ 62 LssAddress(uint32_t vendor_id_ = 0, uint32_t product_code_ = 0,
63 uint32_t revision_ = 0, uint32_t serial_nr_ = 0)
115 ::std::error_code ec{};
118 virtual void operator()() noexcept = 0;
120 virtual void OnRequest(
void* data) noexcept = 0;
125 using LssRequestBase::LssRequestBase;
131 void OnRequest(
void* data) noexcept
final;
136 using LssRequestBase::LssRequestBase;
145 void OnRequest(
void* data) noexcept
final;
150 using LssRequestBase::LssRequestBase;
156 void OnRequest(
void* data) noexcept
final;
161 using LssRequestBase::LssRequestBase;
167 void OnRequest(
void* data) noexcept
final;
172 using LssRequestBase::LssRequestBase;
181 void OnRequest(
void* data) noexcept
final;
186 using LssRequestBase::LssRequestBase;
189 void OnRequest(
void* data) noexcept
final;
194 using LssRequestBase::LssRequestBase;
202 using LssGetNumberRequestBase::LssGetNumberRequestBase;
205 void OnRequest(
void* data) noexcept
final;
210 using LssGetNumberRequestBase::LssGetNumberRequestBase;
213 void OnRequest(
void* data) noexcept
final;
218 using LssGetNumberRequestBase::LssGetNumberRequestBase;
221 void OnRequest(
void* data) noexcept
final;
226 using LssGetNumberRequestBase::LssGetNumberRequestBase;
229 void OnRequest(
void* data) noexcept
final;
234 using LssRequestBase::LssRequestBase;
240 void OnRequest(
void* data) noexcept
final;
245 using LssRequestBase::LssRequestBase;
248 void OnRequest(
void* data) noexcept
final;
253 using LssRequestBase::LssRequestBase;
264 using LssScanRequestBase::LssScanRequestBase;
275 void OnRequest(
void* data) noexcept
final;
280 using LssScanRequestBase::LssScanRequestBase;
290 void OnRequest(
void* data) noexcept
final;
315 : detail::LssSwitchRequestBase(exec), con_(::
std::forward<F>(con)) {}
324 operator()() noexcept
final {
328 ::std::function<Signature> con_;
351 : detail::LssSwitchSelectiveRequestBase(exec),
352 con_(::
std::forward<F>(con)) {}
361 operator()() noexcept
final {
365 ::std::function<Signature> con_;
388 : detail::LssSetIdRequestBase(exec), con_(::
std::forward<F>(con)) {}
397 operator()() noexcept
final {
401 ::std::function<Signature> con_;
424 : detail::LssSetBitrateRequestBase(exec), con_(::
std::forward<F>(con)) {}
433 operator()() noexcept
final {
437 ::std::function<Signature> con_;
460 : detail::LssSwitchBitrateRequestBase(exec),
461 con_(::
std::forward<F>(con)) {}
470 operator()() noexcept
final {
474 ::std::function<Signature> con_;
496 : detail::LssStoreRequestBase(exec), con_(::
std::forward<F>(con)) {}
505 operator()() noexcept
final {
509 ::std::function<Signature> con_;
525 using Signature = void(::std::error_code ec, uint32_t number);
533 : detail::LssGetVendorIdRequestBase(exec), con_(::
std::forward<F>(con)) {}
542 operator()() noexcept
final {
543 if (con_) con_(ec, number);
546 ::std::function<Signature> con_;
562 using Signature = void(::std::error_code ec, uint32_t number);
570 : detail::LssGetProductCodeRequestBase(exec),
571 con_(::
std::forward<F>(con)) {}
580 operator()() noexcept
final {
581 if (con_) con_(ec, number);
584 ::std::function<Signature> con_;
600 using Signature = void(::std::error_code ec, uint32_t number);
608 : detail::LssGetRevisionRequestBase(exec), con_(::
std::forward<F>(con)) {}
617 operator()() noexcept
final {
618 if (con_) con_(ec, number);
621 ::std::function<Signature> con_;
637 using Signature = void(::std::error_code ec, uint32_t number);
645 : detail::LssGetSerialNrRequestBase(exec), con_(::
std::forward<F>(con)) {}
654 operator()() noexcept
final {
655 if (con_) con_(ec, number);
658 ::std::function<Signature> con_;
673 using Signature = void(::std::error_code ec, uint8_t
id);
681 : detail::LssGetIdRequestBase(exec), con_(::
std::forward<F>(con)) {}
690 operator()() noexcept
final {
691 if (con_) con_(ec,
id);
694 ::std::function<Signature> con_;
710 using Signature = void(::std::error_code ec,
bool found);
718 : detail::LssStoreRequestBase(exec), con_(::
std::forward<F>(con)) {}
727 operator()() noexcept
final {
730 if (ec == ::std::errc::timed_out) ec.clear();
731 if (con_) con_(ec, found);
734 ::std::function<Signature> con_;
758 : detail::LssSlowscanRequestBase(exec), con_(::
std::forward<F>(con)) {}
767 operator()() noexcept
final {
768 if (con_) con_(ec, address);
771 ::std::function<Signature> con_;
796 : detail::LssFastscanRequestBase(exec), con_(::
std::forward<F>(con)) {}
805 operator()() noexcept
final {
806 if (con_) con_(ec, address);
809 ::std::function<Signature> con_;
824 operator()() noexcept
final {
825 compat::invoke(::std::move(con_), ec);
829 typename ::std::decay<F>::type con_;
838 this->address = address;
843 operator()() noexcept
final {
844 compat::invoke(::std::move(con_), ec);
848 typename ::std::decay<F>::type con_;
861 operator()() noexcept
final {
862 compat::invoke(::std::move(con_), ec);
866 typename ::std::decay<F>::type con_;
874 this->bitrate = bitrate;
879 operator()() noexcept
final {
880 compat::invoke(::std::move(con_), ec);
884 typename ::std::decay<F>::type con_;
897 operator()() noexcept
final {
898 compat::invoke(::std::move(con_), ec);
902 typename ::std::decay<F>::type con_;
913 operator()() noexcept
final {
914 compat::invoke(::std::move(con_), ec);
918 typename ::std::decay<F>::type con_;
929 operator()() noexcept
final {
930 compat::invoke(::std::move(con_), ec, number);
934 typename ::std::decay<F>::type con_;
945 operator()() noexcept
final {
946 compat::invoke(::std::move(con_), ec, number);
950 typename ::std::decay<F>::type con_;
961 operator()() noexcept
final {
962 compat::invoke(::std::move(con_), ec, number);
966 typename ::std::decay<F>::type con_;
977 operator()() noexcept
final {
978 compat::invoke(::std::move(con_), ec, number);
982 typename ::std::decay<F>::type con_;
993 operator()() noexcept
final {
994 compat::invoke(::std::move(con_), ec,
id);
998 typename ::std::decay<F>::type con_;
1009 operator()() noexcept
final {
1012 if (ec == ::std::errc::timed_out) ec.clear();
1013 compat::invoke(::std::move(con_), ec, found);
1017 typename ::std::decay<F>::type con_;
1032 operator()() noexcept
final {
1033 compat::invoke(::std::move(con_), ec, address);
1037 typename ::std::decay<F>::type con_;
1046 this->address = address;
1052 operator()() noexcept
final {
1053 compat::invoke(::std::move(con_), ec, address);
1057 typename ::std::decay<F>::type con_;
1074 inline typename ::std::enable_if<
1080 ::std::forward<F>(con));
1095 inline typename ::std::enable_if<
1096 compat::is_invocable<F, ::std::error_code>::value,
1101 exec, address, ::std::forward<F>(con));
1116 inline typename ::std::enable_if<
1117 compat::is_invocable<F, ::std::error_code>::value,
1122 ::std::forward<F>(con));
1138 inline typename ::std::enable_if<
1139 compat::is_invocable<F, ::std::error_code>::value,
1144 ::std::forward<F>(con));
1160 inline typename ::std::enable_if<
1161 compat::is_invocable<F, ::std::error_code>::value,
1166 ::std::forward<F>(con));
1180 inline typename ::std::enable_if<
1181 compat::is_invocable<F, ::std::error_code>::value,
1198 inline typename ::std::enable_if<
1203 ::std::forward<F>(con));
1216 inline typename ::std::enable_if<
1217 compat::is_invocable<F, ::std::error_code, uint32_t>::value,
1221 ::std::forward<F>(con));
1234 inline typename ::std::enable_if<
1235 compat::is_invocable<F, ::std::error_code, uint32_t>::value,
1239 ::std::forward<F>(con));
1252 inline typename ::std::enable_if<
1253 compat::is_invocable<F, ::std::error_code, uint32_t>::value,
1257 ::std::forward<F>(con));
1270 inline typename ::std::enable_if<
1288 inline typename ::std::enable_if<
1294 ::std::forward<F>(con));
1310 inline typename ::std::enable_if<
1316 ::std::forward<F>(con));
1335 inline typename ::std::enable_if<
1336 compat::is_invocable<F, ::std::error_code, LssAddress>::value,
1341 ::std::forward<F>(con));
1395 Node& GetNode()
const noexcept;
1404 ::std::chrono::microseconds GetInhibit()
const;
1407 void SetInhibit(const ::std::chrono::microseconds& inhibit);
1414 ::std::chrono::milliseconds GetTimeout()
const;
1421 void SetTimeout(const ::std::chrono::milliseconds& timeout);
1456 SubmitSwitch(
nullptr, state, ::std::forward<F>(con));
1491 return AsyncSwitch(
nullptr, state, preq);
1524 ::std::forward<F>(con)));
1531 SubmitSwitchSelective(
nullptr, address, ::std::forward<F>(con));
1567 return AsyncSwitchSelective(
nullptr, address, preq);
1606 SubmitSetId(
nullptr,
id, ::std::forward<F>(con));
1641 return AsyncSetId(
nullptr,
id, preq);
1683 SubmitSetBitrate(
nullptr, bitrate, ::std::forward<F>(con));
1721 return AsyncSetBitrate(
nullptr, bitrate, preq);
1763 SubmitSwitchBitrate(
nullptr, delay, ::std::forward<F>(con));
1801 return AsyncSwitchBitrate(
nullptr, delay, preq);
1835 SubmitStore(
nullptr, ::std::forward<F>(con));
1869 return AsyncStore(
nullptr, preq);
1903 SubmitGetVendorId(
nullptr, ::std::forward<F>(con));
1937 return AsyncGetVendorId(
nullptr, preq);
1971 SubmitGetProductCode(
nullptr, ::std::forward<F>(con));
2005 return AsyncGetProductCode(
nullptr, preq);
2039 SubmitGetRevision(
nullptr, ::std::forward<F>(con));
2073 return AsyncGetRevision(
nullptr, preq);
2107 SubmitGetSerialNr(
nullptr, ::std::forward<F>(con));
2141 return AsyncGetSerialNr(
nullptr, preq);
2174 SubmitGetId(
nullptr, ::std::forward<F>(con));
2208 return AsyncGetId(
nullptr, preq);
2240 SubmitIdNonConfig(
nullptr, ::std::forward<F>(con));
2277 return AsyncIdNonConfig(
nullptr, preq);
2322 SubmitSlowscan(
nullptr, ::std::forward<F>(con));
2360 return AsyncSlowscan(
nullptr, lo, hi, preq);
2404 ::std::forward<F>(con)));
2411 SubmitFastscan(
nullptr, ::std::forward<F>(con));
2454 return AsyncFastscan(
nullptr, address, mask, preq);
2476 ::std::size_t CancelAll();
2493 ::std::size_t AbortAll();
2507 OnStart(::std::function<
void(::std::error_code ec)> res) noexcept {
2508 res(::std::error_code{});
2529 virtual void OnSwitchBitrate(
2530 int bitrate, ::std::chrono::milliseconds delay,
2531 ::std::function<
void(::std::error_code ec)> res) noexcept;
2535 void unlock()
final;
2545 ::std::unique_ptr<Impl_> impl_;
2552 #endif // LELY_COAPP_LSS_MASTER_HPP_ void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity vendor-ID' r...
bool CancelSlowscan(detail::LssSlowscanRequestBase &req)
Cancels an 'LSS Slowscan' request.
LssSwitchSelectiveRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'switch state selective' request with a completion task.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
An LSS 'switch state global' request.
LssIdNonConfigRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'identify non-configured remote slave' request with a completion task...
bool AbortGetSerialNr(detail::LssGetSerialNrRequestBase &req)
Aborts an LSS 'inquire identity serial-number' request.
LssGetVendorIdRequest(F &&con)
Equivalent to LssGetVendorIdRequest(nullptr, con).
#define EV_TASK_INIT(exec, func)
The static initializer for ev_task.
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetSerialNrRequestWrapper< F > * >::type make_lss_get_serial_nr_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity serial-number' request with a completion task.
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'store configuration' request...
An LSS 'inquire node-ID' request.
void(::std::error_code ec, LssAddress address) Signature
The signature of the callback function invoked on completion of an 'LSS Fastscan' request...
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'switch state global' request...
void SubmitIdNonConfig(detail::LssIdNonConfigRequestBase &req)
Queues an LSS 'identify non-configured remote slave' request.
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'activate bit timing parameter...
bool AbortSlowscan(detail::LssSlowscanRequestBase &req)
Aborts an 'LSS Slowscan' request.
An LSS 'identify non-configured remote slave' request.
LssFuture< void > AsyncStore(detail::LssStoreRequestBase **preq=nullptr)
Equivalent to AsyncStore(nullptr, preq).
Determines whether F can be invoked with the arguments Args....
The state in which the node-ID and bit timing parameters of a slave may be configured.
LssSetBitrateRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'configure bit timing parameters' request with a completion task...
void SubmitFastscan(F &&con)
Equivalent to SubmitFastscan(nullptr, con).
void SubmitSwitchSelective(ev_exec_t *exec, const LssAddress &address, F &&con)
Creates and queues an LSS 'switch state selective' request.
LssFuture< void > AsyncSetId(uint8_t id, detail::LssSetIdRequestBase **preq=nullptr)
Equivalent to AsyncSetId(nullptr, id, preq).
void SubmitGetVendorId(detail::LssGetVendorIdRequestBase &req)
Queues an LSS 'inquire identity vendor-ID' request.
void SubmitGetVendorId(F &&con)
Equivalent to SubmitGetVendorId(nullptr, con).
bool AbortStore(detail::LssStoreRequestBase &req)
Aborts an LSS 'store configuration' request.
An LSS 'configure node-ID' request.
An LSS 'activate bit timing parameters' request.
void SubmitSwitch(detail::LssSwitchRequestBase &req, LssState state=LssState::WAITING)
Queues an LSS 'switch state global' request.
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'configure node-ID' request...
LssSwitchRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'switch state global' request with a completion task.
LssFuture< uint32_t > AsyncGetProductCode(detail::LssGetProductCodeRequestBase **preq=nullptr)
Equivalent to AsyncGetProductCode(nullptr, preq).
The base class for CANopen LSS masters.
void SubmitSwitchSelective(detail::LssSwitchSelectiveRequestBase &req, const LssAddress &address)
Queues an LSS 'switch state selective' request.
An LSS 'inquire identity product-code' request.
bool AbortGetRevision(detail::LssGetRevisionRequestBase &req)
Aborts an LSS 'inquire identity revision-number' request.
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSetIdRequestWrapper< F > * >::type make_lss_set_id_request(ev_exec_t *exec, uint8_t id, F &&con)
Creates an LSS 'configure node-ID' request with a completion task.
uint32_t revision
The revision number.
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSetBitrateRequestWrapper< F > * >::type make_lss_set_bitrate_request(ev_exec_t *exec, int bitrate, F &&con)
Creates an LSS 'configure bit timing parameters' request with a completion task.
void SubmitSwitch(LssState state, F &&con)
Equivalent to SubmitSwitch(nullptr, state, con).
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSwitchSelectiveRequestWrapper< F > * >::type make_lss_switch_selective_request(ev_exec_t *exec, const LssAddress &address, F &&con)
Creates an LSS 'switch state selective' request with a completion task.
An LSS 'inquire identity vendor-ID' request.
int bitrate
The requested pending bit rate (in bit/s) of the LSS slave device.
void SubmitSlowscan(detail::LssSlowscanRequestBase &req, const LssAddress &lo, const LssAddress &hi)
Queues an 'LSS Slowscan' request.
void SubmitGetId(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire node-ID' request.
void SubmitStore(detail::LssStoreRequestBase &req)
Queues an LSS 'store configuration' request.
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetProductCodeRequestWrapper< F > * >::type make_lss_get_product_code_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity product-code' request with a completion task.
LssFuture< uint32_t > AsyncGetVendorId(detail::LssGetVendorIdRequestBase **preq=nullptr)
Equivalent to AsyncGetVendorId(nullptr, preq).
void SubmitSwitchSelective(const LssAddress &address, F &&con)
Equivalent to SubmitSwitchSelective(nullptr, state, con).
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssStoreRequestWrapper< F > * >::type make_lss_store_request(ev_exec_t *exec, F &&con)
Creates an LSS 'store configuration' request with a completion task.
bool CancelGetSerialNr(detail::LssGetSerialNrRequestBase &req)
Cancels an LSS 'inquire identity serial-number' request.
void SubmitGetId(F &&con)
Equivalent to SubmitGetId(nullptr, con).
LssFuture< void > AsyncSwitch(LssState state=LssState::WAITING, detail::LssSwitchRequestBase **preq=nullptr)
Equivalent to AsyncSwitch(nullptr, state, preq).
bool CancelSetId(detail::LssSetIdRequestBase &req)
Cancels an LSS 'configure node-ID' request.
void SubmitSetBitrate(int bitrate, F &&con)
Equivalent to SubmitSetBitrate(nullptr, id, con).
void SubmitGetRevision(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity revision-number' request.
bool AbortSwitchBitrate(detail::LssSwitchBitrateRequestBase &req)
Aborts an LSS 'activate bit timing parameters' request.
uint32_t product_code
THe product code.
LssAddress lo
The lower bound of the LSS address of the slave device.
void SubmitGetProductCode(detail::LssGetProductCodeRequestBase &req)
Queues an LSS 'inquire identity product-code' request.
An LSS 'configure bit timing parameters' request.
uint32_t serial_nr
THe serial number.
void SubmitSlowscan(ev_exec_t *exec, const LssAddress &lo, const LssAddress &hi, F &&con)
Creates and queues an 'LSS Slowscan' request.
LssSlowscanRequest(F &&con)
Equivalent to LssSlowscanRequest(nullptr, con).
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity serial-numbe...
void SubmitGetVendorId(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity vendor-ID' request.
bool AbortSetBitrate(detail::LssSetBitrateRequestBase &req)
Aborts an LSS 'configure bit timing parameters' request.
bool CancelIdNonConfig(detail::LssIdNonConfigRequestBase &req)
Cancels an LSS 'identify non-configured remote slave' request.
void SubmitSetId(uint8_t id, F &&con)
Equivalent to SubmitSetId(nullptr, id, con).
void SubmitGetRevision(F &&con)
Equivalent to SubmitGetRevision(nullptr, con).
ev_exec_t * exec
A pointer to the executor to which the task is (to be) submitted.
void SubmitSwitchBitrate(detail::LssSwitchBitrateRequestBase &req, int delay)
Queues an LSS 'activate bit timing parameters' request.
bool AbortGetId(detail::LssGetIdRequestBase &req)
Aborts an LSS 'inquire node-ID' request.
void SubmitGetProductCode(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity product-code' request.
LssSwitchRequest(F &&con)
Equivalent to LssSwitchRequest(nullptr, con).
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, LssAddress >::value, detail::LssSlowscanRequestWrapper< F > * >::type make_lss_slowscan_request(ev_exec_t *exec, const LssAddress &lo, const LssAddress &hi, F &&con)
Creates an 'LSS Slowscan' request with a completion task.
An LSS 'store configuration' request.
LssAddress hi
The upper bound of the LSS address of the slave device.
An LSS 'switch state selective' request.
LssSwitchBitrateRequest(F &&con)
Equivalent to LssSwitchBitrateRequest(nullptr, con).
void SubmitIdNonConfig(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'identify non-configured remote slave' request.
bool CancelFastscan(detail::LssFastscanRequestBase &req)
Cancels an 'LSS Fastscan' request.
bool AbortFastscan(detail::LssFastscanRequestBase &req)
Aborts an 'LSS Fastscan' request.
void SubmitSetBitrate(ev_exec_t *exec, int bitrate, F &&con)
Creates and queues an LSS 'configure bit timing parameters' request.
The state in which a slave may be identified.
void(::std::error_code ec, bool found) Signature
The signature of the callback function invoked on completion of an LSS 'identify non-configured remot...
LssSwitchBitrateRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'activate bit timing parameters' request with a completion task...
LssGetProductCodeRequest(F &&con)
Equivalent to LssGetProductCodeRequest(nullptr, con).
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity product-code...
The 128-bit number uniquely identifying each CANopen node.
An abstract interface conforming to the BasicLockable concept.
LssFuture< LssAddress > AsyncSlowscan(const LssAddress &lo, const LssAddress &hi, detail::LssSlowscanRequestBase **preq=nullptr)
Equivalent to AsyncSlowscan(nullptr, lo, hi, preq).
LssFastscanRequest(ev_exec_t *exec, F &&con)
Constructs an empty 'LSS Fastscan' request with a completion task.
LssGetProductCodeRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
LssFuture< uint32_t > AsyncGetSerialNr(detail::LssGetSerialNrRequestBase **preq=nullptr)
Equivalent to AsyncGetSerialNr(nullptr, preq).
void SubmitSwitchBitrate(int delay, F &&con)
Equivalent to SubmitSwitchBitrate(nullptr, id, con).
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint8_t >::value, detail::LssGetIdRequestWrapper< F > * >::type make_lss_get_id_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire node-ID' request with a completion task.
void SubmitGetProductCode(F &&con)
Equivalent to SubmitGetProductCode(nullptr, con).
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'switch state selective' reque...
bool CancelGetProductCode(detail::LssGetProductCodeRequestBase &req)
Cancels an LSS 'inquire identity product-code' request.
bool CancelStore(detail::LssStoreRequestBase &req)
Cancels an LSS 'store configuration' request.
void SubmitStore(F &&con)
Equivalent to SubmitStore(nullptr, con).
ev::Executor GetExecutor() const noexcept
Returns the executor to which the completion task is (to be) submitted.
bool CancelSwitchBitrate(detail::LssSwitchBitrateRequestBase &req)
Cancels an LSS 'activate bit timing parameters' request.
LssSetIdRequest(F &&con)
Equivalent to LssSetIdRequest(nullptr, con).
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).
LssFuture< bool > AsyncIdNonConfig(detail::LssIdNonConfigRequestBase **preq=nullptr)
Equivalent to AsyncIdNonConfig(nullptr, preq).
LssStoreRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
LssFuture< uint8_t > AsyncGetId(detail::LssGetIdRequestBase **preq=nullptr)
Equivalent to AsyncGetId(nullptr, preq).
An LSS 'inquire identity revision-number' request.
LssSwitchSelectiveRequest(F &&con)
Equivalent to LssSwitchSelectiveRequest(nullptr, con).
LssGetSerialNrRequest(F &&con)
Equivalent to LssGetSerialNrRequest(nullptr, con).
void SubmitFastscan(ev_exec_t *exec, const LssAddress &address, const LssAddress &mask, F &&con)
Creates and queues an 'LSS Fastscan' request.
An 'LSS Fastscan' request.
LssGetRevisionRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
void SubmitSetBitrate(detail::LssSetBitrateRequestBase &req, int bitrate)
Queues an LSS 'configure bit timing parameters' request.
void SubmitSlowscan(F &&con)
Equivalent to SubmitSlowscan(nullptr, con).
bool CancelGetId(detail::LssGetIdRequestBase &req)
Cancels an LSS 'inquire node-ID' request.
LssFuture< void > AsyncSwitchBitrate(int delay, detail::LssSwitchBitrateRequestBase **preq=nullptr)
Equivalent to AsyncSwitchBitrate(nullptr, id, preq).
void SubmitGetSerialNr(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity serial-number' request.
This header file is part of the compatibility library; it includes <type_traits> and defines any miss...
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...
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetVendorIdRequestWrapper< F > * >::type make_lss_get_vendor_id_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity vendor-ID' request with a completion task.
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSwitchBitrateRequestWrapper< F > * >::type make_lss_switch_bitrate_request(ev_exec_t *exec, int delay, F &&con)
Creates an LSS 'activate bit timing parameters' request with a completion task.
LssSetBitrateRequest(F &&con)
Equivalent to LssSetBitrateRequest(nullptr, con).
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, bool >::value, detail::LssIdNonConfigRequestWrapper< F > * >::type make_lss_id_non_config_request(ev_exec_t *exec, F &&con)
Creates an LSS 'identify non-configured remote slave' request with a completion task.
An abstract task executor. This class is a wrapper around ev_exec_t*.
int delay
The delay (in milliseconds) before and after the switch, during which CAN frames MUST NOT be sent...
LssIdNonConfigRequest(F &&con)
Equivalent to LssIdNonConfigRequest(nullptr, con).
LssAddress mask
A mask specifying which bits in the LSS address of the slave device are already known and can be skip...
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, LssAddress >::value, detail::LssFastscanRequestWrapper< F > * >::type make_lss_fastscan_request(ev_exec_t *exec, const LssAddress &address, const LssAddress &mask, F &&con)
Creates an 'LSS Fastscan' request with a completion task.
An 'LSS Slowscan' request.
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity revision-num...
LssFuture< void > AsyncSetBitrate(int bitrate, detail::LssSetBitrateRequestBase **preq=nullptr)
Equivalent to AsyncSetBitrate(nullptr, id, preq).
void SubmitGetSerialNr(detail::LssGetSerialNrRequestBase &req)
Queues an LSS 'inquire identity serial-number' request.
LssGetIdRequest(F &&con)
Equivalent to LssGetIdRequest(nullptr, con).
LssGetSerialNrRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
This header file is part of the C++ CANopen application library; it contains the CANopen node declara...
LssFastscanRequest(F &&con)
Equivalent to LssSlowscanRequest(nullptr, con).
LssFuture< uint32_t > AsyncGetRevision(detail::LssGetRevisionRequestBase **preq=nullptr)
Equivalent to AsyncGetRevision(nullptr, preq).
void SubmitGetSerialNr(F &&con)
Equivalent to SubmitGetSerialNr(nullptr, con).
bool CancelSwitch(detail::LssSwitchRequestBase &req)
Cancels an LSS 'switch state global' request.
uint8_t id
The requested pending node-ID of the LSS slave device.
bool AbortSwitchSelective(detail::LssSwitchSelectiveRequestBase &req)
Aborts an LSS 'switch state selective' request.
LssState
The states of the LSS finite state automaton (FSA) of a slave device.
LssStoreRequest(F &&con)
Equivalent to LssStoreRequest(nullptr, con).
uint32_t vendor_id
The vendor-ID.
void SubmitSwitch(ev_exec_t *exec, LssState state, F &&con)
Creates and queues an LSS 'switch state global' request.
bool CancelGetRevision(detail::LssGetRevisionRequestBase &req)
Cancels an LSS 'inquire identity revision-number' request.
bool CancelSetBitrate(detail::LssSetBitrateRequestBase &req)
Cancels an LSS 'configure bit timing parameters' request.
bool CancelGetVendorId(detail::LssGetVendorIdRequestBase &req)
Cancels an LSS 'inquire identity vendor-ID' request.
A reference to an abstract CAN controller.
bool AbortIdNonConfig(detail::LssIdNonConfigRequestBase &req)
Aborts an LSS 'identify non-configured remote slave' request.
LssGetIdRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
void SubmitIdNonConfig(F &&con)
Equivalent to SubmitIdNonConfig(nullptr, con).
void SubmitSetId(ev_exec_t *exec, uint8_t id, F &&con)
Creates and queues an LSS 'configure node-ID' request.
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'configure bit timing paramete...
LssGetVendorIdRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
LssSlowscanRequest(ev_exec_t *exec, F &&con)
Constructs an empty 'LSS Slowscan' request with a completion task.
The base class for CANopen nodes.
LssMaster(Node &node, io::CanControllerBase *ctrl=nullptr)
Creates a new CANopen LSS master.
LssState state
The desired state of the LSS slave devices.
void(::std::error_code ec, uint8_t id) Signature
The signature of the callback function invoked on completion of an LSS 'inquire node-ID' request...
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetRevisionRequestWrapper< F > * >::type make_lss_get_revision_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity revision-number' request with a completion task. ...
void SubmitGetRevision(detail::LssGetRevisionRequestBase &req)
Queues an LSS 'inquire identity revision-number' request.
bool CancelSwitchSelective(detail::LssSwitchSelectiveRequestBase &req)
Cancels an LSS 'switch state selective' request.
void SubmitFastscan(detail::LssFastscanRequestBase &req, const LssAddress &address, const LssAddress &mask)
Queues an 'LSS Fastscan' request.
bool AbortGetProductCode(detail::LssGetProductCodeRequestBase &req)
Aborts an LSS 'inquire identity product-code' request.
LssAddress address
On success, the LSS address of the detected slave device.
bool AbortGetVendorId(detail::LssGetVendorIdRequestBase &req)
Aborts an LSS 'inquire identity vendor-ID' request.
LssGetRevisionRequest(F &&con)
Equivalent to LssGetRevisionRequest(nullptr, con).
bool AbortSetId(detail::LssSetIdRequestBase &req)
Aborts an LSS 'configure node-ID' request.
An LSS 'inquire identity serial-number' request.
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSwitchRequestWrapper< F > * >::type make_lss_switch_request(ev_exec_t *exec, LssState state, F &&con)
Creates an LSS 'switch state global' request with a completion task.
bool AbortSwitch(detail::LssSwitchRequestBase &req)
Aborts an LSS 'switch state global' request.
void SubmitGetId(detail::LssGetIdRequestBase &req)
Queues an LSS 'inquire node-ID' request.
void SubmitSetId(detail::LssSetIdRequestBase &req, uint8_t id)
Queues an LSS 'configure node-ID' request.
This header file is part of the compatibility library; it includes <functional> and defines any missi...
LssSetIdRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'configure node-ID' request with a completion task.
LssAddress address
The address of the LSS slave device to be switched into the configuration state.
LssFuture< void > AsyncSwitchSelective(const LssAddress &address, detail::LssSwitchSelectiveRequestBase **preq=nullptr)
Equivalent to AsyncSwitchSelective(nullptr, address, preq).
void(::std::error_code ec, LssAddress address) Signature
The signature of the callback function invoked on completion of an 'LSS Slowscan' request...
void SubmitStore(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'store configuration' request.
void SubmitSwitchBitrate(ev_exec_t *exec, int delay, F &&con)
Creates and queues an LSS 'activate bit timing parameters' request.