1 /* vim: set sw=8 ts=8 si et: */
3 * Linux software to communicate with the DDCP
4 * Written by Guido Socher
14 int main(int argc, char *argv[])
21 printf("USAGE: ddcp-script-setval \"command\" com-port-device\n");
22 printf("Example, linux: ddcp-script-setval \"u=33\" /dev/ttyUSB0\n");
23 printf("Example, mac: ddcp-script-setval \"u=33\" /dev/tty.usbserial-*\n");
29 /* Set up io port correctly, and open it... */
30 fd = open(device, O_WRONLY );
32 fprintf(stderr, "ERROR: open for %s failed.\n",device);
36 usleep(100000); // commands are polled in the avr and it can take 100ms
37 write(fd,str,strlen(str));