5 #define HAS_BLUETOOTH 1
9 altos_puts(struct altos_file *file, char *string)
13 while ((c = *string++))
14 altos_putchar(file, c);
18 main (int argc, char **argv)
20 struct altos_device device;
21 struct altos_list *list;
22 struct altos_bt_device bt_device;
23 struct altos_bt_list *bt_list;
27 list = altos_list_start();
28 while (altos_list_next(list, &device)) {
29 struct altos_file *file;
32 printf ("%04x:%04x %-20s %4d %s\n", device.vendor, device.product,
33 device.name, device.serial, device.path);
35 file = altos_open(&device);
37 printf("altos_open failed\n");
40 altos_puts(file,"v\nc s\n");
42 while ((c = altos_getchar(file, 100)) >= 0) {
45 if (c != LIBALTOS_TIMEOUT)
46 printf ("getchar returns %d\n", c);
49 altos_list_finish(list);
52 bt_list = altos_bt_list_start(8);
53 while (altos_bt_list_next(bt_list, &bt_device)) {
54 printf ("%s %s\n", bt_device.name, bt_device.addr);
55 if (strncmp(bt_device.name, "TeleBT", 6) == 0) {
56 struct altos_file *file;
59 file = altos_bt_open(&bt_device);
61 printf("altos_bt_open failed\n");
64 altos_puts(file,"v\nc s\n");
66 while ((c = altos_getchar(file, 100)) >= 0) {
69 if (c != LIBALTOS_TIMEOUT)
70 printf("getchar returns %d\n", c);
74 altos_bt_list_finish(bt_list);