XJAPI_ERROR

This enumeration contains error codes that can be returned from the various API functions. The majority of XJAPI functions return one of these values to indicate success or failure.

The function XJAPI_GetLastError can be used to retrieve an error message when a function has completed unsuccessfully.

The following values are defined:

XJAPI_SUCCESS
The function completed successfully.
XJAPI_ERROR_NOT_INITIALISED
The system has not been initialised. XJAPI_Startup must be called before any other API function is called.
XJAPI_ERROR_HARDWARE
There was an error from the hardware or the JTAG chain.
XJAPI_ERROR_NOLICENSE
The system is not licensed. See XJLink Manager for more information on XJTAG licensing.
XJAPI_ERROR_PARAMETER1
The first parameter to the function was invalid.
XJAPI_ERROR_PARAMETER2
The second parameter to the function was invalid.
XJAPI_ERROR_PARAMETER3
The third parameter to the function was invalid.
XJAPI_ERROR_PARAMETER4
The fourth parameter to the function was invalid.
XJAPI_ERROR_PARAMETER5
The fifth parameter to the function was invalid.
XJAPI_ERROR_GENERAL
Some other error occurred in the system.
XJAPI_ERROR_NOTFOUND
An item was not found. (This value was added in XJTAG version 3.2.8 and so requires that XJAPI_VERSION be defined to be greater than or equal to 0x030208.)

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);
}