async-hid 0.5.1

A async library for interacting with HID devices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! The IOCTL calls we need for the native linux backend

use nix::ioctl_read;
use nix::ioctl_readwrite_buf;

// From linux/hidraw.h
const HIDRAW_IOC_MAGIC: u8 = b'H';
const HIDRAW_IOC_GRDESCSIZE: u8 = 0x01;
const HIDRAW_SET_FEATURE: u8 = 0x06;
const HIDRAW_GET_FEATURE: u8 = 0x07;

ioctl_read!(hidraw_ioc_grdescsize, HIDRAW_IOC_MAGIC, HIDRAW_IOC_GRDESCSIZE, i32);

ioctl_readwrite_buf!(hidraw_ioc_set_feature, HIDRAW_IOC_MAGIC, HIDRAW_SET_FEATURE, u8);
ioctl_readwrite_buf!(hidraw_ioc_get_feature, HIDRAW_IOC_MAGIC, HIDRAW_GET_FEATURE, u8);