Hermes SDK 1.0.1A
Constructor, destructor and error handling

Functions

HermesReturn HermesConstr (Hermes_H *Hermes_in, CameraMode m, char *Device_ID)
 
HermesReturn HermesDestr (Hermes_H Hermes)
 
void PrintErrorCode (FILE *fout, const char *FunName, HermesReturn retcode)
 

Detailed Description

Functions to construct and destruct Hermes objects, and for error handling.

Function Documentation

◆ HermesConstr()

HermesReturn HermesConstr ( Hermes_H Hermes_in,
CameraMode  m,
char *  Device_ID 
)

Constructor.

It allocates a memory block to contain all the information and buffers required by the Hermes. If multiple devices are connected to the computer, a unique camera ID should be provided to correctly identify the camera. The camera ID can be found in the camera documentation (9 numbers and a letter) and a list of connected device is printed on the screen upon calling this function. An empty string is accepted too. In this case, the first device on the list will be connected.

Parameters
Hermes_inPointer to Hermes handle
mCamera Working mode
Device_IDUnique ID to identify the connected device
Returns
OK
INVALID_OP The Hermes_H points to an occupied memory location
FIRMWARE_NOT_COMPATIBLE The SDK and Firmware versions are not compatible
NOT_EN_MEMORY There is not enough memory to run the camera
Examples
SDK_Example.c.

◆ HermesDestr()

HermesReturn HermesDestr ( Hermes_H  Hermes)

Destructor.

It deallocates the memory block which contains all the information and buffers required by the Hermes. WARNING the user must call the destructor before the end of the program to avoid memory leaks.

Parameters
HermesHermes handle
Returns
OK
NULL_POINTER The provided Hermes_H points to an empty memory location
Examples
SDK_Example.c.

◆ PrintErrorCode()

void PrintErrorCode ( FILE *  fout,
const char *  FunName,
HermesReturn  retcode 
)

Print an error message.

All the SDK functions return an error code to inform the user whether the issued command was successfully executed or not. The result of the execution of a function can be redirect to a text file by providing a valid file pointer.

Parameters
foutOutput text file
FunNameAdditional text to define the warning/error. Usually the name of the calling function is provided.
retcodeError code returned by a SDK command