本文整理汇总了C++中DviDevice::GetUriBase方法的典型用法代码示例。如果您正苦于以下问题:C++ DviDevice::GetUriBase方法的具体用法?C++ DviDevice::GetUriBase怎么用?C++ DviDevice::GetUriBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DviDevice
的用法示例。
在下文中一共展示了DviDevice::GetUriBase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DviProtocolUpnpAdapterSpecificData
DviProtocolUpnpAdapterSpecificData* DviProtocolUpnp::AddInterface(const NetworkAdapter& aAdapter)
{
TIpAddress addr = aAdapter.Address();
Bws<Uri::kMaxUriBytes> uriBase;
TUint port = iServer->Port(addr);
DviDevice* root = (iDevice.IsRoot()? &iDevice : iDevice.Root());
root->GetUriBase(uriBase, addr, port, *this);
DviProtocolUpnpAdapterSpecificData* adapter = new DviProtocolUpnpAdapterSpecificData(iDvStack, *this, aAdapter, uriBase, port);
iAdapters.push_back(adapter);
return adapter;
}
示例2: Enable
void DviProtocolUpnp::Enable()
{
iLock.Wait();
// check we have at least the basic attributes requried for advertisement
ASSERT(Domain().Bytes() > 0);
ASSERT(Type().Bytes() > 0);
ASSERT(Version() > 0);
for (TUint i=0; i<iAdapters.size(); i++) {
DviProtocolUpnpAdapterSpecificData* adapter = iAdapters[i];
Bws<Uri::kMaxUriBytes> uriBase;
DviDevice* root = (iDevice.IsRoot()? &iDevice : iDevice.Root());
adapter->UpdateServerPort(*iServer);
root->GetUriBase(uriBase, adapter->Interface(), adapter->ServerPort(), *this);
adapter->UpdateUriBase(uriBase);
adapter->ClearDeviceXml();
if (iDevice.ResourceManager() != NULL) {
const TChar* name = 0;
GetAttribute("FriendlyName", &name);
adapter->BonjourRegister(name, iDevice.Udn(), kProtocolName, iDevice.kResourceDir);
/*GetAttribute("MdnsHostName", &name);
if (name != NULL) {
iDvStack.MdnsProvider()->MdnsSetHostName(name);
Bwh redirectedPath(iDevice.Udn().Bytes() + kProtocolName.Bytes() + iDevice.kResourceDir.Bytes() + 4);
redirectedPath.Append('/');
Uri::Escape(redirectedPath, iDevice.Udn());
redirectedPath.Append('/');
redirectedPath.Append(kProtocolName);
redirectedPath.Append('/');
redirectedPath.Append(iDevice.kResourceDir);
redirectedPath.Append('/');
iDvStack.ServerUpnp().Redirect(Brn("/"), redirectedPath);
}*/
}
}
for (TUint i=0; i<iAdapters.size(); i++) {
iAdapters[i]->SendByeByeThenAlive(*this);
}
iLock.Signal();
QueueAliveTimer();
}