beautypg.com

Teledyne LeCroy Sierra SAS_SATA Protocol Analyzer STX API Reference Manual User Manual

Page 169

background image


Sierra SAS/SATA Protocol Suite, STX Software API Reference Manual

Using Infusion API 169

The following example shows how to use the SetupTahoe function to set port configuration:

CIBApiDevice* pDevice = GetDevice(0); // Gets Device # 0 from
list.

// See implementation of GetDevice below.

if

(pDevice)

{

BOOL bResSetup = True;

CString strDeviceID;

INFDeviceID DeviceID = pDevice->GetDeviceInfo()->GetID();

strDeviceID.Format("%s", DeviceID.GetText());

strDeviceID.Remove(':');

// Set port configuration to J_J_0_0.

bResSetup= pDevice-
>SetupTahoe(strDeviceID,INI_DEVICE_CONFIG_J_J_0_0);

}

// Get Device function.

CIBApiDevice * CInfAppDemoDlg::GetDevice(

int

nItem)

{

if

(!m_pDeviceManager)

return

NULL;

CIBApiDeviceCollection * DevListManager = m_pDeviceManager-
>GetDeviceCollection();

DevListManager->ResetIterator();

int

DeviceCount = DevListManager->GetDeviceCount();

for

(

int

i=0; i < DeviceCount; i++)

{

CIBApiDevice* pDevice = DevListManager->GetNextDevice();

if

(!pDevice)

return

NULL;

if

(i == nItem)

{

return

pDevice;

break

;

}

}