int fd;
if (argc != 2){
- printf("USAGE: ddcp-script-getval /dev/ttyUSB0\n");
- printf("or ddcp-script-getval /dev/ttyUSB1\n");
+ printf("USAGE: ddcp-script-getval com-port-device\n");
+ printf("Example, linux: ddcp-script-getval /dev/ttyUSB0\n");
+ printf("Example, mac: ddcp-script-getval /dev/tty.usbserial-*\n");
exit(0);
}
device=argv[1];
}
if (state<1) continue;
if (c=='>') {
- putc(c,stdout);
+ fputc(c,stdout);
state=2;
}
if (state>1) break;
putc(c,stdout);
}
- printf("\n");
close(fd);
+ printf("\n");
usleep(100000); // commands are polled in the avr and it can take 100ms
return(0);
}