QtCoap Namespace

Contains miscellaneous identifiers used throughout the Qt CoAP module. More...

Header: #include <QtCoap>
qmake: QT += coap

Types

enum Error { Ok, HostNotFound, AddressInUse, TimeOut, BadRequest, …, Unknown }
enum Method { Invalid, Get, Post, Put, Delete, Other }
enum MulticastGroup { AllCoapNodesIPv4, AllCoapNodesIPv6LinkLocal, AllCoapNodesIPv6SiteLocal }
enum Port { DefaultPort, DefaultSecurePort }
enum ResponseCode { EmptyMessage, Created, Deleted, Valid, Changed, …, InvalidCode }
enum SecurityMode { NoSecurity, PreSharedKey, RawPublicKey, Certificate }

Detailed Description

Type Documentation

enum QtCoap::Error

Indicates the error condition found during processing of the request.

ConstantValueDescription
QtCoap::Ok0No error condition.
QtCoap::HostNotFound1The remote host name was not found.
QtCoap::AddressInUse2The address is already in use.
QtCoap::TimeOut3The response did not arrive in time.
QtCoap::BadRequest4The request was not recognized.
QtCoap::Unauthorized5The client is not authorized to perform the requested action.
QtCoap::BadOption6The request could not be understood by the server due to one or more unrecognized or malformed options.
QtCoap::Forbidden7Access to this resource is forbidden.
QtCoap::NotFound8The resource requested was not found.
QtCoap::MethodNotAllowed9The server does not allow the method used for the URL requested.
QtCoap::NotAcceptable10No resource satisfying the request's acceptance criteria was found.
QtCoap::RequestEntityIncomplete11The server has not received the blocks of the request body that it needs to proceed. The client has not sent all blocks, has not sent them in the order required by the server, or sent them long enough ago that the server has already discarded them.
QtCoap::PreconditionFailed12One or more conditions given in the request header fields evaluated to false when tested on the server.
QtCoap::RequestEntityTooLarge13The request payload is larger than the server is willing or able to process.
QtCoap::UnsupportedContentFormat14The payload is in a format not supported by this method on the target resource.
QtCoap::InternalServerFault15The server encountered an unexpected condition that prevented it from fulfilling the request.
QtCoap::NotImplemented16The server does not support the functionality required to fulfill the request.
QtCoap::BadGateway17An error occurred with an upstream server.
QtCoap::ServiceUnavailable18The service is currently unavailable.
QtCoap::GatewayTimeout19The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request.
QtCoap::ProxyingNotSupported20The server is unable or unwilling to act as a forward-proxy for the URI specified in the Proxy-Uri Option or using the scheme specified in Proxy-Scheme.
QtCoap::Unknown21An unknown error occurred.

enum QtCoap::Method

This enum specifies CoAP request methods.

ConstantValueDescription
QtCoap::Invalid0The default request method for an empty request.
QtCoap::Get1GET method.
QtCoap::Post2POST method.
QtCoap::Put3PUT method.
QtCoap::Delete4DELETE method.
QtCoap::Other5Other request method.

enum QtCoap::MulticastGroup

This enum represents CoAP multicast group addresses defined in RFC 7252.

ConstantValueDescription
QtCoap::AllCoapNodesIPv40IPv4 "All CoAP Nodes" address 224.0.1.187, from the "IPv4 Multicast Address Space Registry".
QtCoap::AllCoapNodesIPv6LinkLocal1IPv6 "All CoAP Nodes" link-local scoped address FF02::FD, from the "IPv6 Multicast Address Space Registry".
QtCoap::AllCoapNodesIPv6SiteLocal2IPv6 "All CoAP Nodes" site-local scoped address FF05::FD, from the "IPv6 Multicast Address Space Registry".

enum QtCoap::Port

This enum specifies the default CoAP port values.

ConstantValueDescription
QtCoap::DefaultPort5683The default port used for the non-secure transmission.
QtCoap::DefaultSecurePort5684The default port used for the secure transmission.

enum QtCoap::ResponseCode

This enum represents the response code from the CoAP protocol, as defined in RFC 7252 and RFC 7959.

