User's Manual
UMAC Turbo CPU/Communications Board Hardware Manual
Ethernet Protocol 36
VR_PMAC_PORT
This packet sends or receives a single byte to or from the UMAC Turbo CPU/Communications Board.
To send data to the host port, set the packet as follows. After sending the packet, the programmer must
wait to receive one byte via the Recv function before continuing. The data received is irrelevant; its
purpose is to ensure that the sender’s command was received.
EthCmd.RequestType = VR_DOWNLOAD;
EthCmd.Request = VR_PMAC_PORT;
EthCmd.wValue = htons((WORD)offset);
EthCmd.wIndex = htons((WORD)outch);
EthCmd.wLength = 0;
To receive data from the host port, set the packet as follows. After sending the packet, the programmer
shall receive one byte which is the value the UMAC Turbo CPU/Communications Board read from the
host port.
EthCmd.RequestType = VR_UPLOAD;
EthCmd.Request = VR_PMAC_PORT;
EthCmd.wValue = htons(offset);
EthCmd.wIndex = 0;
EthCmd.wLength = 0;
VR_PMAC_READREADY
This packet determines if there is data on the Turbo PMAC 2 CPU ready to be read.
Two bytes are returned. The first byte if non-zero indicates there is data to be read; if zero, there is no
data to be read. Set up the packet as follows:
EthCmd.RequestType = VR_UPLOAD;
EthCmd.Request = VR_PMAC_READREADY;
EthCmd.wValue = 0;
EthCmd.wIndex = 0;
EthCmd.wLength = htons(2);
Example:
ETHERNETCMD EthCmd;
char data[2];
int rc;
EthCmd.RequestType = VR_UPLOAD;
EthCmd.Request = VR_PMAC_READREADY;
EthCmd.wValue = 0;
EthCmd.wIndex = 0;
EthCmd.wLength = htons(2);
rc = send(sock,((char *)&EthCmd),ETHERNETCMDSIZE,0);
rc = recv(*((SOCKET *)vh[dwDevice].hDriver),data,2,0);
return data[0];
VR_CTRL_REPONSE
After sending a control character, this packet obtains the response. Set up the packet as follows. The
received data is the response to the sent control character. Meaningful data is returned for the following
control characters ^B, ^C, ^F, ^G, ^P and ^V. All other data control characters do not return meaningful
data.
EthCmd.RequestType = VR_UPLOAD;
EthCmd.Request = VR_CTRL_RESPONSE;
EthCmd.wValue = htons(outchar);//outchar=ctrl char to send out
EthCmd.wIndex = 0;
EthCmd.wLength = htons(len);
rc = send(sock,((char *)&EthCmd),ETHERNETCMDSIZE,0);
rc = recv(sock,outstr,len,0); // returned data appears