当前位置: 首页>>代码示例>>C++>>正文


C++ CpDevice::Udn方法代码示例

本文整理汇总了C++中CpDevice::Udn方法的典型用法代码示例。如果您正苦于以下问题:C++ CpDevice::Udn方法的具体用法?C++ CpDevice::Udn怎么用?C++ CpDevice::Udn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CpDevice的用法示例。


在下文中一共展示了CpDevice::Udn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestSync

void DeviceListTI::TestSync()
{
    // trivial validation of the sync wrappers to all APIs
    // single sync call to whichever device happens to be first in our list
    if (iList.size() == 0) {
        Print("No devices found, so nothing to test\n");
        return;
    }
    CpDevice* device = iList[0];
    Print("Sync call to device ");
    Print(device->Udn());
    Print("\n");
    iConnMgr = new CpProxyUpnpOrgConnectionManager1(*device);
    Brh source;
    Brh sink;
    try {
        iConnMgr->SyncGetProtocolInfo(source, sink);
    }
    catch(ProxyError) {}
#if 0
    Print("source is ");
    Print(source);
    Print("\nsink is ");
    Print(sink);
    Print("\n");
#endif
    delete iConnMgr;
}
开发者ID:MatthewMiddleweek,项目名称:ohNet,代码行数:28,代码来源:TestInvocation.cpp

示例2: Poll

void DeviceList::Poll()
{
    Functor updatesComplete = MakeFunctor(*this, &DeviceList::InitialNotificationComplete);
    const TUint count = (TUint)iList.size();
    for (TUint i=0; i<count; i++) {
        CpDevice* device = iList[i];
        TUint countBefore = gSubscriptionCount;
        Print("Device ");
        Print(device->Udn());
        CpProxyUpnpOrgConnectionManager1* connMgr = new CpProxyUpnpOrgConnectionManager1(*device);
        connMgr->SetPropertyChanged(updatesComplete);
        TUint startTime = Os::TimeInMs(iEnv.OsCtx());
        while(true) {
            iSem.Clear();
            connMgr->Subscribe();
            try {
                iSem.Wait(kDevicePollMs+1);
            }
            catch(Timeout&) {}
            connMgr->Unsubscribe();
            if (Os::TimeInMs(iEnv.OsCtx()) - startTime > kDevicePollMs) {
                break;
            }
            gSubscriptionCount++;
        }
        Print("    %u\n", gSubscriptionCount - countBefore);
        delete connMgr;
    }
}
开发者ID:ACDN,项目名称:ohNet,代码行数:29,代码来源:TestSubscription.cpp

示例3: Removed

void DeviceListTI::Removed(CpDevice& aDevice)
{
    if (iStopped) {
        return;
    }

    AutoMutex a(iLock);
    const TUint count = (TUint)iList.size();
    for (TUint i=0; i<count; i++) {
        CpDevice* device = iList[i];
        if (device->Udn() == aDevice.Udn()) {
            iList[i] = NULL;
            iList.erase(iList.begin()+i);
            device->RemoveRef();
            break;
        }
    }
}
开发者ID:MatthewMiddleweek,项目名称:ohNet,代码行数:18,代码来源:TestInvocation.cpp

示例4: Added

