class Matter::Controller::Client

Defined in:

matter/controller/client.cr

Constant Summary

Log = ::Log.for("matter.controller.client")
MSG_STANDALONE_ACK = 16_u8
PROTOCOL_INTERACTION_MODEL = 1_u16
PROTOCOL_SECURE_CHANNEL = 0_u16

Constructors

Instance Method Summary

Constructor Detail

def self.new(port : Int32 = 0, interface_ipv4 : String = "0.0.0.0", interface_ipv6 : String = "::", crypto : Crypto::CryptoBase = Crypto::StandardCrypto.new, unsecured_source_node_id : UInt64 | Nil = nil, initial_unsecured_message_counter : UInt32 | Nil = nil) #

[View source]

Instance Method Detail

def close : Nil #

[View source]
def crypto : Crypto::CryptoBase #

[View source]
def next_exchange_id : UInt16 #

[View source]
def register_session(session : Session::SecureContext) : Nil #

[View source]
def send_encrypted_request(session : Session::SecureContext, peer : Socket::IPAddress, protocol_id : UInt16, message_type : UInt8, payload : Bytes | Slice(UInt8), exchange_id : UInt16 = next_exchange_id, initiator_message : Bool = true, requires_ack : Bool = true, acknowledged_message_id : UInt32 | Nil = nil) : UInt16 #

Send an encrypted request on an existing secure session.


[View source]
def send_unsecured_on_exchange(peer : Socket::IPAddress, exchange_id : UInt16, protocol_id : UInt16, message_type : UInt8, payload : Bytes | Slice(UInt8), initiator_message : Bool = true, requires_ack : Bool = true, acknowledged_message_id : UInt32 | Nil = nil) : Nil #

Send an unsecured (session_id=0) message on an existing exchange.


[View source]
def send_unsecured_request(peer : Socket::IPAddress, protocol_id : UInt16, message_type : UInt8, payload : Bytes | Slice(UInt8), requires_ack : Bool = true) : UInt16 #

Send an unsecured (session_id=0) request and return the exchange id.


[View source]
def session?(session_id : UInt16) : Session::SecureContext | Nil #

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

[View source]
def wait_for(exchange_id : UInt16, protocol_id : UInt16, message_type : UInt8, timeout : Time::Span) : ReceivedMessage | Nil #

Wait for the next message matching exchange/protocol/type.


[View source]