USB 2.0 USB 3.x GigE |
USB 2.0 USB 3.x GigE |
Syntax
INT is_GetError (HIDS hCam, INT* pErr, IS_CHAR** ppcErr)
Description
is_GetError() queries the last error that occurred and returns the associated error code and message. It is recommended to call this function after the previous function has returned the error IS_NO_SUCCESS. Each error message will be overwritten when a new error occurs.
Input parameters
hCam |
Camera handle |
pErr |
Pointer to the variable containing the error code |
ppcErr |
Pointer to the string containing the error text |
Return values
IS_INVALID_CAMERA_HANDLE |
Invalid camera handle |
IS_INVALID_PARAMETER |
One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode. |
IS_NO_SUCCESS |
General error message |
IS_SUCCESS |
Function executed successfully |
Related functions
Example
HIDS hCam; // Already initialized camera handle
INT newPixelClock = 0;
INT nRet = IS_NO_SUCCESS;
const unsigned short bufferLen = 128;
char myErrorBuffer[bufferLen]; // You can also allocate the string dynamically
// Will cause error because pixel clock 0 does not exist
nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_SET, &newPixelClock, sizeof(newPixelClock));
if(nRet != IS_SUCCESS)
{
INT lastError;
// DO NOT allocate this buffer yourself, otherwise it will be overwritten.
// DO NOT free this buffer
// The internal buffer is overwritten when another API function fails, so make sure to copy this string to your own buffer.
char* lastErrorString;
nRet = is_GetError(hCam, &lastError, &lastErrorString);
if(nRet == IS_SUCCESS)
{
// Copy the temporary string to our own buffer
memset(myErrorBuffer, 0, bufferLen);
strncpy(myErrorBuffer, lastErrorString, bufferLen);
lastErrorString = 0;
}
}