« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.6.1 - ErrorToString

Get the name of an error code.

Syntax

LJM_VOID_RETURN LJM_ErrorToString(
                      int ErrorCode,
                      char * ErrorString)

Parameters

ErrorCode [in]
The error code number.
ErrorString [out]
A pointer to the char array which will be populated with the null-terminated error name/description. Allocate to size LJM_MAX_NAME_SIZE.

Returns

None.

Remarks

If the constants file that has been loaded does not contain the error code, this returns a null-terminated message saying so. If the constants file could not be opened, this returns a null-terminated string containing the expected file path.

Examples

[C/C++] Get the name of error code 1230

char errorName[LJM_MAX_NAME_SIZE]; // LJM_MAX_NAME_SIZE is 256
LJM_ErrorToString(1230, errorName);
printf ("%s \n", errorName);
// prints "LJME_COULD_NOT_CLAIM_DEVICE"