hello!
Now it's august 16th and I am writting my own tcp/ip socket code to run on my real system.during this process, I meet some problems which I can't work out.
I make use of the VR_PMAC_GETRESPONSE explained in the ninth page of ethernet protocol.pdf to send the command string like "p100=100" to the pmac and it will set the value of the register "p100" to 100,which is good ,but then the recv function recvied the string which is "error4" from the pmac.In a word, the "send"function can send the right "string" and get the right result,but the pmac didn't response a right string,I don't know the reason.
Another example is that the program use the "send" function to send the string "p100",but the "recv" function just gets the string"error4" rather than "100"which should be the right value of "p100" ,and i think it's strange.
The follow is my key kode,thank you for helping me to get the right response!
SOCKET sockClient=socket(AF_INET,SOCK_STREAM,0);
SOCKADDR_IN addrSrv;
addrSrv.sin_addr.S_un.S_addr=inet_addr("192.6.94.5"); addrSrv.sin_family=AF_INET;
addrSrv.sin_port=htons(1025);
connect(sockClient,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR));
ETHERNETCMD EthCmd;
EthCmd.RequestType=VR_DOWNLOAD; EthCmd.Request=0XBF;
EthCmd.wValue=0;
EthCmd.wIndex=0;
EthCmd.wLength=htons((WORD)strlen(outstr));
strncpy((char*)&EthCmd.bData[0],outstr,(WORD)strlen(outstr));
send(sockClient,(char*)&EthCmd,ETHCMDSIZE+strlen(outstr),0);
//send the command string to pmac and it works well
recv(sockClient,szPMACDATA,1400,0);
//recive the reponse relative to the send string but it doesn't work well