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

Description

Functions to retrieve information from a device.

Functions

TpVersion_t DevGetDriverVersion (TpDeviceHandle_t hDevice)
 Get the version number of the driver used by the device. More...
 
TpVersion_t DevGetFirmwareVersion (TpDeviceHandle_t hDevice)
 Get the version number of the firmware used by the device. More...
 
TpDate_t DevGetCalibrationDate (TpDeviceHandle_t hDevice)
 Get the calibration date of the device. More...
 
uint32_t DevGetSerialNumber (TpDeviceHandle_t hDevice)
 Get the serial number of the device. More...
 
uint32_t DevGetProductId (TpDeviceHandle_t hDevice)
 Get the product id of the device. More...
 
uint32_t DevGetType (TpDeviceHandle_t hDevice)
 Get the device type. More...
 
uint32_t DevGetName (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
 Get the full name of the device. More...
 
uint32_t DevGetNameShort (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
 Get the short name of the device. More...
 
uint32_t DevGetNameShortest (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
 Get the short name of the device without model postfix. More...
 

Function Documentation

TpVersion_t DevGetDriverVersion ( TpDeviceHandle_t  hDevice)

Get the version number of the driver used by the device.

Parameters
hDeviceA device handle identifying the device.
Returns
Driver version number, or zero if no version number is available.
Status values
NOT_SUPPORTED The indicated device does not support reading a driver version or does not require a driver.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
Example
TpVersion_t Version = DevGetDriverVersion( hDevice );
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( "DevGetDriverVersion = %u.%u.%u.%u\n" , wMajor , wMinor , wRelease , wBuild );
Since
0.4.0
TpVersion_t DevGetFirmwareVersion ( TpDeviceHandle_t  hDevice)

Get the version number of the firmware used by the device.

Parameters
hDeviceA device handle identifying the device.
Returns
Firmware version number, or zero if no version number is available.
Status values
NOT_SUPPORTED The indicated device does not support reading a firmware version or does not require firmware.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
Example
TpVersion_t Version = DevGetFirmwareVersion( hDevice );
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( "DevGetFirmwareVersion = %u.%u.%u.%u\n" , wMajor , wMinor , wRelease , wBuild );
Since
0.4.0
TpDate_t DevGetCalibrationDate ( TpDeviceHandle_t  hDevice)

Get the calibration date of the device.

Parameters
hDeviceA device handle identifying the device.
Returns
The calibration date of the device, or zero if no calibration date is available.
Status values
NOT_SUPPORTED The indicated device does not have a calibration date.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
Example
TpDate_t Date = DevGetCalibrationDate( hDevice );
uint16_t wYear = TPDATE_YEAR( Date );
uint8_t byMonth = TPDATE_MONTH( Date );
uint8_t byDay = TPDATE_DAY( Date );
printf( "DevGetCalibrationDate = %u-%u-%u\n" , wYear , byMonth , byDay );
Since
0.4.0
uint32_t DevGetSerialNumber ( TpDeviceHandle_t  hDevice)

Get the serial number of the device.

Parameters
hDeviceA device handle identifying the device.
Returns
The serial number of the device.
Status values
NOT_SUPPORTED The indicated device does not have a serial number.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
Since
0.4.0
uint32_t DevGetProductId ( TpDeviceHandle_t  hDevice)

Get the product id of the device.

Parameters
hDeviceA device handle identifying the device.
Returns
The product id of the device.
Status values
NOT_SUPPORTED The indicated device does not support reading a product id.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
Since
0.4.0
uint32_t DevGetType ( TpDeviceHandle_t  hDevice)

Get the device type.

Parameters
hDeviceA device handle identifying the device.
Returns
The device type.
Status values
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
UNSUCCESSFUL An error occurred during execution of the last called function.
SUCCESS The function executed successfully.
Since
0.4.0
uint32_t DevGetName ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the full name of the device.

E.g. Handyscope HS5-530XMS

Parameters
hDeviceA device handle identifying the device.
pBufferA pointer to a buffer for the name.
dwBufferLengthThe length of the buffer, in bytes.
Returns
The length of the name in bytes, excluding terminating zero.
Status values
NOT_SUPPORTED The indicated device does not support reading a name.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
See also
DevGetNameShort
DevGetNameShortest
Example
uint32_t dwLength = DevGetName( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char* sName = malloc( sizeof( char ) * dwLength );
dwLength = DevGetName( hDevice , sName , dwLength );
printf( "DevGetName = %s\n" , sName );
free( sName );
Since
0.4.0
uint32_t DevGetNameShort ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the short name of the device.

E.g. HS5-530XMS

Parameters
hDeviceA device handle identifying the device.
pBufferA pointer to a buffer for the name.
dwBufferLengthThe length of the buffer, in bytes.
Returns
The length of the short name in bytes, excluding terminating zero.
Status values
NOT_SUPPORTED The indicated device does not support reading a name.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
See also
DevGetName
DevGetNameShortest
Example
uint32_t dwLength = DevGetNameShort( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char* sNameShort = malloc( sizeof( char ) * dwLength );
dwLength = DevGetNameShort( hDevice , sNameShort , dwLength );
printf( "DevGetNameShort = %s\n" , sNameShort );
free( sNameShort );
Since
0.4.0
uint32_t DevGetNameShortest ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the short name of the device without model postfix.

E.g. HS5

Parameters
hDeviceA device handle identifying the device.
pBufferA pointer to a buffer for the name.
dwBufferLengthThe length of the buffer, in bytes.
Returns
The length of the short name in bytes, excluding terminating zero.
Status values
NOT_SUPPORTED The indicated device does not support reading a name.
INVALID_HANDLEThe handle to the device is invalid.
DEVICE_GONE The device indicated by the device handle is no longer available.
SUCCESS The function executed successfully.
See also
DevGetName
DevGetNameShort
Example
uint32_t dwLength = DevGetNameShortest( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char* sNameShortest = malloc( sizeof( char ) * dwLength );
dwLength = DevGetNameShortest( hDevice , sNameShortest , dwLength );
printf( "DevGetNameShortest = %s\n" , sNameShortest );
free( sNameShortest );
Since
0.4.4