IgH EtherCAT Master  1.6.2
foe_request.h File Reference

EtherCAT FoE request structure. More...

Go to the source code of this file.

Data Structures

struct  ec_foe_request_t
 FoE request. More...
 

Functions

void ec_foe_request_init (ec_foe_request_t *, uint8_t *file_name)
 FoE request constructor. More...
 
void ec_foe_request_clear (ec_foe_request_t *)
 FoE request destructor.
 
int ec_foe_request_alloc (ec_foe_request_t *, size_t)
 Pre-allocates the data memory. More...
 
int ec_foe_request_copy_data (ec_foe_request_t *, const uint8_t *, size_t)
 Copies FoE data from an external source. More...
 
int ec_foe_request_timed_out (const ec_foe_request_t *)
 Checks, if the timeout was exceeded. More...
 
void ec_foe_request_write (ec_foe_request_t *)
 Prepares a write request (master to slave).
 
void ec_foe_request_read (ec_foe_request_t *)
 Prepares a read request (slave to master).
 

Detailed Description

EtherCAT FoE request structure.

Definition in file foe_request.h.

Function Documentation

◆ ec_foe_request_init()

void ec_foe_request_init ( ec_foe_request_t ,
uint8_t *  file_name 
)

FoE request constructor.

Parameters
file_namefilename

Definition at line 52 of file foe_request.c.

◆ ec_foe_request_alloc()

int ec_foe_request_alloc ( ec_foe_request_t req,
size_t  size 
)

Pre-allocates the data memory.

If the internal buffer_size is already bigger than size, nothing is done.

Returns
Zero on success, otherwise a negative error code.
Parameters
reqFoE request.
sizeData size to allocate.

Definition at line 106 of file foe_request.c.

◆ ec_foe_request_copy_data()

int ec_foe_request_copy_data ( ec_foe_request_t req,
const uint8_t *  source,
size_t  size 
)

Copies FoE data from an external source.

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

Returns
Zero on success, otherwise a negative error code.
Parameters
reqFoE request.
sourceSource data.
sizeNumber of bytes in source.

Definition at line 135 of file foe_request.c.

◆ ec_foe_request_timed_out()

int ec_foe_request_timed_out ( const ec_foe_request_t req)

Checks, if the timeout was exceeded.

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

Definition at line 159 of file foe_request.c.