Home | History | Annotate | Line # | Download | only in libusbhid
      1 /*	$NetBSD: hid_test_data.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2016 Jonathan A. Kollasch
      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
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
     20  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     23  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     25  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     26  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  */
     28 
     29 static const uint8_t range_test_report_descriptor[] = {
     30 	0x0b, 0x03, 0x00, 0x00, 0xff,	// Usage
     31 	0x75, 0x20,			// Report Size
     32 	0x95, 0x01,			// Report Count
     33 	0x17, 0x00, 0x00, 0x00, 0x80,	// Logical Minimum
     34 	0x27, 0xff, 0xff, 0xff, 0x7f,	// Logical Maximum
     35 	0x37, 0x00, 0x00, 0x00, 0x80,	// Physical Minimum
     36 	0x47, 0xff, 0xff, 0xff, 0x7f,	// Physical Maximum
     37 	0x81, 0x00,			// Input
     38 
     39 	0x0b, 0x02, 0x00, 0x00, 0xff,	// Usage
     40 	0x75, 0x10,			// Report Size
     41 	0x95, 0x01,			// Report Count
     42 	0x16, 0x00, 0x80,		// Logical Minimum
     43 	0x26, 0xff, 0x7f,		// Logical Maximum
     44 	0x36, 0x00, 0x80,		// Physical Minimum
     45 	0x46, 0xff, 0x7f,		// Physical Maximum
     46 	0x81, 0x00,			// Input
     47 
     48 	0x0b, 0x01, 0x00, 0x00, 0xff,	// Usage
     49 	0x75, 0x08,			// Report Size
     50 	0x95, 0x01,			// Report Count
     51 	0x15, 0x80,			// Logical Minimum
     52 	0x25, 0x7f,			// Logical Maximum
     53 	0x35, 0x80,			// Physical Minimum
     54 	0x45, 0x7f,			// Physical Maximum
     55 	0x81, 0x00,			// Input
     56 };
     57 
     58 static const uint8_t range_test_minimum_report[7] = {
     59 	0x00, 0x00, 0x00, 0x80,
     60 	0x00, 0x80,
     61 	0x80,
     62 };
     63 
     64 static const uint8_t range_test_negative_one_report[7] = {
     65 	0xff, 0xff, 0xff, 0xff,
     66 	0xff, 0xff,
     67 	0xff,
     68 };
     69 
     70 static const uint8_t range_test_positive_one_report[7] = {
     71 	0x01, 0x00, 0x00, 0x00,
     72 	0x01, 0x00,
     73 	0x01,
     74 };
     75 
     76 static const uint8_t range_test_maximum_report[7] = {
     77 	0xff, 0xff, 0xff, 0x7f,
     78 	0xff, 0x7f,
     79 	0x7f,
     80 };
     81 
     82 static const uint8_t unsigned_range_test_report_descriptor[] = {
     83 	0x0b, 0x13, 0x00, 0x00, 0xff,	// Usage
     84 	0x75, 0x20,			// Report Size
     85 	0x95, 0x01,			// Report Count
     86 	0x17, 0x00, 0x00, 0x00, 0x00,	// Logical Minimum
     87 	0x27, 0xff, 0xff, 0xff, 0xff,	// Logical Maximum
     88 	0x37, 0x00, 0x00, 0x00, 0x00,	// Physical Minimum
     89 	0x47, 0xff, 0xff, 0xff, 0xff,	// Physical Maximum
     90 	0x81, 0x00,			// Input
     91 
     92 	0x0b, 0x12, 0x00, 0x00, 0xff,	// Usage
     93 	0x75, 0x10,			// Report Size
     94 	0x95, 0x01,			// Report Count
     95 	0x16, 0x00, 0x00,		// Logical Minimum
     96 	0x26, 0xff, 0xff,		// Logical Maximum
     97 	0x36, 0x00, 0x00,		// Physical Minimum
     98 	0x46, 0xff, 0xff,		// Physical Maximum
     99 	0x81, 0x00,			// Input
    100 
    101 	0x0b, 0x11, 0x00, 0x00, 0xff,	// Usage
    102 	0x75, 0x08,			// Report Size
    103 	0x95, 0x01,			// Report Count
    104 	0x15, 0x00,			// Logical Minimum
    105 	0x25, 0xff,			// Logical Maximum
    106 	0x35, 0x00,			// Physical Minimum
    107 	0x45, 0xff,			// Physical Maximum
    108 	0x81, 0x00,			// Input
    109 };
    110 
    111 static const uint8_t unsigned_range_test_minimum_report[7] = {
    112 	0x00, 0x00, 0x00, 0x00,
    113 	0x00, 0x00,
    114 	0x00,
    115 };
    116 
    117 static const uint8_t unsigned_range_test_positive_one_report[7] = {
    118 	0x01, 0x00, 0x00, 0x00,
    119 	0x01, 0x00,
    120 	0x01,
    121 };
    122 
    123 static const uint8_t unsigned_range_test_negative_one_report[7] = {
    124 	0xfe, 0xff, 0xff, 0xff,
    125 	0xfe, 0xff,
    126 	0xfe,
    127 };
    128 
    129 static const uint8_t unsigned_range_test_maximum_report[7] = {
    130 	0xff, 0xff, 0xff, 0xff,
    131 	0xff, 0xff,
    132 	0xff,
    133 };
    134 
    135 static const uint8_t just_pop_report_descriptor[] = {
    136 	0xb4,
    137 };
    138