From f05a20b18aa2d930a85f8e43829dba5f5d7d1311 Mon Sep 17 00:00:00 2001 From: Kedar Sovani Date: Sat, 4 Mar 2023 15:21:54 +0530 Subject: [PATCH] Commissioning: Show QR Code only when in commissioning mode --- matter/src/core.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/matter/src/core.rs b/matter/src/core.rs index 68c07f4..9f1b13b 100644 --- a/matter/src/core.rs +++ b/matter/src/core.rs @@ -61,12 +61,14 @@ impl Matter { let mdns = Mdns::get()?; mdns.set_values(dev_det.vid, dev_det.pid, &dev_det.device_name); - print_pairing_code_and_qr(&dev_det, &dev_comm, DiscoveryCapabilities::default()); - let fabric_mgr = Arc::new(FabricMgr::new()?); + let open_comm_window = fabric_mgr.is_empty(); + if open_comm_window { + print_pairing_code_and_qr(&dev_det, &dev_comm, DiscoveryCapabilities::default()); + } + let acl_mgr = Arc::new(AclMgr::new()?); let mut pase = PaseMgr::new(); - let open_comm_window = fabric_mgr.is_empty(); let data_model = DataModel::new(dev_det, dev_att, fabric_mgr.clone(), acl_mgr, pase.clone())?; let mut matter = Box::new(Matter {