Ewan
You can do this as follows:
I have taken an example of the TIME SERVER connection in the demo code (application.c).
if ((TIME_TCP_socket = fnGetTCP_Socket(TOS_MINIMISE_DELAY, TCP_DEFAULT_TIMEOUT, fnTimeListener)) >= 0) {
fnTCP_Connect(TIME_TCP_socket, (unsigned char *)&ucTimeServers[ucTimeServerTry++], TIME_PORT, 0, 0);
}
This is a connection to a server somewhere on the Internet and so will normally cause an ARP resolve to be sent the first time to find the local gateway and then the TCP connection will be established via the gateway. I can prime the IP / MAC of my gateway (router) as follows and so the TCP connection is established without first sending an ARP - it is a fixed entry and will not timeout.
unsigned char server_ip[IPV4_LENGTH] = {192, 168, 0, 1};
unsigned char server_mac[MAC_LENGTH] = {0x00, 0x0d, 0x88, 0xe7, 0x6a, 0x49};
fnAddARP(server_ip, server_mac, ARP_FIXED_IP);
if ((TIME_TCP_socket = fnGetTCP_Socket(TOS_MINIMISE_DELAY, TCP_DEFAULT_TIMEOUT, fnTimeListener)) >= 0) {
fnTCP_Connect(TIME_TCP_socket, (unsigned char *)&ucTimeServers[ucTimeServerTry++], TIME_PORT, 0, 0);
}
Here the values are fixed but it would be possible to make them configurable and save them to parameter FLASH so that all devices can be set up and then operate with the value until possibly reconfigured.
Note that fnDeleteArp() deletes all entries (including fixed ones) and so afterwards such fixed ones may have to be added again. If you find that you need to be able to selectively delete, or just delete all non-fixed entries, this can be quite easily made available.
Regards
Mark