class

Matter::SessionManager

Inherits Reference < Object

SessionManager manages secure communication sessions

Matter uses two types of sessions:

  • PASE (Password-Authenticated Session Establishment): Used during commissioning
  • CASE (Certificate-Authenticated Session Establishment): Used for operational communication

During failsafe rollback, PASE sessions must be cleared to prevent unauthorized access if commissioning fails.

Matter Core Spec ยง4.13 - Secure Channel Protocol

Constants

Log = ::Log.for("matter.session_manager")

Constructors

Instance methods

add_case_session(session : CaseSession) : Nil

Add an existing CASE session

Source
add_pase_session(session : PaseSession) : Nil

Add an existing PASE session

Source
case_session_count

Get count of active CASE sessions

Source
case_session_ids

Get all CASE session IDs

Source
clear_all_sessions

Clear all sessions

Source
clear_case_sessions

Clear all CASE sessions (typically used for device reset)

Source
clear_pase_sessions

Clear all PASE sessions

This is called during failsafe rollback to remove all PASE sessions established during commissioning. This ensures that if commissioning fails, the temporary authenticated sessions are removed.

Source
create_case_session(session_id : UInt16, fabric_index : UInt8, peer_node_id : UInt64, vendor_id : UInt16 = 65521_u16) : CaseSession

Create a new CASE session

Source
create_pase_session(session_id : UInt16) : PaseSession

Create a new PASE session

Source
get_case_session(session_id : UInt16) : CaseSession | Nil

Get a CASE session by ID

Source
get_fabric_sessions(fabric_index : UInt8) : Array(CaseSession)

Get all CASE sessions for a specific fabric

Source
get_pase_session(session_id : UInt16) : PaseSession | Nil

Get a PASE session by ID

Source
has_case_session?(session_id : UInt16) : Bool

Check if a CASE session exists

Source
has_pase_session?(session_id : UInt16) : Bool

Check if a PASE session exists

Source
pase_session_count

Get count of active PASE sessions

Source
pase_session_ids

Get all PASE session IDs

Source
remove_case_session(session_id : UInt16) : CaseSession | Nil

Remove a specific CASE session

Source
remove_fabric_sessions(fabric_index : UInt8) : Int32

Remove all CASE sessions for a specific fabric

Source
remove_pase_session(session_id : UInt16) : PaseSession | Nil

Remove a specific PASE session

Source
total_session_count

Get total session count

Source

Nested types