2 * Copyright © 2010 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
26 # define PUBLIC __declspec(dllexport)
28 # define PUBLIC __declspec(dllimport)
30 # endif /* BUILD_STATIC */
47 struct altos_bt_device {
54 #define LIBALTOS_SUCCESS 0
55 #define LIBALTOS_ERROR -1
56 #define LIBALTOS_TIMEOUT -2
58 /* Returns 0 for success, < 0 on error */
65 PUBLIC struct altos_list *
66 altos_list_start(void);
68 /* Returns 1 for success, zero on end of list */
70 altos_list_next(struct altos_list *list, struct altos_device *device);
73 altos_list_finish(struct altos_list *list);
75 PUBLIC struct altos_file *
76 altos_open(struct altos_device *device);
79 altos_close(struct altos_file *file);
82 altos_free(struct altos_file *file);
84 /* Returns < 0 for error */
86 altos_putchar(struct altos_file *file, char c);
88 /* Returns < 0 for error */
90 altos_flush(struct altos_file *file);
92 /* Returns < 0 for error or timeout. timeout of 0 == wait forever */
94 altos_getchar(struct altos_file *file, int timeout);
96 // #define HAS_BLUETOOTH 1
99 PUBLIC struct altos_bt_list *
100 altos_bt_list_start(int inquiry_time);
103 altos_bt_list_next(struct altos_bt_list *list, struct altos_bt_device *device);
106 altos_bt_list_finish(struct altos_bt_list *list);
109 altos_bt_fill_in(char *name, char *addr, struct altos_bt_device *device);
111 PUBLIC struct altos_file *
112 altos_bt_open(struct altos_bt_device *device);
116 #endif /* _LIBALTOS_H_ */