IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QCoapOption Class

The QCoapOption class holds data about CoAP options.

All functions in this class are reentrant.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QCoapOption Class

  • Header: QCoapOption

  • qmake: QT += coap

Detailed Description

CoAP defines a number of options that can be included in a message. Both requests and responses may include a list of one or more options. For example, the URI in a request is transported in several options, and metadata that would be carried in an HTTP header in HTTP is supplied as options as well.

An option contains a name, related to an option ID, and a value. The name is one of the values from the OptionName enumeration.

Member Type Documentation

 

enum QCoapOption::OptionName

Indicates the name of an option. The value of each ID is as specified by the CoAP standard, with the exception of Invalid. You can refer to RFC 7252 and RFC 7959 for more details.

Constant

Value

Description

QCoapOption::Invalid

0

An invalid option.

QCoapOption::IfMatch

1

If-Match option.

QCoapOption::UriHost

3

Uri-Host option.

QCoapOption::Etag

4

Etag option.

QCoapOption::IfNoneMatch

5

If-None-Match option.

QCoapOption::Observe

6

Observe option.

QCoapOption::UriPort

7

Uri-Port option.

QCoapOption::LocationPath

8

Location-path option.

QCoapOption::UriPath

11

Uri-Path option.

QCoapOption::ContentFormat

12

Content-Format option.

QCoapOption::MaxAge

14

Max-Age option.

QCoapOption::UriQuery

15

Uri-Query option.

QCoapOption::Accept

17

Accept option.

QCoapOption::LocationQuery

20

Location-Query option.

QCoapOption::Block2

23

Block2 option.

QCoapOption::Block1

27

Block1 option.

QCoapOption::Size2

28

Size2 option.

QCoapOption::ProxyUri

35

Proxy-Uri option.

QCoapOption::ProxyScheme

39

Proxy-Scheme option.

QCoapOption::Size1

60

Size1 option.

Member Function Documentation

 

QCoapOption::QCoapOption(QCoapOption::OptionName name = Invalid, const QByteArray &opaqueValue = QByteArray())

Constructs a new CoAP option with the given name and QByteArray opaqueValue. If no parameters are passed, constructs an Invalid object.

See Also

See also isValid()

QCoapOption::QCoapOption(QCoapOption::OptionName name, const QString &stringValue)

Constructs a new CoAP option with the given name and the QString stringValue.

See Also

See also isValid()

QCoapOption::QCoapOption(QCoapOption::OptionName name, quint32 intValue)

Constructs a new CoAP option with the given name and the unsigned integer intValue.

See Also

See also isValid()

QCoapOption::QCoapOption(const QCoapOption &other)

Constructs a new CoAP option as a copy of other, making the two options identical.

See Also

See also isValid()

QCoapOption::QCoapOption(QCoapOption &&other)

Move-constructs a QCoapOption, making it point to the same object as other was pointing to.

QCoapOption::~QCoapOption()

Destroys the QCoapOption object.

bool QCoapOption::isValid() const

Returns true if the option is valid.

int QCoapOption::length() const

Returns the length of the value of the option.

QCoapOption::OptionName QCoapOption::name() const

Returns the name of the option.

QByteArray QCoapOption::opaqueValue() const

Returns the value of the option.

QString QCoapOption::stringValue() const

Returns the QString value of the option.

void QCoapOption::swap(QCoapOption &other)

Swaps this option with other. This operation is very fast and never fails.

quint32 QCoapOption::uintValue() const

Returns the integer value of the option.

bool QCoapOption::operator!=(const QCoapOption &other) const

Returns true if this QCoapOption and other are different.

QCoapOption &QCoapOption::operator=(const QCoapOption &other)

Copies other into this option, making the two options identical. Returns a reference to this QCoapOption.

QCoapOption &QCoapOption::operator=(QCoapOption &&other)

Move-assignment operator.

bool QCoapOption::operator==(const QCoapOption &other) const

Returns true if this QCoapOption and other are equals.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+