class Matter::Protocol::MessageHandler::ActiveSubscription

Overview

Active subscriptions - keyed by subscription_id After SubscribeResponse is sent, subscriptions are moved here for ongoing updates

Defined in:

matter/protocol/message_handler.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_h(h : Hash(String, String | UInt32 | UInt16 | Int64 | Array(Hash(String, UInt32 | UInt16 | Nil))), session : Session::SecureContext) : ActiveSubscription #

Deserialize subscription from hash Requires a session lookup function to resolve session_id to SecureContext


[View source]
def self.new(subscription_id : UInt32, min_interval : UInt16, max_interval : UInt16, peer : Socket::IPAddress, session : Matter::Session::SecureContext, attribute_paths : Array(Matter::InteractionModel::AttributePath), next_exchange_id : UInt16 = 0_u16) #

[View source]

Instance Method Detail

def attribute_paths : Array(InteractionModel::AttributePath) #

[View source]
def attribute_paths=(attribute_paths : Array(InteractionModel::AttributePath)) #

[View source]
def last_report_time : Time #

[View source]
def last_report_time=(last_report_time : Time) #

[View source]
def matches?(endpoint_id : UInt16, cluster_id : UInt32, attribute_id : UInt32) : Bool #

Check if a path matches any subscribed paths (including wildcards)


[View source]
def max_interval : UInt16 #

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

[View source]
def min_interval : UInt16 #

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

[View source]
def next_exchange_id : UInt16 #

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

[View source]
def peer : Socket::IPAddress #

[View source]
def peer=(peer : Socket::IPAddress) #

[View source]
def session : Session::SecureContext #

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

[View source]
def subscription_id : UInt32 #

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

[View source]
def to_h : Hash(String, String | UInt32 | UInt16 | Int64 | Array(Hash(String, UInt32 | UInt16 | Nil))) #

Serialize subscription to hash for persistence Note: session is stored by session_id - must be resolved when restoring


[View source]