InvocationUpnp::InvocationUpnp(CpStack& aCpStack, Invocation& aInvocation) : iCpStack(aCpStack) , iInvocation(aInvocation) , iReadBuffer(iSocket) , iReaderResponse(aCpStack.GetStack(), iReadBuffer) { }
void TestInvocation(CpStack& aCpStack) { gActionCount = 0; // reset this here in case we're run multiple times via TestShell Stack& stack = aCpStack.GetStack(); 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 */ stack.InitParams().SetAsyncErrorHandler(dummy); Debug::SetLevel(Debug::kNone); DeviceListTI* deviceList = new DeviceListTI(stack); FunctorCpDevice added = MakeFunctorCpDevice(*deviceList, &DeviceListTI::Added); FunctorCpDevice removed = MakeFunctorCpDevice(*deviceList, &DeviceListTI::Removed); const Brn domainName("upnp.org"); const Brn serviceType("ConnectionManager"); #if 1 const TUint ver = 1; CpDeviceListUpnpServiceType* list = new CpDeviceListUpnpServiceType(aCpStack, domainName, serviceType, ver, added, removed); #else const Brn uuid("7076436f-6e65-1063-8074-000da201f542"); CpDeviceListUpnpUuid* list = new CpDeviceListUpnpUuid(aCpStack, uuid, added, removed); #endif Blocker* blocker = new Blocker(stack); blocker->Wait(stack.InitParams().MsearchTimeSecs()); delete blocker; deviceList->Stop(); TUint startTime = Os::TimeInMs(); //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()-startTime+500)/1000); delete list; delete deviceList; }
static void RunTestSsdpUListen(CpStack& aCpStack, DvStack& /*aDvStack*/, const std::vector<Brn>& aArgs) { TestSsdpUListen(aCpStack.GetStack(), aArgs); }