Module: CoRE::CoAP::Options

Extended by:
Types
Included in:
CoRE::CoAP
Defined in:
lib/core/coap/options.rb

Constant Summary collapse

TOKEN_ON =
19
OPTIONS =

14 => :user, default, length range, replicable?, decoder, encoder

{ # name      minlength, maxlength, [default]    defined where:
   1 => [:if_match,       *o256_many(0, 8)],     # core-coap-12
   3 => [:uri_host,       *str_once(1, 255)],    # core-coap-12
   4 => [:etag,           *o256_many(1, 8)],     # core-coap-12 !! once in rp
   5 => [:if_none_match,  *presence_once],       # core-coap-12
   6 => [:observe,        *uint_once(0, 3)],     # core-observe-07
   7 => [:uri_port,       *uint_once(0, 2)],     # core-coap-12
   8 => [:location_path,  *str_many(0, 255)],    # core-coap-12
  11 => [:uri_path,       *str_many(0, 255)],    # core-coap-12
  12 => [:content_format, *uint_once(0, 2)],     # core-coap-12
  14 => [:max_age,        *uint_once(0, 4, 60)], # core-coap-12
  15 => [:uri_query,      *str_many(0, 255)],    # core-coap-12
  17 => [:accept,         *uint_once(0, 2)],     # core-coap-18!
  TOKEN_ON => [:token,    *o256_once(1, 8, 0)],  # core-coap-12 -> opaq_once(1, 8, EMPTY)
  20 => [:location_query, *str_many(0, 255)],    # core-coap-12
  23 => [:block2,         *uint_once(0, 3)],     # core-block-10
  27 => [:block1,         *uint_once(0, 3)],     # core-block-10
  28 => [:size2,          *uint_once(0, 4)],     # core-block-10
  35 => [:proxy_uri,      *str_once(1, 1034)],   # core-coap-12
  39 => [:proxy_scheme,   *str_once(1, 255)],    # core-coap-13
  60 => [:size1,          *uint_once(0, 4)],     # core-block-10
}
OPTIONS_I =

:user => 14, :user, def, range, rep, deco, enco

Hash[OPTIONS.map { |k, v| [v[0], [k, *v]] }]
DEFAULTING_OPTIONS =
Hash[
  OPTIONS 
    .map { |k, v| [v[0].freeze, v[1].freeze] }
    .select { |k, v| v }
].freeze

Method Summary

Methods included from Types

o256_many, o256_once, opaq_many, opaq_once, presence_once, str_many, str_once, uint_many, uint_once