@@ -291,11 +291,6 @@ CHIP_ERROR TransferSession::PrepareBlockQuery()
291
291
292
292
ReturnErrorOnFailure (WriteToPacketBuffer (queryMsg, mPendingMsgHandle ));
293
293
294
- #if CHIP_AUTOMATION_LOGGING
295
- ChipLogAutomation (" Sending BDX Message" );
296
- queryMsg.LogMessage (msgType);
297
- #endif // CHIP_AUTOMATION_LOGGING
298
-
299
294
mAwaitingResponse = true ;
300
295
mLastQueryNum = mNextQueryNum ++;
301
296
@@ -319,11 +314,6 @@ CHIP_ERROR TransferSession::PrepareBlockQueryWithSkip(const uint64_t & bytesToSk
319
314
320
315
ReturnErrorOnFailure (WriteToPacketBuffer (queryMsg, mPendingMsgHandle ));
321
316
322
- #if CHIP_AUTOMATION_LOGGING
323
- ChipLogAutomation (" Sending BDX Message" );
324
- queryMsg.LogMessage (msgType);
325
- #endif // CHIP_AUTOMATION_LOGGING
326
-
327
317
mAwaitingResponse = true ;
328
318
mLastQueryNum = mNextQueryNum ++;
329
319
@@ -351,13 +341,12 @@ CHIP_ERROR TransferSession::PrepareBlock(const BlockData & inData)
351
341
352
342
const MessageType msgType = inData.IsEof ? MessageType::BlockEOF : MessageType::Block;
353
343
354
- #if CHIP_AUTOMATION_LOGGING
355
- ChipLogAutomation (" Sending BDX Message" );
356
- blockMsg.LogMessage (msgType);
357
- #endif // CHIP_AUTOMATION_LOGGING
358
-
359
344
if (msgType == MessageType::BlockEOF)
360
345
{
346
+ #if CHIP_AUTOMATION_LOGGING
347
+ ChipLogAutomation (" Sending BDX Message" );
348
+ blockMsg.LogMessage (msgType);
349
+ #endif // CHIP_AUTOMATION_LOGGING
361
350
mState = TransferState::kAwaitingEOFAck ;
362
351
}
363
352
@@ -382,11 +371,6 @@ CHIP_ERROR TransferSession::PrepareBlockAck()
382
371
383
372
ReturnErrorOnFailure (WriteToPacketBuffer (ackMsg, mPendingMsgHandle ));
384
373
385
- #if CHIP_AUTOMATION_LOGGING
386
- ChipLogAutomation (" Sending BDX Message" );
387
- ackMsg.LogMessage (msgType);
388
- #endif // CHIP_AUTOMATION_LOGGING
389
-
390
374
if (mState == TransferState::kTransferInProgress )
391
375
{
392
376
if (mControlMode == TransferControlFlags::kSenderDrive )
@@ -399,6 +383,10 @@ CHIP_ERROR TransferSession::PrepareBlockAck()
399
383
}
400
384
else if (mState == TransferState::kReceivedEOF )
401
385
{
386
+ #if CHIP_AUTOMATION_LOGGING
387
+ ChipLogAutomation (" Sending BDX Message" );
388
+ ackMsg.LogMessage (msgType);
389
+ #endif // CHIP_AUTOMATION_LOGGING
402
390
mState = TransferState::kTransferDone ;
403
391
mAwaitingResponse = false ;
404
392
}
@@ -475,20 +463,25 @@ CHIP_ERROR TransferSession::HandleBdxMessage(const PayloadHeader & header, Syste
475
463
476
464
const MessageType msgType = static_cast <MessageType>(header.GetMessageType ());
477
465
478
- #if CHIP_AUTOMATION_LOGGING
479
- ChipLogAutomation (" Handling received BDX Message" );
480
- #endif // CHIP_AUTOMATION_LOGGING
481
-
482
466
switch (msgType)
483
467
{
484
468
case MessageType::SendInit:
485
469
case MessageType::ReceiveInit:
470
+ #if CHIP_AUTOMATION_LOGGING
471
+ ChipLogAutomation (" Handling received BDX Message" );
472
+ #endif // CHIP_AUTOMATION_LOGGING
486
473
HandleTransferInit (msgType, std::move (msg));
487
474
break ;
488
475
case MessageType::SendAccept:
476
+ #if CHIP_AUTOMATION_LOGGING
477
+ ChipLogAutomation (" Handling received BDX Message" );
478
+ #endif // CHIP_AUTOMATION_LOGGING
489
479
HandleSendAccept (std::move (msg));
490
480
break ;
491
481
case MessageType::ReceiveAccept:
482
+ #if CHIP_AUTOMATION_LOGGING
483
+ ChipLogAutomation (" Handling received BDX Message" );
484
+ #endif // CHIP_AUTOMATION_LOGGING
492
485
HandleReceiveAccept (std::move (msg));
493
486
break ;
494
487
case MessageType::BlockQuery:
@@ -672,10 +665,6 @@ void TransferSession::HandleBlockQuery(System::PacketBufferHandle msgData)
672
665
673
666
mAwaitingResponse = false ;
674
667
mLastQueryNum = query.BlockCounter ;
675
-
676
- #if CHIP_AUTOMATION_LOGGING
677
- query.LogMessage (MessageType::BlockQuery);
678
- #endif // CHIP_AUTOMATION_LOGGING
679
668
}
680
669
681
670
void TransferSession::HandleBlockQueryWithSkip (System::PacketBufferHandle msgData)
@@ -695,10 +684,6 @@ void TransferSession::HandleBlockQueryWithSkip(System::PacketBufferHandle msgDat
695
684
mAwaitingResponse = false ;
696
685
mLastQueryNum = query.BlockCounter ;
697
686
mBytesToSkip .BytesToSkip = query.BytesToSkip ;
698
-
699
- #if CHIP_AUTOMATION_LOGGING
700
- query.LogMessage (MessageType::BlockQueryWithSkip);
701
- #endif // CHIP_AUTOMATION_LOGGING
702
687
}
703
688
704
689
void TransferSession::HandleBlock (System::PacketBufferHandle msgData)
@@ -733,10 +718,6 @@ void TransferSession::HandleBlock(System::PacketBufferHandle msgData)
733
718
mLastBlockNum = blockMsg.BlockCounter ;
734
719
735
720
mAwaitingResponse = false ;
736
-
737
- #if CHIP_AUTOMATION_LOGGING
738
- blockMsg.LogMessage (MessageType::Block);
739
- #endif // CHIP_AUTOMATION_LOGGING
740
721
}
741
722
742
723
void TransferSession::HandleBlockEOF (System::PacketBufferHandle msgData)
@@ -787,10 +768,6 @@ void TransferSession::HandleBlockAck(System::PacketBufferHandle msgData)
787
768
// In Receiver Drive, the Receiver can send a BlockAck to indicate receipt of the message and reset the timeout.
788
769
// In this case, the Sender should wait to receive a BlockQuery next.
789
770
mAwaitingResponse = (mControlMode == TransferControlFlags::kReceiverDrive );
790
-
791
- #if CHIP_AUTOMATION_LOGGING
792
- ackMsg.LogMessage (MessageType::BlockAck);
793
- #endif // CHIP_AUTOMATION_LOGGING
794
771
}
795
772
796
773
void TransferSession::HandleBlockAckEOF (System::PacketBufferHandle msgData)
0 commit comments