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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
27 # define PUBLIC __declspec(dllexport)
29 # define PUBLIC __declspec(dllimport)
31 # endif /* BUILD_STATIC */
45 int (*method_1)(int x, int y);
49 struct altos_bt_device {
61 #define LIBALTOS_SUCCESS 0
62 #define LIBALTOS_ERROR -1
63 #define LIBALTOS_TIMEOUT -2
65 /* Returns 0 for success, < 0 on error */
73 altos_get_last_error(struct altos_error *error);
75 PUBLIC struct altos_list *
76 altos_list_start(void);
78 PUBLIC struct altos_list *
79 altos_ftdi_list_start(void);
81 /* Returns 1 for success, zero on end of list */
83 altos_list_next(struct altos_list *list, struct altos_device *device);
86 altos_list_finish(struct altos_list *list);
88 PUBLIC struct altos_file *
89 altos_open(struct altos_device *device);
92 altos_close(struct altos_file *file);
95 altos_free(struct altos_file *file);
97 /* Returns < 0 for error */
99 altos_putchar(struct altos_file *file, char c);
101 /* Returns < 0 for error */
103 altos_flush(struct altos_file *file);
105 /* Returns < 0 for error or timeout. timeout of 0 == wait forever */
107 altos_getchar(struct altos_file *file, int timeout);
109 PUBLIC struct altos_bt_list *
110 altos_bt_list_start(int inquiry_time);
113 altos_bt_list_next(struct altos_bt_list *list, struct altos_bt_device *device);
116 altos_bt_list_finish(struct altos_bt_list *list);
119 altos_bt_fill_in(char *name, char *addr, struct altos_bt_device *device);
121 PUBLIC struct altos_file *
122 altos_bt_open(struct altos_bt_device *device);
124 #endif /* _LIBALTOS_H_ */