libtiepie
 All Files Functions Typedefs Groups
Device

Modules

 Events

Functions

void DevClose (TpDeviceHandle_t hDevice)
bool8_t DevIsRemoved (TpDeviceHandle_t hDevice)
TpVersion_t DevGetDriverVersion (TpDeviceHandle_t hDevice)
TpVersion_t DevGetFirmwareVersion (TpDeviceHandle_t hDevice)
TpDate_t DevGetCalibrationDate (TpDeviceHandle_t hDevice)
uint32_t DevGetSerialNumber (TpDeviceHandle_t hDevice)
uint32_t DevGetProductId (TpDeviceHandle_t hDevice)
uint32_t DevGetVendorId (TpDeviceHandle_t hDevice)
uint32_t DevGetName (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
uint32_t DevGetNameShort (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)

Detailed Description


Function Documentation

void DevClose ( TpDeviceHandle_t  hDevice)

Close a device handle.

Parameters:
hDevicethe handle to close
TpDate_t DevGetCalibrationDate ( TpDeviceHandle_t  hDevice)

Get the calibration date of the instrument.

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 );
Parameters:
hDevicea device handle
Returns:
Instruments calibration date
TpVersion_t DevGetDriverVersion ( TpDeviceHandle_t  hDevice)

Get version number of the driver.

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 );
Parameters:
hDevicea device handle
Returns:
Library version number
TpVersion_t DevGetFirmwareVersion ( TpDeviceHandle_t  hDevice)

Get version number of the firmware.

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 );
Parameters:
hDevicea device handle
Returns:
Firmware version number
uint32_t DevGetName ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instruments name.

Example:

uint32_t dwLength = DevGetName( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char sName[ dwLength ];
dwLength = DevGetName( hDevice , sName , dwLength );
printf( "DevGetName = %s\n" , Name );
See also:
DevGetNameShort
Parameters:
hDevicea device handle
pBufferpointer to buffer to write to
dwBufferLengthlength of the buffer
Returns:
Length of the short name excluding excluding terminating zero.
uint32_t DevGetNameShort ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instruments short name.

Example:

uint32_t dwLength = DevGetNameShort( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char sNameShort[ dwLength ];
dwLength = DevGetNameShort( hDevice , sNameShort , dwLength );
printf( "DevGetNameShort = %s\n" , Name );
See also:
DevGetName
Parameters:
hDevicea device handle
pBufferpointer to buffer to write to
dwBufferLengthlength of the buffer
Returns:
Length of the short name excluding excluding terminating zero.
uint32_t DevGetProductId ( TpDeviceHandle_t  hDevice)

Get the instruments Product ID.

Parameters:
hDevicea device handle
Returns:
Instruments Product ID
uint32_t DevGetSerialNumber ( TpDeviceHandle_t  hDevice)

Get the instruments serial number.

Parameters:
hDevicea device handle
Returns:
Instruments serial number
uint32_t DevGetVendorId ( TpDeviceHandle_t  hDevice)

Get the instruments Vendor ID.

Parameters:
hDevicea device handle
Returns:
Instruments Vendor ID
bool8_t DevIsRemoved ( TpDeviceHandle_t  hDevice)

Check whether an instrument is removed.

Parameters:
hDevicea device handle
Returns:
1 if removed else 0