Tizen 2.0 Release
[framework/connectivity/bluez.git] / input / device.h
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
6  *
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23
24 #define L2CAP_PSM_HIDP_CTRL     0x11
25 #define L2CAP_PSM_HIDP_INTR     0x13
26
27 struct input_device;
28 struct input_conn;
29
30 struct fake_input {
31         int             flags;
32         GIOChannel      *io;
33         int             uinput;         /* uinput socket */
34         int             rfcomm;         /* RFCOMM socket */
35         uint8_t         ch;             /* RFCOMM channel number */
36         gboolean        (*connect) (struct input_conn *iconn, GError **err);
37         int             (*disconnect) (struct input_conn *iconn);
38         void            *priv;
39         const struct input_device *idev;
40 };
41
42 int fake_input_register(DBusConnection *conn, struct btd_device *device,
43                         const char *path, const char *uuid, uint8_t channel);
44 int input_device_register(DBusConnection *conn, struct btd_device *device,
45                                         const char *path, const char *uuid,
46                                         const sdp_record_t *rec, int timeout);
47 int input_device_unregister(const char *path, const char *uuid);
48
49 int input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm,
50                                                         GIOChannel *io);
51 int input_device_close_channels(const bdaddr_t *src, const bdaddr_t *dst);