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();
50 free(
void* ptr) noexcept {
56 return __co_lss_init(p, nmt);
73 getNMT()
const noexcept {
89 setRateInd(F* f) noexcept {
91 static_cast<void*
>(f));
94 template <class C, typename c_mem_fn<co_lss_rate_ind_t*, C>::type M>
96 setRateInd(C* obj) noexcept {
98 static_cast<void*
>(obj));
113 setStoreInd(F* f) noexcept {
115 static_cast<void*
>(f));
118 template <class C, typename c_mem_fn<co_lss_store_ind_t*, C>::type M>
120 setStoreInd(C* obj) noexcept {
122 static_cast<void*
>(obj));
126 getInhibit()
const noexcept {
131 setInhibit(co_unsigned16_t inhibit) noexcept {
136 getTimeout()
const noexcept {
141 setTimeout(
int timeout) noexcept {
146 isMaster()
const noexcept {
151 isIdle()
const noexcept {
156 abortReq() noexcept {
161 switchReq(co_unsigned8_t mode) noexcept {
172 switchSelReq(
const co_id&
id, F* f) noexcept {
174 static_cast<void*
>(f));
177 template <class C, typename c_mem_fn<co_lss_cs_ind_t*, C>::type M>
179 switchSelReq(
const co_id&
id, C* obj) noexcept {
181 static_cast<void*
>(obj));
191 setIdReq(co_unsigned8_t
id, F* f) noexcept {
193 static_cast<void*
>(f));
196 template <class C, typename c_mem_fn<co_lss_err_ind_t*, C>::type M>
198 setIdReq(co_unsigned8_t
id, C* obj) noexcept {
200 static_cast<void*
>(obj));
204 setRateReq(co_unsigned16_t rate,
co_lss_err_ind_t* ind,
void* data) noexcept {
210 setRateReq(co_unsigned16_t rate, F* f) noexcept {
212 static_cast<void*
>(f));
215 template <class C, typename c_mem_fn<co_lss_err_ind_t*, C>::type M>
217 setRateReq(co_unsigned16_t rate, C* obj) noexcept {
219 static_cast<void*
>(obj));
223 switchRateReq(
int delay) noexcept {
234 storeReq(F* f) noexcept {
236 static_cast<void*
>(f));
239 template <class C, typename c_mem_fn<co_lss_err_ind_t*, C>::type M>
241 storeReq(C* obj) noexcept {
243 static_cast<void*
>(obj));
253 getVendorIdReq(F* f) noexcept {
255 static_cast<void*
>(f));
258 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
260 getVendorIdReq(C* obj) noexcept {
262 static_cast<void*
>(obj));
272 getProductCodeReq(F* f) noexcept {
274 static_cast<void*
>(f));
277 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
279 getProductCodeReq(C* obj) noexcept {
281 static_cast<void*
>(obj));
291 getRevisionReq(F* f) noexcept {
293 static_cast<void*
>(f));
296 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
298 getRevisionReq(C* obj) noexcept {
300 static_cast<void*
>(obj));
310 getSerialNrReq(F* f) noexcept {
312 static_cast<void*
>(f));
315 template <class C, typename c_mem_fn<co_lss_lssid_ind_t*, C>::type M>
317 getSerialNrReq(C* obj) noexcept {
319 static_cast<void*
>(obj));
329 getIdReq(F* f) noexcept {
331 static_cast<void*
>(f));
334 template <class C, typename c_mem_fn<co_lss_nid_ind_t*, C>::type M>
336 getIdReq(C* obj) noexcept {
338 static_cast<void*
>(obj));
343 void* data) noexcept {
349 idSlaveReq(
const co_id& lo,
const co_id& hi, F* f) noexcept {
351 static_cast<void*
>(f));
354 template <class C, typename c_mem_fn<co_lss_cs_ind_t*, C>::type M>
356 idSlaveReq(
const co_id& lo,
const co_id& hi, C* obj) noexcept {
358 static_cast<void*
>(obj));
368 idNonCfgSlaveReq(F* f) noexcept {
370 static_cast<void*
>(f));
373 template <class C, typename c_mem_fn<co_lss_cs_ind_t*, C>::type M>
375 idNonCfgSlaveReq(C* obj) noexcept {
377 static_cast<void*
>(obj));
382 void* data) noexcept {
388 slowscanReq(
const co_id& lo,
const co_id& hi, F* f) noexcept {
390 static_cast<void*
>(f));
393 template <class C, typename c_mem_fn<co_lss_scan_ind_t*, C>::type M>
395 slowscanReq(
const co_id& lo,
const co_id& hi, C* obj) noexcept {
397 static_cast<void*
>(obj));
402 void* data) noexcept {
408 fastscanReq(
const co_id*
id,
const co_id* mask, F* f) noexcept {
410 static_cast<void*
>(f));
413 template <class C, typename c_mem_fn<co_lss_scan_ind_t*, C>::type M>
415 fastscanReq(
const co_id*
id,
const co_id* mask, C* obj) noexcept {
416 return fastscanReq(
id, mask,
418 static_cast<void*
>(obj));
An opaque CANopen LSS master/slave service type.
An opaque CANopen NMT master/slave service type.
The base class for a C++ interface to an incomplete C type.
This header file is part of the CANopen library; it contains the Layer Setting Services (LSS) and pro...
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...
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.
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...
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',...
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.
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...
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.
void co_lss_set_timeout(co_lss_t *lss, int timeout)
Sets the timeout of an LSS master service.
co_unsigned16_t co_lss_get_inhibit(const co_lss_t *lss)
Returns the inhibit time (in multiples of 100 microseconds) of an LSS master 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...
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_rate_req(co_lss_t *lss, int delay)
Requests the 'activate bit timing parameters' 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.
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_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_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_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_switch_req(co_lss_t *lss, co_unsigned8_t mode)
Requests the 'switch state global' 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.
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.
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.
int co_lss_get_timeout(const co_lss_t *lss)
Returns the timeout (in milliseconds) of an LSS master service.
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.
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.
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_store_req(co_lss_t *lss, co_lss_err_ind_t *ind, void *data)
Requests the 'store configuration' 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...
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...
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.
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.
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.
void co_lss_abort_req(co_lss_t *lss)
Aborts the current LSS master request.
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.
void co_lss_set_inhibit(co_lss_t *lss, co_unsigned16_t inhibit)
Sets the inhibit time between successive LSS messages of an LSS master service.
This header file is part of the CAN library; it contains the C++ interface of the CAN network interfa...
A CANopen LSS master/slave service.
A class template supplying a uniform interface to certain attributes of C types.