]> Joshua Wise's Git repositories - fpgaboy.git/blob - binwire.c
9322ef1b710eb9484bb477938b13d3f7c0c6ef38
[fpgaboy.git] / binwire.c
1 #include <stdio.h>
2
3 void dowrite(char *s, int len)
4 {
5   int i;
6   for (i=0; i<len; i++)
7   {
8     write(1, s+i, 1);
9   }
10 }
11
12 void main()
13 {
14   char buf[259];
15   int sz;
16   dowrite("\x1B" "A\x00\x00\x00...", 8);
17   fprintf(stderr, "Address sent\n");
18   while ((sz = read(0, buf+3, 128)) > 0)
19   {
20     buf[0] = 0x1B;
21     buf[1] = 'D';
22     buf[2] = sz - 1;
23     dowrite(buf, sz + 3);
24     dowrite(".", 1);
25     fprintf(stderr, "Data sent\n");
26     usleep(100000);
27   }
28 }
This page took 0.016132 seconds and 2 git commands to generate.