hid.c (128080) | hid.c (163811) |
---|---|
1/* 2 * hid.c 3 * 4 * Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: hid.c,v 1.3 2004/02/17 22:14:57 max Exp $ | 1/* 2 * hid.c 3 * 4 * Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: hid.c,v 1.3 2004/02/17 22:14:57 max Exp $ |
29 * $FreeBSD: head/usr.sbin/bluetooth/bthidcontrol/hid.c 128080 2004-04-10 00:18:00Z emax $ | 29 * $FreeBSD: head/usr.sbin/bluetooth/bthidcontrol/hid.c 163811 2006-10-31 00:26:58Z markus $ |
30 */ 31 32#include <sys/queue.h> 33#include <bluetooth.h> 34#include <dev/usb/usb.h> 35#include <dev/usb/usbhid.h> 36#include <stdio.h> 37#include <string.h> 38#include <usbhid.h> 39#include "bthid_config.h" 40#include "bthidcontrol.h" 41 | 30 */ 31 32#include <sys/queue.h> 33#include <bluetooth.h> 34#include <dev/usb/usb.h> 35#include <dev/usb/usbhid.h> 36#include <stdio.h> 37#include <string.h> 38#include <usbhid.h> 39#include "bthid_config.h" 40#include "bthidcontrol.h" 41 |
42extern uint32_t verbose; 43 |
|
42static void hid_dump_descriptor (report_desc_t r); 43static void hid_dump_item (char const *label, struct hid_item *h); 44 45static int 46hid_dump(bdaddr_t *bdaddr, int argc, char **argv) 47{ 48 struct hid_device *hd = NULL; 49 int e = FAILED; --- 98 unchanged lines hidden (view full) --- 148 } 149 150 hid_end_parse(d); 151} 152 153static void 154hid_dump_item(char const *label, struct hid_item *h) 155{ | 44static void hid_dump_descriptor (report_desc_t r); 45static void hid_dump_item (char const *label, struct hid_item *h); 46 47static int 48hid_dump(bdaddr_t *bdaddr, int argc, char **argv) 49{ 50 struct hid_device *hd = NULL; 51 int e = FAILED; --- 98 unchanged lines hidden (view full) --- 150 } 151 152 hid_end_parse(d); 153} 154 155static void 156hid_dump_item(char const *label, struct hid_item *h) 157{ |
158 if ((h->flags & HIO_CONST) && !verbose) 159 return; 160 |
|
156 fprintf(stdout, 157"%s id=%u size=%u count=%u page=%s usage=%s%s%s%s%s%s%s%s%s%s", 158 label, (uint8_t) h->report_ID, h->report_size, h->report_count, 159 hid_usage_page(HID_PAGE(h->usage)), 160 hid_usage_in_page(h->usage), 161 h->flags & HIO_CONST ? " Const" : "", 162 h->flags & HIO_VARIABLE ? " Variable" : "", 163 h->flags & HIO_RELATIVE ? " Relative" : "", --- 46 unchanged lines hidden --- | 161 fprintf(stdout, 162"%s id=%u size=%u count=%u page=%s usage=%s%s%s%s%s%s%s%s%s%s", 163 label, (uint8_t) h->report_ID, h->report_size, h->report_count, 164 hid_usage_page(HID_PAGE(h->usage)), 165 hid_usage_in_page(h->usage), 166 h->flags & HIO_CONST ? " Const" : "", 167 h->flags & HIO_VARIABLE ? " Variable" : "", 168 h->flags & HIO_RELATIVE ? " Relative" : "", --- 46 unchanged lines hidden --- |