#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; float DES_HA, DES_DEC=0; char OBJECT_NAME[20]="\0"; int ITEM=0; 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"); printf(" (hrs) (deg)\n "); scanf(" %f %f %s", &DES_HA, &DES_DEC, OBJECT_NAME); sprintf(command, "PD %.4f,%.4f", DES_HA, DES_DEC); printf("The command is \"%s\"\n", command); status = vrsi_command_tcpip(command, reply, (int) COMMAND_LENGTH,1,"192.168.140.1",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); }