beautypg.com

Get connected devices list – Teledyne LeCroy Sierra SAS_SATA Protocol Analyzer STX API Reference Manual User Manual

Page 163

background image


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

Using Infusion API 163

Get connected devices list

First call the Refresh function to update the device collection. Then call

AfxGetAppDeliverableFolder() to get the Application folder and pass it to the InfApi object as

the system path. To get connected-devices information, get their numbers from the Device

Manager object, inside a loop, by accessing MacId and DeviceName. You can decide how to

show their information in your API.

// Call Refresh to update the device collection.

EINFRC eRC = pDeviceManager->GetDeviceCollection()->Refresh();

// Set the working directory to InfApi.

CString str = AfxGetAppDeliverableFolder();

pInfApi->SetSysPath(str);

// Get Connected device list one by one.

CIBApiDeviceCollection * DevListManager;

DevListManager = pDeviceManager->GetDeviceCollection();

int

DeviceCount = DevListManager->GetDeviceCount();

for

(

int

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

{

CIBApiDevice* pDevice = DevListManager->GetNextDevice();

CString sDevMacId = pDevice->GetDeviceInfo()->GetID().GetText();

CString sDevName = pDevice->GetDeviceInfo()->GetRefName();

// Add your list functions here . . .

// . . .

}