#include #include #include #include #include "definitions.h" #include "net.h" #define COMMAND_LENGTH 80 /* max length of a command. */ int main() { int i=1; int status=FAILURE; int number_of_terminators=1; char *command=NULL; char **reply=NULL; int polarityflip, orderflip; float startmark, tablecoverage; if ((command = (char *) calloc(COMMAND_LENGTH, sizeof(char)))==NULL) { fprintf(stderr, "*ERROR* failed to allocate command buffer!"); fflush(stderr); exit(EXIT_FAILURE); } if ((reply = (char **) calloc(COMMAND_LENGTH, sizeof(char *))) == NULL) { fprintf(stderr, "*ERROR* failed to allocate command buffer!"); fflush(stderr); exit(EXIT_FAILURE); } for (i=0; i\n\ \n\ \n\ \n "); scanf("%d,%d,%f,%f", &polarityflip, &orderflip, &startmark, &tablecoverage); sprintf(command, "WCC %1d,%1d,%.4f,%.4f", polarityflip, orderflip, startmark, tablecoverage); printf("The command is \"%s\"\n", command); status = vrsi_command_tcpip(command, reply, (int) COMMAND_LENGTH,1,"10.212.212.121",5001); if (status != SUCCESS) { fprintf(stderr,"*ERROR* failed to send command %s\n", command); fflush(stderr); exit(EXIT_FAILURE); } if (reply != NULL) { printf("Received the reply:\n\t%s\n",reply[0]); } exit(EXIT_SUCCESS); }