Poco::UPnP::SSDP

class Advertisement

File Information

Library: UPnP/SSDP
Package: SSDP
Header: Poco/UPnP/SSDP/Advertisement.h

Description

An Advertisement contains all data transferred via a SSDP Discovery message.

Advertisement objects are used with the SSDPResponder and the SSDPBrowser classes.

In addition to UUID, URN, location and lifetime an Advertisement can hold an arbitrary number of attributes. These can provide additional information about an Advertisement, such as the server ID of the device sending the advertisement, as well as the sender's IP address. Attributes can also be used by an application to add application-specific data to an Advertisement.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: attributes, determineType, expired, lastSeen, lifetime, location, notificationType, renew, type, uniqueServiceName

Inherited Functions: duplicate, referenceCount, release

Types

Ptr

typedef Poco::AutoPtr < Advertisement > Ptr;

Enumerations

Anonymous

DEFAULT_LIFETIME = 120

Default lifetime of advertisements in seconds.

Type

AD_ROOT_DEVICE

AD_DEVICE

AD_DEVICE_TYPE

AD_SERVICE_TYPE

Constructors

Advertisement

Advertisement(
    Type type,
    const Poco::UUID & deviceUUID,
    const std::string & location,
    int lifetime = DEFAULT_LIFETIME
);

Creates an Advertisement for the given root device or embedded device with the given XML device description location (URI) and lifetime in seconds.

Type must be ANNOUNCE_ROOT_DEVICE or ANNOUNCE_DEVICE.

Advertisement

Advertisement(
    const Poco::UUID & deviceUUID,
    const URN & deviceOrServiceURN,
    const std::string & location,
    int lifetime = DEFAULT_LIFETIME
);

Creates an Advertisement for a device type or service type.

Advertisement

Advertisement(
    const std::string & notificationType,
    const std::string & uniqueServiceName,
    const std::string & location,
    int lifetime = DEFAULT_LIFETIME
);

Creates an Advertisement for the given notificationType, uniqueServiceName and with the given timestamp and lifetime (in seconds).

Advertisement

Advertisement(
    const URN & notificationType,
    const UniqueServiceName & uniqueServiceName,
    const std::string & location,
    int lifetime = DEFAULT_LIFETIME
);

Creates an Advertisement for the given notificationType, uniqueServiceName and with the given timestamp and lifetime (in seconds).

Destructor

~Advertisement virtual

~Advertisement();

Destroys the Advertisement.

Member Functions

attributes inline

Poco::Net::NameValueCollection & attributes();

Returns the Advertisement's attributes.

attributes

const Poco::Net::NameValueCollection & attributes() const;

Returns the Advertisement's attributes.

expired inline

bool expired() const;

Returns true if and only if the Advertisement has expired.

lastSeen inline

Poco::Timestamp lastSeen() const;

Returns the time the Advertisement was last seen.

lifetime inline

int lifetime() const;

Returns the lifetime, in seconds, of the Advertisement.

location inline

const std::string & location() const;

Returns the URI for obtaining the device or service description.

notificationType inline

const URN & notificationType() const;

Returns the notification type.

renew inline

void renew();

Renews the Advertisement by updating the lastSeen variable.

type inline

Type type() const;

Returns the type of the Advertisement.

uniqueServiceName inline

const UniqueServiceName & uniqueServiceName() const;

Returns the unique service name.

determineType protected

void determineType();

Securely control IoT edge devices from anywhere   Connect a Device