本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
}
示例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);
}
示例5: Added
void CpDevices::Added(CpDevice& aDevice)
{
iLock.Wait();
if (aDevice.Udn() == iTargetUdn) {
iDevices.push_back(&aDevice);
aDevice.AddRef();
iAddedSem.Signal();
}
iLock.Signal();
}
示例6: Added
void CpDevices::Added(CpDevice& aDevice)
{
iLock.Wait();
if (aDevice.Udn() == gDeviceName) {
iList.push_back(&aDevice);
aDevice.AddRef();
iAddedSem.Signal();
}
iLock.Signal();
}
示例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();
}
示例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();
}
示例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");
}
}
示例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();
}
示例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");
}
示例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();
}
示例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();
}
示例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);
}
}
示例15: return
TBool CpTopology2Device::IsAttachedTo(CpDevice& aDevice)
{
return (iDevice.Udn() == aDevice.Udn());
}