XJAPI_GetLastError

Retrieve a description of the last error that occurred.

void XJAPI_GetLastError(
    char *buffer,
    unsigned int length
);

Arguments

buffer
A pointer to a buffer to write the NULL-terminated string into.
length
The size of buffer, including the space for the NULL terminator.

Return value

None

Notes

Whenever an API function returns an error code other than XJAPI_SUCCESS, then calling this function will return a more detailed description of the error.

Example

XJAPI_ERROR ec = XJAPI_SetPinMap(XJAPI_USERDEFINED, &pinMap, TRUE);
if (ec != XJAPI_SUCCESS) {
    char text[256];
    XJAPI_GetLastError(text, sizeof(text));
    printf("Failed to execute SetPinMap: %s\n", text);
}