MatterTrait

protocol MatterTrait : Trait
extension MatterTrait : CustomStringConvertible, Equatable, Hashable, Sendable, TraitEncodable

An internal protocol to encapsulate logic shared across Matter cluster classes.

  • makeTraitID(for:)

    Extension method

    Create a TraitID based on the cluster ID defined by the Matter spec.

    The matter cluster ID follows the Matter Manufacturer Extensible Identifier (MEI) format: 16-bit source and 16-bit ID. The numeric ID is transformed into the GHP-specific trait ID, for example: home.matter.0000.clusters.0006

    Declaration

    Swift

    static func makeTraitID(for clusterID: UInt32) -> String