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

QCoapResource Class

The QCoapResource class holds information about a discovered resource.

All functions in this class are reentrant.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QCoapResource Class▲

  • Header: QCoapResource

  • qmake: QT += coap

Detailed Description▲

The QCoapRequest contains data as the path and title of the resource and other ancillary information.

See Also▲

Member Function Documentation▲

 

QCoapResource::QCoapResource()▲

Constructs a new QCoapResource.

QCoapResource::QCoapResource(const QCoapResource &other)▲

Constructs a new CoAP resource as a copy of other, making the two resources identical.

QCoapResource::~QCoapResource()▲

Destroy the QCoapResource.

uint QCoapResource::contentFormat() const▲

Returns the Content-Format code of the resource.

The Content-Format code corresponds to the 'ct' attribute and provides a hint about the Content-Formats this resource returns. It is specified in RFC 7252.

See Also▲

See also setContentFormat()

QHostAddress QCoapResource::host() const▲

Returns the host of the resource.

See Also▲

See also setHost()

QString QCoapResource::interface() const▲

Returns the interface description of the resource.

The Interface Description 'if' attribute is an opaque string used to provide a name or URI indicating a specific interface definition used to interact with the target resource. It is specified in RFC 6690.

See Also▲

See also setInterface()

int QCoapResource::maximumSize() const▲

Returns the maximum size of the resource.

The maximum size estimate attribute 'sz' gives an indication of the maximum size of the resource representation returned by performing a GET on the target URI. It is specified in RFC 6690.

See Also▲

See also setMaximumSize()

bool QCoapResource::observable() const▲

Returns true if the resource is observable

See Also▲

See also setObservable()

QString QCoapResource::path() const▲

Returns the path of the resource.

See Also▲

See also setPath()

QString QCoapResource::resourceType() const▲

Returns the type of the resource.

See Also▲

See also setResourceType()

void QCoapResource::setContentFormat(uint contentFormat)▲

Sets the content format of the resource to contentFormat. The content format can be one of the content formats defined in CoAP Content-Formats Registry.

CoAP supports common content formats such as XML, JSON, and so on, but these are text based and consequently heavy both in payload and in processing. One of the recommended content formats to use with CoAP is CBOR, which is designed to be used in such contexts.

See Also▲

void QCoapResource::setHost(const QHostAddress &host)▲

Sets the host of the resource to host.

See Also▲

See also host()

void QCoapResource::setInterface(const QString &interface)▲

Sets the interface of the resource to interface.

See Also▲

See also interface()

void QCoapResource::setMaximumSize(int maximumSize)▲

Sets the maximum size of the resource to maximumSize.

See Also▲

See also maximumSize()

void QCoapResource::setObservable(bool observable)▲

Makes the resource observable if the observable parameter is true.

See Also▲

See also observable()

void QCoapResource::setPath(const QString &path)▲

Sets the path of the resource to path.

See Also▲

See also path()

void QCoapResource::setResourceType(const QString &resourceType)▲

Sets the resource type to resourceType.

See Also▲

See also resourceType()

void QCoapResource::setTitle(const QString &title)▲

Sets the title of the resource to title.

See Also▲

See also title()

void QCoapResource::swap(QCoapResource &other)▲

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

QString QCoapResource::title() const▲

Returns the title of the resource.

See Also▲

See also setTitle()

QCoapResource &QCoapResource::operator=(const QCoapResource &other)▲

Copies other into this resource, making the two resources identical. Returns a reference to this QCoapResource.

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