7 char *cmdsink = "./IPC/SDR-1000-0-commands.fifo",
8 *mtrsrc = "./IPC/SDR-1000-0-meter.fifo";
13 REAL rxm[MAXRX][RXMETERPTS];
17 main(int argc, char **argv) {
18 int i = 0, j, k, lab = getpid();
20 if (!(cmdfp = fopen(cmdsink, "r+")))
21 perror(cmdsink), exit(1);
22 if (!(mtrfp = fopen(mtrsrc, "r+")))
23 perror(mtrsrc), exit(1);
25 fprintf(stderr, "metermon OK\n");
31 fprintf(cmdfp, "reqMeter %d\n", lab);
34 if (fread((char *) &label, sizeof(int), 1, mtrfp) != 1)
35 perror("fread meter label"), exit(1);
37 if (fread((char *) rxm, sizeof(REAL), MAXRX * RXMETERPTS, mtrfp)
38 != MAXRX * RXMETERPTS)
39 perror("fread meter"), exit(1);
41 printf("%d <%d>", i++, label);
42 for (j = 0; j < MAXRX; j++) {
43 for (k = 0; k < RXMETERPTS; k++)
44 printf(" %8.3f", rxm[j][k]);
48 if (fread((char *) txm, sizeof(REAL), TXMETERPTS, mtrfp)
50 perror("fread meter"), exit(1);
53 for (k = 0; k < TXMETERPTS; k++)
54 printf(" %8.3f", txm[k]);