class CoAP::Option

Defined in:

coap/option.cr

Constant Summary

ENDIAN = ["big"]
KLASS_NAME = [CoAP::Option]
PARTS = [{type: "bitfield", name: 0, cls: CoAP::Option, onlyif: nil, verify: nil}, {type: "basic", name: delta_8bit, cls: UInt8, onlyif: -> do op_delta == 13_u8 end, verify: nil, value: nil}, {type: "basic", name: delta_16bit, cls: UInt16, onlyif: -> do op_delta == 14_u8 end, verify: nil, value: nil}, {type: "basic", name: length_8bit, cls: UInt8, onlyif: -> do op_length == 13_u8 end, verify: nil, value: nil}, {type: "basic", name: length_16bit, cls: UInt16, onlyif: -> do op_length == 14_u8 end, verify: nil, value: nil}, {type: "bytes", name: data, cls: Bytes, onlyif: nil, verify: nil, length: -> do op_length == 15_u8 ? 0 : option_length end, value: nil}] of Nil
REMAINING = [] of Nil

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.bit_fields #

[View source]

Instance Method Detail

def <=>(option) #

Make options sortable


[View source]
def __format__ : IO::ByteFormat #

[View source]
def content_type(string : String) #

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


[View source]
def content_type #

[View source]
def data(value : Slice(UInt8)) #

[View source]
def data : Bytes #

def data=(data : Bytes) #

def delta_16bit : UInt16 #

def delta_16bit=(delta_16bit : UInt16) #

def delta_8bit : UInt8 #

def delta_8bit=(delta_8bit : UInt8) #

def end_of_options? #

[View source]
def length_16bit : UInt16 #

def length_16bit=(length_16bit : UInt16) #

def length_8bit : UInt8 #

def length_8bit=(length_8bit : UInt8) #

def max_age(number : Int) #

[View source]
def max_age #

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


[View source]
def observation(number : Int) #

[View source]
def observation #

https://tools.ietf.org/html/draft-ietf-core-observe-08


[View source]
def op_delta : UInt8 #

Options


def op_delta=(op_delta : UInt8) #

Options


def op_length : UInt8 #

Options


def op_length=(op_length : UInt8) #

Options


def option_delta : Int32 #

[View source]
def option_delta=(size : Int) #

[View source]
def option_length : Int32 #

[View source]
def option_length=(size : Int) #

[View source]
def string(data : String) #

[View source]
def string #

[View source]
def type(type : Options) #

[View source]
def type : Options #

Set as the option is parsed


[View source]
def type? : Options | Nil #

Set as the option is parsed


[View source]
def uri_port(number : Int) #

[View source]
def uri_port #

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


[View source]

Macro Detail

macro co_ap_option(name, onlyif = nil, verify = nil, value = nil) #

[View source]