![]() |
IDS peak comfortC
v1.1.0
|
Modules | |
| Library version | |
Functions | |
| peak_status | peak_Library_Init () |
| Init the peak comfortC library. More... | |
| peak_status | peak_Library_Exit () |
| Exit the peak comfortC library. More... | |
| peak_status | peak_Library_GetVersion (uint32_t *majorVersion, uint32_t *minorVersion, uint32_t *subminorVersion, uint32_t *patchVersion) |
| Query the library version. More... | |
| peak_status | peak_Library_GetLastError (peak_status *lastErrorCode, char *lastErrorMessage, size_t *lastErrorMessageSize) |
| Query the last error. More... | |
Library level functions and types.
| peak_status peak_Library_Exit | ( | ) |
Exit the peak comfortC library.
Deinitializes the internal library status.
For each call to peak_Library_Init there must be a corresponding call to this function to ensure proper deinitialization of the library status.
After the library has been exited its functions (besides peak_Library_Init) will not be operable until peak_Library_Init has been called again.
| peak_status peak_Library_GetLastError | ( | peak_status * | lastErrorCode, |
| char * | lastErrorMessage, | ||
| size_t * | lastErrorMessageSize | ||
| ) |
Query the last error.
Provides a readable text description of the last error occurred in the local thread context.
The library stores the last error thread local, i.e. for each thread separately.
If any library function fails and reports an error status this function can be used to query a text message which gives details on the error that occurred.
In case an error occurs and after that several other function calls return without error the last error value and description is returned and the successful calls are ignored.
If there has not been any error in the given thread context since startup the function will return PEAK_STATUS_SUCCESS with *peak_status also set to PEAK_STATUS_SUCCESS and lastErrorMessage containing "No Error".
In case peak_Library_GetLastError itself generates an error it will return the according error code but it will not store the error internally so that succeeding calls to peak_Library_GetLastError will still be able to report the stored error code.
This function implements the Two Staged Data Query principle.
| [out] | lastErrorCode | The error code of the last error. NULL if not required. |
| [out] | lastErrorMessage | Pointer to a user allocated C string buffer to receive the last error text. If this parameter is NULL, lastErrorMessageSize will contain the needed size of lastErrorMessage in bytes. The size includes the terminating 0. |
| [in,out] | lastErrorMessageSize |
|
lastErrorMessage is not NULL and the value of *lastErrorMessageSize is too small to receive the expected amount of data. lastErrorMessageSize is an invalid pointer. | peak_status peak_Library_GetVersion | ( | uint32_t * | majorVersion, |
| uint32_t * | minorVersion, | ||
| uint32_t * | subminorVersion, | ||
| uint32_t * | patchVersion | ||
| ) |
Query the library version.
Provides the version of the library divided in major, minor, subminor and patch, in that order of magnitude.
You are allowed to pass NULL for parts you are not interested in.
| [out] | majorVersion | Major Version. NULL if not required. |
| [out] | minorVersion | Minor Version. NULL if not required. |
| [out] | subminorVersion | Subminor Version. NULL if not required. |
| [out] | patchVersion | Patch Version. NULL if not required. |
| peak_status peak_Library_Init | ( | ) |
Init the peak comfortC library.
Initializes the internal library status.
This function must be called prior to any other function call.
The function may be called multiple times from a single client process. For each call there must be a corresponding call to peak_Library_Exit to ensure proper deinitialization of the library status.