Beispiel #1
0
 def __init__(self):
     import ioctl
     import ctypes
     size = ctypes.sizeof(ctypes.c_int(0))
     self._VFD_IOC_MAGIC = ord('M')
     self._VFD_IOC_SMODE = ioctl.IOW(self._VFD_IOC_MAGIC, 1, size)
     self._VFD_IOC_GMODE = ioctl.IOR(self._VFD_IOC_MAGIC, 2, size)
     self._VFD_IOC_SBRIGHT = ioctl.IOW(self._VFD_IOC_MAGIC, 3, size)
     self._VFD_IOC_GBRIGHT = ioctl.IOR(self._VFD_IOC_MAGIC, 4, size)
     self._VFD_IOC_POWER = ioctl.IOW(self._VFD_IOC_MAGIC, 5, size)
     self._VFD_IOC_GVER = ioctl.IOR(self._VFD_IOC_MAGIC, 6, size)
     self._VFD_IOC_STATUS_LED = ioctl.IOW(self._VFD_IOC_MAGIC, 7, size)
     self._VFD_IOC_GDISPLAY_TYPE = ioctl.IOR(self._VFD_IOC_MAGIC, 8, size)
     self._VFD_IOC_SDISPLAY_TYPE = ioctl.IOW(self._VFD_IOC_MAGIC, 9, size)
     self._VFD_IOC_SCHARS_ORDER = ioctl.IOW(self._VFD_IOC_MAGIC, 10, 7)
     self._VFD_IOC_USE_DTB_CONFIG = ioctl.IOW(self._VFD_IOC_MAGIC, 11, size)
     self._VFD_IOC_MAXNR = 12
Beispiel #2
0
HID_REPORT_ID_UNKNOWN = 0xffffffff
HID_REPORT_ID_FIRST = 0x00000100
HID_REPORT_ID_NEXT = 0x00000200
HID_REPORT_ID_MASK = 0x000000ff
HID_REPORT_ID_MAX = 0x000000ff

HID_REPORT_TYPE_INPUT = 1
HID_REPORT_TYPE_OUTPUT = 2
HID_REPORT_TYPE_FEATURE = 3
HID_REPORT_TYPE_MIN = 1
HID_REPORT_TYPE_MAX = 3

# -------------------------------------------------------------------------------------------------
# IOCTLs (0x00 - 0x7f)

HIDIOCGVERSION = ioctl.IOR(ord('H'), 0x01, len(hid_version))
HIDIOCAPPLICATION = ioctl.IO(ord('H'), 0x02)
HIDIOCGDEVINFO = ioctl.IOR(ord('H'), 0x03, len(hiddev_devinfo))
# HIDIOCGSTRING = ioctl.IOR(ord('H'), 0x04, len(hiddev_string_descriptor))
HIDIOCINITREPORT = ioctl.IO(ord('H'), 0x05)
# HIDIOCGNAME(len)	_IOC(_IOC_READ, 'H', 0x06, len)
HIDIOCGREPORT = ioctl.IOW(ord('H'), 0x07, len(hiddev_report_info))
HIDIOCSREPORT = ioctl.IOW(ord('H'), 0x08, len(hiddev_report_info))
HIDIOCGREPORTINFO = ioctl.IOWR(ord('H'), 0x09, len(hiddev_report_info))
# HIDIOCGFIELDINFO	_IOWR('H', 0x0A, struct hiddev_field_info)
HIDIOCGUSAGE = ioctl.IOWR(ord('H'), 0x0B, len(hiddev_usage_ref))  # get
HIDIOCSUSAGE = ioctl.IOW(ord('H'), 0x0C, len(hiddev_usage_ref))  # set
HIDIOCGUCODE = ioctl.IOWR(ord('H'), 0x0D, len(hiddev_usage_ref))
HIDIOCGFLAG = ioctl.IOR(ord('H'), 0x0E, struct.calcsize(ctypes.c_ushort._type_))
# HIDIOCSFLAG		_IOW('H', 0x0F, int)
HIDIOCGCOLLECTIONINDEX = ioctl.IOW(ord('H'), 0x10, len(hiddev_usage_ref))