diff options
Diffstat (limited to 'common/btio.h')
-rw-r--r-- | common/btio.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/common/btio.h b/common/btio.h index 834e8527..614a1632 100644 --- a/common/btio.h +++ b/common/btio.h @@ -27,6 +27,17 @@ #include <glib.h> typedef enum { + BT_IO_ERROR_DISCONNECTED, + BT_IO_ERROR_CONNECT_FAILED, + BT_IO_ERROR_FAILED, + BT_IO_ERROR_INVALID_ARGS, +} BtIOError; + +#define BT_IO_ERROR bt_io_error_quark() + +GQuark bt_io_error_quark(void); + +typedef enum { BT_IO_L2RAW, BT_IO_L2CAP, BT_IO_RFCOMM, @@ -50,21 +61,24 @@ typedef enum { typedef void (*BtIOConfirm)(GIOChannel *io, gpointer user_data); -typedef void (*BtIOConnect)(GIOChannel *io, int err, gpointer user_data); +typedef void (*BtIOConnect)(GIOChannel *io, GError *err, gpointer user_data); gboolean bt_io_accept(GIOChannel *io, BtIOConnect connect, gpointer user_data, - GDestroyNotify destroy); + GDestroyNotify destroy, GError **err); -gboolean bt_io_set(GIOChannel *io, BtIOType type, BtIOOption opt1, ...); +gboolean bt_io_set(GIOChannel *io, BtIOType type, GError **err, + BtIOOption opt1, ...); -gboolean bt_io_get(GIOChannel *io, BtIOType type, BtIOOption opt1, ...); +gboolean bt_io_get(GIOChannel *io, BtIOType type, GError **err, + BtIOOption opt1, ...); GIOChannel *bt_io_connect(BtIOType type, BtIOConnect connect, gpointer user_data, GDestroyNotify destroy, - BtIOOption opt1, ...); + GError **err, BtIOOption opt1, ...); GIOChannel *bt_io_listen(BtIOType type, BtIOConnect connect, BtIOConfirm confirm, gpointer user_data, - GDestroyNotify destroy, BtIOOption opt1, ...); + GDestroyNotify destroy, GError **err, + BtIOOption opt1, ...); #endif |