Tipro API
Communicate with Tipro devices
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TiproHidDevice Class Reference

Public Types

enum  ETErrCode {
  terrNone, terrWrongParameter, terrInvalidHandleValue, terrDeviceNotOpened,
  terrGetFeature, terrSetFeature, terrUnknown, terrCmdNotSupportedAtFWLevel,
  terrFWLevelNotAvailable, terrFWLevelChangeFailed, terrWTCDelayExpired, terrWrongSignatureBytes,
  terrResponseTimoutExpired, terrExchStatusVoid, terrExchStatusReqTO, terrExchStatusReqReject,
  terrExchStatusReqFail, terrExchStatusReqSucc, terrExchStatusAnsPend, terrExchStatusAnsTO,
  terrExchStatusAnsReject, terrExchStatusAnsFail, terrExchStatusAnsOK, terrExchStatusFWBug
}
 

Public Member Functions

virtual int Open ()
 Opens device for communication. More...
 
virtual int Close ()
 Closes device. More...
 
 TiproHidDevice ()
 Constructor.
 
 TiproHidDevice (const char path[])
 Constructor. More...
 
virtual ~TiproHidDevice ()
 Destructor.
 
 TiproHidDevice (const TiproHidDevice &other)
 Constructor. More...
 
virtual TiproHidDeviceoperator= (const TiproHidDevice &other)
 Compare operator. More...
 
virtual int SendCommandToConnectedDeviceEx (const UCHAR nCommand, const UCHAR nDest, const UCHAR *pParameters, const int nLen, UCHAR *pResponse, int *nResponseLen)
 Sends command to the device. More...
 
virtual int HIDEnumerateModules ()
 Enumerates modules of the device. More...
 
virtual const char * GetPath ()
 Returns path name of the device. More...
 
virtual hid_device * GetHidDevice ()
 Returns hid_device handle of the device. More...
 
virtual int Reset ()
 Resets the device. More...
 
virtual int GetIndexedStringDescriptor (int lStrIx, wchar_t *pString, int lBufferLen)
 Gets a string from device, based on its string index. More...
 
virtual int GetManufacturerString (wchar_t *pString, int lBufferLen)
 Gets manufacturer string from device. More...
 
virtual int GetProductString (wchar_t *pString, int lBufferLen)
 Gets product string from device. More...
 
virtual int GetSerialNumberString (wchar_t *pString, int lBufferLen)
 Gets serial number string from device. More...
 
virtual int GetModuleVersion (int nIndex, unsigned char *nVerMaj, unsigned char *nVerMin, unsigned char *nVerBuild)
 Gets module version from device, based on module index. More...
 
virtual int GetModuleVersionEx (int nIndex, unsigned char *nVerMaj, unsigned char *nVerMin, unsigned char *nVerBuild, unsigned char *nModuleType, unsigned char *nModuleID)
 Gets module version, type and ID from device, based on module index. More...
 
virtual int GetControllerInfo (int *nVerMaj, int *nVerMin, int *nVerBuild, int *nVerCustom, int *nFWLevel)
 Gets controller version of device. More...
 

Public Attributes

TiproBus g_TiproBus
 

Static Public Attributes

static const UCHAR FRCMD_RESET = 0x00
 
static const UCHAR FRCMD_TMC_IF_DISABLE = 0x01
 
static const UCHAR FRCMD_TMC_IF_ENABLE = 0x02
 
static const UCHAR FRCMD_TMC_IF_V2_ENABLE = 0x03
 
static const UCHAR FRCMD_LEVEL1_CMD = 0x04
 
static const UCHAR FRCMD_CLR_SERIAL_NO = 0x05
 
static const UCHAR FRCMD_OPT_IF = 0x06
 
static const UCHAR FRCMD_FW_LEVEL = 0x07
 
static const UCHAR FRCMD_MID_EXCH = 0x08
 

Constructor & Destructor Documentation

◆ TiproHidDevice() [1/2]

TiproHidDevice::TiproHidDevice ( const char  path[])

Constructor.

Parameters
pathDevice path

◆ TiproHidDevice() [2/2]

TiproHidDevice::TiproHidDevice ( const TiproHidDevice other)

Constructor.

Parameters
otherCreated from that device

Member Function Documentation

◆ Close()

virtual int TiproHidDevice::Close ( )
virtual

Closes device.

Returns
Error code (0 - no error)

◆ GetControllerInfo()

virtual int TiproHidDevice::GetControllerInfo ( int *  nVerMaj,
int *  nVerMin,
int *  nVerBuild,
int *  nVerCustom,
int *  nFWLevel 
)
virtual

