LibTiePie  0.4.5
Library for interfacing TiePie engineering instruments
 All Files Functions Typedefs Macros Modules Pages
Library

Description

Functions to retrieve information from the library itself.

The library has a version number and a configuration number that can be queried. These can be used when requesting support from TiePie engineering.

On each library function call a status flag is set, indicating how the function was executed. When a function call behaves different than expected, check the status for possible causes.

Functions

TpVersion_t LibGetVersion (void)
 Get the library version number. More...
 
uint32_t LibGetConfig (uint8_t *pBuffer, uint32_t dwBufferLength)
 Get the library configuration number. More...
 
LibTiePieStatus_t LibGetLastStatus (void)
 Get the last status value. More...
 
const char * LibGetLastStatusStr (void)
 Get the last status value as text. More...
 

Function Documentation

TpVersion_t LibGetVersion ( void  )

Get the library version number.

Returns
The library version number.
Status values
SUCCESSThe function executed successfully.
Example
uint16_t wMajor = TPVERSION_MAJOR( Version );
uint16_t wMinor = TPVERSION_MINOR( Version );
uint16_t wRelease = TPVERSION_RELEASE( Version );
uint16_t wBuild = TPVERSION_BUILD( Version );
printf( "LibGetVersion = %u.%u.%u.%u\n" , wMajor , wMinor , wRelease , wBuild );
Since
0.4.0
uint32_t LibGetConfig ( uint8_t *  pBuffer,
uint32_t  dwBufferLength 
)

Get the library configuration number.

Parameters
pBufferA pointer to the buffer to write to.
dwBufferLengthThe length of the buffer, in bytes.
Returns
The library configuration number length in bytes.
Status values
SUCCESSThe function executed successfully.
Example
uint32_t dwLength = LibGetConfig( NULL , 0 );
uint8_t* pBuffer = malloc( sizeof( uint8_t ) * dwLength );
dwLength = LibGetConfig( Buffer , dwLength );
printf( "LibGetConfig = 0x" );
for( i = 0 ; i < dwLength ; i++ )
printf( "%02x" , pBuffer[ i ] );
printf( "\n" );
free( pBuffer );
Since
0.4.0
LibTiePieStatus_t LibGetLastStatus ( void  )

Get the last status value.

After each call to a library function, a status flag is set, indicating how the function was executed.

Returns
Status code.
Status values
This function does not affect the status flag.
See also
LibGetLastStatusStr
Example
printf( "LibGetLastStatus = %d\n" , LibGetLastStatus() );
Since
0.4.0
const char* LibGetLastStatusStr ( void  )

Get the last status value as text.

After each call to a library function, a status flag is set, indicating how the function was executed.

Returns
Status code as text.
Status values
This function does not affect the status flag.
See also
LibGetLastStatus
Example
printf( "LibGetLastStatusStr = %s\n" , LibGetLastStatusStr() );
Since
0.4.0