logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_hid_send_feature_report - Send a Feature report to the device.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.20                     SDL_hid_send_feature_report(3)

Description

       Feature  reports are sent over the Control endpoint as a Set_Report transfer. The first byte of data must
       contain the Report ID. For devices which only support a single report, this  must  be  set  to  0x0.  The
       remaining   bytes   contain   the   report   data.   Since   the   Report   ID  is  mandatory,  calls  to
       SDL_hid_send_feature_report() will always contain one more byte than the report contains. For example, if
       a hid report is 16 bytes long, 17 bytes must be passed to SDL_hid_send_feature_report():  the  Report  ID
       (or  0x0, for devices which do not use numbered reports), followed by the report data (16 bytes). In this
       example, the length passed in would be 17.

Function Parameters

dev    a device handle returned from SDL_hid_open().

       data   the data to send, including the report number as the first byte.

       length the length in bytes of the data to send, including the report number.

Name

       SDL_hid_send_feature_report - Send a Feature report to the device.

Return Value

       for more information.

Synopsis

#include<SDL3/SDL_hidapi.h>intSDL_hid_send_feature_report(SDL_hid_device*dev,constunsignedchar*data,size_tlength);

See Also