|
IgH EtherCAT Master
1.7.0
|
EtherCAT FoE state machines. More...
Go to the source code of this file.
Macros | |
| #define | EC_FSM_FOE_TIMEOUT 3000 |
| Maximum time in ms to wait for responses when reading out the dictionary. | |
| #define | EC_FOE_HEADER_SIZE 6 |
| Size of the FoE header. | |
Enumerations | |
| enum | { EC_FOE_OPCODE_RRQ = 1 , EC_FOE_OPCODE_WRQ = 2 , EC_FOE_OPCODE_DATA = 3 , EC_FOE_OPCODE_ACK = 4 , EC_FOE_OPCODE_ERR = 5 , EC_FOE_OPCODE_BUSY = 6 } |
| FoE OpCodes. More... | |
Functions | |
| int | ec_foe_prepare_data_send (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Sends a file or the next fragment. | |
| int | ec_foe_prepare_wrq_send (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Prepare a write request (WRQ) with filename. | |
| int | ec_foe_prepare_rrq_send (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Prepare a read request (RRQ) with filename. | |
| int | ec_foe_prepare_send_ack (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Prepare to send an acknowledge. | |
| void | ec_foe_set_tx_error (ec_fsm_foe_t *fsm, uint32_t errorcode) |
| Set an error code and go to the send error state. | |
| void | ec_foe_set_rx_error (ec_fsm_foe_t *fsm, uint32_t errorcode) |
| Set an error code and go to the receive error state. | |
| void | ec_fsm_foe_end (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: END. | |
| void | ec_fsm_foe_error (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: ERROR. | |
| void | ec_fsm_foe_state_wrq_sent (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: WRQ SENT. | |
| void | ec_fsm_foe_state_rrq_sent (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: RRQ SENT. | |
| void | ec_fsm_foe_state_ack_read (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: ACK READ. | |
| void | ec_fsm_foe_state_data_sent (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: WRQ SENT. | |
| void | ec_fsm_foe_state_data_read (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| State: DATA READ. | |
| void | ec_fsm_foe_state_sent_ack (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Sent an acknowledge. | |
| void | ec_fsm_foe_write_start (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Initializes the FoE write state machine. | |
| void | ec_fsm_foe_read_start (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Starting state for read operations. | |
| void | ec_fsm_foe_init (ec_fsm_foe_t *fsm) |
| Constructor. | |
| void | ec_fsm_foe_clear (ec_fsm_foe_t *fsm) |
| Destructor. | |
| int | ec_fsm_foe_exec (ec_fsm_foe_t *fsm, ec_datagram_t *datagram) |
| Executes the current state of the state machine. | |
| int | ec_fsm_foe_success (const ec_fsm_foe_t *fsm) |
| Returns, if the state machine terminated with success. | |
| void | ec_fsm_foe_transfer (ec_fsm_foe_t *fsm, ec_slave_t *slave, ec_foe_request_t *request) |
| Prepares an FoE transfer. | |
| static void | ec_fsm_foe_wait (ec_fsm_foe_t *fsm, void(*state)(ec_fsm_foe_t *, ec_datagram_t *)) |
| Starts waiting for an FoE response. | |
| static void | ec_fsm_foe_receive (ec_fsm_foe_t *fsm, ec_datagram_t *datagram, void(*state)(ec_fsm_foe_t *, ec_datagram_t *)) |
| Waits for an FoE response. | |
EtherCAT FoE state machines.
Definition in file fsm_foe.c.
| #define EC_FSM_FOE_TIMEOUT 3000 |
| anonymous enum |
| int ec_foe_prepare_data_send | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_foe_prepare_wrq_send | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_foe_prepare_rrq_send | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_foe_prepare_send_ack | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_foe_set_tx_error | ( | ec_fsm_foe_t * | fsm, |
| uint32_t | errorcode ) |
| void ec_foe_set_rx_error | ( | ec_fsm_foe_t * | fsm, |
| uint32_t | errorcode ) |
| void ec_fsm_foe_end | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_error | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_state_wrq_sent | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_state_rrq_sent | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_state_ack_read | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_state_data_sent | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_state_data_read | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_state_sent_ack | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_write_start | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_read_start | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_foe_init | ( | ec_fsm_foe_t * | fsm | ) |
| void ec_fsm_foe_clear | ( | ec_fsm_foe_t * | fsm | ) |
| int ec_fsm_foe_exec | ( | ec_fsm_foe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_foe_success | ( | const ec_fsm_foe_t * | fsm | ) |
| void ec_fsm_foe_transfer | ( | ec_fsm_foe_t * | fsm, |
| ec_slave_t * | slave, | ||
| ec_foe_request_t * | request ) |
|
static |
|
static |
Waits for an FoE response.
Starts the mailbox receive state machine and executes the given response state immediately. The response state is left, as soon as an FoE response is available, or receiving failed.
| fsm | Finite state machine. |
| datagram | Datagram to use. |
| state | Response state. |