23 #ifndef LELY_CO_LSS_HPP_ 24 #define LELY_CO_LSS_HPP_ 27 #error "include <lely/co/lss.h> for the C interface" 46 return __co_lss_alloc();
49 free(
void* ptr) noexcept {
55 return __co_lss_init(p, nmt);
72 getNMT()
const noexcept {
88 setRateInd(F* f) noexcept {
90 static_cast<void*>(f));
93 template <class C, typename c_mem_fn<co_lss_rate_ind_t*, C>::type M>
95 setRateInd(C* obj) noexcept {
97 static_cast<void*>(obj));
112 setStoreInd(F* f) noexcept {
114 static_cast<void*>(f));
117 template <class C, typename c_mem_fn<co_lss_store_ind_t*, C>::type M>
119 setStoreInd(C* obj) noexcept {
121 static_cast<void*>(obj));
125 getTimeout()
const noexcept {
130 setTimeout(
int timeout) noexcept {
135 isMaster()
const noexcept {
140 isIdle()
const noexcept {
145 abortReq() noexcept {
150 switchReq(co_unsigned8_t mode) noexcept {
161 switchSelReq(
const co_id&
id, F* f) noexcept {
163 static_cast<void*>(f));
166 template <class C, typename c_mem_fn<co_lss_cs_ind_t*, C>::type M>
168 switchSelReq(
const co_id&
id, C* obj) noexcept {
170 static_cast<void*>(obj));
180 setIdReq(co_unsigned8_t
id, F* f) noexcept {
182 static_cast<void*>(f));
185 template <class C, typename c_mem_fn<co_lss_err_ind_t*, C>::type M>
187 setIdReq(co_unsigned8_t
id, C* obj) noexcept {
189 static_cast<void*>(obj));
193 setRateReq(co_unsigned16_t rate,
co_lss_err_ind_t* ind,
void* data) noexcept {
199 setRateReq(co_unsigned16_t rate, F* f) noexcept {
201 static_cast<void*>(f));
204 template <class C, typename c_mem_fn<co_lss_err_ind_t*, C>::type M>
206 setRateReq(co_unsigned16_t rate, C* obj) noexcept {
208 static_cast<void*>(obj));
212 switchRateReq(
int delay) noexcept {
223 storeReq(F* f) noexcept {
225 static_cast<void*>(f));
228 template <class C, typename c_mem_fn<co_lss_err_ind_t*, C>::type M>
230 storeReq(C* obj) noexcept {
232 static_cast<void*>(obj));
242 getVendorIdReq(F* f) noexcept {
244 static_cast<void*>(f));
247 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
249 getVendorIdReq(C* obj) noexcept {
251 static_cast<void*>(obj));
261 getProductCodeReq(F* f) noexcept {
263 static_cast<void*>(f));
266 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
268 getProductCodeReq(C* obj) noexcept {
270 static_cast<void*>(obj));
280 getRevisionReq(F* f) noexcept {
282 static_cast<void*>(f));
285 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
287 getRevisionReq(C* obj) noexcept {
289 static_cast<void*>(obj));
299 getSerialNrReq(F* f) noexcept {
301 static_cast<void*>(f));
304 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
306 getSerialNrReq(C* obj) noexcept {
308 static_cast<void*>(obj));
318 getIdReq(F* f) noexcept {
320 static_cast<void*>(f));
323 template <class C, typename c_mem_fn<co_lss_nid_ind_t*, C>::type M>
325 getIdReq(C* obj) noexcept {
327 static_cast<void*>(obj));
332 void* data) noexcept {
338 idSlaveReq(
const co_id& lo,
const co_id& hi, F* f) noexcept {
340 static_cast<void*>(f));
343 template <class C, typename c_mem_fn<co_lss_cs_ind_t*, C>::type M>
345 idSlaveReq(
const co_id& lo,
const co_id& hi, C* obj) noexcept {
347 static_cast<void*>(obj));
357 idNonCfgSlaveReq(F* f) noexcept {
359 static_cast<void*>(f));
362 template <class C, typename c_mem_fn<co_lss_cs_ind_t*, C>::type M>
364 idNonCfgSlaveReq(C* obj) noexcept {
366 static_cast<void*>(obj));
371 void* data) noexcept {
377 slowscanReq(
const co_id& lo,
const co_id& hi, F* f) noexcept {
379 static_cast<void*>(f));
382 template <class C, typename c_mem_fn<co_lss_scan_ind_t*, C>::type M>
384 slowscanReq(
const co_id& lo,
const co_id& hi, C* obj) noexcept {
386 static_cast<void*>(obj));
391 void* data) noexcept {
397 fastscanReq(
const co_id*
id,
const co_id* mask, F* f) noexcept {
399 static_cast<void*>(f));
402 template <class C, typename c_mem_fn<co_lss_scan_ind_t*, C>::type M>
404 fastscanReq(
const co_id*
id,
const co_id* mask, C* obj) noexcept {
405 return fastscanReq(
id, mask,
407 static_cast<void*>(obj));
416 #endif // !LELY_CO_LSS_HPP_ int co_lss_is_idle(const co_lss_t *lss)
Returns 1 if the specified LSS master is idle, and 0 if a request is ongoing.
int co_lss_set_id_req(co_lss_t *lss, co_unsigned8_t id, co_lss_err_ind_t *ind, void *data)
Requests the 'configure node-ID' service.
int co_lss_get_revision_req(co_lss_t *lss, co_lss_lssid_ind_t *ind, void *data)
Requests the 'inquire identity revision-number' service.
void co_lss_set_rate_ind(co_lss_t *lss, co_lss_rate_ind_t *ind, void *data)
Sets the indication function invoked when an LSS 'activate bit timing' request is received...
A CANopen LSS master/slave service.
int co_lss_set_rate_req(co_lss_t *lss, co_unsigned16_t rate, co_lss_err_ind_t *ind, void *data)
Requests the 'configure bit timing parameters' service.
void co_lss_rate_ind_t(co_lss_t *lss, co_unsigned16_t rate, int delay, void *data)
The type of a CANopen LSS 'activate bit timing' indication function, invoked when a baudrate switch i...
void co_lss_nid_ind_t(co_lss_t *lss, co_unsigned8_t cs, co_unsigned8_t id, void *data)
The type of a CANopen LSS inquire node-ID indication function, invoked when an 'inquire node-ID' requ...
This header file is part of the CAN library; it contains the C++ interface of the CAN network interfa...
int co_lss_id_slave_req(co_lss_t *lss, const struct co_id *lo, const struct co_id *hi, co_lss_cs_ind_t *ind, void *data)
Requests the 'LSS identify remote slave' service.
int co_lss_slowscan_req(co_lss_t *lss, const struct co_id *lo, const struct co_id *hi, co_lss_scan_ind_t *ind, void *data)
Requests the 'LSS Slowscan' service.
int co_lss_switch_sel_req(co_lss_t *lss, const struct co_id *id, co_lss_cs_ind_t *ind, void *data)
Requests the 'switch state selective' service.
void co_lss_scan_ind_t(co_lss_t *lss, co_unsigned8_t cs, const struct co_id *id, void *data)
The type of a CANopen LSS identify remote slave indication function, invoked when a 'Slowscan' or 'Fa...
The base class for a C++ interface to an incomplete C type.
int co_lss_get_product_code_req(co_lss_t *lss, co_lss_lssid_ind_t *ind, void *data)
Requests the 'inquire identity product-code' service.
An opaque CANopen LSS master/slave service type.
int co_lss_switch_rate_req(co_lss_t *lss, int delay)
Requests the 'activate bit timing parameters' service.
int co_lss_get_serial_nr_req(co_lss_t *lss, co_lss_lssid_ind_t *ind, void *data)
Requests the 'inquire identity serial-number' service.
int co_lss_get_id_req(co_lss_t *lss, co_lss_nid_ind_t *ind, void *data)
Requests the 'inquire node-ID' service.
void co_lss_set_store_ind(co_lss_t *lss, co_lss_store_ind_t *ind, void *data)
Sets the indication function invoked when an LSS 'store configuration' request is received...
int co_lss_get_timeout(const co_lss_t *lss)
Returns the timeout (in milliseconds) of an LSS master service.
int co_lss_is_master(const co_lss_t *lss)
Returns 1 if the specified CANopen LSS service is a master, and 0 if not.
int co_lss_store_ind_t(co_lss_t *lss, co_unsigned8_t id, co_unsigned16_t rate, void *data)
The type of a CANopen LSS 'store configuration' indication function, invoked when the pending node-ID...
int co_lss_store_req(co_lss_t *lss, co_lss_err_ind_t *ind, void *data)
Requests the 'store configuration' service.
void co_lss_lssid_ind_t(co_lss_t *lss, co_unsigned8_t cs, co_unsigned32_t id, void *data)
The type of a CANopen LSS inquire identity indication function, invoked when an 'inquire identity ven...
void co_lss_abort_req(co_lss_t *lss)
Aborts the current LSS master request.
co_nmt_t * co_lss_get_nmt(const co_lss_t *lss)
Returns a pointer to the NMT service of an LSS master/slave service.
void co_lss_set_timeout(co_lss_t *lss, int timeout)
Sets the timeout of an LSS master service.
int co_lss_switch_req(co_lss_t *lss, co_unsigned8_t mode)
Requests the 'switch state global' service.
void co_lss_err_ind_t(co_lss_t *lss, co_unsigned8_t cs, co_unsigned8_t err, co_unsigned8_t spec, void *data)
The type of a CANopen LSS error received indication function, invoked when a 'configure node-ID'...
This header file is part of the CANopen library; it contains the Layer Setting Services (LSS) and pro...
void co_lss_get_store_ind(const co_lss_t *lss, co_lss_store_ind_t **pind, void **pdata)
Retrieves the indication function invoked when an LSS 'store configuration' request is received...
int co_lss_fastscan_req(co_lss_t *lss, const struct co_id *id, const struct co_id *mask, co_lss_scan_ind_t *ind, void *data)
Requests the 'LSS Fastscan' service.
void co_lss_cs_ind_t(co_lss_t *lss, co_unsigned8_t cs, void *data)
The type of a CANopen LSS command received indication function, invoked when a 'switch state selectiv...
An opaque CANopen NMT master/slave service type.
int co_lss_get_vendor_id_req(co_lss_t *lss, co_lss_lssid_ind_t *ind, void *data)
Requests the 'inquire identity vendor-ID' service.
Global namespace for the Lely Industries N.V. libraries.
void co_lss_get_rate_ind(const co_lss_t *lss, co_lss_rate_ind_t **pind, void **pdata)
Retrieves the indication function invoked when an LSS 'activate bit timing' request is received...
int co_lss_id_non_cfg_slave_req(co_lss_t *lss, co_lss_cs_ind_t *ind, void *data)
Requests the 'LSS identify non-configured remote slave' service.
A class template supplying a uniform interface to certain attributes of C types.