Skip to content

Commit

Permalink
remove unnecessary check-in delegate since the ChipToolCheckInDelegat…
Browse files Browse the repository at this point in the history
…e is enough for chip-tool icd usage
  • Loading branch information
yunhanw-google committed Apr 26, 2024
1 parent 8ebadd4 commit 6c051bc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 61 deletions.
9 changes: 0 additions & 9 deletions examples/chip-tool/commands/common/CHIPCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,3 @@ void CHIPCommand::ExecuteDeferredCleanups(intptr_t ignored)
sDeferredCleanups.clear();
}

void CHIPCommand::SetOnCheckInCompleteCallback(CheckInCompleteCallback * handler)
{
sCheckInDelegate.SetOnCheckInCompleteCallback(handler);
}

void CHIPCommand::UnsetOnCheckInCompleteCallback()
{
sCheckInDelegate.UnsetOnCheckInCompleteCallback();
}
4 changes: 0 additions & 4 deletions examples/chip-tool/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ class CHIPCommand : public Command

ChipDeviceCommissioner & GetCommissioner(std::string identity);

static void SetOnCheckInCompleteCallback(CheckInCompleteCallback * handler);

static void UnsetOnCheckInCompleteCallback();

private:
CHIP_ERROR MaybeSetUpStack();
void MaybeTearDownStack();
Expand Down
14 changes: 0 additions & 14 deletions examples/chip-tool/commands/common/ChipToolCheckInDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ void ChipToolCheckInDelegate::OnCheckInComplete(const ICDClientInfo & clientInfo
ChipLogProgress(
ICD, "Check In Message processing complete: start_counter=%" PRIu32 " offset=%" PRIu32 " nodeid=" ChipLogFormatScopedNodeId,
clientInfo.start_icd_counter, clientInfo.offset, ChipLogValueScopedNodeId(clientInfo.peer_node));
if (mpCheckInCompleteCallbacks != nullptr)
{
mpCheckInCompleteCallbacks->OnCheckInComplete(clientInfo);
}
}

RefreshKeySender * ChipToolCheckInDelegate::OnKeyRefreshNeeded(ICDClientInfo & clientInfo, ICDClientStorage * clientStorage)
Expand Down Expand Up @@ -78,13 +74,3 @@ void ChipToolCheckInDelegate::OnKeyRefreshDone(RefreshKeySender * refreshKeySend
refreshKeySender = nullptr;
}
}

void ChipToolCheckInDelegate::SetOnCheckInCompleteCallback(CheckInCompleteCallback * handler)
{
mpCheckInCompleteCallbacks = handler;
}

void ChipToolCheckInDelegate::UnsetOnCheckInCompleteCallback()
{
mpCheckInCompleteCallbacks = nullptr;
}
34 changes: 0 additions & 34 deletions examples/chip-tool/commands/common/ChipToolCheckInDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
#include <app/icd/client/CheckInDelegate.h>
#include <app/icd/client/ICDClientStorage.h>

class CheckInCompleteCallback
{
public:
virtual ~CheckInCompleteCallback() {}

/**
* @brief Callback used to let the application know that a check-in message was received and validated.
*
* The callback will be executed in CHIP main loop. Implementations should avoid blocking operations in this callback.
*
* @param[in] clientInfo - ICDClientInfo object representing the state associated with the
* node that sent the check-in message.
*/
virtual void OnCheckInComplete(const chip::app::ICDClientInfo & clientInfo) = 0;
};

class ChipToolCheckInDelegate : public chip::app::CheckInDelegate
{
public:
Expand All @@ -50,25 +34,7 @@ class ChipToolCheckInDelegate : public chip::app::CheckInDelegate
chip::app::ICDClientStorage * clientStorage) override;
void OnKeyRefreshDone(chip::app::RefreshKeySender * refreshKeySender, CHIP_ERROR error) override;

/**
* @brief Sets a callback for when the Check-In processing completes.
*
* This method does not consider the race condition that the callback is changed during OnCheckInComplete.
*
* @param[in] handler - A pointer to the CheckInCompleteCallback to register.
*/
void SetOnCheckInCompleteCallback(CheckInCompleteCallback * handler);

/**
* @brief Unsets the callback for when the Check-In processing completes.
*
* This method does not consider the race condition that the callback is changed during OnCheckInComplete.
*/
void UnsetOnCheckInCompleteCallback();

private:
chip::app::ICDClientStorage * mpStorage = nullptr;
chip::app::InteractionModelEngine * mpImEngine = nullptr;

CheckInCompleteCallback * mpCheckInCompleteCallbacks;
};

0 comments on commit 6c051bc

Please sign in to comment.