本文整理汇总了C++中DviDevice::AddService方法的典型用法代码示例。如果您正苦于以下问题:C++ DviDevice::AddService方法的具体用法?C++ DviDevice::AddService怎么用?C++ DviDevice::AddService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DviDevice
的用法示例。
在下文中一共展示了DviDevice::AddService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Test
void SuiteMsearch::Test()
{
DviDevice* device = new DviDeviceStandard(iDvStack, gNameDevice1);
iDevices[0] = device;
device->SetAttribute("Upnp.Domain", "upnp.org");
device->SetAttribute("Upnp.Type", "test1");
device->SetAttribute("Upnp.Version", "1");
AddService(device, new DviService(iDvStack, "upnp.org", "service1", 1));
AddService(device, new DviService(iDvStack, "openhome.org", "service2", 3));
AddService(device, new DviService(iDvStack, "upnp.org", "service3", 1));
DviService* service = new DviService(iDvStack, "upnp.org", "service1", 1);
TEST_THROWS(device->AddService(service), AssertionFailed);
service->RemoveRef();
device->SetEnabled();
service = new DviService(iDvStack, "upnp.org", "service4", 1);
TEST_THROWS(device->AddService(service), AssertionFailed);
service->RemoveRef();
device = new DviDeviceStandard(iDvStack, gNameDevice2);
iDevices[1] = device;
device->SetAttribute("Upnp.Domain", "openhome.org");
device->SetAttribute("Upnp.Type", "test2");
device->SetAttribute("Upnp.Version", "2");
AddService(device, new DviService(iDvStack, "openhome.org", "service4", 2));
AddService(device, new DviService(iDvStack, "openhome.org", "service5", 1));
device = new DviDeviceStandard(iDvStack, gNameDevice2Embedded1);
iDevices[1]->AddDevice(device);
device->SetAttribute("Upnp.Domain", "openhome.org");
device->SetAttribute("Upnp.Type", "test3");
device->SetAttribute("Upnp.Version", "1");
AddService(device, new DviService(iDvStack, "upnp.org", "service1", 1));
AddService(device, new DviService(iDvStack, "openhome.org", "service6", 1));
AddService(device, new DviService(iDvStack, "openhome.org", "service2", 3));
service = new DviService(iDvStack, "openhome.org", "service5", 1);
TEST_THROWS(device->AddService(service), AssertionFailed);
service->RemoveRef();
iDevices[1]->SetEnabled();
device->SetEnabled();
device = new DviDeviceStandard(iDvStack, kNameDummy);
TEST_THROWS(iDevices[1]->AddDevice(device), AssertionFailed);
device->Destroy();
//Wait(); // allow time for initial annoucements to be delivered
TestMsearchAll();
TestMsearchRoot();
TestMsearchUuid();
TestMsearchDeviceType();
TestMsearchServiceType();
}
示例2: iDelayPropertyUpdates
DvProvider::DvProvider(DviDevice& aDevice, const TChar* aDomain, const TChar* aType, TUint aVersion)
: iDelayPropertyUpdates(false)
, iPropertyChanged(false)
{
iService = new DviService(aDomain, aType, aVersion);
aDevice.AddService(iService); // ownership of service passed to aDevice
}