QCoapOption#
The QCoapOption
class holds data about CoAP options. More…
Synopsis#
Functions#
def
isValid
()def
length
()def
name
()def
opaqueValue
()def
__ne__
(other)def
__eq__
(other)def
stringValue
()def
swap
(other)def
uintValue
()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
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.
- class PySide6.QtCoap.QCoapOption([name=QCoapOption.OptionName.Invalid[, opaqueValue=QByteArray()]])#
PySide6.QtCoap.QCoapOption(name, stringValue)
PySide6.QtCoap.QCoapOption(name, intValue)
PySide6.QtCoap.QCoapOption(other)
- Parameters:
stringValue – str
name –
OptionName
other –
PySide6.QtCoap.QCoapOption
opaqueValue –
PySide6.QtCore.QByteArray
intValue – int
Constructs a new CoAP option with the given name
and QByteArray opaqueValue
. If no parameters are passed, constructs an Invalid object.
See also
Constructs a new CoAP option with the given name
and the QString stringValue
.
See also
Constructs a new CoAP option with the given name
and the unsigned integer intValue
.
See also
Constructs a new CoAP option as a copy of other
, making the two options identical.
See also
- PySide6.QtCoap.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
Description
QCoapOption.Invalid
An invalid option.
QCoapOption.IfMatch
If-Match option.
QCoapOption.UriHost
Uri-Host option.
QCoapOption.Etag
Etag option.
QCoapOption.IfNoneMatch
If-None-Match option.
QCoapOption.Observe
Observe option.
QCoapOption.UriPort
Uri-Port option.
QCoapOption.LocationPath
Location-path option.
QCoapOption.UriPath
Uri-Path option.
QCoapOption.ContentFormat
Content-Format option.
QCoapOption.MaxAge
Max-Age option.
QCoapOption.UriQuery
Uri-Query option.
QCoapOption.Accept
Accept option.
QCoapOption.LocationQuery
Location-Query option.
QCoapOption.Block2
Block2 option.
QCoapOption.Block1
Block1 option.
QCoapOption.Size2
Size2 option.
QCoapOption.ProxyUri
Proxy-Uri option.
QCoapOption.ProxyScheme
Proxy-Scheme option.
QCoapOption.Size1
Size1 option.
- PySide6.QtCoap.QCoapOption.isValid()#
- Return type:
bool
Returns true
if the option is valid.
- PySide6.QtCoap.QCoapOption.length()#
- Return type:
int
Returns the length of the value of the option.
- PySide6.QtCoap.QCoapOption.name()#
- Return type:
Returns the name of the option.
- PySide6.QtCoap.QCoapOption.opaqueValue()#
- Return type:
Returns the value of the option.
- PySide6.QtCoap.QCoapOption.__ne__(other)#
- Parameters:
other –
PySide6.QtCoap.QCoapOption
- Return type:
bool
Returns true
if this QCoapOption
and other
are different.
- PySide6.QtCoap.QCoapOption.__eq__(other)#
- Parameters:
other –
PySide6.QtCoap.QCoapOption
- Return type:
bool
Returns true
if this QCoapOption
and other
are equals.
- PySide6.QtCoap.QCoapOption.stringValue()#
- Return type:
str
Returns the QString value of the option.
- PySide6.QtCoap.QCoapOption.swap(other)#
- Parameters:
other –
PySide6.QtCoap.QCoapOption
Swaps this option with other
. This operation is very fast and never fails.
- PySide6.QtCoap.QCoapOption.uintValue()#
- Return type:
int
Returns the integer value of the option.