Lely core libraries 2.3.4
lss.h File Reference

This header file is part of the CANopen library; it contains the Layer Setting Services (LSS) and protocols declarations. More...

#include <lely/can/net.h>
#include <lely/co/dev.h>
Include dependency graph for lss.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LELY_CO_LSS_INHIBIT   10
 The default LSS inhibit time (in multiples of 100 microseconds).
 
#define LELY_CO_LSS_TIMEOUT   100
 The default LSS timeout (in milliseconds).
 
#define CO_LSS_CANID(master)   (0x7e4 + !!(master))
 The CAN identifier used for LSS by the master (1) or the slave (0).
 

Typedefs

typedef 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 is requested.
 
typedef 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 and baudrate should be copied to the persistent node-ID and baudrate.
 
typedef 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 selective','LSS identify remote slave' or 'LSS identify non-configured remote slave' request completes.
 
typedef 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', 'configure bit timing parameters' or 'store configuration' request completes.
 
typedef 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 vendor-ID', 'inquire identity product-code', 'inquire identity revision-number' or 'inquire identity serial-number' request completes.
 
typedef 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' request completes.
 
typedef 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 'Fastscan' request completes.
 

Functions

co_lss_tco_lss_create (co_nmt_t *nmt)
 Creates a new CANopen LSS master/slave service.
 
void co_lss_destroy (co_lss_t *lss)
 Destroys a CANopen LSS master/slave service.
 
int co_lss_start (co_lss_t *lss)
 Starts an LSS service.
 
void co_lss_stop (co_lss_t *lss)
 Stops an LSS service.
 
int co_lss_is_stopped (const co_lss_t *lss)
 Retuns 1 if the specified LSS service is stopped, and 0 if not.
 
co_nmt_tco_lss_get_nmt (const co_lss_t *lss)
 Returns a pointer to the NMT service of an LSS master/slave 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.
 
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.
 
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_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.
 
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_set_inhibit (co_lss_t *lss, co_unsigned16_t inhibit)
 Sets the inhibit time between successive LSS messages of an LSS master service.
 
int co_lss_get_timeout (const co_lss_t *lss)
 Returns the timeout (in milliseconds) of an LSS master service.
 
void co_lss_set_timeout (co_lss_t *lss, int timeout)
 Sets the timeout 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_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_abort_req (co_lss_t *lss)
 Aborts the current LSS master request.
 
int co_lss_switch_req (co_lss_t *lss, co_unsigned8_t mode)
 Requests the 'switch state global' 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.
 
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_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_switch_rate_req (co_lss_t *lss, int delay)
 Requests the 'activate bit timing parameters' service.
 
int co_lss_store_req (co_lss_t *lss, co_lss_err_ind_t *ind, void *data)
 Requests the 'store configuration' service.
 
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_get_product_code_req (co_lss_t *lss, co_lss_lssid_ind_t *ind, void *data)
 Requests the 'inquire identity product-code' 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.
 
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.
 
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_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_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_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.
 

Detailed Description

This header file is part of the CANopen library; it contains the Layer Setting Services (LSS) and protocols declarations.

Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file lss.h.

Typedef Documentation

◆ co_lss_rate_ind_t

typedef 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 is requested.

Parameters
lssa pointer to an LSS slave service.
ratethe new baudrate (in kbit/s), or 0 for automatic bit rate detection.
delaythe delay (in milliseconds) before the switch and the delay after the switch during which CAN frames MUST NOT be sent.
dataa pointer to user-specified data.

Definition at line 56 of file lss.h.

◆ co_lss_store_ind_t

typedef 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 and baudrate should be copied to the persistent node-ID and baudrate.

Parameters
lssa pointer to an LSS slave service.
idthe node-ID.
ratethe new baudrate (in kbit/s), or 0 for automatic bit rate detection.
dataa pointer to user-specified data.
Returns
0 on success, or -1 on error.

Definition at line 72 of file lss.h.

◆ co_lss_cs_ind_t

typedef 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 selective','LSS identify remote slave' or 'LSS identify non-configured remote slave' request completes.

Parameters
lssa pointer to an LSS master service.
csthe received command specifier (one of 0x44, 0x4f or 0x50), or 0 on timeout.
dataa pointer to user-specified data.

Definition at line 85 of file lss.h.

◆ co_lss_err_ind_t

typedef 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', 'configure bit timing parameters' or 'store configuration' request completes.

