bthid_config.h revision 128080
1128080Semax/*
2128080Semax * bthid_config.h
3128080Semax *
4128080Semax * Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5128080Semax * All rights reserved.
6128080Semax *
7128080Semax * Redistribution and use in source and binary forms, with or without
8128080Semax * modification, are permitted provided that the following conditions
9128080Semax * are met:
10128080Semax * 1. Redistributions of source code must retain the above copyright
11128080Semax *    notice, this list of conditions and the following disclaimer.
12128080Semax * 2. Redistributions in binary form must reproduce the above copyright
13128080Semax *    notice, this list of conditions and the following disclaimer in the
14128080Semax *    documentation and/or other materials provided with the distribution.
15128080Semax *
16128080Semax * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17128080Semax * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18128080Semax * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19128080Semax * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20128080Semax * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21128080Semax * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22128080Semax * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23128080Semax * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24128080Semax * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25128080Semax * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26128080Semax * SUCH DAMAGE.
27128080Semax *
28128080Semax * $Id: bthid_config.h,v 1.3 2004/02/17 22:05:02 max Exp $
29128080Semax * $FreeBSD: head/usr.sbin/bluetooth/bthidd/bthid_config.h 128080 2004-04-10 00:18:00Z emax $
30128080Semax */
31128080Semax
32128080Semax#ifndef _BTHID_CONFIG_H_
33128080Semax#define _BTHID_CONFIG_H_ 1
34128080Semax
35128080Semax#define BTHIDD_CONFFILE		"/etc/bluetooth/bthidd.conf"
36128080Semax#define BTHIDD_HIDSFILE		"/var/db/bthidd.hids"
37128080Semax
38128080Semaxstruct hid_device
39128080Semax{
40128080Semax	bdaddr_t		bdaddr;		/* HID device BDADDR */
41128080Semax	uint16_t		control_psm;	/* control PSM */
42128080Semax	uint16_t		interrupt_psm;	/* interrupt PSM */
43128080Semax	unsigned		new_device           : 1;
44128080Semax	unsigned		reconnect_initiate   : 1;
45128080Semax	unsigned		battery_power        : 1;
46128080Semax	unsigned		normally_connectable : 1;
47128080Semax	unsigned		reserved             : 12;
48128080Semax	report_desc_t		desc;		/* HID report descriptor */
49128080Semax	LIST_ENTRY(hid_device)	next;		/* link to the next */
50128080Semax};
51128080Semaxtypedef struct hid_device	hid_device_t;
52128080Semaxtypedef struct hid_device *	hid_device_p;
53128080Semax
54128080Semaxextern char	*config_file;
55128080Semaxextern char	*hids_file;
56128080Semax
57128080Semaxint		read_config_file	(void);
58128080Semaxvoid		clean_config		(void);
59128080Semaxhid_device_p	get_hid_device		(bdaddr_p bdaddr);
60128080Semaxhid_device_p	get_next_hid_device	(hid_device_p d);
61128080Semaxvoid		print_hid_device	(hid_device_p hid_device, FILE *f);
62128080Semax
63128080Semaxint		read_hids_file		(void);
64128080Semaxint		write_hids_file		(void);
65128080Semax
66128080Semax#endif /* ndef _BTHID_CONFIG_H_ */
67128080Semax
68