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