1281777Sdim/* 2281777Sdim * bthid_config.h 3281777Sdim */ 4281777Sdim 5281777Sdim/*- 6281777Sdim * Copyright (c) 2006 Maksim Yevmenkin <m_evmenkin@yahoo.com> 7281777Sdim * All rights reserved. 8281777Sdim * 9281777Sdim * Redistribution and use in source and binary forms, with or without 10281777Sdim * modification, are permitted provided that the following conditions 11281777Sdim * are met: 12281777Sdim * 1. Redistributions of source code must retain the above copyright 13281777Sdim * notice, this list of conditions and the following disclaimer. 14281777Sdim * 2. Redistributions in binary form must reproduce the above copyright 15281777Sdim * notice, this list of conditions and the following disclaimer in the 16281777Sdim * documentation and/or other materials provided with the distribution. 17281777Sdim * 18281777Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19281777Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20281777Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21281777Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22281777Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23281777Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24281777Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25281777Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26281777Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27281777Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28281777Sdim * SUCH DAMAGE. 29281777Sdim * 30281777Sdim * $Id: bthid_config.h,v 1.4 2006/09/07 21:06:53 max Exp $ 31281777Sdim * $FreeBSD$ 32281777Sdim */ 33281777Sdim 34281777Sdim#ifndef _BTHID_CONFIG_H_ 35281777Sdim#define _BTHID_CONFIG_H_ 1 36281777Sdim 37281777Sdim#define BTHIDD_CONFFILE "/etc/bluetooth/bthidd.conf" 38281777Sdim#define BTHIDD_HIDSFILE "/var/db/bthidd.hids" 39281777Sdim 40281777Sdimstruct hid_device 41281777Sdim{ 42281777Sdim bdaddr_t bdaddr; /* HID device BDADDR */ 43281777Sdim uint16_t control_psm; /* control PSM */ 44281777Sdim uint16_t interrupt_psm; /* interrupt PSM */ 45281777Sdim unsigned new_device : 1; 46281777Sdim unsigned reconnect_initiate : 1; 47281777Sdim unsigned battery_power : 1; 48281777Sdim unsigned normally_connectable : 1; 49281777Sdim unsigned keyboard : 1; 50281777Sdim unsigned reserved : 11; 51281777Sdim report_desc_t desc; /* HID report descriptor */ 52281777Sdim LIST_ENTRY(hid_device) next; /* link to the next */ 53281777Sdim}; 54281777Sdimtypedef struct hid_device hid_device_t; 55281777Sdimtypedef struct hid_device * hid_device_p; 56281777Sdim 57281777Sdimextern char const *config_file; 58281777Sdimextern char const *hids_file; 59281777Sdim 60281777Sdimint32_t read_config_file (void); 61281777Sdimvoid clean_config (void); 62281777Sdimhid_device_p get_hid_device (bdaddr_p bdaddr); 63281777Sdimhid_device_p get_next_hid_device (hid_device_p d); 64281777Sdimvoid print_hid_device (hid_device_p hid_device, FILE *f); 65281777Sdim 66281777Sdimint32_t read_hids_file (void); 67281777Sdimint32_t write_hids_file (void); 68281777Sdim 69281777Sdim#endif /* ndef _BTHID_CONFIG_H_ */ 70281777Sdim 71281777Sdim