本文整理汇总了C++中CpiSubscription::ServiceType方法的典型用法代码示例。如果您正苦于以下问题:C++ CpiSubscription::ServiceType方法的具体用法?C++ CpiSubscription::ServiceType怎么用?C++ CpiSubscription::ServiceType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CpiSubscription
的用法示例。
在下文中一共展示了CpiSubscription::ServiceType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Unsubscribe
void CpiDeviceUpnp::Unsubscribe(CpiSubscription& aSubscription, const Brx& aSid)
{
Uri uri;
GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
EventUpnp eventUpnp(iDevice->GetCpStack(), aSubscription);
eventUpnp.Unsubscribe(uri, aSid);
}
示例2: Subscribe
TUint CpiDeviceDv::Subscribe(CpiSubscription& aSubscription, const OpenHome::Uri& /*aSubscriber*/)
{
Brh sid;
iDeviceDv.CreateSid(sid);
Brn tmp(sid);
Brh transfer(tmp);
aSubscription.SetSid(transfer);
TUint durationSecs = iDeviceCp->GetCpStack().Env().InitParams()->SubscriptionDurationSecs();
DviSubscription* subscriptionDv = new DviSubscription(iDeviceDv.GetDvStack(), iDeviceDv, *this, NULL, sid);
subscriptionDv->AddRef(); // guard against subscription expiring before client tries to renew or unsubscribe
iDeviceDv.GetDvStack().SubscriptionManager().AddSubscription(*subscriptionDv);
subscriptionDv->SetDuration(durationSecs);
iLock.Wait();
if (iSubscriptions.size() == 0) {
iShutdownSem.Wait(); // consume shutdown signal now the map is non-empty
}
Brn sid2(subscriptionDv->Sid());
Subscription* subscription = new Subscription(aSubscription, subscriptionDv);
iSubscriptions.insert(std::pair<Brn,Subscription*>(sid2, subscription));
iDeviceCp->AddRef();
iLock.Signal();
DviService* service = iDeviceDv.ServiceReference(aSubscription.ServiceType());
ASSERT(service != NULL);
service->AddSubscription(subscriptionDv);
service->RemoveRef();
return durationSecs;
}
示例3: Renew
TUint CpiDeviceUpnp::Renew(CpiSubscription& aSubscription)
{
TUint durationSecs = iDevice->GetCpStack().Env().InitParams()->SubscriptionDurationSecs();
Uri uri;
GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
EventUpnp eventUpnp(iDevice->GetCpStack(), aSubscription);
eventUpnp.RenewSubscription(uri, durationSecs);
return durationSecs;
}
示例4: Renew
TUint CpiDeviceUpnp::Renew(CpiSubscription& aSubscription)
{
TUint durationSecs = 30 * 60; // 30 minutes
Uri uri;
GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
EventUpnp eventUpnp(aSubscription);
eventUpnp.RenewSubscription(uri, durationSecs);
return durationSecs;
}
示例5: Subscribe
TUint CpiDeviceUpnp::Subscribe(CpiSubscription& aSubscription, const Uri& aSubscriber)
{
TUint durationSecs = CpiSubscription::kDefaultDurationSecs;
Uri uri;
GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
EventUpnp eventUpnp(aSubscription);
eventUpnp.Subscribe(uri, aSubscriber, durationSecs);
return durationSecs;
}
示例6: Subscribe
TUint CpiDeviceUpnp::Subscribe(CpiSubscription& aSubscription, const Uri& aSubscriber)
{
TUint durationSecs = iDevice->GetCpStack().Env().InitParams().SubscriptionDurationSecs();
Uri uri;
GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
EventUpnp eventUpnp(iDevice->GetCpStack(), aSubscription);
eventUpnp.Subscribe(uri, aSubscriber, durationSecs);
return durationSecs;
}
示例7: Unsubscribe
void CpiDeviceLpec::Unsubscribe(CpiSubscription& aSubscription, const Brx& /*aSid*/)
{
AutoMutex a(iLock);
iWriteBuffer->Write(Lpec::kMethodUnsubscribe);
iWriteBuffer->Write(' ');
iWriteBuffer->Write(iLpecName);
iWriteBuffer->Write('/');
iWriteBuffer->Write(aSubscription.ServiceType().Name());
iWriteBuffer->Write(Lpec::kMsgTerminator);
iWriteBuffer->WriteFlush();
// no great benefit in waiting for a response
}
示例8: Unsubscribe
void CpiDeviceDv::Unsubscribe(CpiSubscription& aSubscription, const Brx& aSid)
{
iLock.Wait();
Brn sid(aSid);
SubscriptionMap::iterator it = iSubscriptions.find(sid);
if (it == iSubscriptions.end()) {
iLock.Signal();
return;
}
Subscription* subscription = it->second;
iLock.Signal();
DviService* service = iDeviceDv.ServiceReference(aSubscription.ServiceType());
if (service != NULL) {
service->RemoveSubscription(aSid);
service->RemoveRef();
}
subscription->iCp = NULL;
subscription->iDv->RemoveRef();
// can't safely access subscription now - RemoveRef() above may have resulted in it being deleted
}
示例9: Subscribe
TUint CpiDeviceLpec::Subscribe(CpiSubscription& aSubscription, const OpenHome::Uri& /*aSubscriber*/)
{
Semaphore sem("CLS2", 0);
SubscriptionResponse resp(sem);
AutoMutex a(iLock);
iResponseHandler = &resp;
iWriteBuffer->Write(Lpec::kMethodSubscribe);
iWriteBuffer->Write(' ');
iWriteBuffer->Write(iLpecName);
iWriteBuffer->Write('/');
iWriteBuffer->Write(aSubscription.ServiceType().Name());
iWriteBuffer->Write(Lpec::kMsgTerminator);
iWriteBuffer->WriteFlush();
sem.Wait();
Bws<128> sid(iDevice->Udn());
sid.Append('-');
sid.Append(resp.SidFragment());
Brh sid2(sid);
aSubscription.SetSid(sid2);
iResponseHandler = NULL;
return UINT_MAX; // subscription never expires so report the longest possible duration
}