xref: /netbsd-src/tests/lib/libusbhid/hid_test_data.c (revision 4887406fba3dc9734f27bc3fa63fe9575c414590)
1*4887406fSjakllsch /*	$NetBSD: hid_test_data.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $	*/
243fe9848Sjakllsch 
343fe9848Sjakllsch /*
443fe9848Sjakllsch  * Copyright (c) 2016 Jonathan A. Kollasch
543fe9848Sjakllsch  * All rights reserved.
643fe9848Sjakllsch  *
743fe9848Sjakllsch  * Redistribution and use in source and binary forms, with or without
843fe9848Sjakllsch  * modification, are permitted provided that the following conditions
943fe9848Sjakllsch  * are met:
1043fe9848Sjakllsch  * 1. Redistributions of source code must retain the above copyright
1143fe9848Sjakllsch  *    notice, this list of conditions and the following disclaimer.
1243fe9848Sjakllsch  * 2. Redistributions in binary form must reproduce the above copyright
1343fe9848Sjakllsch  *    notice, this list of conditions and the following disclaimer in the
1443fe9848Sjakllsch  *    documentation and/or other materials provided with the distribution.
1543fe9848Sjakllsch  *
1643fe9848Sjakllsch  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1743fe9848Sjakllsch  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1843fe9848Sjakllsch  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1943fe9848Sjakllsch  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
2043fe9848Sjakllsch  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2143fe9848Sjakllsch  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2243fe9848Sjakllsch  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2343fe9848Sjakllsch  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2443fe9848Sjakllsch  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2543fe9848Sjakllsch  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2643fe9848Sjakllsch  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2743fe9848Sjakllsch  */
2843fe9848Sjakllsch 
2943fe9848Sjakllsch static const uint8_t range_test_report_descriptor[] = {
3043fe9848Sjakllsch 	0x0b, 0x03, 0x00, 0x00, 0xff,	// Usage
3143fe9848Sjakllsch 	0x75, 0x20,			// Report Size
3243fe9848Sjakllsch 	0x95, 0x01,			// Report Count
3343fe9848Sjakllsch 	0x17, 0x00, 0x00, 0x00, 0x80,	// Logical Minimum
3443fe9848Sjakllsch 	0x27, 0xff, 0xff, 0xff, 0x7f,	// Logical Maximum
3543fe9848Sjakllsch 	0x37, 0x00, 0x00, 0x00, 0x80,	// Physical Minimum
3643fe9848Sjakllsch 	0x47, 0xff, 0xff, 0xff, 0x7f,	// Physical Maximum
3743fe9848Sjakllsch 	0x81, 0x00,			// Input
3843fe9848Sjakllsch 
3943fe9848Sjakllsch 	0x0b, 0x02, 0x00, 0x00, 0xff,	// Usage
4043fe9848Sjakllsch 	0x75, 0x10,			// Report Size
4143fe9848Sjakllsch 	0x95, 0x01,			// Report Count
4243fe9848Sjakllsch 	0x16, 0x00, 0x80,		// Logical Minimum
4343fe9848Sjakllsch 	0x26, 0xff, 0x7f,		// Logical Maximum
4443fe9848Sjakllsch 	0x36, 0x00, 0x80,		// Physical Minimum
4543fe9848Sjakllsch 	0x46, 0xff, 0x7f,		// Physical Maximum
4643fe9848Sjakllsch 	0x81, 0x00,			// Input
4743fe9848Sjakllsch 
4843fe9848Sjakllsch 	0x0b, 0x01, 0x00, 0x00, 0xff,	// Usage
4943fe9848Sjakllsch 	0x75, 0x08,			// Report Size
5043fe9848Sjakllsch 	0x95, 0x01,			// Report Count
5143fe9848Sjakllsch 	0x15, 0x80,			// Logical Minimum
5243fe9848Sjakllsch 	0x25, 0x7f,			// Logical Maximum
5343fe9848Sjakllsch 	0x35, 0x80,			// Physical Minimum
5443fe9848Sjakllsch 	0x45, 0x7f,			// Physical Maximum
5543fe9848Sjakllsch 	0x81, 0x00,			// Input
5643fe9848Sjakllsch };
5743fe9848Sjakllsch 
5843fe9848Sjakllsch static const uint8_t range_test_minimum_report[7] = {
5943fe9848Sjakllsch 	0x00, 0x00, 0x00, 0x80,
6043fe9848Sjakllsch 	0x00, 0x80,
6143fe9848Sjakllsch 	0x80,
6243fe9848Sjakllsch };
6343fe9848Sjakllsch 
6443fe9848Sjakllsch static const uint8_t range_test_negative_one_report[7] = {
6543fe9848Sjakllsch 	0xff, 0xff, 0xff, 0xff,
6643fe9848Sjakllsch 	0xff, 0xff,
6743fe9848Sjakllsch 	0xff,
6843fe9848Sjakllsch };
6943fe9848Sjakllsch 
7043fe9848Sjakllsch static const uint8_t range_test_positive_one_report[7] = {
7143fe9848Sjakllsch 	0x01, 0x00, 0x00, 0x00,
7243fe9848Sjakllsch 	0x01, 0x00,
7343fe9848Sjakllsch 	0x01,
7443fe9848Sjakllsch };
7543fe9848Sjakllsch 
7643fe9848Sjakllsch static const uint8_t range_test_maximum_report[7] = {
7743fe9848Sjakllsch 	0xff, 0xff, 0xff, 0x7f,
7843fe9848Sjakllsch 	0xff, 0x7f,
7943fe9848Sjakllsch 	0x7f,
8043fe9848Sjakllsch };
8143fe9848Sjakllsch 
8243fe9848Sjakllsch static const uint8_t unsigned_range_test_report_descriptor[] = {
8343fe9848Sjakllsch 	0x0b, 0x13, 0x00, 0x00, 0xff,	// Usage
8443fe9848Sjakllsch 	0x75, 0x20,			// Report Size
8543fe9848Sjakllsch 	0x95, 0x01,			// Report Count
8643fe9848Sjakllsch 	0x17, 0x00, 0x00, 0x00, 0x00,	// Logical Minimum
8743fe9848Sjakllsch 	0x27, 0xff, 0xff, 0xff, 0xff,	// Logical Maximum
8843fe9848Sjakllsch 	0x37, 0x00, 0x00, 0x00, 0x00,	// Physical Minimum
8943fe9848Sjakllsch 	0x47, 0xff, 0xff, 0xff, 0xff,	// Physical Maximum
9043fe9848Sjakllsch 	0x81, 0x00,			// Input
9143fe9848Sjakllsch 
9243fe9848Sjakllsch 	0x0b, 0x12, 0x00, 0x00, 0xff,	// Usage
9343fe9848Sjakllsch 	0x75, 0x10,			// Report Size
9443fe9848Sjakllsch 	0x95, 0x01,			// Report Count
9543fe9848Sjakllsch 	0x16, 0x00, 0x00,		// Logical Minimum
9643fe9848Sjakllsch 	0x26, 0xff, 0xff,		// Logical Maximum
9743fe9848Sjakllsch 	0x36, 0x00, 0x00,		// Physical Minimum
9843fe9848Sjakllsch 	0x46, 0xff, 0xff,		// Physical Maximum
9943fe9848Sjakllsch 	0x81, 0x00,			// Input
10043fe9848Sjakllsch 
10143fe9848Sjakllsch 	0x0b, 0x11, 0x00, 0x00, 0xff,	// Usage
10243fe9848Sjakllsch 	0x75, 0x08,			// Report Size
10343fe9848Sjakllsch 	0x95, 0x01,			// Report Count
10443fe9848Sjakllsch 	0x15, 0x00,			// Logical Minimum
10543fe9848Sjakllsch 	0x25, 0xff,			// Logical Maximum
10643fe9848Sjakllsch 	0x35, 0x00,			// Physical Minimum
10743fe9848Sjakllsch 	0x45, 0xff,			// Physical Maximum
10843fe9848Sjakllsch 	0x81, 0x00,			// Input
10943fe9848Sjakllsch };
11043fe9848Sjakllsch 
11143fe9848Sjakllsch static const uint8_t unsigned_range_test_minimum_report[7] = {
11243fe9848Sjakllsch 	0x00, 0x00, 0x00, 0x00,
11343fe9848Sjakllsch 	0x00, 0x00,
11443fe9848Sjakllsch 	0x00,
11543fe9848Sjakllsch };
11643fe9848Sjakllsch 
11743fe9848Sjakllsch static const uint8_t unsigned_range_test_positive_one_report[7] = {
11843fe9848Sjakllsch 	0x01, 0x00, 0x00, 0x00,
11943fe9848Sjakllsch 	0x01, 0x00,
12043fe9848Sjakllsch 	0x01,
12143fe9848Sjakllsch };
12243fe9848Sjakllsch 
12343fe9848Sjakllsch static const uint8_t unsigned_range_test_negative_one_report[7] = {
12443fe9848Sjakllsch 	0xfe, 0xff, 0xff, 0xff,
12543fe9848Sjakllsch 	0xfe, 0xff,
12643fe9848Sjakllsch 	0xfe,
12743fe9848Sjakllsch };
12843fe9848Sjakllsch 
12943fe9848Sjakllsch static const uint8_t unsigned_range_test_maximum_report[7] = {
13043fe9848Sjakllsch 	0xff, 0xff, 0xff, 0xff,
13143fe9848Sjakllsch 	0xff, 0xff,
13243fe9848Sjakllsch 	0xff,
13343fe9848Sjakllsch };
13443fe9848Sjakllsch 
135*4887406fSjakllsch static const uint8_t just_pop_report_descriptor[] = {
136*4887406fSjakllsch 	0xb4,
137*4887406fSjakllsch };
138