Skip to content

Commit

Permalink
Fix minor issues in the transfer server.
Browse files Browse the repository at this point in the history
  • Loading branch information
harimau-qirex committed Aug 22, 2024
1 parent af4bd78 commit 3680655
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/controller/python/chip/bdx/bdx-transfer-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,11 @@ void BdxTransferServer::Shutdown()
mExchangeManager = nullptr;
}

CHIP_ERROR BdxTransferServer::OnUnsolicitedMessageReceived(const PayloadHeader& payloadHeader,
CHIP_ERROR BdxTransferServer::OnUnsolicitedMessageReceived(const PayloadHeader & payloadHeader,
Messaging::ExchangeDelegate *& delegate)
{
// TODO: Verify details from the payload header.
BdxTransfer * transfer = mBdxTransferPool->Allocate();
if (!transfer)
{
return CHIP_ERROR_NO_MEMORY;
}

VerifyOrReturnError(transfer != nullptr, CHIP_ERROR_NO_MEMORY);
delegate = transfer;
return CHIP_NO_ERROR;
}
Expand Down
5 changes: 3 additions & 2 deletions src/controller/python/chip/bdx/bdx-transfer-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
namespace chip {
namespace bdx {

// This class handles incoming BDX init messages to start BDX transfers. It allocates BdxTransfer objects from a pool.
// This class handles incoming BDX init messages to start BDX transfers. It requests the BdxTransfer objects from a pool
// and uses them as exchange delegates.
class BdxTransferServer : public Messaging::UnsolicitedMessageHandler
{
public:
Expand All @@ -35,7 +36,7 @@ class BdxTransferServer : public Messaging::UnsolicitedMessageHandler
CHIP_ERROR Init(Messaging::ExchangeManager * exchangeManager);
void Shutdown();

CHIP_ERROR OnUnsolicitedMessageReceived(const PayloadHeader& payloadHeader, Messaging::ExchangeDelegate *& delegate) override;
CHIP_ERROR OnUnsolicitedMessageReceived(const PayloadHeader & payloadHeader, Messaging::ExchangeDelegate *& delegate) override;
void OnExchangeCreationFailed(Messaging::ExchangeDelegate * delegate) override;

private:
Expand Down

0 comments on commit 3680655

Please sign in to comment.