class Matter::Protocol::MessageHandler

Overview

Protocol message handler that routes incoming messages to appropriate handlers

Handles:

Defined in:

matter/protocol/message_handler.cr

Constant Summary

Log = ::Log.for("matter.protocol")
MSG_CASE_SIGMA1 = 48_u8
MSG_CASE_SIGMA2 = 49_u8
MSG_CASE_SIGMA3 = 50_u8
MSG_PASE_PAKE1 = 34_u8
MSG_PASE_PAKE2 = 35_u8
MSG_PASE_PAKE3 = 36_u8
MSG_PBKDF_PARAM_REQUEST = 32_u8
MSG_PBKDF_PARAM_RESPONSE = 33_u8
MSG_STANDALONE_ACK = 16_u8

Secure Channel Message Types

MSG_STATUS_REPORT = 64_u8
PROTOCOL_BDX = 2_u16
PROTOCOL_INTERACTION_MODEL = 1_u16
PROTOCOL_SECURE_CHANNEL = 0_u16

Protocol IDs

PROTOCOL_USER_DIRECTED_COMM = 3_u16

Constructors

Instance Method Summary

Constructor Detail

def self.new(transport : Transport::UDPTransport, setup_pin : UInt32, discriminator : UInt16, iterations : UInt32 = 1000_u32, salt : Bytes = Random::Secure.random_bytes(32)) #

[View source]

Instance Method Detail

def case_initiator_session_id : UInt16 | Nil #

[View source]
def case_initiator_session_id=(case_initiator_session_id : UInt16 | Nil) #

[View source]
def case_responder : Session::Case::CaseResponder | Nil #

CASE support


[View source]
def case_responder=(case_responder : Session::Case::CaseResponder | Nil) #

CASE support


[View source]
def case_responder_session_id : UInt16 | Nil #

[View source]
def case_responder_session_id=(case_responder_session_id : UInt16 | Nil) #

[View source]
def clusters : Hash(Tuple(UInt16, UInt32), Cluster::Base) #

[View source]
def discriminator : UInt16 #

[View source]
def discriminator=(discriminator : UInt16) #

[View source]
def handle_message(msg : Codec::MessageCodec::Message, peer : Socket::IPAddress) : Nil #

Main message routing entry point


[View source]
def initiator_session_id : UInt16 | Nil #

PASE session IDs from PBKDF exchange


[View source]
def initiator_session_id=(initiator_session_id : UInt16 | Nil) #

PASE session IDs from PBKDF exchange


[View source]
def iterations : UInt32 #

[View source]
def iterations=(iterations : UInt32) #

[View source]
def on_get_fabric : Proc(Fabric | Nil) | Nil #

Fabric access callback - set by the device implementation This allows the message handler to access fabric data for CASE


[View source]
def on_get_fabric=(on_get_fabric : Proc(Fabric | Nil) | Nil) #

Fabric access callback - set by the device implementation This allows the message handler to access fabric data for CASE


[View source]
def pase_responder : Session::Pase::PaseResponder | Nil #

[View source]
def pbkdf_request_payload : Bytes | Nil #

PASE context: store request/response payloads for context hashing


[View source]
def pbkdf_request_payload=(pbkdf_request_payload : Bytes | Nil) #

PASE context: store request/response payloads for context hashing


[View source]
def pbkdf_response_payload : Bytes | Nil #

[View source]
def pbkdf_response_payload=(pbkdf_response_payload : Bytes | Nil) #

[View source]
def responder_session_id : UInt16 | Nil #

[View source]
def responder_session_id=(responder_session_id : UInt16 | Nil) #

[View source]
def salt : Bytes #

[View source]
def salt=(salt : Bytes) #

[View source]
def sessions : Hash(UInt16, Session::SecureContext) #

[View source]
def setup_pin : UInt32 #

Device credentials for PASE


[View source]
def setup_pin=(setup_pin : UInt32) #

Device credentials for PASE


[View source]
def transport : Transport::UDPTransport #

[View source]