Skip to content

Commit

Permalink
Minor renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
harimau-qirex committed Sep 11, 2024
1 parent d1da1e3 commit 024a8a9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/controller/python/chip/ChipDeviceCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ def WriteGroupAttribute(
# An empty list is the expected return for sending group write attribute.
return []

def PrepareToReceiveBdxData(self) -> asyncio.Future:
def TestOnlyPrepareToReceiveBdxData(self) -> asyncio.Future:
'''
Sets up the system to expect a node to initiate a BDX transfer. The transfer will send data here.
Expand All @@ -1359,7 +1359,7 @@ def PrepareToReceiveBdxData(self) -> asyncio.Future:
Bdx.PrepareToReceiveBdxData(future).raise_on_error()
return future

def PrepareToSendBdxData(self, data: bytes) -> asyncio.Future:
def TestOnlyPrepareToSendBdxData(self, data: bytes) -> asyncio.Future:
'''
Sets up the system to expect a node to initiate a BDX transfer. The transfer will send data to the node.
Expand Down
10 changes: 5 additions & 5 deletions src/controller/python/chip/bdx/bdx-transfer-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace chip {
namespace bdx {

CHIP_ERROR BdxTransferServer::Init(Messaging::ExchangeManager * exchangeManager)
CHIP_ERROR TestBdxTransferServer::Init(Messaging::ExchangeManager * exchangeManager)
{
VerifyOrReturnError(exchangeManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
mExchangeManager = exchangeManager;
Expand All @@ -35,23 +35,23 @@ CHIP_ERROR BdxTransferServer::Init(Messaging::ExchangeManager * exchangeManager)
return mExchangeManager->RegisterUnsolicitedMessageHandlerForProtocol(Protocols::BDX::Id, this);
}

void BdxTransferServer::Shutdown()
void TestBdxTransferServer::Shutdown()
{
VerifyOrReturn(mExchangeManager != nullptr);
LogErrorOnFailure(mExchangeManager->UnregisterUnsolicitedMessageHandlerForProtocol(Protocols::BDX::Id));
mExchangeManager = nullptr;
}

CHIP_ERROR BdxTransferServer::OnUnsolicitedMessageReceived(const PayloadHeader & payloadHeader,
Messaging::ExchangeDelegate *& delegate)
CHIP_ERROR TestBdxTransferServer::OnUnsolicitedMessageReceived(const PayloadHeader & payloadHeader,
Messaging::ExchangeDelegate *& delegate)
{
BdxTransfer * transfer = mBdxTransferPool->Allocate();
VerifyOrReturnError(transfer != nullptr, CHIP_ERROR_NO_MEMORY);
delegate = transfer;
return CHIP_NO_ERROR;
}

void BdxTransferServer::OnExchangeCreationFailed(Messaging::ExchangeDelegate * delegate)
void TestBdxTransferServer::OnExchangeCreationFailed(Messaging::ExchangeDelegate * delegate)
{
BdxTransfer * transfer = static_cast<BdxTransfer *>(delegate);
transfer->mDelegate->TransferCompleted(transfer, CHIP_ERROR_CONNECTION_ABORTED);
Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/bdx/bdx-transfer-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ namespace bdx {

// 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
class TestBdxTransferServer : public Messaging::UnsolicitedMessageHandler
{
public:
BdxTransferServer(BdxTransferPool & bdxTransferPool) : mBdxTransferPool(&bdxTransferPool) {}
TestBdxTransferServer(BdxTransferPool & bdxTransferPool) : mBdxTransferPool(&bdxTransferPool) {}

CHIP_ERROR Init(Messaging::ExchangeManager * exchangeManager);
void Shutdown();
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/bdx/bdx-transfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BdxTransfer : public Responder
chip::System::PacketBufferHandle && payload) override;

private:
friend class BdxTransferServer;
friend class TestBdxTransferServer;

void EndSession(CHIP_ERROR result);
CHIP_ERROR SendMessage(TransferSession::OutputEvent & event);
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/bdx/bdx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class TransferDelegate : public bdx::BdxTransfer::Delegate
TransferMap gTransfers;
TransferDelegate gBdxTransferDelegate(&gTransfers);
bdx::BdxTransferManager gBdxTransferManager(&gBdxTransferDelegate);
bdx::BdxTransferServer gBdxTransferServer(gBdxTransferManager);
bdx::TestBdxTransferServer gBdxTransferServer(gBdxTransferManager);

void ReleaseTransfer(System::Layer * systemLayer, bdx::BdxTransfer * transfer)
{
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TestBdxTransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def steps_bdx_transfer(self) -> list[TestStep]:
@async_test_body
async def test_bdx_transfer(self):
self.step(1)
bdx_future: asyncio.futures.Future = self.default_controller.PrepareToReceiveBdxData()
bdx_future: asyncio.futures.Future = self.default_controller.TestOnlyPrepareToReceiveBdxData()

self.step(2)
file_designator = "filename"
Expand Down

0 comments on commit 024a8a9

Please sign in to comment.