Home | History | Annotate | Download | only in input
      1 /*
      2  *
      3  *  BlueZ - Bluetooth protocol stack for Linux
      4  *
      5  *  Copyright (C) 2004-2010  Marcel Holtmann <marcel (at) 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 HSP_HS_UUID		"00001108-0000-1000-8000-00805F9B34FB"
     25 #define HID_UUID		"00001124-0000-1000-8000-00805f9b34fb"
     26 
     27 #define L2CAP_PSM_HIDP_CTRL	0x11
     28 #define L2CAP_PSM_HIDP_INTR	0x13
     29 
     30 struct input_device;
     31 struct input_conn;
     32 
     33 struct fake_input {
     34 	int		flags;
     35 	GIOChannel	*io;
     36 	int		uinput;		/* uinput socket */
     37 	int		rfcomm;		/* RFCOMM socket */
     38 	uint8_t		ch;		/* RFCOMM channel number */
     39 	gboolean	(*connect) (struct input_conn *iconn, GError **err);
     40 	int		(*disconnect) (struct input_conn *iconn);
     41 	void		*priv;
     42 	const struct input_device *idev;
     43 };
     44 
     45 int fake_input_register(DBusConnection *conn, struct btd_device *device,
     46 			const char *path, bdaddr_t *src, bdaddr_t *dst,
     47 			const char *uuid, uint8_t channel);
     48 int input_device_register(DBusConnection *conn, struct btd_device *device,
     49 			const char *path, const bdaddr_t *src,
     50 			const bdaddr_t *dst, const char *uuid,
     51 			uint32_t handle, int timeout);
     52 int input_device_unregister(const char *path, const char *uuid);
     53 
     54 int input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm,
     55 							GIOChannel *io);
     56 int input_device_close_channels(const bdaddr_t *src, const bdaddr_t *dst);
     57