Parameters
lssa pointer to an LSS master service.
csthe received command specifier (one of 0x11, 0x13 or 0x17), or 0 on timeout.
errthe error code (0 on success).
specthe implementation-specific error code (if err is 0xff).
dataa pointer to user-specified data.

Definition at line 99 of file lss.h.

◆ co_lss_lssid_ind_t

typedef 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 vendor-ID', 'inquire identity product-code', 'inquire identity revision-number' or 'inquire identity serial-number' request completes.

Parameters
lssa pointer to an LSS master service.
csthe received command specifier (one of 0x5a, 0x5b, 0x5c or 0x5d), or 0 on timeout.
idthe received LSS number.
dataa pointer to user-specified data.

Definition at line 114 of file lss.h.

◆ co_lss_nid_ind_t

typedef 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' request completes.

Parameters
lssa pointer to an LSS master service.
csthe received command specifier (0x5e), or 0 on timeout.
idthe received node-ID.
dataa pointer to user-specified data.

Definition at line 126 of file lss.h.

◆ co_lss_scan_ind_t

typedef 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 'Fastscan' request completes.

Parameters
lssa pointer to an LSS master service.
csthe received command specifier (0x44 or 0x4f), or 0 if no slave was found.
ida pointer to the received LSS address, or NULL if no slave was found.
dataa pointer to user-specified data.

Definition at line 140 of file lss.h.

Function Documentation

◆ co_lss_create()

co_lss_t * co_lss_create ( co_nmt_t nmt)

Creates a new CANopen LSS master/slave service.

The service is started as if by co_lss_start().

Parameters
nmta pointer to an NMT master/slave service.
Returns
a pointer to a new LSS service, or NULL on error. In the latter case, the error number can be obtained with get_errc().
See also
co_lss_destroy()

Definition at line 783 of file lss.c.

◆ co_lss_destroy()

void co_lss_destroy ( co_lss_t lss)

Destroys a CANopen LSS master/slave service.

See also
co_lss_create()

Definition at line 810 of file lss.c.

◆ co_lss_start()

int co_lss_start ( co_lss_t lss)

Starts an LSS service.

Postcondition
on success, co_lss_is_stopped() returns 0.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().
See also
co_lss_stop()

Definition at line 820 of file lss.c.

◆ co_lss_stop()

void co_lss_stop ( co_lss_t lss)

Stops an LSS service.

Postcondition
co_lss_is_stopped() returns 1.
See also
co_lss_start()

Definition at line 833 of file lss.c.

◆ co_lss_is_stopped()

int co_lss_is_stopped ( const co_lss_t lss)

Retuns 1 if the specified LSS service is stopped, and 0 if not.

See also
co_lss_start, co_lss_stop()

Definition at line 849 of file lss.c.

◆ co_lss_get_rate_ind()

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.

Parameters
lssa pointer to an LSS slave service.
pindthe address at which to store a pointer to the indication function (can be NULL).
pdatathe address at which to store a pointer to user-specified data (can be NULL).
See also
co_lss_set_rate_ind()

Definition at line 865 of file lss.c.

◆ co_lss_set_rate_ind()

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.

Parameters
lssa pointer to an LSS slave service.
inda pointer to the function to be invoked.
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
See also
co_lss_get_rate_ind()

Definition at line 876 of file lss.c.

◆ co_lss_get_store_ind()

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.

Parameters
lssa pointer to an LSS slave service.
pindthe address at which to store a pointer to the indication function (can be NULL).
pdatathe address at which to store a pointer to user-specified data (can be NULL).
See also
co_lss_set_store_ind()

Definition at line 885 of file lss.c.

◆ co_lss_set_store_ind()

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.

Parameters
lssa pointer to an LSS slave service.
inda pointer to the function to be invoked.
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
See also
co_lss_get_store_ind()

Definition at line 897 of file lss.c.

◆ co_lss_get_inhibit()

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.

A return value of 0 means the inhibit time is disabled.

See also
co_lss_set_inhibit()

Definition at line 908 of file lss.c.

◆ co_lss_set_inhibit()

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.

