IDS peak comfortC v1.11.0
Loading...
Searching...
No Matches
Library

Modules

 Library version
 

Functions

peak_status peak_Library_Init ()
 Init the peak comfortC library.
 
peak_status peak_Library_Exit ()
 Exit the peak comfortC library.
 
peak_status peak_Library_GetVersion (uint32_t *majorVersion, uint32_t *minorVersion, uint32_t *subminorVersion, uint32_t *patchVersion)
 Query the library version.
 
peak_status peak_Library_GetLastError (peak_status *lastErrorCode, char *lastErrorMessage, size_t *lastErrorMessageSize)
 Query the last error.
 
peak_bool peak_Library_InterfaceTechnology_IsSupported (peak_interface_technology interfaceTech)
 Query the supported interface technologies.
 

Detailed Description

Library level functions and types.

Function Documentation

◆ peak_Library_Exit()

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.

Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Library_GetLastError()

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.

See also
Last Error Handling

This function implements the Two Staged Data Query principle.

Parameters
[out]lastErrorCodeThe error code of the last error. NULL if not required.
[out]lastErrorMessagePointer 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 equal NULL:
    out: minimal size of lastErrorMessage in bytes to hold all information
  • lastErrorMessage unequal NULL:
    in: size of the provided lastErrorMessage in bytes
    out: number of bytes filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_BUFFER_TOO_SMALL lastErrorMessage is not NULL and the value of *lastErrorMessageSize is too small to receive the expected amount of data.
PEAK_STATUS_INVALID_PARAMETER lastErrorMessageSize is an invalid pointer.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
This function can be used even if the library is not initialized. This is useful in the case that peak_Library_Init fails.

◆ peak_Library_GetVersion()

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.

Parameters
[out]majorVersionMajor Version. NULL if not required.
[out]minorVersionMinor Version. NULL if not required.
[out]subminorVersionSubminor Version. NULL if not required.
[out]patchVersionPatch Version. NULL if not required.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
Note
This function can be used even if the library is not initialized.

◆ peak_Library_Init()

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.

Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Library_InterfaceTechnology_IsSupported()

peak_bool peak_Library_InterfaceTechnology_IsSupported ( peak_interface_technology  interfaceTech)

Query the supported interface technologies.

Queries whether the specified interface technology is supported.

This function implements the Enabled Status Query principle.

Note
Depends on the system environment which technology is supported.
Parameters
[in]interfaceTechinterface technology to which the setting refers.
See also
peak_interface_technology for possible interface technologies.
Returns
PEAK_TRUE The interface technology is supported.
PEAK_FALSE The interface technology is not supported.