Mercurial > code > home > repos > light9
annotate dmx_usb_module/dmx_usb_test.c @ 1870:51a9b23db357
rm stubs/rdfdb; point mypy to the real code instead
Ignore-this: cd59283a21e2e593682e105d6507a462
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Mon, 27 May 2019 00:41:38 +0000 |
parents | 2b2ad8e7cb9f |
children |
rev | line source |
---|---|
355 | 1 /* |
2 * $Id: dmx_usb_test.c 40 2004-09-11 11:16:39Z erwin $ | |
3 */ | |
4 | |
5 #include <stdio.h> | |
6 #include <sys/types.h> | |
7 #include <sys/stat.h> | |
8 #include <fcntl.h> | |
9 #include <unistd.h> | |
10 #include <stdlib.h> | |
11 | |
12 int main(int argc, char* argv[]) | |
13 { | |
14 unsigned char buffer[513]; | |
15 int fd; | |
16 int res; | |
17 int i; | |
18 | |
19 fd = open("/dev/dmx0",O_WRONLY); | |
20 if (fd < 0) { | |
21 perror("open"); | |
22 exit(-1); | |
23 } | |
24 | |
25 for (i = 0; i < 513;i++) { | |
875
2b2ad8e7cb9f
update dmx_usb. ok on kernel 3.5.0
Drew Perttula <drewp@bigasterisk.com>
parents:
355
diff
changeset
|
26 buffer[i] = i; |
355 | 27 } |
28 | |
29 buffer[512] = 0x55; | |
30 | |
31 while(1) { | |
32 res = write(fd, buffer, 513); | |
33 | |
34 if (res < 0){ | |
35 perror("write"); | |
36 exit(-1); | |
37 } | |
38 } | |
39 | |
40 close(fd); | |
41 | |
42 return 0; | |
43 } | |
44 |