CoAPOption Type
A CoAP option.
Remarks
This type represents a CoAP option.
Fields
critical Bool |
Whether the option is critical. This property reflects whether the option is critical or elective. Receivers that do not recognize a critical option must return a 4.02 "Bad Option" response code back to the sender. Unrecognized elective options can be safely ignored. | ||||||||||||||||||||||||||||||||||||||
noCacheKey Bool |
Whether the option is to be excluded from the cache-key. This property reflects whether the option should be excluded from any cache-key calculations. This information is generally only needed for caching and proxying. | ||||||||||||||||||||||||||||||||||||||
number Int32 |
The option's number. The property reflects the option's number, which must be a value in the range 0 to 65535 (inclusive). Setting this property to a recognized option number (see table below) will automatically set the ValueType property to the correct value (it should be set manually otherwise). The following table provides a (non-exhaustive) list of some of the more common option numbers; refer to the IANA's CoAP Option Numbers registry for a full list.
| ||||||||||||||||||||||||||||||||||||||
unsafe Bool |
Whether the option is unsafe to forward. This property reflects whether the option is unsafe to forward. This information is generally only needed for proxying. | ||||||||||||||||||||||||||||||||||||||
value String |
The option's value. This property specifies the option's value. The ValueType property specifies the data type of the value. | ||||||||||||||||||||||||||||||||||||||
valueType CoAPOptionValueTypes |
The option's value data type. This property specifies the data type of the option's Value. If Number is set to a recognized value (refer to the table in its documentation), this property will automatically be set to the correct value. The table below shows the possible value types, their descriptions, and how to format the data assigned to Value.
|
Constructors
public init()
public init(number: Int32, value: String)