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
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
~Advertisement();
Destroys the Advertisement.
Member Functions
attributes
Poco::Net::NameValueCollection & attributes();
Returns the Advertisement's attributes.
attributes
const Poco::Net::NameValueCollection & attributes() const;
Returns the Advertisement's attributes.
expired
bool expired() const;
Returns true if and only if the Advertisement has expired.
lastSeen
Poco::Timestamp lastSeen() const;
Returns the time the Advertisement was last seen.
lifetime
int lifetime() const;
Returns the lifetime, in seconds, of the Advertisement.
location
const std::string & location() const;
Returns the URI for obtaining the device or service description.
notificationType
const URN & notificationType() const;
Returns the notification type.
renew
void renew();
Renews the Advertisement by updating the lastSeen variable.
type
Type type() const;
Returns the type of the Advertisement.
uniqueServiceName
const UniqueServiceName & uniqueServiceName() const;
Returns the unique service name.
determineType
void determineType();