HIDDeviceClient
A client of a physical or virtual HID compatible peripheral.
Declaration
actor HIDDeviceClientMentioned in
Overview
A human interface device (HID) is a computer peripheral intended to provide direction to the system from human input. The specification is a broad, industry-wide standard, maintained by the USB Implementers Forum. For more details, see Human Interface Devices (HID) Specifications and Tools.
A HIDDeviceClient is a connection to one HID device on the system. It’s created using a HIDDeviceClient.DeviceReference, received from a HIDDeviceManager. A HIDDeviceClient.DeviceReference is a simple reference to a specific HID device. The HID peripheral can be a USB device like a wired mouse, a Bluetooth device like a wireless keyboard, an onboard sensor like an accelerometer, or even a software based, virtual peripheral created using HIDVirtualDevice.
A HIDDeviceClient receives device notifications, such as input HID reports that are dispatched from the device in response to human input (like a keyboard key press) in monitorNotifications(reportIDsToMonitor:elementsToMonitor:). It sends get and set reports to the device to retrieve information or configure device functionality using dispatchSetReportRequest(type:id:data:timeout:). dispatchGetReportRequest(type:id:timeout:). It monitors or updates specific pieces of the HID report using HIDElement.
Topics
Create a device client
Get device information
descriptordeviceUsagesisBuiltInlocalizationCodelocationIDmanufacturermodelNumberprimaryUsageproductproductIDserialNumbertransportuniqueIDvendorIDversionNumberelements
Interact with the device
dispatchGetReportRequest(type:id:timeout:)dispatchSetReportRequest(type:id:data:timeout:)seizeDevice()
Monitor device notifications
Update element values
updateElements(_:timeout:)HIDDeviceClient.RequestElementUpdateHIDDeviceClient.ProvideElementUpdateHIDDeviceClient.HIDElementUpdateResult