From 2ed665e2d97f64c1fb286be232bae2f4370fdb95 Mon Sep 17 00:00:00 2001 From: Shana Azria Date: Wed, 28 Apr 2021 20:03:47 +0200 Subject: [PATCH] Functionality fixes --- .../operational-credentials-server.cpp | 17 ++++++++++------- src/messaging/ExchangeMgr.cpp | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 5dbf3b7e9243d0..b083636cde6b3a 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -99,14 +99,16 @@ CHIP_ERROR writeAdminsIntoFabricsListAttribute(void) uint16_t vendorId = pairing.GetVendorId(); // Skip over uninitialized admins - if (nodeId != kUndefinedNodeId && fabricId != kUndefinedFabricId && vendorId != kUndefinedVendorId) + if (nodeId == kUndefinedNodeId || fabricId == kUndefinedFabricId || vendorId == kUndefinedVendorId) { - if (writeFabric(fabricId, nodeId, vendorId, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write admin with fabricId %" PRIX64 " in fabrics list", fabricId); - err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; - break; - } + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Skipping over unitialized admin with fabricId %" PRIX64 + ", nodeId %" PRIX64 " vendorId %" PRIX16, fabricId, nodeId, vendorId); + continue; + } else if (writeFabric(fabricId, nodeId, vendorId, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write admin with fabricId %" PRIX64 " in fabrics list", fabricId); + err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; + break; } fabricIndex ++; } @@ -202,6 +204,7 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::app::Command GetGlobalAdminPairingTable().ReleaseAdminId(adminId); exit: + writeAdminsIntoFabricsListAttribute(); emberAfSendImmediateDefaultResponse(status); return true; } diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index b9e44d0b043dc5..22fae90cdaa9d2 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -224,6 +224,8 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const UnsolicitedMessageHandler * matchingUMH = nullptr; bool sendAckAndCloseExchange = false; + ChipLogProgress(ExchangeManager, "Received message of type %d and protocolId %d", payloadHeader.GetMessageType(), payloadHeader.GetProtocolID()); + // Search for an existing exchange that the message applies to. If a match is found... for (auto & ec : mContextPool) {