IgH EtherCAT Master
1.5.3
|
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_timeout (ec_foe_request_t *req, uint32_t timeout) |
Set the request timeout. More... | |
uint8_t * | ec_foe_request_data (ec_foe_request_t *req) |
Returns a pointer to the request's data. More... | |
size_t | ec_foe_request_data_size (const ec_foe_request_t *req) |
Returns the data size. 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... | |
File-over-EtherCAT request functions.
Definition in file foe_request.c.
void ec_foe_request_clear_data | ( | ec_foe_request_t * | req | ) |
void ec_foe_request_init | ( | ec_foe_request_t * | req, |
uint8_t * | file_name | ||
) |
FoE request constructor.
req | FoE request. |
file_name | filename |
Definition at line 57 of file foe_request.c.
void ec_foe_request_clear | ( | ec_foe_request_t * | req | ) |
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.
req | FoE request. |
size | Data size to allocate. |
Definition at line 111 of file foe_request.c.
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.
req | FoE request. |
source | Source data. |
size | Number of bytes in source. |
Definition at line 140 of file foe_request.c.
int ec_foe_request_timed_out | ( | const ec_foe_request_t * | req | ) |
Checks, if the timeout was exceeded.
req | FoE request. |
Definition at line 164 of file foe_request.c.
void ec_foe_request_timeout | ( | ec_foe_request_t * | req, |
uint32_t | timeout | ||
) |
Set the request timeout.
req | FoE request. |
timeout | Timeout in ms. |
Definition at line 176 of file foe_request.c.
uint8_t* ec_foe_request_data | ( | ec_foe_request_t * | req | ) |
Returns a pointer to the request's data.
req | FoE request. |
Definition at line 190 of file foe_request.c.
size_t ec_foe_request_data_size | ( | const ec_foe_request_t * | req | ) |
Returns the data size.
req | FoE request. |
Definition at line 203 of file foe_request.c.
void ec_foe_request_read | ( | ec_foe_request_t * | req | ) |
Prepares a read request (slave to master).
req | FoE request. |
Definition at line 214 of file foe_request.c.
void ec_foe_request_write | ( | ec_foe_request_t * | req | ) |
Prepares a write request (master to slave).
req | FoE request. |
Definition at line 228 of file foe_request.c.