From c73e8919a2f83a68e832b993b8eec5fa45ada749 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 15 Aug 2024 10:05:49 -0700 Subject: [PATCH] Use VerifyOrDie to check pairingCommand --- .../commands/fabric-sync/FabricSyncCommand.cpp | 9 ++------- examples/fabric-admin/device_manager/DeviceManager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp index 3af8395577fbe9..704996d189d9c2 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp @@ -199,12 +199,7 @@ CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand(NodeId deviceId) } PairingCommand * pairingCommand = static_cast(CommandMgr().GetCommandByName("pairing", "already-discovered")); - - if (pairingCommand == nullptr) - { - ChipLogError(NotSpecified, "Pairing already-discovered command is not available"); - return CHIP_ERROR_NOT_IMPLEMENTED; - } + VerifyOrDie(pairingCommand != nullptr); pairingCommand->RegisterCommissioningDelegate(this); mLocalBridgeNodeId = deviceId; @@ -271,7 +266,7 @@ void FabricSyncDeviceCommand::OnCommissioningWindowOpened(NodeId deviceId, CHIP_ if (err == CHIP_NO_ERROR) { - char payloadBuffer[kMaxManaulCodeLength + 1]; + char payloadBuffer[kMaxManualCodeLength + 1]; MutableCharSpan manualCode(payloadBuffer); CHIP_ERROR error = ManualSetupPayloadGenerator(payload).payloadDecimalStringRepresentation(manualCode); if (error == CHIP_NO_ERROR) diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index b7d135c57cdadf..17adcc2427f9c6 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -32,8 +32,8 @@ namespace { // Constants constexpr uint32_t kSetupPinCode = 20202021; -constexpr uint16_t kRemoteBridgePort = 6541; -constexpr uint16_t kLocalBridgePort = 6540; +constexpr uint16_t kRemoteBridgePort = 5540; +constexpr uint16_t kLocalBridgePort = 5540; constexpr uint16_t kWindowTimeout = 300; constexpr uint16_t kIteration = 1000; constexpr uint16_t kSubscribeMinInterval = 0;