~ubuntu-branches/ubuntu/wily/bluez/wily

« back to all changes in this revision

Viewing changes to btio/btio.h

ImportĀ upstreamĀ versionĀ 4.81

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  BlueZ - Bluetooth protocol stack for Linux
 
4
 *
 
5
 *  Copyright (C) 2009-2010  Marcel Holtmann <marcel@holtmann.org>
 
6
 *  Copyright (C) 2009-2010  Nokia Corporation
 
7
 *
 
8
 *
 
9
 *  This program is free software; you can redistribute it and/or modify
 
10
 *  it under the terms of the GNU General Public License as published by
 
11
 *  the Free Software Foundation; either version 2 of the License, or
 
12
 *  (at your option) any later version.
 
13
 *
 
14
 *  This program is distributed in the hope that it will be useful,
 
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 *  GNU General Public License for more details.
 
18
 *
 
19
 *  You should have received a copy of the GNU General Public License
 
20
 *  along with this program; if not, write to the Free Software
 
21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
22
 *
 
23
 */
 
24
#ifndef BT_IO_H
 
25
#define BT_IO_H
 
26
 
 
27
#include <glib.h>
 
28
 
 
29
typedef enum {
 
30
        BT_IO_ERROR_DISCONNECTED,
 
31
        BT_IO_ERROR_CONNECT_FAILED,
 
32
        BT_IO_ERROR_FAILED,
 
33
        BT_IO_ERROR_INVALID_ARGS,
 
34
} BtIOError;
 
35
 
 
36
#define BT_IO_ERROR bt_io_error_quark()
 
37
 
 
38
GQuark bt_io_error_quark(void);
 
39
 
 
40
typedef enum {
 
41
        BT_IO_L2RAW,
 
42
        BT_IO_L2CAP,
 
43
        BT_IO_RFCOMM,
 
44
        BT_IO_SCO,
 
45
} BtIOType;
 
46
 
 
47
typedef enum {
 
48
        BT_IO_OPT_INVALID = 0,
 
49
        BT_IO_OPT_SOURCE,
 
50
        BT_IO_OPT_SOURCE_BDADDR,
 
51
        BT_IO_OPT_DEST,
 
52
        BT_IO_OPT_DEST_BDADDR,
 
53
        BT_IO_OPT_DEFER_TIMEOUT,
 
54
        BT_IO_OPT_SEC_LEVEL,
 
55
        BT_IO_OPT_CHANNEL,
 
56
        BT_IO_OPT_SOURCE_CHANNEL,
 
57
        BT_IO_OPT_DEST_CHANNEL,
 
58
        BT_IO_OPT_PSM,
 
59
        BT_IO_OPT_CID,
 
60
        BT_IO_OPT_MTU,
 
61
        BT_IO_OPT_OMTU,
 
62
        BT_IO_OPT_IMTU,
 
63
        BT_IO_OPT_MASTER,
 
64
        BT_IO_OPT_HANDLE,
 
65
        BT_IO_OPT_CLASS,
 
66
        BT_IO_OPT_MODE,
 
67
} BtIOOption;
 
68
 
 
69
typedef enum {
 
70
        BT_IO_SEC_SDP = 0,
 
71
        BT_IO_SEC_LOW,
 
72
        BT_IO_SEC_MEDIUM,
 
73
        BT_IO_SEC_HIGH,
 
74
} BtIOSecLevel;
 
75
 
 
76
typedef void (*BtIOConfirm)(GIOChannel *io, gpointer user_data);
 
77
 
 
78
typedef void (*BtIOConnect)(GIOChannel *io, GError *err, gpointer user_data);
 
79
 
 
80
gboolean bt_io_accept(GIOChannel *io, BtIOConnect connect, gpointer user_data,
 
81
                                        GDestroyNotify destroy, GError **err);
 
82
 
 
83
gboolean bt_io_set(GIOChannel *io, BtIOType type, GError **err,
 
84
                                                BtIOOption opt1, ...);
 
85
 
 
86
gboolean bt_io_get(GIOChannel *io, BtIOType type, GError **err,
 
87
                                                BtIOOption opt1, ...);
 
88
 
 
89
GIOChannel *bt_io_connect(BtIOType type, BtIOConnect connect,
 
90
                                gpointer user_data, GDestroyNotify destroy,
 
91
                                GError **err, BtIOOption opt1, ...);
 
92
 
 
93
GIOChannel *bt_io_listen(BtIOType type, BtIOConnect connect,
 
94
                                BtIOConfirm confirm, gpointer user_data,
 
95
                                GDestroyNotify destroy, GError **err,
 
96
                                BtIOOption opt1, ...);
 
97
 
 
98
#endif