33 explicit constexpr
Code(u8 val)
35 constexpr
Code(u8 x, u8 yy)
36 :
value((x << 5) | yy) {}
44 {
return (
value >> 5) & 0x7; }
46 {
return (
value & 0x1F); }
49 bool operator==(
const Code& other)
const
51 bool operator!=(
const Code& other)
const
52 {
return (
value != other.value); }
62 {
return (
value == 0); }
constexpr u16 OPTION_PROXY_URI
Option: Proxy-Uri.
constexpr Code CODE_BAD_FORMAT(4, 15)
< 4.13 Request Entity Too Large
constexpr u16 FORMAT_EXI
application/exi
constexpr Code CODE_BAD_REQUEST(4, 0)
< 2.31 Continue
constexpr u16 FORMAT_LINK
application/link-format
constexpr u16 OPTION_URI_QUERY
Option: Uri-Query.
constexpr u16 OPTION_LOC_PATH
Option: Location-Path.
constexpr Code CODE_BAD_GATEWAY(5, 2)
< 5.01 Not Implemented
constexpr Code CODE_CHANGED(2, 4)
< 2.03 Valid
constexpr u16 FORMAT_TEXT
text/plain;charset=utf-8
constexpr Code CODE_UNAVAILABLE(5, 3)
< 5.02 Bad Gateway
constexpr u16 OPTION_LOC_QUERY
Option: Location-Query.
constexpr u16 OPTION_URI_PORT
Option: Uri-Port.
constexpr Code CODE_DELETED(2, 2)
< 2.01 Created
constexpr Code CODE_PUT(0, 3)
< 0.02 POST request
constexpr Code CODE_FORBIDDEN(4, 3)
< 4.02 Bad Option
constexpr u16 OPTION_MAX_AGE
Option: Max-Age.
constexpr Code CODE_NO_PROXY(5, 5)
< 5.04 Gateway Timeout
constexpr Code CODE_POST(0, 2)
< 0.01 GET request
constexpr Code CODE_DELETE(0, 4)
< 0.03 PUT request
constexpr Code CODE_BAD_OPTION(4, 2)
< 4.01 Unauthorized
constexpr u8 PAYLOAD_MARKER
CoAP message header VERSION and TYPE fields (Section 3).
constexpr Code CODE_VALID(2, 3)
< 2.02 Deleted
constexpr u16 FORMAT_XML
application/xml
constexpr u16 OPTION_IF_NONE
Option: If-None-Match.
constexpr u16 OPTION_ETAG
Option: ETag.
constexpr Code CODE_PRECND_FAIL(4, 12)
< 4.06 Not Acceptable
constexpr u16 OPTION_IF_MATCH
Option: If-Match.
constexpr Code CODE_BAD_METHOD(4, 5)
< 4.04 Not Found
constexpr u16 OPTION_PROXY_SCH
Option: Proxy-Scheme.
constexpr Code CODE_NOT_FOUND(4, 4)
< 4.03 Forbidden
constexpr Code CODE_GET(0, 1)
< 0.00 Empty message
constexpr u16 OPTION_BLOCK2
Option: Block transfer (RFC7959)
constexpr u16 OPTION_ACCEPT
Option: Accept.
constexpr u16 FORMAT_CBOR
application/cbor (RFC8949)
constexpr u16 FORMAT_JSON
application/json
constexpr Code CODE_GATE_TIMEOUT(5, 4)
< 5.03 Service Unavailable
constexpr u16 FORMAT_BYTES
application/octet-stream
constexpr u16 FORMAT_CBOR_SEQ
application/cbor-seq (RFC8742)
constexpr Code CODE_UNAUTHORIZED(4, 1)
< 4.00 Bad Request
constexpr Code CODE_NOT_ACCEPT(4, 6)
< 4.05 Method Not Allowed
constexpr u16 OPTION_URI_HOST
Option: Uri-Host.
constexpr u16 OPTION_SIZE1
Option: Size1.
constexpr Code CODE_CONTINUE(2, 31)
< 2.05 Content
constexpr Code CODE_SERVER_ERROR(5, 0)
< 4.15 Unsupported Content-Format
constexpr u16 OPTION_BLOCK1
Option: Block transfer (RFC7959)
constexpr u16 OPTION_URI_PATH
Option: Uri-Path.
constexpr u16 OPTION_FORMAT
Option: Content-Format.
constexpr Code CODE_NOT_IMPL(5, 1)
< 5.00 Internal Server Error
constexpr Code CODE_CONTENT(2, 5)
< 2.04 Changed
constexpr Code CODE_TOO_LARGE(4, 13)
< 4.12 Precondition Failed
CoAP message header CODE field (Section 12.1).
constexpr Code(u8 x, u8 yy)
Create x.yy from x and yy.
constexpr u8 category() const
Return the "x" from x.yy.
constexpr bool is_request() const
Category tests: 0.00 = Empty (may be request or response) 0.01-0.31 = Request 2.00-2....
Code & operator=(const Code &other)
Assignment operator.
constexpr u8 subtype() const
Return the "yy" from x.yy.
constexpr Code(const Code &other)
Copy constructor.
constexpr Code(u8 val)
Create x.yy from raw byte.
constexpr bool is_empty() const
Category tests: 0.00 = Empty (may be request or response) 0.01-0.31 = Request 2.00-2....
constexpr bool is_error() const
Category tests: 0.00 = Empty (may be request or response) 0.01-0.31 = Request 2.00-2....
constexpr bool is_success() const
Category tests: 0.00 = Empty (may be request or response) 0.01-0.31 = Request 2.00-2....
constexpr bool is_response() const
Category tests: 0.00 = Empty (may be request or response) 0.01-0.31 = Request 2.00-2....
Basic type aliases and prototypes used throughout SatCat5.