summaryrefslogtreecommitdiff
path: root/altosui/libaltos/cjnitest.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-12-25 14:19:19 -0800
committerKeith Packard <keithp@keithp.com>2012-12-25 14:20:12 -0800
commit669cde8a87d88ceae89e369c1d38b88c9f8198cf (patch)
tree9f241ecb0abd86ead6c9bb65ce88a4f50f9622f4 /altosui/libaltos/cjnitest.c
parentd7d35b0bd86b912c43a21a275347fca201079847 (diff)
Move libaltos to top level
This will let it be shared by the new MicroPeak gui Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/libaltos/cjnitest.c')
-rw-r--r--altosui/libaltos/cjnitest.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/altosui/libaltos/cjnitest.c b/altosui/libaltos/cjnitest.c
deleted file mode 100644
index f0fe78f7..00000000
--- a/altosui/libaltos/cjnitest.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#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;
- struct altos_list *list;
- struct altos_bt_device bt_device;
- struct altos_bt_list *bt_list;
-
- altos_init();
- list = altos_list_start();
- while (altos_list_next(list, &device)) {
- 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);
- 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);
- }
- if (c != LIBALTOS_TIMEOUT)
- printf ("getchar returns %d\n", c);
- altos_close(file);
- }
- altos_list_finish(list);
-#if HAS_BLUETOOTH
- bt_list = altos_bt_list_start(8);
- while (altos_bt_list_next(bt_list, &bt_device)) {
- printf ("%s %s\n", bt_device.name, bt_device.addr);
- if (strncmp(bt_device.name, "TeleBT", 6) == 0) {
- struct altos_file *file;
-
- int c;
- file = altos_bt_open(&bt_device);
- if (!file) {
- printf("altos_bt_open failed\n");
- continue;
- }
- altos_puts(file,"v\nc s\n");
- altos_flush(file);
- while ((c = altos_getchar(file, 100)) >= 0) {
- putchar(c);
- }
- if (c != LIBALTOS_TIMEOUT)
- printf("getchar returns %d\n", c);
- altos_close(file);
- }
- }
- altos_bt_list_finish(bt_list);
-#endif
- altos_fini();
- return 0;
-}