libx52 0.3.0
Saitek X52/X52Pro drivers for Linux/Unix
Loading...
Searching...
No Matches
Functions
Utility Functions

Functions

int libx52util_convert_utf8_string (const uint8_t *input, uint8_t *output, size_t *len)
 Convert UTF8 string to X52 character map.
 

Detailed Description

These functions simplify some of the data handling for MFD & LED control.

Function Documentation

◆ libx52util_convert_utf8_string()

int libx52util_convert_utf8_string ( const uint8_t * input,
uint8_t * output,
size_t * len )

Convert UTF8 string to X52 character map.

This function takes in a UTF-8 string and converts it to the character map used by the X52Pro MFD. Unrecognized characters are silently dropped.

Parameters
[in]inputInput string in UTF-8. Must be NUL-terminated
[out]outputOutput buffer
[in,out]lenLength of output buffer
Returns
0 on success, -EINVAL on invalid parameters, -E2BIG if the buffer filled up before converting the entire string.