IgH EtherCAT Master  1.5.3
sdo_request.h File Reference

EtherCAT CANopen SDO request structure. More...

Go to the source code of this file.

Data Structures

struct  ec_sdo_request
 CANopen SDO request. More...
 

Functions

void ec_sdo_request_init (ec_sdo_request_t *)
 SDO request constructor.
 
void ec_sdo_request_clear (ec_sdo_request_t *)
 SDO request destructor.
 
int ec_sdo_request_copy (ec_sdo_request_t *, const ec_sdo_request_t *)
 Copy another SDO request. More...
 
int ec_sdo_request_alloc (ec_sdo_request_t *, size_t)
 Pre-allocates the data memory. More...
 
int ec_sdo_request_copy_data (ec_sdo_request_t *, const uint8_t *, size_t)
 Copies SDO data from an external source. More...
 
int ec_sdo_request_timed_out (const ec_sdo_request_t *)
 Checks, if the timeout was exceeded. More...
 

Detailed Description

EtherCAT CANopen SDO request structure.

Definition in file sdo_request.h.

Function Documentation

◆ ec_sdo_request_copy()

int ec_sdo_request_copy ( ec_sdo_request_t req,
const ec_sdo_request_t other 
)

Copy another SDO request.

Attention
Only the index subindex and data are copied.
Returns
Zero on success, otherwise a negative error code.
Parameters
reqSDO request.
otherOther SDO request to copy from.

Definition at line 91 of file sdo_request.c.

◆ ec_sdo_request_alloc()

int ec_sdo_request_alloc ( ec_sdo_request_t req,
size_t  size 
)

Pre-allocates the data memory.

If the mem_size is already bigger than size, nothing is done.

Returns
0 on success, otherwise -ENOMEM.
Parameters
reqSDO request.
sizeData size to allocate.

Definition at line 127 of file sdo_request.c.

◆ ec_sdo_request_copy_data()

int ec_sdo_request_copy_data ( ec_sdo_request_t req,
const uint8_t *  source,
size_t  size 
)

Copies SDO data from an external source.

If the mem_size is to small, new memory is allocated.

Return values
0Success.
<0Error code.
Parameters
reqSDO request.
sourceSource data.
sizeNumber of bytes in source.

Definition at line 156 of file sdo_request.c.

◆ ec_sdo_request_timed_out()

int ec_sdo_request_timed_out ( const ec_sdo_request_t req)

Checks, if the timeout was exceeded.

Returns
non-zero if the timeout was exceeded, else zero.
Parameters
reqSDO request.

Definition at line 177 of file sdo_request.c.