matter

package
v0.0.0-...-da36182 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubtypeDiscriminatorLong  = "_L"
	SubtypeDiscriminatorShort = "_S"
	SubtypeVendorID           = "_V"
	SubtypeDeviceType         = "_T"
	SubtypeCommissioningMode  = "_CM"
)

Matter Specification Version 1.2 4.3.1.3. Commissioning Subtypes.

View Source
const (
	TxtRecordDiscriminator      = "D"
	TxtRecordVendorProductID    = "VP"
	TxtRecordCommissioningMode  = "CM"
	TxtRecordDeviceType         = "DT"
	TxtRecordDeviceName         = "DN"
	TxtRecordRotatingDeviceID   = "RI"
	TxtRecordPairingHint        = "PH"
	TxtRecordPairingInstruction = "PI"
)

Matter Specification Version 1.2 4.3.1.4. TXT Records.

View Source
const (
	CommissioningModeNone = "0"
	CommissioningMode1    = "1"
	CommissioningMode2    = "2"
)

Matter Specification Version 1.2 4.3.1.7. TXT key for commissioning mode (CM).

View Source
const (
	AnonymizedProductID = (ProductID)(0x0000)
)
View Source
const (
	DNSSDServerType = "_matter._tcp"
)
View Source
const (
	Port = 5540
)
View Source
const (
	UnspecifiedNodeID = (NodeID)(0x0000000000000000)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Commissionee

type Commissionee struct {
	*mdns.Service
}

Commissionee represents a commissionee.

func NewCommissioneeWithMessage

func NewCommissioneeWithMessage(msg *dns.Message) (*Commissionee, error)

NewCommissioneeWithMessage returns a new commissionee with a mDNS message.

func NewCommissioneeWithService

func NewCommissioneeWithService(service *mdns.Service) *Commissionee

NewCommissioneeWithService returns a new commissionee with a mDNS service.

func (*Commissionee) LookupAttribute

func (com *Commissionee) LookupAttribute(name string) (string, bool)

LookupAttribute returns an attribute value for the specified name.

func (*Commissionee) LookupCommissioningMode

func (com *Commissionee) LookupCommissioningMode() (string, bool)

4.3.1.3. Commissioning Subtypes (_CM) 4.3.1.7. TXT key for commissioning mode (CM) LookupCommissioningMode returns a commissioning mode.

func (*Commissionee) LookupDeviceName

func (com *Commissionee) LookupDeviceName() (string, bool)

4.3.1.9. TXT key for device name (DN) LookupDeviceName returns a device name.

func (*Commissionee) LookupDeviceType

func (com *Commissionee) LookupDeviceType() (DeviceType, bool)

4.3.1.3. Commissioning Subtypes (_T) 4.3.1.8. TXT key for device type (DT) LookupDeviceType returns a device type.

func (*Commissionee) LookupDiscriminator

func (com *Commissionee) LookupDiscriminator() (string, bool)

4.3.1.3. Commissioning Subtypes (_L,_S) 4.3.1.5. TXT key for discriminator (D) LookupDiscriminator returns a discriminator.

func (*Commissionee) LookupFullDiscriminator

func (com *Commissionee) LookupFullDiscriminator() (string, bool)

4.3.1.3. Commissioning Subtypes (_L) LookupDiscriminator returns a full 12-bit discriminator.

func (*Commissionee) LookupPairingHint

func (com *Commissionee) LookupPairingHint() (PairingHint, bool)

4.3.1.11. TXT key for pairing hint (PH) LookupPairingHint returns a pairing hint.

func (*Commissionee) LookupPairingInstructions

func (com *Commissionee) LookupPairingInstructions() (string, bool)

4.3.1.12. TXT key for pairing instructions (PI) LookupPairingInstructions returns a pairing instructions.

func (*Commissionee) LookupRotatingDeviceID

func (com *Commissionee) LookupRotatingDeviceID() (string, bool)

4.3.1.10. TXT key for rotating device identifier (RI) LookupRotatingDeviceID returns a rotating device identifier.

func (*Commissionee) LookupShortDiscriminator

func (com *Commissionee) LookupShortDiscriminator() (string, bool)

4.3.1.3. Commissioning Subtypes (_S) LookupShortDiscriminator returns a short 4-bit discriminator.

func (*Commissionee) LookupSubtype

func (com *Commissionee) LookupSubtype(prefix string) (string, bool)

LookupSubtype returns a subtype for the specified prefix.

func (*Commissionee) LookupVendorID

func (com *Commissionee) LookupVendorID() (string, bool)

4.3.1.3. Commissioning Subtypes (_V) 4.3.1.6. TXT key for Vendor ID and Product ID (VP) LookupVendorID returns a vendor and product ID.

func (*Commissionee) LookupVendorProductID

func (com *Commissionee) LookupVendorProductID() (string, string, bool)

4.3.1.6. TXT key for Vendor ID and Product ID (VP) LookupVendorProductID returns a vendor and product ID.

type Commissioner

type Commissioner struct {
	*Discoverer
}

Commissioner represents a commissioner.

func NewCommissioner

func NewCommissioner() *Commissioner

NewCommissioner returns a new commissioner.

func (*Commissioner) Start

func (com *Commissioner) Start() error

Start starts the commissioner.

func (*Commissioner) Stop

func (com *Commissioner) Stop() error

Stop stops the commissioner.

type DeviceType

type DeviceType uint

DeviceType represents a device type.

const (
	// DeviceTypeUnknown represents an unknown device type.
	DeviceTypeUnknown DeviceType = 0
)

func NewDeviceTypeFromString

func NewDeviceTypeFromString(s string) (DeviceType, error)

NewDeviceTypeFromString returns a new device type from a string.

type Discoverer

type Discoverer struct {
	*mdns.Client
}

Discoverer represents a discoverer for commisionners.

func NewDiscoverer

func NewDiscoverer() *Discoverer

NewDiscoverer returns a new discoverer.

func (*Discoverer) MessageReceived

func (disc *Discoverer) MessageReceived(msg *dns.Message)

MessageReceived is a callback when a message is received.

func (*Discoverer) Search

func (disc *Discoverer) Search() error

Search searches commisioners. 5.4.3.3. Using Existing IP-bearing Network To discover a commissionable device over an existing IP-bearing network connection, the Commis­ sioner SHALL perform service discovery using DNS-SD as detailed in Section 4.3, “Discovery”, and more specifically in Section 4.3.1, “Commissionable Node Discovery”.

func (*Discoverer) Start

func (disc *Discoverer) Start() error

Start starts this discoverer.

func (*Discoverer) Stop

func (disc *Discoverer) Stop() error

Stop stops this discoverer.

type GroupID

type GroupID = message.GroupID

GroupID represents a group ID.

const (
	UnspecifiedGroupID            GroupID = 0x0000
	UniversalGroupIDMin           GroupID = 0xFF00
	UniversalGroupIDMax           GroupID = 0xFFFF
	UniversalAllNodeGroupID       GroupID = 0xFFFF
	UniversalAllNonICDNodeGroupID GroupID = 0xFFFE
	UniversalAllProxyGroupID      GroupID = 0xFFFD
	ApplicationGroupIDMin         GroupID = 0x0001
	ApplicationGroupIDMax         GroupID = 0xFEFF
)

type NodeID

type NodeID = message.NodeID

NodeID represents a node ID.

type PairingHint

type PairingHint uint

PairingHint represents a pairing hint.

const (
	PairingHintNone                                 (PairingHint) = 0x0000
	PairingHintPowerCycle                           (PairingHint) = 0x0001
	PairingHintDeviceManufacturerURL                (PairingHint) = 0x0002
	PairingHintAdministrator                        (PairingHint) = 0x0004
	PairingHintSettingsMenu                         (PairingHint) = 0x0008
	PairingHintCustomInstruction                    (PairingHint) = 0x0010
	PairingHintDeviceManual                         (PairingHint) = 0x0020
	PairingHintPressResetButton                     (PairingHint) = 0x0040
	PairingHintPressResetButtonWithfPower           (PairingHint) = 0x0080
	PairingHintPressResetButtonForNSeconds          (PairingHint) = 0x0100
	PairingHintPressResetButtonUntilLightBlinks     (PairingHint) = 0x0200
	PairingHintPressResetButtonForNSecondsWithPower (PairingHint) = 0x0400
)

func NewPairingHintFromString

func NewPairingHintFromString(s string) (PairingHint, error)

NewPairingHintFromString returns a new pairing hint from a string.

type ProductID

type ProductID uint16

ProductID represents a product ID.

type VenderID

type VenderID = protocol.VenderID

VendorID represents a vendor ID.

const (
	MatterStandardVenderID VenderID = 0x0000
	TestVender01ID         VenderID = 0xFFF1
	TestVender02ID         VenderID = 0xFFF2
	TestVender03ID         VenderID = 0xFFF3
	TestVender04ID         VenderID = 0xFFF4
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL