---
name: "SDL_hid_send_feature_report"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_hid_send_feature_report"
---

# SDL\_hid\_send\_feature\_report(3)

Send a Feature report to the device.

## NAME

SDL\_hid\_send\_feature\_report - Send a Feature report to the device.

## HEADER FILE

Defined in SDL3/SDL\_hidapi.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**int SDL\_hid\_send\_feature\_report(SDL\_hid\_device \*dev, const unsigned char \*data, size\_t length);**

## 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.

## RETURN VALUE

Returns the actual number of bytes written and -1 on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
