Skip to content

Instantly share code, notes, and snippets.

View kevin-hall-kollmorgen's full-sized avatar

Kevin Hall kevin-hall-kollmorgen

View GitHub Profile
@kevin-hall-kollmorgen
kevin-hall-kollmorgen / txrx-mmap-ecat.c
Created September 22, 2023 23:13
Open raw socket specified with both PACKET_TX_RING and PACKET_RX_RING and send and receive EtherCAT packet.
/*
* This application tests whether an ethernet port can correctly send and receive
* data with both PACKET_TX_RING and PACKET_RX_RING enabled.
*
* This application uses EtherCAT packets and is intended to communicate with an EtherCAT slave device
* connected to the eth0 port. This core problem looks to be unrelated to the use of EtherCAT; it's just
* that communicating with a single device that echos (or almost echos) data is easier to write a test for.
*
* The test contains 2 sub-tests:
* (1) Send and receive data using PACKET_RX_RING but without PACKET_TX_RING. (named 'Tx-Send' in the test output)