Delta Tau GEO BRICK LV Manual De Usuario
Turbo PMAC User Manual
416
Writing a Host Communications Program
EthCmd.RequestType = VR_UPLOAD;
EthCmd.Request = VR_PMAC_GETBUFFER;
EthCmd.wValue = 0;
EthCmd.wIndex = 0;
EthCmd.wLength = htons( (WORD)strlen(outstr));
EthCmd.bData - Not Used
Example
int CALLBACK PmacSockGetBuffer(char *instr)
{
EthCmd.RequestType = VR_DOWNLOAD;
EthCmd.Request = VR_PMAC_GETBUFFER;
EthCmd.wValue = 0;
EthCmd.wIndex = 0;
EthCmd.wLength = htons( (WORD)strlen(outstr));
send(sock,(char *)&EthCmd,ETHERNETCMDSIZE,0);
send(sock,(char *)&EthCmd,ETHERNETCMDSIZE,0);
recv(sock,(char *)&instr,1400,0);
}
VR_ IPADDRESS
This packet permits either setting or retrieval of the current IP address in the Ethernet interface.
When setting the IP address to a new value it is required that the Turbo PMAC is powered down for the
new address to take effect.
new address to take effect.
EthCmd.RequestType = VR_UPLOAD to retrieve the IP address
or
EthCmd.RequestType = VR_DOWNLOAD to set the IP address
EthCmd.Request = VR_IPADDRESS;
EthCmd.wValue = 0;
EthCmd.wIndex = 0;
EthCmd.wLength = htons(4);
EthCmd.bData = contains 4 bytes of data indicating the IP
address set on the send command.
For the receive command four bytes of data are returned indicating the IP address.
VR_PMAC_SENDCTRLCHAR
This packet permits sending of a single character or control character to the Turbo PMAC Ethernet port.
The packet below is what is to be sent. The data received is irrelevant; its purpose is to insure the sender's
command was received.
The packet below is what is to be sent. The data received is irrelevant; its purpose is to insure the sender's
command was received.
EthCmd.RequestType = VR_DOWNLOAD;
EthCmd.Request = VR_PMAC_SENDCTRLCHAR;
EthCmd.wValue = htons(outch); // the character to write
EthCmd.wIndex = 0;
EthCmd.bData - Not Used
VR_PMAC_PORT
This packet permits sending of a single byte or receiving of single byte through the Ethernet port to or
from the CPU’s host port.
from the CPU’s host port.
To send data to the host port set the packet as follows. After sending the packet the programmer must
wait to receive 1 byte via the recv function before continuing. The data received is irrelevant; its purpose
is to insure the sender’s command was received.
wait to receive 1 byte via the recv function before continuing. The data received is irrelevant; its purpose
is to insure the sender’s command was received.
EthCmd.RequestType = VR_DOWNLOAD;
EthCmd.Request = VR_PMAC_PORT;