136a137,138 > Weger Oct. 22, 2013 Read in ACU status and faults in do_vrsi(). Allocate > more memory for the replies. 837,843c839,842 < /* Now read the focus, which also comes in on the HIFI line. */ < /* The code should eventually be reorganized to put this in */ < /* a better place, with general HIFI input for many terms. */ < /* FOCUS = -4.8763E-4 * ( < (double) ( (0x0F & HIFI[2])<<8 | HIFI[3]) < - 2030.4 < ); */ --- > /* Now read the focus, which also comes in on the HIFI line. */ > /* The code should eventually be reorganized to put this in */ > /* a better place, with general HIFI input for many terms. */ > /* FOCUS = -4.8763E-4*((double)((0x0F & HIFI[2])<<8 | HIFI[3])-2030.4); */ 851c850,851 < sprintf(USER_STR[4], " %2x %2x %2x %2x %2x %7.3f", HIFI[1], HIFI[2], HIFI[3], HIFI[4], HIFI[5], FOCUS); --- > sprintf(USER_STR[4], " %2x %2x %2x %2x %2x %7.3f", HIFI[1], HIFI[2], \ > HIFI[3], HIFI[4], HIFI[5], FOCUS); 1866c1866,1868 < int mode=0; --- > unsigned long long mode; > int fault=0, nfault=0, ontarget=0; > 1876c1878,1879 < if ((reply = (char *) calloc(80, sizeof(char))) == NULL) { --- > > if ((reply = (char *) calloc(320, sizeof(char))) == NULL) { 1973c1976 < sscanf(reply, "%2d:%2d:%2d:%2d,%lf,%lf,%lf,%d\r\n", \ --- > sscanf(reply, "%2d:%2d:%2d:%2d,%lf,%lf,%lf,%llu,%d,%d,%d\r\n", \ 1975c1978,1979 < &vrsi_HA,&vrsi_DEC,&vrsi_DOME,&mode); --- > &vrsi_HA,&vrsi_DEC,&vrsi_DOME,&mode,&fault,&nfault,&ontarget); > 1988a1993,2008 > tinfo->vrsi_mode = mode; > tinfo->vrsi_fault_alarm = fault; > tinfo->vrsi_ontarget = ontarget; > > vrsi_tcpip("STM", reply, 320, 1, "192.168.140.1", 5001); > strcpy(tinfo->vrsi_status, reply); > > if ((reply = (char *) calloc(320, sizeof(char))) == NULL) { > fprintf(stderr, "*ERROR* failed to allocate reply buffer!"); > fflush(stderr); > exit(0); > } > > vrsi_tcpip("M", reply, 320, 1, "192.168.140.1", 5001); > strcpy(tinfo->vrsi_faults, reply); > 2107c2127,2128 < /* for (j=0; j > for (j=0; j } 2125c2146 < #ifdef DEBUG --- > #ifdef DEBUG 2127,2128c2148,2149 < printf("The command \"%s\" was received.\n", command_with_terminator); < #endif --- > printf("The command \"%s\" was received.\n", command); > #endif 2133c2154,2155 < /* --- > > /* 2142a2165 > 2286a2310,2320 > if ((command = (char *) calloc(80, sizeof(char)))==NULL) { > fprintf(stderr, "*ERROR* failed to allocate command buffer!"); > fflush(stderr); > exit(0); > } > if ((reply = (char *) calloc(80, sizeof(char))) == NULL) { > fprintf(stderr, "*ERROR* failed to allocate reply buffer!"); > fflush(stderr); > exit(0); > } > 2440a2475,2485 > if ((command = (char *) calloc(80, sizeof(char)))==NULL) { > fprintf(stderr, "*ERROR* failed to allocate command buffer!"); > fflush(stderr); > exit(0); > } > if ((reply = (char *) calloc(80, sizeof(char))) == NULL) { > fprintf(stderr, "*ERROR* failed to allocate reply buffer!"); > fflush(stderr); > exit(0); > } > 2617a2663,2673 > > if ((command = (char *) calloc(80, sizeof(char)))==NULL) { > fprintf(stderr, "*ERROR* failed to allocate command buffer!"); > fflush(stderr); > exit(0); > } > if ((reply = (char *) calloc(80, sizeof(char))) == NULL) { > fprintf(stderr, "*ERROR* failed to allocate reply buffer!"); > fflush(stderr); > exit(0); > } 2730a2787,2797 > if ((command = (char *) calloc(80, sizeof(char)))==NULL) { > fprintf(stderr, "*ERROR* failed to allocate command buffer!"); > fflush(stderr); > exit(0); > } > if ((reply = (char *) calloc(80, sizeof(char))) == NULL) { > fprintf(stderr, "*ERROR* failed to allocate reply buffer!"); > fflush(stderr); > exit(0); > } > 2749a2817,2827 > if ((command = (char *) calloc(80, sizeof(char)))==NULL) { > fprintf(stderr, "*ERROR* failed to allocate command buffer!"); > fflush(stderr); > exit(0); > } > if ((reply = (char *) calloc(80, sizeof(char))) == NULL) { > fprintf(stderr, "*ERROR* failed to allocate reply buffer!"); > fflush(stderr); > exit(0); > } >