Herqq

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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 ()
| HDiscoveryRequest (const HDiscoveryRequest &)
HDiscoveryRequest & | operator= (const HDiscoveryRequest &)
bool | isValid (HValidityCheckLevel level) const
const HDiscoveryType & | searchTarget () const
qint32 | mx () const
const HProductTokens & | userAgent () const
## Friends
H_UPNP_CORE_EXPORT bool | operator== (const HDiscoveryRequest &, const HDiscoveryRequest &)
## Related Functions
(Note that these are not member functions.)
bool | operator!= (const HDiscoveryRequest &obj1, const HDiscoveryRequest &obj2)

## Detailed Description

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

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()

~HDiscoveryRequest | ( |  | ) |

Destroys the instance.

HDiscoveryRequest | ( | const HDiscoveryRequest & | other | ) |

Copy constructor.

Copies the contents of `other` to this.

## 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.

const 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.

const 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.

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

Compares the two objects for inequality.

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