Public Member Functions | Friends | Related Functions

# HDiscoveryRequest Class Reference
[Ssdp]

Class representing an M-SEARCH (ssdp:discover) message. More...

`#include <HDiscoveryRequest>`

List of all members.

## Public Member Functions
| HDiscoveryRequest ()
| HDiscoveryRequest (qint32 mx, const HDiscoveryType &resource, const HProductTokens &userAgent)
HDiscoveryRequest & | operator= (const HDiscoveryRequest &)
bool | isValid (HValidityCheckLevel level) const
HDiscoveryType | searchTarget () const
qint32 | mx () const
HProductTokens | userAgent () const
## Friends
H_UPNP_CORE_EXPORT bool | operator== (const HDiscoveryRequest &, const HDiscoveryRequest &)
## Related Functions
(Note that these are not member functions.)
H_UPNP_CORE_EXPORT bool | operator!= (const HDiscoveryRequest &, const HDiscoveryRequest &)

## Detailed Description

Usually, you create instances of this class to be sent by the Herqq::Upnp::HSsdp, or you receive instances of this class from the Herqq::Upnp::HSsdp.

Remarks:
  the class provides an assignment operator, which is not thread-safe.

See also:
  HSsdp

## Constructor & Destructor Documentation

HDiscoveryRequest | ( |  | ) |

Constructs a new, empty instance.

The constructed object is not valid, i.e isValid() returns false.

See also:
  isValid()

HDiscoveryRequest | ( | qint32 | mx,
|  | const HDiscoveryType & | resource,
|  | const HProductTokens & | userAgent |
| ) |  |  |

Creates a new instance based on the provided parameters.

The constructed object will be invalid, i.e. isValid() returns false in case the provided information is invalid.

Parameters:

  | mx | specifies the maximum wait time in seconds.
  | resource | specifies the Search Target (ST). If the object is invalid, the created object will be invalid.
  | userAgent | specifies information about the requester.

Remarks:
  - if userAgent identifies a UPnP v1.1 requester:
    - if mx is smaller than 1 it is set to 1 and
    - if mx is larger than 5 it it set to 5.
  - if userAgent does not specify UPnP version (it always should however) or the userAgent identifies a UPnP v1.0 requester:
    - if mx is smaller than 0 it is set to 0 and
    - if mx is larger than 120 it it set to 120.

See also:
  isValid(), mx(), searchTarget(), userAgent()

## Member Function Documentation

HDiscoveryRequest & operator= | ( | const HDiscoveryRequest & | other | ) |

Assigns the contents of the other to this.

Returns:
  a reference to this.

bool isValid | ( | HValidityCheckLevel | level | ) | const

Indicates whether or not the object contains valid announcement information.

Parameters:

  | level | indicates whether the check should be strictly according to the UDA specification. If set to false some checks are omitted that are known to be poorly implemented in some UPnP software.

Returns:
  true in case the objects contains valid announcement information in terms of the requested strictness.

HDiscoveryType searchTarget | ( |  | ) | const

Returns the Search Target of the request.

Returns:
  the Search Target of the request.

qint32 mx | ( |  | ) | const

Returns the maximum wait time in seconds.

According to UDA, Device responses SHOULD be delayed a random duration between 0 and this many seconds to balance load for the control point when it processes responses.

Returns:
  the maximum wait time in seconds.

HProductTokens userAgent | ( |  | ) | const

Returns information about the maker of the request.

Returns:
  information about the maker of the request.

## Friends And Related Function Documentation

H_UPNP_CORE_EXPORT bool operator== | ( | const HDiscoveryRequest & | ,
|  | const HDiscoveryRequest & |  |
| ) |  |  | `[friend]`

Compares the two objects for equality.

Returns:
  true in case the objects are logically equivalent.

H_UPNP_CORE_EXPORT bool operator!= | ( | const HDiscoveryRequest & | ,
|  | const HDiscoveryRequest & |  |
| ) |  |  | `[related]`

Compares the two objects for inequality.

Returns:
  true in case the objects are not logically equivalent.