class

CoAP::Message

Inherits CoAP::Header < BinData < Reference < Object

https://tools.ietf.org/html/rfc7252#section-3

Constants

ENDIAN = ["big"]

https://tools.ietf.org/html/rfc7252#section-3

KLASS_NAME = [CoAP::Message]

https://tools.ietf.org/html/rfc7252#section-3

PARTS = [{type: "bitfield", name: 2, cls: CoAP::Message, onlyif: nil, verify: nil}, {type: "basic", name: message_id, cls: UInt16, onlyif: nil, verify: nil, value: nil}, {type: "bytes", name: token, cls: Bytes, onlyif: nil, verify: nil, length: -> do token_length end, value: nil}, {type: "variable_array", name: raw_options, cls: Option, onlyif: nil, verify: nil, length: -> do if opt = raw_options[-1]? !opt.end_of_options? elsif remaining = io.peek remaining.size > 0 else false end end, value: nil}, {type: "bytes", name: payload_data, cls: Bytes, onlyif: nil, verify: nil, length: -> do io.peek.try(&.size) || 0 end, value: nil}] of Nil

https://tools.ietf.org/html/rfc7252#section-3

REMAINING = [] of Nil

https://tools.ietf.org/html/rfc7252#section-3

Class methods

bit_fields

https://tools.ietf.org/html/rfc7252#section-3

Source

Instance methods

__format__
Source
code_class

https://tools.ietf.org/html/rfc7252#section-12.1

Source
code_class=(code_class : UInt8)

https://tools.ietf.org/html/rfc7252#section-12.1

code_class=(value : CodeClass)

https://tools.ietf.org/html/rfc7252#section-12.1

Source
code_detail

When code_class above == Method then this indicates if it's a GET POST etc

code_detail=(code_detail : UInt8)

When code_class above == Method then this indicates if it's a GET POST etc

message_id
message_id=(message_id : UInt16)
method
Source
options

https://tools.ietf.org/html/rfc7252#section-12.2

Source
options=(values : Enumerable(Option))

allow for reasonablly flexible header parsing

Source
payload_data
payload_data=(payload_data : Bytes)
raw_options
raw_options=(raw_options : Array(Option))
status

These do actually differ slightly from the HTTP originals https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#response-codes

Source
status=(value : Int | HTTP::Status)
Source
status_code
Source
status_code=(value : Int | HTTP::Status)
Source
success?
Source
token
token=(token : Bytes)

Macros

co_ap_header(name, onlyif = nil, verify = nil, value = nil)

https://tools.ietf.org/html/rfc7252#section-3

Source
co_ap_message(name, onlyif = nil, verify = nil, value = nil)

https://tools.ietf.org/html/rfc7252#section-3

Source
co_ap_option(name, onlyif = nil, verify = nil, value = nil)

https://tools.ietf.org/html/rfc7252#section-3

Source