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

« back to all changes in this revision

Viewing changes to attrib/gattrib.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) 2010  Nokia Corporation
 
6
 *  Copyright (C) 2010  Marcel Holtmann <marcel@holtmann.org>
 
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 __GATTRIB_H
 
25
#define __GATTRIB_H
 
26
 
 
27
#ifdef __cplusplus
 
28
extern "C" {
 
29
#endif
 
30
 
 
31
#define GATTRIB_ALL_EVENTS 0xFF
 
32
 
 
33
struct _GAttrib;
 
34
typedef struct _GAttrib GAttrib;
 
35
 
 
36
typedef void (*GAttribResultFunc) (guint8 status, const guint8 *pdu,
 
37
                                        guint16 len, gpointer user_data);
 
38
typedef void (*GAttribDisconnectFunc)(gpointer user_data);
 
39
typedef void (*GAttribDebugFunc)(const char *str, gpointer user_data);
 
40
typedef void (*GAttribNotifyFunc)(const guint8 *pdu, guint16 len,
 
41
                                                        gpointer user_data);
 
42
 
 
43
GAttrib *g_attrib_new(GIOChannel *io);
 
44
GAttrib *g_attrib_ref(GAttrib *attrib);
 
45
void g_attrib_unref(GAttrib *attrib);
 
46
 
 
47
gboolean g_attrib_set_disconnect_function(GAttrib *attrib,
 
48
                GAttribDisconnectFunc disconnect, gpointer user_data);
 
49
 
 
50
gboolean g_attrib_set_destroy_function(GAttrib *attrib,
 
51
                GDestroyNotify destroy, gpointer user_data);
 
52
 
 
53
guint g_attrib_send(GAttrib *attrib, guint8 opcode, const guint8 *pdu,
 
54
                                guint16 len, GAttribResultFunc func,
 
55
                                gpointer user_data, GDestroyNotify notify);
 
56
gboolean g_attrib_cancel(GAttrib *attrib, guint id);
 
57
gboolean g_attrib_cancel_all(GAttrib *attrib);
 
58
 
 
59
gboolean g_attrib_set_debug(GAttrib *attrib,
 
60
                GAttribDebugFunc func, gpointer user_data);
 
61
 
 
62
guint g_attrib_register(GAttrib *attrib, guint8 opcode,
 
63
                GAttribNotifyFunc func, gpointer user_data,
 
64
                                        GDestroyNotify notify);
 
65
 
 
66
gboolean g_attrib_unregister(GAttrib *attrib, guint id);
 
67
gboolean g_attrib_unregister_all(GAttrib *attrib);
 
68
 
 
69
#ifdef __cplusplus
 
70
}
 
71
#endif
 
72
#endif