IgH EtherCAT Master  1.6.2
foe_request.c File Reference

File-over-EtherCAT request functions. More...

Go to the source code of this file.

Macros

#define EC_FOE_REQUEST_RESPONSE_TIMEOUT   3000
 Default timeout in ms to wait for FoE transfer responses.
 

Functions

void ec_foe_request_clear_data (ec_foe_request_t *req)
 FoE request destructor. More...
 
void ec_foe_request_init (ec_foe_request_t *req, uint8_t *file_name)
 FoE request constructor. More...
 
void ec_foe_request_clear (ec_foe_request_t *req)
 FoE request destructor. More...
 
int ec_foe_request_alloc (ec_foe_request_t *req, size_t size)
 Pre-allocates the data memory. More...
 
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. More...
 
int ec_foe_request_timed_out (const ec_foe_request_t *req)
 Checks, if the timeout was exceeded. More...
 
void ec_foe_request_read (ec_foe_request_t *req)
 Prepares a read request (slave to master). More...
 
void ec_foe_request_write (ec_foe_request_t *req)
 Prepares a write request (master to slave). More...
 

Detailed Description

File-over-EtherCAT request functions.

Definition in file foe_request.c.

Function Documentation

◆ ec_foe_request_clear_data()

void ec_foe_request_clear_data ( ec_foe_request_t req)

FoE request destructor.

Parameters
reqFoE request.

Definition at line 84 of file foe_request.c.

◆ ec_foe_request_init()

void ec_foe_request_init ( ec_foe_request_t req,
uint8_t *  file_name 
)

FoE request constructor.

Parameters
reqFoE request.
file_namefilename

Definition at line 52 of file foe_request.c.

◆ ec_foe_request_clear()

void ec_foe_request_clear ( ec_foe_request_t req)

FoE request destructor.

Parameters
reqFoE request.

Definition at line 73 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.

◆ ec_foe_request_read()

void ec_foe_request_read ( ec_foe_request_t req)

Prepares a read request (slave to master).

Parameters
reqFoE request.

Definition at line 171 of file foe_request.c.

◆ ec_foe_request_write()

void ec_foe_request_write ( ec_foe_request_t req)

Prepares a write request (master to slave).

Parameters
reqFoE request.

Definition at line 185 of file foe_request.c.