Expand description
Device manager for simplified Matter device interaction.
Wraps certificate management, transport, controller, mDNS discovery, and a persistent device registry so that commissioning and connecting to devices is simpler.
§Features
- Commission by address:
DeviceManager::commissionwhen the device IP is known - Commission by pairing code:
DeviceManager::commission_with_codedecodes a manual pairing code, discovers the device via commissionable mDNS (_matterc._udp.local), and commissions it automatically - Connect with auto-rediscovery:
DeviceManager::connectandDeviceManager::connect_by_nametry the stored address first; if the connection fails (e.g. device changed IP), they automatically re-discover the device via operational mDNS (_matter._tcp.local) and retry - Explicit discovery:
DeviceManager::discover_devicefinds the current address of a commissioned device via operational mDNS and updates the registry
§First-time setup
let config = ManagerConfig { fabric_id: 1000, controller_id: 100,
local_address: "0.0.0.0:5555".into() };
let dm = DeviceManager::create("./matter-data", config).await?;
let conn = dm.commission("192.168.1.100:5540", 123456, 300, "kitchen light").await?;§Commission using manual pairing code
let dm = DeviceManager::load("./matter-data").await?;
let conn = dm.commission_with_code("0251-520-0076", 300, "kitchen light").await?;§Reconnecting later
If the device changed its IP address since commissioning, the connection automatically falls back to operational mDNS discovery, updates the stored address, and retries.
let dm = DeviceManager::load("./matter-data").await?;
let conn = dm.connect_by_name("kitchen light").await?;