LibTiePie  0.9.15
Library for interfacing TiePie engineering instruments

Description

Functions to retrieve information from a device.

Functions

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

Function Documentation

TpVersion_t DevGetDriverVersion ( LibTiePieHandle_t  hDevice)

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

Parameters
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
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 ( LibTiePieHandle_t  hDevice)

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

Parameters
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
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 ( LibTiePieHandle_t  hDevice)

Get the calibration date of the device.

Parameters
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
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 ( LibTiePieHandle_t  hDevice)

Get the serial number of the device.

Parameters
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.4.0
uint32_t DevGetIPv4Address ( LibTiePieHandle_t  hDevice)

Get the IPv4 address of the device.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
The IPv4 address of the device, or zero if no IPv4 address is available.
Status values
INVALID_DEVICE_INDEX The device index is invalid, must be < LstGetCount().
INVALID_DEVICE_SERIALNUMBERThere is no device with the requested serial number.
INVALID_PRODUCT_ID There is no device with the requested product ID.
NOT_SUPPORTED The indicated device is not a network device.
INVALID_VALUE The value of dwIdKind is invalid.
LIBRARY_NOT_INITIALIZED The library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.9
uint16_t DevGetIPPort ( LibTiePieHandle_t  hDevice)

Get the IP port number of the device.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
The IP port number of the device, or zero if no IP port number is available.
Status values
INVALID_DEVICE_INDEX The device index is invalid, must be < LstGetCount().
INVALID_DEVICE_SERIALNUMBERThere is no device with the requested serial number.
INVALID_PRODUCT_ID There is no device with the requested product ID.
NOT_SUPPORTED The indicated device is not a network device.
INVALID_VALUE The value of dwIdKind is invalid.
LIBRARY_NOT_INITIALIZED The library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.9
uint32_t DevGetProductId ( LibTiePieHandle_t  hDevice)

Get the product id of the device.

Parameters
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.4.0
uint32_t DevGetType ( LibTiePieHandle_t  hDevice)

Get the device type.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
The device type.
Status values
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
UNSUCCESSFUL An error occurred during execution of the last called function.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.4.0
uint32_t DevGetName ( LibTiePieHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the full name of the device.

E.g. Handyscope HS5-530XMS

Parameters
[in]hDeviceA device handle identifying the device.
[out]pBufferA pointer to a buffer for the name.
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
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 ( LibTiePieHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the short name of the device.

E.g. HS5-530XMS

Parameters
[in]hDeviceA device handle identifying the device.
[out]pBufferA pointer to a buffer for the name.
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
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 ( LibTiePieHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the short name of the device without model postfix.

E.g. HS5

Parameters
[in]hDeviceA device handle identifying the device.
[out]pBufferA pointer to a buffer for the name.
[in]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_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
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