File: hidapi_hidclass.h

package info (click to toggle)
python-hidapi 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,192 kB
  • sloc: ansic: 5,960; python: 264; makefile: 7
file content (56 lines) | stat: -rw-r--r-- 1,568 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*******************************************************
 HIDAPI - Multi-Platform library for
 communication with HID devices.

 libusb/hidapi Team

 Copyright 2022, All Rights Reserved.

 At the discretion of the user of this library,
 this software may be licensed under the terms of the
 GNU General Public License v3, a BSD-Style license, or the
 original HIDAPI license as outlined in the LICENSE.txt,
 LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
 files located at the root of the source distribution.
 These files may also be found in the public source
 code repository located at:
        https://github.com/libusb/hidapi .
********************************************************/

#ifndef HIDAPI_HIDCLASS_H
#define HIDAPI_HIDCLASS_H

#ifdef HIDAPI_USE_DDK

#include <hidclass.h>

#else

/* This part of the header mimics hidclass.h,
    but only what is used by HIDAPI */

#ifndef FILE_DEVICE_KEYBOARD
#define FILE_DEVICE_KEYBOARD                0x0000000b
#endif

#ifndef METHOD_OUT_DIRECT
#define METHOD_OUT_DIRECT               2
#endif

#ifndef FILE_ANY_ACCESS
#define FILE_ANY_ACCESS                 0
#endif

#ifndef CTL_CODE
#define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
    ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
#endif

#define HID_OUT_CTL_CODE(id) CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100)
#define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104)

#endif

#endif /* HIDAPI_HIDCLASS_H */