detection works
[sball] / src / main.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "sball.h"
4
5 static struct sball *sb;
6
7 int main(int argc, char **argv)
8 {
9         if(!(sb = sball_open(argv[1] ? argv[1] : "/dev/ttyS0"))) {
10                 fprintf(stderr, "Failed to open spaceball at %s\n", argv[1] ? argv[1] : "/dev/ttyS0");
11                 return 1;
12         }
13
14         sball_close(sb);
15         return 0;
16 }