diff options
author | Keith Packard <keithp@keithp.com> | 2010-07-26 15:41:39 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-07-26 15:42:05 -0700 |
commit | c726d8f6eb861801d7543552beab6ee2c920c96f (patch) | |
tree | e86fbc214dc27838fbffdd44fd3a6b7bb8c360ae /ao-tools/libaltos/cjnitest.c | |
parent | 05111d5be4d37bedaaee6415d6ee27347e6a112c (diff) |
Add libaltos which talks to USB connected altos devices
Diffstat (limited to 'ao-tools/libaltos/cjnitest.c')
-rw-r--r-- | ao-tools/libaltos/cjnitest.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ao-tools/libaltos/cjnitest.c b/ao-tools/libaltos/cjnitest.c new file mode 100644 index 00000000..cd3898ed --- /dev/null +++ b/ao-tools/libaltos/cjnitest.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include "libaltos.h" + +main () +{ + struct altos_device device; + struct altos_list *list; + + altos_init(); + list = altos_list_start(); + while (altos_list_next(list, &device)) { + struct altos_file *file; + int c; + + file = altos_open(&device); + altos_putchar(file, '?'); altos_putchar(file, '\n'); altos_flush(file); + while ((c = altos_getchar(file, 100)) >= 0) { + putchar (c); + } + printf ("getchar returns %d\n", c); + altos_close(file); + } + altos_list_finish(list); + altos_fini(); +} |