5 altos_puts(struct altos_file *file, char *string)
9 while ((c = *string++))
10 altos_putchar(file, c);
15 struct altos_device device;
16 struct altos_list *list;
17 struct altos_bt_device bt_device;
18 struct altos_bt_list *bt_list;
21 list = altos_list_start();
22 while (altos_list_next(list, &device)) {
23 struct altos_file *file;
26 printf ("%04x:%04x %-20s %4d %s\n", device.vendor, device.product,
27 device.name, device.serial, device.path);
29 file = altos_open(&device);
31 printf("altos_open failed\n");
34 altos_puts(file,"v\nc s\n");
36 while ((c = altos_getchar(file, 100)) >= 0) {
39 if (c != LIBALTOS_TIMEOUT)
40 printf ("getchar returns %d\n", c);
43 altos_list_finish(list);
45 bt_list = altos_bt_list_start(8);
46 while (altos_bt_list_next(bt_list, &bt_device)) {
47 printf ("%s %s\n", bt_device.name, bt_device.addr);
48 if (strncmp(bt_device.name, "TeleBT", 6) == 0) {
49 struct altos_file *file;
52 file = altos_bt_open(&bt_device);
54 printf("altos_bt_open failed\n");
57 altos_puts(file,"v\nc s\n");
59 while ((c = altos_getchar(file, 100)) >= 0) {
62 if (c != LIBALTOS_TIMEOUT)
63 printf("getchar returns %d\n", c);
67 altos_bt_list_finish(bt_list);