void CpDeviceList::Added(CpiDevice& aDevice)
{
    CpDevice* device = new CpDevice(aDevice);
    /* No mutex used for Added or Removed as we assume the underlying list's
       lock already protects us */
    Brn udn(device->Udn());
    iMap.insert(std::pair<Brn,CpDevice*>(udn, device));
    iAdded(*device);
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:9,代码来源:CpDeviceCore.cpp

示例5: Added

void CpDevices::Added(CpDevice& aDevice)
{
    iLock.Wait();
    if (aDevice.Udn() == iTargetUdn) {
        iDevices.push_back(&aDevice);
        aDevice.AddRef();
        iAddedSem.Signal();
    }
    iLock.Signal();
}
开发者ID:Montellese,项目名称:ohNet,代码行数:10,代码来源:TestAdapterChange.cpp

示例6: Added

void CpDevices::Added(CpDevice& aDevice)
{
    iLock.Wait();
    if (aDevice.Udn() == gDeviceName) {
        iList.push_back(&aDevice);
        aDevice.AddRef();
        iAddedSem.Signal();
    }
    iLock.Signal();
}
开发者ID:astaykov,项目名称:ohNet,代码行数:10,代码来源:TestDvSubscription.cpp

示例7: Added

void CpDevices::Added(CpDevice& aDevice)
{
    iLock.Wait();
    const Brx& udn = aDevice.Udn();
    if (udn == gNameDevice1 || udn == gNameDevice1_1 || udn == gNameDevice1_2 || udn == gNameDevice2) {
        iList.push_back(&aDevice);
        aDevice.AddRef();
    }
    iLock.Signal();
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:10,代码来源:TestDviDeviceList.cpp

示例8: Removed

void CpDevices::Removed(CpDevice& aDevice)
{
    iLock.Wait();
    for (TUint i=0; i<(TUint)iDevices.size(); i++) {
        if (iDevices[i]->Udn() == aDevice.Udn()) {
            iDevices[i]->RemoveRef();
            iDevices.erase(iDevices.begin() + i);
            break;
        }
    }
    iLock.Signal();
}
开发者ID:Montellese,项目名称:ohNet,代码行数:12,代码来源:TestAdapterChange.cpp

示例9: Show

void DimmableLightList::Show()
{
    AutoMutex amtx(iMutex);
    for ( DimmableMap::iterator i = iMap.begin() ; i != iMap.end() ; i++ )
    {
        CpDevice* d = i->first;
        DimmableLight* l = i->second;
        Print(d->Udn());
        Print(" %s", (l->GetTarget() ? "on" : "off"));
        //Print(" %d%%", l->GetLoadLevelTarget());
        Print("\n");
    }
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:13,代码来源:TestDimmableLights.cpp

示例10: Added

void CpDevices::Added(CpDevice& aDevice)
{
    iLock.Wait();
    const Brx& udn = aDevice.Udn();
    if (udn == gNameDevice1 || udn == gNameDevice1_1 || udn == gNameDevice1_2 || udn == gNameDevice2) {
        iList.push_back(&aDevice);
        aDevice.AddRef();
    }
    if ((TUint)iList.size() == iTargetCount) {
        iSem.Signal();
    }
    iLock.Signal();
}
开发者ID:astaykov,项目名称:ohNet,代码行数:13,代码来源:TestDviDeviceList.cpp

示例11: PrintDeviceInfo

void TopologyLogger::PrintDeviceInfo(const char* aPrologue, const CpDevice& aDevice)
{
    Print("%s\n    udn = ", aPrologue);
    Print(aDevice.Udn());
    Print("\n    location = ");
    Brh val;
    aDevice.GetAttribute("Upnp.Location", val);
    Print(val);
    Print("\n    name = ");
    aDevice.GetAttribute("Upnp.FriendlyName", val);
    Print(val);
    Print("\n");
}
开发者ID:cedric-andrieu,项目名称:ohTopology,代码行数:13,代码来源:TestTopology1.cpp

示例12: PrintDeviceInfo

void DeviceListLogger::PrintDeviceInfo(const char* aPrologue, const CpDevice& aDevice)
{
    iLock.Wait();
    Print("%s\n    udn = ", aPrologue);
    Print(aDevice.Udn());
    Print("\n    location = ");
    Brh val;
    aDevice.GetAttribute("Upnp.Location", val);
    Print(val);
    Print("\n    name = ");
    aDevice.GetAttribute("Upnp.FriendlyName", val);
    Print(val);
    Print("\n");
    iLock.Signal();
}
开发者ID:astaykov,项目名称:ohNet,代码行数:15,代码来源:TestDeviceList.cpp

示例13: Removed

void CpDevices::Removed(CpDevice& aDevice)
{
    /* A device sends out byebye messages before alives after being enabled.
    (This is required for many buggy control points which don't spot a change of location otherwise.)
    Its possible that the last of these byebyes may get interleaved with the first msearch responses,
    leading to a device being added, removed, then added again.
    Accept that this is possible and cope with devices being removed. */
    iLock.Wait();
    const Brx& udn = aDevice.Udn();
    for (TUint i=0; i<iList.size(); i++) {
        if (iList[i]->Udn() == udn) {
            iList[i]->RemoveRef();
            iList.erase(iList.begin() + i);
            break;
        }
    }
    iLock.Signal();
}
开发者ID:fuzzy01,项目名称:ohNet,代码行数:18,代码来源:TestDviDeviceList.cpp

示例14: Poll

void DeviceListTI::Poll()
{
    Timer timer(iEnv, MakeFunctor(*this, &DeviceListTI::TimerExpired));
    FunctorAsync callback = MakeFunctorAsync(*this, &DeviceListTI::GetProtocolInfoComplete);
    Brh tmp;
    const TUint count = (TUint)iList.size();
    for (TUint i=0; i<count; i++) {
        CpDevice* device = iList[i];
        TUint countBefore = gActionCount;
        Print("Device ");
        Print(device->Udn());
        iConnMgr = new CpProxyUpnpOrgConnectionManager1(*device);
        iStopTimeMs = Os::TimeInMs(iEnv.OsCtx()) + kDevicePollMs;
        timer.FireIn(kDevicePollMs);
        for (TUint j=0; j<iEnv.InitParams()->NumActionInvokerThreads(); j++) {
            iConnMgr->BeginGetProtocolInfo(callback);
        }
        iPollStop.Wait();
        Print("    %u\n", gActionCount - countBefore);
        delete iConnMgr;
        iExpectedSink.TransferTo(tmp);
    }
}
开发者ID:Wodath,项目名称:ohNet,代码行数:23,代码来源:TestInvocation.cpp

示例15: return

TBool CpTopology2Device::IsAttachedTo(CpDevice& aDevice)
{
    return (iDevice.Udn() == aDevice.Udn());
}
开发者ID:fuzzy01,项目名称:ohTopology,代码行数:4,代码来源:CpTopology2.cpp


注:本文中的CpDevice::Udn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。