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