I use the matterSupport and matterExtension,when I pair device success, where can i get the deviceID or nodeID to contrl the device? There is only a callback "override func commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throws {}"
How can i get the deviceID or nodeID with matterSupport
I use the matterSupport and matterExtension,when I pair device success, where can i get the deviceID or nodeID to contrl the device? There is only a callback "override func commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throws {}"
I think you may have misunderstood what the MatterSupport framework actually does. The MatterSupport framework is essentially an "interface" framework, not a hardware pairing API. It presents a user interface (based on the data your provided) and provides pairing data back to you (from our own data and the users selection). Much of it's design only make sense once you understand that role.
For example, the reason methods like "selectThreadNetwork(from:)" and "selectWiFiNetwork(from:)" exist is so that the ecosystem controller (typically some kind of in home device) can determine what network should be used, which could be a completely different network than the iPhone is currently on.
In that context, a question like this doesn't really make sense:
I use the matterSupport and matterExtension,when I pair device success, where can i get the deviceID or nodeID to contrl the device?
...because the answer is "you figured that out as part of the process of pairing the accessory into YOUR ecosystem".
What are you actually trying to do? Are you an ecosystem vendor? If you're not an ecosystem vendor and are simply trying to pair the accessory into HomeKit, then you do that through the HomeKit framework using HMAccessorySetupManager. Note that while HMAccessorySetupManager requires you to pass in a request object, ALL of HMAccessorySetupRequest's properties are actually nullable. The various properties are there to handle a variety of edge cases, but for the typical Matter (or HomeKit) accessory you'd just pass in "NULL" and HomeKit will handle everything else through it's own UI.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware