VPI - Vision Programming Interface

1.2 Release

Status Codes

Declares entities to handle return status codes used in VPI. More...

Macros

#define VPI_MAX_STATUS_MESSAGE_LENGTH   256
 Maximum status message length in bytes. More...
 

Enumerations

enum  VPIStatus
 Status codes. More...
 

Functions

const char * vpiStatusGetName (VPIStatus code)
 Returns a string representation of the status code. More...
 
VPIStatus vpiGetLastStatus ()
 Returns and resets the status of the last VPI function call in current thread. More...
 
VPIStatus vpiGetLastStatusMessage (char *msgBuffer, int32_t lenBuffer)
 Returns and resets the status code and message of the last VPI function call in current thread. More...
 
VPIStatus vpiPeekAtLastStatus ()
 Returns the status of the last VPI function call in current thread. More...
 
VPIStatus vpiPeekAtLastStatusMessage (char *msgBuffer, int32_t lenBuffer)
 Returns and status code and message of the last VPI function call in current thread. More...
 

Detailed Description

Declares entities to handle return status codes used in VPI.

VPI functions uses status codes to return if they succeeded or not.

Macro Definition Documentation

◆ VPI_MAX_STATUS_MESSAGE_LENGTH

#define VPI_MAX_STATUS_MESSAGE_LENGTH   256

#include <vpi/Status.h>

Maximum status message length in bytes.

This is the maximum number of bytes that will be written by vpiGetLastStatusMessage and vpiPeekAtLastStatusMessage to the status message output buffer.

Definition at line 112 of file Status.h.

Enumeration Type Documentation

◆ VPIStatus

enum VPIStatus

#include <vpi/Status.h>

Status codes.

Enumerator
VPI_SUCCESS 

Operation completed successfully.

VPI_ERROR_NOT_IMPLEMENTED 

Operation isn't implemented.

VPI_ERROR_INVALID_ARGUMENT 

Invalid argument, either wrong range or value not accepted.

VPI_ERROR_INVALID_IMAGE_FORMAT 

Image type not accepted.

VPI_ERROR_INVALID_ARRAY_TYPE 

Array type not accepted.

VPI_ERROR_INVALID_PAYLOAD_TYPE 

Payload not created for this algorithm.

VPI_ERROR_INVALID_OPERATION 

Operation isn't valid in this context.

VPI_ERROR_INVALID_CONTEXT 

Context is invalid or is already destroyed.

VPI_ERROR_DEVICE 

Device backend error.

VPI_ERROR_NOT_READY 

Operation not completed yet, try again later.

VPI_ERROR_BUFFER_LOCKED 

Invalid operation on a locked buffer.

VPI_ERROR_OUT_OF_MEMORY 

Not enough free memory to allocate object.

VPI_ERROR_INTERNAL 

Internal, non specific error.

Definition at line 80 of file Status.h.

Function Documentation

◆ vpiGetLastStatus()

VPIStatus vpiGetLastStatus ( )

#include <vpi/Status.h>

Returns and resets the status of the last VPI function call in current thread.

A new call to this function will return VPI_SUCCESS, as the thread-specific status was reset. This operation doesn't affect the statuses in other threads.

Returns
The status of the last VPI function call in current thread.

◆ vpiGetLastStatusMessage()

VPIStatus vpiGetLastStatusMessage ( char *  msgBuffer,
int32_t  lenBuffer 
)

#include <vpi/Status.h>

Returns and resets the status code and message of the last VPI function call in current thread.

A new call to this function will return VPI_SUCCESS, as the thread-specific status was reset. This operation doesn't affect the statuses in other threads.

It's guaranteed that the message is never larger than VPI_MAX_STATUS_MESSAGE_LENGTH bytes, including the '\0' string terminator.

Parameters
[out]msgBufferPointer to memory where the status message will be written to.
[in]lenBufferSize in bytes of msgBuffer.
Returns
The status of the last VPI function call in current thread.

◆ vpiPeekAtLastStatus()

VPIStatus vpiPeekAtLastStatus ( )

#include <vpi/Status.h>

Returns the status of the last VPI function call in current thread.

The status code won't be reset.

Returns
The status of the last VPI function call in current thread.

◆ vpiPeekAtLastStatusMessage()

VPIStatus vpiPeekAtLastStatusMessage ( char *  msgBuffer,
int32_t  lenBuffer 
)

#include <vpi/Status.h>

Returns and status code and message of the last VPI function call in current thread.

The status code and message won't be reset.

It's guaranteed that the message is never larger than VPI_MAX_STATUS_MESSAGE_LENGTH bytes, including the '\0' string terminator.

Parameters
[out]msgBufferPointer to memory where the status message will be written to.
[in]lenBufferSize in bytes of msgBuffer.
Returns
The status of the last VPI function call in current thread.

◆ vpiStatusGetName()

const char* vpiStatusGetName ( VPIStatus  code)

#include <vpi/Status.h>

Returns a string representation of the status code.

Parameters
[in]codeStatus code whose string representation is to be returned.
Returns
The string representation of the code. The returned pointer points to a static string, hence it must not be freed.