Delta Tau TURBO UMAC 사용자 설명서

다운로드
페이지 49
UMAC Turbo CPU/Communications Board Hardware Manual 
Ethernet Protocol 
34 
EthCmd.RequestType = VR_DOWNLOAD; 
EthCmd.Request     = VR_PMAC_SENDLINE; 
EthCmd.wValue      = 0; 
EthCmd.wIndex      = 0; 
EthCmd.wLength     = htons( (WORD)strlen(outstr)); 
strncpy((char *)&EthCmd.bData[0], 
         outstr 
         ,(WORD)strlen(outstr)); 
Example: 
int CALLBACK PmacSockSendLine(char *outstr) 

   EthCmd.RequestType = VR_DOWNLOAD; 
   EthCmd.Request     = VR_PMAC_SENDLINE; 
   EthCmd.wValue      = 0; 
   EthCmd.wIndex      = 0; 
   EthCmd.wLength     = htons( (WORD)strlen(outstr)); 
   strncpy((char *)&EthCmd.bData[0],outstr,(WORD)strlen(outstr)); 
   send(sock, 
        (char *)&EthCmd, 
        ETHERNETCMDSIZE +  strlen(outstr), 
       0); 
   recv(sock,(char *)&EthCmd,1 ,0); 
VR_PMAC_GETLINE 
This packet causes the Ethernet connection to return any available string that may be residing in the 
UMAC Turbo CPU/Communications Board.  All characters up to a <CR>, <ACK> or <LF> are returned. 
The available string in UMAC Turbo CPU/Communications Board is returned and captured via an 
Ethernet recv command.  Do not use this function.  Use VR_PMAC_GETBUFFER instead, as this 
function will retrieve multiple lines and enhance performance instead of using multiple calls of 
VR_PMAC_GETLINE. 
EthCmd.RequestType = VR_UPLOAD; 
EthCmd.Request     = VR_PMAC_GETLINE; 
EthCmd.wValue      = 0; 
EthCmd.wIndex      = 0; 
EthCmd.wLength     Not used 
Example: 
int CALLBACK PmacSockGetLine(char *instr) 

   EthCmd.RequestType = VR_DOWNLOAD; 
   EthCmd.Request     = VR_PMAC_GETLINE; 
   EthCmd.wValue      = 0; 
   EthCmd.wIndex      = 0; 
   EthCmd.wLength     = htons( (WORD)strlen(outstr)); 
   strncpy((char *)&EthCmd.bData[0],outstr,(WORD)strlen(outstr)); 
   send(sock,(char *)&EthCmd,ETHERNETCMDSIZE,0); 
   recv(sock,(char *)&instr,255 ,0);