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");
}
Exemple #2
0
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();
}
void CpDevices::WaitForDeviceDiscovery()
{
    (void)iAddedSem.Clear();
    iAddedSem.Wait(30*1000); // allow up to 30 seconds to issue the msearch and receive a response
    // check that we not only have a device but that its at a different location from previously
    ASSERT(iDevices.size() == 1);
    CpDevice* device = iDevices[0];
    Brh locationBuf;
    ASSERT(device->GetAttribute("Upnp.Location", locationBuf));
    const TChar* location = locationBuf.Extract();
    if (iLocation != NULL) {
        ASSERT(strcmp(location, iLocation) != 0);
    }
    iLocation = location;
}