Skip to content

Commit

Permalink
Use VerifyOrDie to check pairingCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Aug 15, 2024
1 parent b61464a commit c73e891
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,7 @@ CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand(NodeId deviceId)
}

PairingCommand * pairingCommand = static_cast<PairingCommand *>(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;
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/fabric-admin/device_manager/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c73e891

Please sign in to comment.