EtherSpaceLink-RG408
EtherSpaceLink family User Manual
/****************************************************************************************/
/* (c) June 2013,
R M A Peel, 4Links Limited
*/
/* */
/* Program sends the contents of a file to the ESL output port and stores the traffic
*/
/* received into a file.
Requires a loopback connector on port 1, or a separate
*/
/* SpaceWire device to sink the tx traffic and generate the rx traffic
*/
/* */
/* Run as
*/
/* c-api-example2-esl <IP address of ESL> <filename to tx> <filename to rx>
*/
/* */
/* Compile on Linux:
*/
/* gcc -O2 -o c-api-example2-esl c-api-example2-esl.c EtherSpaceLink.c -lm -lpthread
*/
/* */
/* Compile on Windows:
*/
/* cl /MT /D "_X86_" c-api-example2-esl.c EtherSpaceLink.c wsock32.lib
*/
/* */
/****************************************************************************************/
#include <stdio.h>
#include <sys/timeb.h>
#include <signal.h>
#include "EtherSpaceLink.h"
EtherSpaceLink ESL_unit;
int running = 1;
FILE *
rx_fd; /* Output file */
char filename[256];
/* Shut down */
void shut_down ( int sig )
{
fprintf (stderr, "\nCtrl/C seen\n" );
running = 0;
EtherSpaceLink_flush ( ESL_unit );
}
4Links Limited
www.4Links.co.uk
[email protected]
page 46 of 110
T +44 1908 642001; F +44 1908 363463
Milton Keynes MK3 6EB, UK
Suite EU2, Bletchley Park