SDL Wiki
(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)


Get a report descriptor from a HID device.

Header File

Defined in <SDL3/SDL_hidapi.h>


int SDL_hid_get_report_descriptor(SDL_hid_device *dev, unsigned char *buf, size_t buf_size);

Function Parameters

SDL_hid_device * dev a device handle returned from SDL_hid_open().
unsigned char * buf the buffer to copy descriptor into.
size_t buf_size the size of the buffer in bytes.

Return Value

(int) Returns the number of bytes actually copied or -1 on failure; call SDL_GetError() for more information.


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


This function is available since SDL 3.0.0.

CategoryAPI, CategoryAPIFunction, CategoryHIDAPI

[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.