diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-16 09:01:29 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-16 09:01:29 +0200 |
commit | d3351f1b45477451d28e9e65996946fa6291f319 (patch) | |
tree | a53e990e1bb3fe6252a74fb2c662c02dd06bfe8c /common/btio.h | |
parent | 87e1eceda35d2e17ddfff0d099aaac57392e8bf1 (diff) |
Merge external btio rework
Diffstat (limited to 'common/btio.h')
-rw-r--r-- | common/btio.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/common/btio.h b/common/btio.h new file mode 100644 index 00000000..bfdd2966 --- /dev/null +++ b/common/btio.h @@ -0,0 +1,71 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2009 Marcel Holtmann <marcel@holtmann.org> + * Copyright (C) 2009 Nokia Corporation + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ +#ifndef BT_IO_H +#define BT_IO_H + +#include <glib.h> + +typedef enum { + BT_IO_L2RAW, + BT_IO_L2CAP, + BT_IO_RFCOMM, + BT_IO_SCO, +} BtIOType; + +typedef enum { + BT_IO_OPT_SOURCE, + BT_IO_OPT_SOURCE_BDADDR, + BT_IO_OPT_DEST, + BT_IO_OPT_DEST_BDADDR, + BT_IO_OPT_DEFER_TIMEOUT, + BT_IO_OPT_LM_FLAGS, + BT_IO_OPT_SEC_LEVEL, + BT_IO_OPT_CHANNEL, + BT_IO_OPT_PSM, + BT_IO_OPT_MTU, + BT_IO_OPT_OMTU, + BT_IO_OPT_IMTU, + BT_IO_OPT_INVALID, +} BtIOOption; + +typedef void (*BtIOConfirm)(GIOChannel *io, gpointer user_data); + +typedef void (*BtIOConnect)(GIOChannel *io, int err, gpointer user_data); + +gboolean bt_io_accept(GIOChannel *io, BtIOConnect connect, gpointer user_data, + GDestroyNotify destroy); + +gboolean bt_io_set(GIOChannel *io, BtIOType type, BtIOOption opt1, ...); + +gboolean bt_io_get(GIOChannel *io, BtIOType type, BtIOOption opt1, ...); + +GIOChannel *bt_io_connect(BtIOType type, BtIOConnect connect, + gpointer user_data, GDestroyNotify destroy, + BtIOOption opt1, ...); + +GIOChannel *bt_io_listen(BtIOType type, BtIOConnect connect, + BtIOConfirm confirm, gpointer user_data, + GDestroyNotify destroy, BtIOOption opt1, ...); + +#endif |