IgH EtherCAT Master  1.5.3
soe_request.h File Reference

EtherCAT SoE request structure. More...

Go to the source code of this file.

Data Structures

struct  ec_soe_request
 Sercos-over-EtherCAT request. More...
 

Functions

void ec_soe_request_init (ec_soe_request_t *)
 SoE request constructor.
 
void ec_soe_request_clear (ec_soe_request_t *)
 SoE request destructor.
 
int ec_soe_request_copy (ec_soe_request_t *, const ec_soe_request_t *)
 Copy another SoE request. More...
 
void ec_soe_request_set_drive_no (ec_soe_request_t *, uint8_t)
 Set drive number.
 
void ec_soe_request_set_idn (ec_soe_request_t *, uint16_t)
 Set IDN.
 
int ec_soe_request_alloc (ec_soe_request_t *, size_t)
 Pre-allocates the data memory. More...
 
int ec_soe_request_copy_data (ec_soe_request_t *, const uint8_t *, size_t)
 Copies SoE data from an external source. More...
 
int ec_soe_request_append_data (ec_soe_request_t *, const uint8_t *, size_t)
 Copies SoE data from an external source. More...
 
void ec_soe_request_read (ec_soe_request_t *)
 Request a read operation.
 
void ec_soe_request_write (ec_soe_request_t *)
 Request a write operation.
 
int ec_soe_request_timed_out (const ec_soe_request_t *)
 Checks, if the timeout was exceeded. More...
 

Detailed Description

EtherCAT SoE request structure.

Definition in file soe_request.h.

Function Documentation

◆ ec_soe_request_copy()

int ec_soe_request_copy ( ec_soe_request_t req,
const ec_soe_request_t other 
)

Copy another SoE request.

Returns
Zero on success, otherwise a negative error code.
Parameters
reqSoE request.
otherOther SoE request to copy from.

Definition at line 90 of file soe_request.c.

◆ ec_soe_request_alloc()

int ec_soe_request_alloc ( ec_soe_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
reqSoE request.
sizeData size to allocate.

Definition at line 150 of file soe_request.c.

◆ ec_soe_request_copy_data()

int ec_soe_request_copy_data ( ec_soe_request_t req,
const uint8_t *  source,
size_t  size 
)

Copies SoE data from an external source.

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

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

Definition at line 179 of file soe_request.c.

◆ ec_soe_request_append_data()

int ec_soe_request_append_data ( ec_soe_request_t req,
const uint8_t *  source,
size_t  size 
)

Copies SoE data from an external source.

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

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

Definition at line 203 of file soe_request.c.

◆ ec_soe_request_timed_out()

int ec_soe_request_timed_out ( const ec_soe_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 262 of file soe_request.c.