• CoapOption
  • CoapOption Class

    Represents the option of a CoapPdu. More...

    Header: #include <CoapOption>

    Public Types

    enum Option { IfMatch, UriHost, ETag, IfNoneMatch, ..., Size1 }

    Public Functions

    CoapOption()
    QByteArray data() const
    Option option() const
    void setData(const QByteArray & data)
    void setOption(const CoapOption::Option & option)

    Detailed Description

    Represents the option of a CoapPdu.

    The CoapOption class provides an easy way to create / parse CoAP options of a CoapPdu (Protocol Data Unit). An options can be compared with a HTTP header.

    Member Type Documentation

    enum CoapOption::Option

    Represents the known CoAP options according to RFC7252.

    ConstantValueDescription
    CoapOption::IfMatch1 
    CoapOption::UriHost3 
    CoapOption::ETag4 
    CoapOption::IfNoneMatch5 
    CoapOption::Observe6https://tools.ietf.org/html/rfc7641
    CoapOption::UriPort7 
    CoapOption::LocationPath8 
    CoapOption::UriPath11 
    CoapOption::ContentFormat12 
    CoapOption::MaxAge14 
    CoapOption::UriQuery15 
    CoapOption::Accept17 
    CoapOption::LocationQuery20 
    CoapOption::Block223https://tools.ietf.org/html/draft-ietf-core-block-18
    CoapOption::Block127https://tools.ietf.org/html/draft-ietf-core-block-18
    CoapOption::ProxyUri35 
    CoapOption::ProxyScheme39 
    CoapOption::Size160 

    Member Function Documentation

    CoapOption::CoapOption()

    Constructs a CoapOption.

    QByteArray CoapOption::data() const

    Returns the data of this CoapOption.

    See also setData().

    Option CoapOption::option() const

    Returns the option value of this CoapOption.

    See also setOption().

    void CoapOption::setData(const QByteArray & data)

    Sets the data of this CoapOption to the given data.

    See also data().

    void CoapOption::setOption(const CoapOption::Option & option)

    Sets the option of this CoapOption to the given parameter.

    See also option().