User's Manual

UMAC Turbo CPU/Communications Board Hardware Manual
Ethernet Protocol 33
#define VR_PMAC_WRITEBUFFER 0xC6
#define VR_PMAC_WRITEERROR 0xC7
#define VR_FWDOWNLOAD 0xCB
#define VR_IPADDRESS 0xE0
wValue is request specific and its use is indicated under the description of each command.
wLength indicates the length of the bData field below.
bData is the meaningful data that is sent to the UMAC Turbo CPU/Communications Board.
Every command that is sent to the UMAC Turbo CPU/Communications Board uses the Ethernetcmd
packet structure and is initiated with a PC send command. Every command must issue a recv command
to either receive an acknowledgement character back via the recv command or receive meaningful data.
#define ETHERNETCMDSIZE 8
send(sock,(char *)&EthCmd,ETHERNETCMDSIZE,0);
recv(sock,(char *)&EthCmd,1,0);
Ethernet Protocol Command Set
VR_PMAC_FLUSH
This packet issues a ^X to the UMAC Turbo CPU/Communications Board and waits up to 10 msec for
UMAC Turbo CPU/Communications Board to respond with a ^X. command. Set up the packet that is
sent as follows. One byte is returned upon successful completion of the command.
EthCmd.RequestType = VR_DOWNLOAD;
EthCmd.Request = VR_PMAC_FLUSH;
EthCmd.wValue = 0;
EthCmd.wIndex = 0;
EthCmd.wLength = 0;
EthCmd.bData not used for this command
Example:
int CALLBACK PmacSockFlush()
{
ETHERNETCMD EthCmd;
int rc,iTimeout;
EthCmd.RequestType = VR_DOWNLOAD;
EthCmd.Request = VR_PMAC_FLUSH;
EthCmd.wValue = htons(FLUSH_TIMEOUT);
EthCmd.wIndex = 0;
EthCmd.wLength = 0;
send(sock,
(char *)&EthCmd,
ETHERNETCMDSIZE ,
0);
recv(sock,
(char *)&EthCmd,
1,
0);
}
The above example and all of the examples in this document do not perform error checking and timeout
checking. It is the application developer’s responsibility to perform error checking and timeout checks to
ensure that the application is working properly.
VR_PMAC_SENDLINE
This packet causes the string NULL terminated in EthCmd.bData to be sent to the UMAC Turbo
CPU/Communications Board. The string should not be terminated with a carriage return as this is done
by the firmware. One byte will be returned upon successful completion of the command.