hidapi topic

CategoryHIDAPI

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.

Functions

sdlHidBleScan(bool active) → void hidapi
Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers.
sdlHidClose(Pointer<SdlHidDevice> dev) int hidapi
Close a HID device.
sdlHidDeviceChangeCount() int hidapi
Check to see if devices may have been added or removed.
sdlHidEnumerate(int vendorId, int productId) Pointer<SdlHidDeviceInfo> hidapi
Enumerate the HID Devices.
sdlHidExit() int hidapi
Finalize the HIDAPI library.
sdlHidFreeEnumeration(Pointer<SdlHidDeviceInfo> devs) → void hidapi
Free an enumeration linked list.
sdlHidGetDeviceInfo(Pointer<SdlHidDevice> dev) Pointer<SdlHidDeviceInfo> hidapi
Get the device info from a HID device.
sdlHidGetFeatureReport(Pointer<SdlHidDevice> dev, Pointer<Uint8> data, int length) int hidapi
Get a feature report from a HID device.
sdlHidGetIndexedString(Pointer<SdlHidDevice> dev, int stringIndex, Pointer<Int16> string, int maxlen) int hidapi
Get a string from a HID device, based on its string index.
sdlHidGetInputReport(Pointer<SdlHidDevice> dev, Pointer<Uint8> data, int length) int hidapi
Get an input report from a HID device.
sdlHidGetManufacturerString(Pointer<SdlHidDevice> dev, Pointer<Int16> string, int maxlen) int hidapi
Get The Manufacturer String from a HID device.
sdlHidGetProductString(Pointer<SdlHidDevice> dev, Pointer<Int16> string, int maxlen) int hidapi
Get The Product String from a HID device.
sdlHidGetProperties(Pointer<SdlHidDevice> dev) int hidapi
Get the properties associated with an SDL_hid_device.
sdlHidGetReportDescriptor(Pointer<SdlHidDevice> dev, Pointer<Uint8> buf, int bufSize) int hidapi
Get a report descriptor from a HID device.
sdlHidGetSerialNumberString(Pointer<SdlHidDevice> dev, Pointer<Int16> string, int maxlen) int hidapi
Get The Serial Number String from a HID device.
sdlHidInit() int hidapi
Initialize the HIDAPI library.
sdlHidOpen(int vendorId, int productId, Pointer<Int16> serialNumber) Pointer<SdlHidDevice> hidapi
Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.
sdlHidOpenPath(String? path) Pointer<SdlHidDevice> hidapi
Open a HID device by its path name.
sdlHidRead(Pointer<SdlHidDevice> dev, Pointer<Uint8> data, int length) int hidapi
Read an Input report from a HID device.
sdlHidReadTimeout(Pointer<SdlHidDevice> dev, Pointer<Uint8> data, int length, int milliseconds) int hidapi
Read an Input report from a HID device with timeout.
sdlHidSendFeatureReport(Pointer<SdlHidDevice> dev, Pointer<Uint8> data, int length) int hidapi
Send a Feature report to the device.
sdlHidSetNonblocking(Pointer<SdlHidDevice> dev, int nonblock) int hidapi
Set the device handle to be non-blocking.
sdlHidWrite(Pointer<SdlHidDevice> dev, Pointer<Uint8> data, int length) int hidapi
Write an Output report to a HID device.