Skip to content

Commit

Permalink
Functionality fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shana-apple committed Apr 28, 2021
1 parent f40b3c2 commit 2ed665e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++;
}
Expand Down Expand Up @@ -202,6 +204,7 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::app::Command
GetGlobalAdminPairingTable().ReleaseAdminId(adminId);

exit:
writeAdminsIntoFabricsListAttribute();
emberAfSendImmediateDefaultResponse(status);
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions src/messaging/ExchangeMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 2ed665e

Please sign in to comment.