Gets controller version of device.

Parameters
[out]nVerMajMajor version of controller
[out]nVerMinMinor version of controller
[out]nVerBuildBuild version of controller
[out]nVerCustomCustom version of controller
[out]nFWLevelFirmware level of controller
Returns
Error code (0 - no error)

◆ GetHidDevice()

virtual hid_device* TiproHidDevice::GetHidDevice ( )
virtual

Returns hid_device handle of the device.

Returns
Handle of hid_device

◆ GetIndexedStringDescriptor()

virtual int TiproHidDevice::GetIndexedStringDescriptor ( int  lStrIx,
wchar_t *  pString,
int  lBufferLen 
)
virtual

Gets a string from device, based on its string index.

Parameters
[in]lStrIxThe index of the string to get
[out]pStringA wide string buffer to put the data into
[in]lBufferLenThe length of the buffer in multiples of wchar_t
Returns
Error code (0 - no error)

◆ GetManufacturerString()

virtual int TiproHidDevice::GetManufacturerString ( wchar_t *  pString,
int  lBufferLen 
)
virtual

Gets manufacturer string from device.

Parameters
[out]pStringA wide string buffer to put the data into
[in]lBufferLenThe length of the buffer in multiples of wchar_t
Returns
Error code (0 - no error)

◆ GetModuleVersion()

virtual int TiproHidDevice::GetModuleVersion ( int  nIndex,
unsigned char *  nVerMaj,
unsigned char *  nVerMin,
unsigned char *  nVerBuild 
)
virtual

Gets module version from device, based on module index.

Parameters
[in]nIndexModule index (zero based, from right to left)
[out]nVerMajMajor version of module
[out]nVerMinMinor version of module
[out]nVerBuildBuild version of module
Returns
Error code (0 - no error)

◆ GetModuleVersionEx()

virtual int TiproHidDevice::GetModuleVersionEx ( int  nIndex,
unsigned char *  nVerMaj,
unsigned char *  nVerMin,
unsigned char *  nVerBuild,
unsigned char *  nModuleType,
unsigned char *  nModuleID 
)
virtual

Gets module version, type and ID from device, based on module index.

Parameters
[in]nIndexModule index (zero based, from right to left)
[out]nVerMajMajor version of module
[out]nVerMinMinor version of module
[out]nVerBuildBuild version of module
[out]nModuleTypeModule type
[out]nModuleIDModule ID
Returns
Error code (0 - no error)

◆ GetPath()

virtual const char* TiproHidDevice::GetPath ( )
virtual

Returns path name of the device.

Returns
Platform-specific device path

◆ GetProductString()

virtual int TiproHidDevice::GetProductString ( wchar_t *  pString,
int  lBufferLen 
)
virtual

Gets product string from device.

Parameters
[out]pStringA wide string buffer to put the data into
[in]lBufferLenThe length of the buffer in multiples of wchar_t
Returns
Error code (0 - no error)

◆ GetSerialNumberString()

virtual int TiproHidDevice::GetSerialNumberString ( wchar_t *  pString,
int  lBufferLen 
)
virtual

Gets serial number string from device.

Parameters
[out]pStringA wide string buffer to put the data into
[in]lBufferLenThe length of the buffer in multiples of wchar_t
Returns
Error code (0 - no error)

◆ HIDEnumerateModules()

virtual int TiproHidDevice::HIDEnumerateModules ( )
virtual

Enumerates modules of the device.

Returns
Error code (0 - no error)

◆ Open()

virtual int TiproHidDevice::Open ( )
virtual

Opens device for communication.

Returns
Error code (0 - no error)

◆ operator=()

virtual TiproHidDevice& TiproHidDevice::operator= ( const TiproHidDevice other)
virtual

Compare operator.

Parameters
otherDevice to compare to

◆ Reset()

virtual int TiproHidDevice::Reset ( )
virtual

Resets the device.

Returns
Error code (0 - no error)

◆ SendCommandToConnectedDeviceEx()

virtual int TiproHidDevice::SendCommandToConnectedDeviceEx ( const UCHAR  nCommand,
const UCHAR  nDest,
const UCHAR *  pParameters,
const int  nLen,
UCHAR *  pResponse,
int *  nResponseLen 
)
virtual

Sends command to the device.

Parameters
nCommandCommand
nDestDestination
pParametersData
nLenLength of data
pResponseAnswer data
nResponseLenLength of answer data
Returns
Error code (0 - no error)

The documentation for this class was generated from the following file: