From 372bd12a64cc35d86c179e93bc885bf5d6a5ca2f Mon Sep 17 00:00:00 2001 From: Jerry Johns Date: Thu, 3 Nov 2022 13:02:55 -0700 Subject: [PATCH] Fix joining fabric print in `ChipDeviceController` (#21297) * Fix joining fabric print to actually emit a sensible compressed fabric ID by moving it to the right location * Review fixes * Added FabricID to the print Co-authored-by: Tennessee Carmel-Veilleux --- src/controller/CHIPDeviceController.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index af628edc572cc3..0e6c0d544d3ee9 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -142,6 +142,15 @@ CHIP_ERROR DeviceController::Init(ControllerInitParams params) mSystemState = params.systemState->Retain(); mState = State::Initialized; + + if (GetFabricIndex() != kUndefinedFabricIndex) + { + ChipLogProgress(Controller, + "Joined the fabric at index %d. Fabric ID is 0x" ChipLogFormatX64 + " (Compressed Fabric ID: " ChipLogFormatX64 ")", + GetFabricIndex(), ChipLogValueX64(GetFabricId()), ChipLogValueX64(GetCompressedFabricId())); + } + return CHIP_NO_ERROR; } @@ -311,9 +320,6 @@ CHIP_ERROR DeviceController::InitControllerNOCChain(const ControllerInitParams & mFabricIndex = fabricIndex; - ChipLogProgress(Controller, "Joined the fabric at index %d. Compressed fabric ID is: 0x" ChipLogFormatX64, GetFabricIndex(), - ChipLogValueX64(GetCompressedFabricId())); - return CHIP_NO_ERROR; }