Tizen 2.0 Release
[profile/ivi/bluez.git] / attrib / att-database.h
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2012 Texas Instruments Corporation
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  *
21  */
22
23 /* Requirements for read/write operations */
24 enum {
25         ATT_NONE,               /* No restrictions */
26         ATT_AUTHENTICATION,     /* Authentication required */
27         ATT_AUTHORIZATION,      /* Authorization required */
28         ATT_NOT_PERMITTED,      /* Operation not permitted */
29 };
30
31 struct attribute {
32         uint16_t handle;
33         bt_uuid_t uuid;
34         int read_reqs;
35         int write_reqs;
36         uint8_t (*read_cb)(struct attribute *a, struct btd_device *device,
37                                                         gpointer user_data);
38         uint8_t (*write_cb)(struct attribute *a, struct btd_device *device,
39                                                         gpointer user_data);
40         gpointer cb_user_data;
41         int len;
42         uint8_t *data;
43 };