---
name: "SDL_hid_get_report_descriptor"
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_get_report_descriptor"
---

# SDL\_hid\_get\_report\_descriptor(3)

Get a report descriptor from a HID device.

## NAME

SDL\_hid\_get\_report\_descriptor - Get a report descriptor from a HID device.

## HEADER FILE

Defined in SDL3/SDL\_hidapi.h

## SYNOPSIS

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

**int SDL\_hid\_get\_report\_descriptor(SDL\_hid\_device \*dev, unsigned char \*buf, size\_t buf\_size);**

## DESCRIPTION

User has to provide a preallocated buffer where descriptor will be copied to. The recommended size for a preallocated buffer is 4096 bytes.

## FUNCTION PARAMETERS

- *dev*

  a device handle returned from  **SDL\_hid\_open** ().

- *buf*

  the buffer to copy descriptor into.

- *buf\_size*

  the size of the buffer in bytes.

## RETURN VALUE

Returns the number of bytes actually copied or -1 on failure; call

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

## AVAILABILITY

This function is available since SDL 3.2.0.
