QCoapInternalMessage Class

The QCoapInternalMessage class contains data related to a received message or a message to send. It contains an instance of QCoapMessage and other data for the block management. More...

Header: #include <QCoapInternalMessage>
Inherits: QObject
Inherited By:

QCoapInternalReply and QCoapInternalRequest

Public Functions

QCoapInternalMessage(QObject *parent = nullptr)
QCoapInternalMessage(const QCoapMessage &message, QObject *parent = nullptr)
virtual void addOption(const QCoapOption &option)
void addOption(QCoapOption::OptionName name, const QByteArray &value)
void addOption(QCoapOption::OptionName name, quint32 value)
uint blockSize() const
uint currentBlockNumber() const
bool hasMoreBlocksToReceive() const
virtual bool isValid() const
QCoapMessage *message()
const QCoapMessage *message() const
void removeOption(QCoapOption::OptionName name)

Static Public Members

bool isUrlValid(const QUrl &url)

Protected Functions

QCoapInternalMessage(QCoapInternalMessagePrivate &dd, QObject *parent = nullptr)
void setFromDescriptiveBlockOption(const QCoapOption &option)

Detailed Description

\internal

\reentrant

The QCoapInternalMessage class is inherited by QCoapInternalRequest and QCoapInternalReply that are used internally to manage requests to send and receive replies.

See also QCoapInternalReply, QCoapInternalRequest, and QCoapMessage.

Member Function Documentation

[explicit] QCoapInternalMessage::QCoapInternalMessage(QObject *parent = nullptr)

\internal

Constructs a new QCoapInternalMessage and sets parent as the parent object.

[explicit] QCoapInternalMessage::QCoapInternalMessage(const QCoapMessage &message, QObject *parent = nullptr)

\internal

Constructs a new QCoapInternalMessage with the given message and sets parent as the parent object.

[explicit protected] QCoapInternalMessage::QCoapInternalMessage(QCoapInternalMessagePrivate &dd, QObject *parent = nullptr)

\internalConstructs a new QCoapInternalMessage with dd as the d_ptr. This constructor must be used when subclassing internally the QCoapInternalMessage class.

[virtual] void QCoapInternalMessage::addOption(const QCoapOption &option)

\internal

Adds the given CoAP option.

void QCoapInternalMessage::addOption(QCoapOption::OptionName name, const QByteArray &value)

\internal

This is an overloaded function.

Adds the CoAP option with the given name and value.

void QCoapInternalMessage::addOption(QCoapOption::OptionName name, quint32 value)

\internal

This is an overloaded function.

Adds the CoAP option with the given name and value.

uint QCoapInternalMessage::blockSize() const

\internal

Returns the size of the block.

uint QCoapInternalMessage::currentBlockNumber() const

\internal

Returns the block number

bool QCoapInternalMessage::hasMoreBlocksToReceive() const

\internal

Returns true if it has a next block, false otherwise.

[static] bool QCoapInternalMessage::isUrlValid(const QUrl &url)

\internal

Returns true if URL is considered valid.

See also QCoapRequest::isUrlValid().

[virtual] bool QCoapInternalMessage::isValid() const

\internal

Returns true if the message is considered valid.

See also isUrlValid().

QCoapMessage *QCoapInternalMessage::message()

\internal

Returns a pointer to the message.

const QCoapMessage *QCoapInternalMessage::message() const

\internal

Returns a const pointer to the message.

void QCoapInternalMessage::removeOption(QCoapOption::OptionName name)

\internal

Removes the option with the given name.

[protected] void QCoapInternalMessage::setFromDescriptiveBlockOption(const QCoapOption &option)

\internalSet block information from a descriptive block option. See RFC 7959.

Note: For block-wise transfer, the size of the block is expressed by a power of two. See 'Structure of a Block Option' in RFC 7959 for more information.