13eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg/*
23eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
33eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  BlueZ - Bluetooth protocol stack for Linux
43eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
59184e2eeb7b97371c6b83b747c8984e2340d2b47Marcel Holtmann *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
63eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
73eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
83eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  This program is free software; you can redistribute it and/or modify
93eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  it under the terms of the GNU General Public License as published by
103eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  the Free Software Foundation; either version 2 of the License, or
113eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  (at your option) any later version.
123eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
133eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  This program is distributed in the hope that it will be useful,
143eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  but WITHOUT ANY WARRANTY; without even the implied warranty of
153eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
163eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  GNU General Public License for more details.
173eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
183eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  You should have received a copy of the GNU General Public License
193eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  along with this program; if not, write to the Free Software
203eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
213eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg *
223eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg */
236de268e32d69d08a9cf50c41f4a3ee67ade3ec99Marcel Holtmann
240d526038144d38375bccfd8a21502b5176f64b35Claudio Takahasi#define HSP_HS_UUID		"00001108-0000-1000-8000-00805F9B34FB"
250d526038144d38375bccfd8a21502b5176f64b35Claudio Takahasi#define HID_UUID		"00001124-0000-1000-8000-00805f9b34fb"
260d526038144d38375bccfd8a21502b5176f64b35Claudio Takahasi
276de268e32d69d08a9cf50c41f4a3ee67ade3ec99Marcel Holtmann#define L2CAP_PSM_HIDP_CTRL	0x11
286de268e32d69d08a9cf50c41f4a3ee67ade3ec99Marcel Holtmann#define L2CAP_PSM_HIDP_INTR	0x13
293eb0a5cd951b680c89f92bce6dddce2da2539af0Johan Hedberg
30d2fd09864d8b9e5289f0a6ab230063b32f661048Luiz Augusto von Dentzstruct input_device;
31d2fd09864d8b9e5289f0a6ab230063b32f661048Luiz Augusto von Dentzstruct input_conn;
32f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann
33f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmannstruct fake_input {
34f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann	int		flags;
35f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann	GIOChannel	*io;
36f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann	int		uinput;		/* uinput socket */
37f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann	int		rfcomm;		/* RFCOMM socket */
38f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann	uint8_t		ch;		/* RFCOMM channel number */
39c95494ee508a9f36096af5ddb1c2ac1579a32b1dLuiz Augusto von Dentz	gboolean	(*connect) (struct input_conn *iconn, GError **err);
40d2fd09864d8b9e5289f0a6ab230063b32f661048Luiz Augusto von Dentz	int		(*disconnect) (struct input_conn *iconn);
41f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann	void		*priv;
42f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann};
43f53dce601c8b8ee28bc8b5d354aaa56b454b1a71Marcel Holtmann
44f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentzint fake_input_register(DBusConnection *conn, struct btd_device *device,
45f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentz			const char *path, bdaddr_t *src, bdaddr_t *dst,
46f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentz			const char *uuid, uint8_t channel);
47f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentzint input_device_register(DBusConnection *conn, struct btd_device *device,
48f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentz			const char *path, const bdaddr_t *src,
49f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentz			const bdaddr_t *dst, const char *uuid,
50f12e4e2783cba479638ee42e0da4862cd9b6e648Luiz Augusto von Dentz			uint32_t handle, int timeout);
51d2fd09864d8b9e5289f0a6ab230063b32f661048Luiz Augusto von Dentzint input_device_unregister(const char *path, const char *uuid);
52e3aec1dd412fc0adb0587edf750979e4d18906b0Marcel Holtmann
535285b3f4bf029f86b2e22c24428fa92315267897Johan Hedbergint input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm,
545285b3f4bf029f86b2e22c24428fa92315267897Johan Hedberg							GIOChannel *io);
55dcada8eed787ddcca19634f5a71a4dd0a2dc1856Marcel Holtmannint input_device_close_channels(const bdaddr_t *src, const bdaddr_t *dst);
56