projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libaltos: cjnitest needs altos_flush now
[fw/altos]
/
ao-tools
/
libaltos
/
cjnitest.c
diff --git
a/ao-tools/libaltos/cjnitest.c
b/ao-tools/libaltos/cjnitest.c
index cd3898edadbd656178eadfbd70897d15484c160f..c6d6e069c1f188cd56666292236e5c1f083c7dbb 100644
(file)
--- a/
ao-tools/libaltos/cjnitest.c
+++ b/
ao-tools/libaltos/cjnitest.c
@@
-1,6
+1,15
@@
#include <stdio.h>
#include "libaltos.h"
#include <stdio.h>
#include "libaltos.h"
+static void
+altos_puts(struct altos_file *file, char *string)
+{
+ char c;
+
+ while ((c = *string++))
+ altos_putchar(file, c);
+}
+
main ()
{
struct altos_device device;
main ()
{
struct altos_device device;
@@
-12,12
+21,21
@@
main ()
struct altos_file *file;
int c;
struct altos_file *file;
int c;
+ printf ("%04x:%04x %-20s %4d %s\n", device.vendor, device.product,
+ device.name, device.serial, device.path);
+
file = altos_open(&device);
file = altos_open(&device);
- altos_putchar(file, '?'); altos_putchar(file, '\n'); altos_flush(file);
+ if (!file) {
+ printf("altos_open failed\n");
+ continue;
+ }
+ altos_puts(file,"v\nc s\n");
+ altos_flush(file);
while ((c = altos_getchar(file, 100)) >= 0) {
putchar (c);
}
while ((c = altos_getchar(file, 100)) >= 0) {
putchar (c);
}
- printf ("getchar returns %d\n", c);
+ if (c != LIBALTOS_TIMEOUT)
+ printf ("getchar returns %d\n", c);
altos_close(file);
}
altos_list_finish(list);
altos_close(file);
}
altos_list_finish(list);