Mercurial > code > home > repos > light9
view dmx_usb_module/dmx_usb_test.c @ 798:5c158d37f1ce
autoretry websocket. fix rdflib quad patching. only rerun handlers that asked for the affected subj-preds.
Ignore-this: 31e03cf07e5d460ea5c72d7beccefe7
author | drewp@bigasterisk.com |
---|---|
date | Mon, 16 Jul 2012 00:49:57 +0000 |
parents | 4e60444605f6 |
children | 2b2ad8e7cb9f |
line wrap: on
line source
/* * $Id: dmx_usb_test.c 40 2004-09-11 11:16:39Z erwin $ */ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> int main(int argc, char* argv[]) { unsigned char buffer[513]; int fd; int res; int i; fd = open("/dev/dmx0",O_WRONLY); if (fd < 0) { perror("open"); exit(-1); } for (i = 0; i < 513;i++) { buffer[i] = 0x00; } buffer[512] = 0x55; while(1) { res = write(fd, buffer, 513); if (res < 0){ perror("write"); exit(-1); } } close(fd); return 0; }