Parameters
lssa pointer to an LSS master service.
inhibitthe inhibit time (in multiples of 100 microseconds. A value of 0 disables the inhibit time.
See also
co_lss_get_inhibit()

Definition at line 916 of file lss.c.

◆ co_lss_get_timeout()

int co_lss_get_timeout ( const co_lss_t lss)

Returns the timeout (in milliseconds) of an LSS master service.

A return value of 0 means no timeout is being used.

See also
co_lss_set_timeout()

Definition at line 924 of file lss.c.

◆ co_lss_set_timeout()

void co_lss_set_timeout ( co_lss_t lss,
int  timeout 
)

Sets the timeout of an LSS master service.

Parameters
lssa pointer to an LSS master service.
timeoutthe timeout (in milliseconds). A value of 0 disables the timeout.
See also
co_lss_get_timeout()

Definition at line 932 of file lss.c.

◆ co_lss_abort_req()

void co_lss_abort_req ( co_lss_t lss)

Aborts the current LSS master request.

This function has no effect if the LSS service is idle (see co_lss_is_idle()).

Definition at line 969 of file lss.c.

◆ co_lss_switch_req()

int co_lss_switch_req ( co_lss_t lss,
co_unsigned8_t  mode 
)

Requests the 'switch state global' service.

See section 6.3.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
mode0 to switch to all slaves the LSS waiting state, 1 to switch all slaves to the LSS configuration state.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 977 of file lss.c.

◆ co_lss_switch_sel_req()

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.

See section 6.3.3 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
ida pointer to the LSS address of the slave to be configured.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 999 of file lss.c.

◆ co_lss_set_id_req()

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.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.4.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
idthe pending node-ID to be configured.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1021 of file lss.c.

◆ co_lss_set_rate_req()

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.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.4.3 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
ratethe pending baudrate (in kbit/s), or 0 for automatic bit rate detection.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1053 of file lss.c.

◆ co_lss_switch_rate_req()

int co_lss_switch_rate_req ( co_lss_t lss,
int  delay 
)

Requests the 'activate bit timing parameters' service.

See section 6.4.4 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
delaythe delay (in milliseconds) before the switch and the delay after the switch during which CAN frames MUST NOT be sent.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1094 of file lss.c.

◆ co_lss_store_req()

int co_lss_store_req ( co_lss_t lss,
co_lss_err_ind_t ind,
void *  data 
)

Requests the 'store configuration' service.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.4.5 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1117 of file lss.c.

◆ co_lss_get_vendor_id_req()

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.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.5.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1142 of file lss.c.

◆ co_lss_get_product_code_req()

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.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.5.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1167 of file lss.c.

◆ co_lss_get_revision_req()

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.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.5.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1192 of file lss.c.

◆ co_lss_get_serial_nr_req()

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.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.5.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1218 of file lss.c.

◆ co_lss_get_id_req()

int co_lss_get_id_req ( co_lss_t lss,
co_lss_nid_ind_t ind,
void *  data 
)

Requests the 'inquire node-ID' service.

It is the responsibility of the LSS master to ensure that a single LSS slave is in the LSS configuration state.

See section 6.5.3 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1244 of file lss.c.

◆ co_lss_id_slave_req()

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.

The specified indication function is invoked as soon as the first slave responds.

See section 6.6.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
loa pointer to the lower bound of the LSS address.
hia pointer to the upper bound of the LSS address. The vendor-ID and product-code MUST be the same as in *lo.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1269 of file lss.c.

◆ co_lss_id_non_cfg_slave_req()

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.

The specified indication function is invoked as soon as the first slave responds.

See section 6.6.4 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1303 of file lss.c.

◆ co_lss_slowscan_req()

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.

This service performs a binary search using the 'LSS identify remote slave' service to obtain a single LSS address, followed by the 'switch state selective' service. If the request completes with success, the identified slave is in the LSS configuration state.

See section 8.4.2 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
loa pointer to the lower bound of the LSS address.
hia pointer to the upper bound of the LSS address. The vendor-ID and product-code MUST be the same as in *lo.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1329 of file lss.c.

◆ co_lss_fastscan_req()

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.

If the request completes with success, the identified slave is in the LSS configuration state.

See section 6.7 in CiA 305 version 3.0.0.

Parameters
lssa pointer to an LSS master service.
ida pointer a struct containing the bits of the LSS address that are already known and can be skipped during scanning (can be NULL).
maska pointer to a struct containing the mask specifying which bits in *id are already known (can be NULL). If a bit in *mask is 1, the corresponding bit in *id is not checked.
inda pointer to the indication function (can be NULL).
dataa pointer to user-specified data (can be NULL). data is passed as the last parameter to ind.
Returns
0 on success, or -1 on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 1365 of file lss.c.