Module hidapi

Available on crate feature dep_sdl3 only.
Expand description

Header file for SDL HIDAPI functions.

This is an adaptation of the original HIDAPI interface by Alan Ott, and includes source code licensed under the following license:

HIDAPI - Multi-Platform library for
communication with HID devices.

Copyright 2009, Alan Ott, Signal 11 Software.
All Rights Reserved.

This software may be used by anyone for any reason so
long as the copyright notice in the source files
remains intact.

(Note that this license is the same as item three of SDL’s zlib license, so it adds no new requirements on the user.)

If you would like a version of SDL without this code, you can build SDL with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example on iOS or tvOS to avoid a dependency on the CoreBluetooth framework.

Structs§

SDL_hid_bus_type
HID underlying bus types.
SDL_hid_device
An opaque handle representing an open HID device.
SDL_hid_device_info
Information about a connected HID device

Constants§

SDL_HID_API_BUS_BLUETOOTH
Bluetooth or Bluetooth LE bus Specifications: https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/ https://www.bluetooth.com/specifications/specs/hid-service-1-0/ https://www.bluetooth.com/specifications/specs/hid-over-gatt-profile-1-0/
SDL_HID_API_BUS_I2C
I2C bus Specifications: https://docs.microsoft.com/previous-versions/windows/hardware/design/dn642101(v=vs.85)
SDL_HID_API_BUS_SPI
SPI bus Specifications: https://www.microsoft.com/download/details.aspx?id=103325
SDL_HID_API_BUS_UNKNOWN
Unknown bus type
SDL_HID_API_BUS_USB
USB bus Specifications: https://usb.org/hid

Functions§

SDL_hid_ble_scan
Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers.
SDL_hid_close
Close a HID device.
SDL_hid_device_change_count
Check to see if devices may have been added or removed.
SDL_hid_enumerate
Enumerate the HID Devices.
SDL_hid_exit
Finalize the HIDAPI library.
SDL_hid_free_enumeration
Free an enumeration linked list.
SDL_hid_get_device_info
Get the device info from a HID device.
SDL_hid_get_feature_report
Get a feature report from a HID device.
SDL_hid_get_indexed_string
Get a string from a HID device, based on its string index.
SDL_hid_get_input_report
Get an input report from a HID device.
SDL_hid_get_manufacturer_string
Get The Manufacturer String from a HID device.
SDL_hid_get_product_string
Get The Product String from a HID device.
SDL_hid_get_report_descriptor
Get a report descriptor from a HID device.
SDL_hid_get_serial_number_string
Get The Serial Number String from a HID device.
SDL_hid_init
Initialize the HIDAPI library.
SDL_hid_open
Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.
SDL_hid_open_path
Open a HID device by its path name.
SDL_hid_read
Read an Input report from a HID device.
SDL_hid_read_timeout
Read an Input report from a HID device with timeout.
SDL_hid_send_feature_report
Send a Feature report to the device.
SDL_hid_set_nonblocking
Set the device handle to be non-blocking.
SDL_hid_write
Write an Output report to a HID device.