5 altos_puts(struct altos_file *file, char *string)
9 while ((c = *string++))
10 altos_putchar(file, c);
14 main (int argc, char **argv)
16 struct altos_device device;
17 struct altos_list *list;
18 struct altos_bt_device bt_device;
19 struct altos_bt_list *bt_list;
22 list = altos_list_start();
23 while (altos_list_next(list, &device)) {
24 struct altos_file *file;
27 printf ("%04x:%04x %-20s %4d %s\n", device.vendor, device.product,
28 device.name, device.serial, device.path);
30 file = altos_open(&device);
32 printf("altos_open failed\n");
35 altos_puts(file,"v\nc s\n");
37 while ((c = altos_getchar(file, 100)) >= 0) {
40 if (c != LIBALTOS_TIMEOUT)
41 printf ("getchar returns %d\n", c);
44 altos_list_finish(list);
46 bt_list = altos_bt_list_start(8);
47 while (altos_bt_list_next(bt_list, &bt_device)) {
48 printf ("%s %s\n", bt_device.name, bt_device.addr);
49 if (strncmp(bt_device.name, "TeleBT", 6) == 0) {
50 struct altos_file *file;
53 file = altos_bt_open(&bt_device);
55 printf("altos_bt_open failed\n");
58 altos_puts(file,"v\nc s\n");
60 while ((c = altos_getchar(file, 100)) >= 0) {
63 if (c != LIBALTOS_TIMEOUT)
64 printf("getchar returns %d\n", c);
68 altos_bt_list_finish(bt_list);