Barst  2.0
A server that controls lab hardware.
Public Member Functions | Public Attributes | List of all members
CChannelFTDI Class Reference
Inheritance diagram for CChannelFTDI:
CDevice

Public Member Functions

 CChannelFTDI (SChanInitFTDI &sChanInit, SBase *pInit, DWORD dwSize, FT_DEVICE_LIST_INFO_NODE &FTInfo, const TCHAR szPipe[], int nChan, int &nError, LARGE_INTEGER &llStart)
 
void ProcessData (const void *pHead, DWORD dwSize, __int64 llId)
 
void Result (void *pHead, bool bPass)
 
DWORD GetInfo (void *pHead, DWORD dwSize)
 
DWORD ThreadProc ()
 
- Public Member Functions inherited from CDevice
 CDevice (const TCHAR szName[])
 

Public Attributes

const FT_DEVICE_LIST_INFO_NODE m_FTInfo
 
const std::tstring m_csPipeName
 
const int m_nChan
 
- Public Attributes inherited from CDevice
const std::tstring m_csName
 

Additional Inherited Members

- Protected Attributes inherited from CDevice
CCommm_pcComm
 
CLogBufferm_pcLogBuffer
 
CMemPoolm_pcMemPool
 
bool m_bError
 

Detailed Description

Definition at line 44 of file ftdi device.h.

Constructor & Destructor Documentation

◆ CChannelFTDI()

CChannelFTDI::CChannelFTDI ( SChanInitFTDI sChanInit,
SBase pInit,
DWORD  dwSize,
FT_DEVICE_LIST_INFO_NODE FTInfo,
const TCHAR  szPipe[],
int  nChan,
int &  nError,
LARGE_INTEGER &  llStart 
)

Creates an FTDI channel. sChanInit initializes the main channel params. pInit is a buffer of size dwSize that holds a list of all the devices used by this channel. Each device has an SBase struct identifying the device type struct following followed by the device init sturct. The channel numbers assigned to the devices will be in order of the devices in the buffer. We do not check if multiple devices use the same pins (which is invalid). See the API for how we initialize a channel. FTInfo is struct describing this channel. szPipe is the pipe name exclusive for this channel (see the API for how they are named). nChan is this channel's number in the FTDI manager. nError return an error code if something went wrong. llStart returns the offset of the timer for this channel. You can use this to convert the time sent with each frame to another common time (see API).

Definition at line 299 of file ftdi device.cpp.

Member Function Documentation

◆ GetInfo()

DWORD CChannelFTDI::GetInfo ( void *  pHead,
DWORD  dwSize 
)
virtual

This function copies chennel specific info into pHead which could then be sent to the user in response to a query request. If phead is NULL, the function returns the required size of pHead. If non NULL, dwSize if the sise of pHead and the function returns the total size of the data copied into pHead. This funcion followes the rules where every sub-struct is proceeded by an SBase. Typically, it returns an SBaseOut sturct which holds the name of the device followed by channels specific structs.

Implements CDevice.

Definition at line 691 of file ftdi device.cpp.

◆ ProcessData()

void CChannelFTDI::ProcessData ( const void *  pHead,
DWORD  dwSize,
__int64  llId 
)
virtual

Comm calls this function when a user sent data to the device.

Implements CDevice.

Definition at line 749 of file ftdi device.cpp.

◆ Result()

void CChannelFTDI::Result ( void *  pHead,
bool  bPass 
)
inlinevirtual

Comm calls this function when it finished writing data to user sent by this device. phead is the pHead parameter in the SData struct that was sent with SendData() bPass is true if successfull and false otherwise.

Implements CDevice.

Definition at line 63 of file ftdi device.h.