ConstantValueDescription
QtCoap::EmptyMessage0x00The response code for an empty message.
QtCoap::Created0x41The request was successful and has resulted in new resources being created. This response code corresponds to HTTP 201 "Created".
QtCoap::Deleted0x42The resource has been successfully deleted. This response code corresponds to HTTP 204 "No Content" but is only used in response to requests that cause the resource to cease being available, such as DELETE and, in certain circumstances, POST.
QtCoap::Valid0x43This response code is related to HTTP 304 "Not Modified" but is only used to indicate that the response identified by the entity-tag given in the ETag Option is valid.
QtCoap::Changed0x44The resource has been successfully modified. This response code corresponds to HTTP 204 "No Content" but is only used in response to POST and PUT requests.
QtCoap::Content0x45The request has succeeded. This response code corresponds to HTTP 200 "OK" but is only used in response to GET requests.
QtCoap::Continue0x5FIndicates that the transfer of the current block was successful, and the server will send more blocks.
QtCoap::BadRequest0xffffffffffffff80The request was not recognized. This response code corresponds to HTTP 400 "Bad Request".
QtCoap::Unauthorized0xffffffffffffff81The client is not authorized to perform the requested action. This response code corresponds to HTTP 401 "Unauthorized".
QtCoap::BadOption0xffffffffffffff82The request could not be understood by the server due to unrecognized options.
QtCoap::Forbidden0xffffffffffffff83Access to this resource is forbidden. This response code corresponds to HTTP 403 "Forbidden".
QtCoap::NotFound0xffffffffffffff84The resource requested was not found. This response code corresponds to HTTP 404 "Not Found".
QtCoap::MethodNotAllowed0xffffffffffffff85The server does not allow the method used for the URL requested. This response code corresponds to HTTP 405 "Method Not Allowed" but with no parallel to the "Allow" header field.
QtCoap::NotAcceptable0xffffffffffffff86No resource satisfying the request's acceptance criteria was found. This response code corresponds to HTTP 406 "Not Acceptable", but with no response entity.
QtCoap::RequestEntityIncomplete0xffffffffffffff88The server has not received all blocks, of the request body, that it needs to proceed.
QtCoap::PreconditionFailed0xffffffffffffff8cPreconditions given in the request header fields evaluated to false when tested on the server. This response code corresponds to HTTP 412 "Precondition Failed".
QtCoap::RequestEntityTooLarge0xffffffffffffff8dThe request payload is larger than the server is willing or able to process. This response code corresponds to HTTP 413 "Request Entity Too Large".
QtCoap::UnsupportedContentFormat0xffffffffffffff8eThe payload is in a format not supported by this method on the target resource. This response code corresponds to HTTP 415 "Unsupported Media Type".
QtCoap::InternalServerFault0xffffffffffffffa0The server encountered an unexpected condition that prevented it from fulfilling the request. This response code corresponds to HTTP 500 "Internal Server Error".
QtCoap::NotImplemented0xffffffffffffffa1The server does not support the functionality required to fulfill the request. This response code corresponds to HTTP 501 "Not Implemented".
QtCoap::BadGateway0xffffffffffffffa2An error occurred with an upstream server. This response code corresponds to HTTP 502 "Bad Gateway".
QtCoap::ServiceUnavailable0xffffffffffffffa3The service is currently unavailable. This response code corresponds to HTTP 503 "Service Unavailable".
QtCoap::GatewayTimeout0xffffffffffffffa4The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server. This response code corresponds to HTTP 504 "Gateway Timeout".
QtCoap::ProxyingNotSupported0xffffffffffffffa5The server is unable or unwilling to act as a forward-proxy for the URI specified in the Proxy-Uri Option or using the scheme specified in Proxy-Scheme.
QtCoap::InvalidCode0xFFAn invalid response code.

enum QtCoap::SecurityMode

Specifies the security mode used for securing a CoAP connection, as defined in RFC 7252.

ConstantValueDescription
QtCoap::NoSecurity0There is no protocol-level security (DTLS is disabled).
QtCoap::PreSharedKey1DTLS is enabled. PSK authentication will be used for security.
QtCoap::RawPublicKey2DTLS is enabled. An asymmetric key pair without a certificate (a raw public key) will be used for security. This mode is not supported yet.
QtCoap::Certificate3DTLS is enabled. An asymmetric key pair with an X.509 certificate will be used for security.

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.