本文整理汇总了C++中DeviceList::TestSync方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceList::TestSync方法的具体用法?C++ DeviceList::TestSync怎么用?C++ DeviceList::TestSync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceList
的用法示例。
在下文中一共展示了DeviceList::TestSync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: domainName
void OpenHome::TestFramework::Runner::Main(TInt /*aArgc*/, TChar* /*aArgv*/[], InitialisationParams* aInitParams)
{
FunctorAsync dummy;
/* Set an empty handler for errors to avoid test output being swamped by expected
errors from invocations we interrupt at the end of each device's 1s timeslice */
aInitParams->SetAsyncErrorHandler(dummy);
UpnpLibrary::Initialise(aInitParams);
std::vector<NetworkAdapter*>* subnetList = UpnpLibrary::CreateSubnetList();
TIpAddress subnet = (*subnetList)[0]->Subnet();
UpnpLibrary::DestroySubnetList(subnetList);
UpnpLibrary::StartCp(subnet);
Debug::SetLevel(Debug::kNone);
DeviceList* deviceList = new DeviceList;
FunctorCpDeviceCpp added = MakeFunctorCpDeviceCpp(*deviceList, &DeviceList::Added);
FunctorCpDeviceCpp removed = MakeFunctorCpDeviceCpp(*deviceList, &DeviceList::Removed);
std::string domainName("upnp.org");
std::string serviceType("ConnectionManager");
#if 1
const TUint ver = 1;
CpDeviceListCppUpnpServiceType* list =
new CpDeviceListCppUpnpServiceType(domainName, serviceType, ver, added, removed);
#else
const std::string uuid("896659847466-8000600fe800-737837");
CpDeviceListCppUpnpUuid* list = new CpDeviceListCppUpnpUuid(uuid, added, removed);
#endif
Blocker* blocker = new Blocker(*gEnv);
blocker->Wait(aInitParams->MsearchTimeSecs());
delete blocker;
deviceList->Stop();
TUint startTime = Os::TimeInMs(gEnv->OsCtx());
deviceList->TestSync();
deviceList->Poll();
const TUint count = deviceList->Count();
Print("\n%u actions invoked on %u devices (avg %u) in %u seconds\n",
gActionCount, count, (count==0? 0 : gActionCount/count), (Os::TimeInMs(gEnv->OsCtx())-startTime+500)/1000);
delete list;
delete deviceList;
UpnpLibrary::Close();
}