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