Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
nivi-apple and bzbarsky-apple authored Dec 2, 2023
1 parent e5340b4 commit 5a37be1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LogProvider : public LogProviderDelegate

~LogProvider(){};

static inline LogProvider & getLogProvider() { return sInstance; }
static inline LogProvider & GetInstance() { return sInstance; }

private:
Optional<std::string> GetLogFilePath(IntentEnum logType);
Expand Down
4 changes: 2 additions & 2 deletions src/app/bdx/DiagnosticLogsBDXTransferHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void DiagnosticLogsBDXTransferHandler::HandleBDXError(CHIP_ERROR error)
VerifyOrReturn(error != CHIP_NO_ERROR);
LogErrorOnFailure(error);

// If Send Accept was not received, send a response with status Denied to the RetreiveLogRequest
// If Send Accept was not received, send a response with status Denied to the RetrieveLogsRequest
if (!mIsAcceptReceived)
{
DiagnosticLogsServer::Instance().SendCommandResponse(StatusEnum::kDenied);
Expand Down Expand Up @@ -176,7 +176,7 @@ void DiagnosticLogsBDXTransferHandler::HandleTransferSessionOutput(TransferSessi
mTransfer.AbortTransfer(GetBdxStatusCodeFromChipError(CHIP_ERROR_INCORRECT_STATE));
return;
}
// Send a response with status Success to the RetreiveLogRequest, since we got a SendAccept message.
// Send a response with status Success to the RetrieveLogsRequest, since we got a SendAccept message.
DiagnosticLogsServer::Instance().SendCommandResponse(StatusEnum::kSuccess);

[[fallthrough]];
Expand Down
4 changes: 2 additions & 2 deletions src/app/bdx/DiagnosticLogsBDXTransferHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class DiagnosticLogsBDXTransferHandler : public bdx::Initiator
* It starts the BDX transfer session by calling InitiateTransfer of the which sends the SendInit BDX message
* to the log requestor.
*
* @param[in] exchangeMgr The exchange manager from the command handler object for the RetreiveLogRequest command
* @param[in] sessionHandle The session handle from the command handler object for the RetreiveLogRequest command
* @param[in] exchangeMgr The exchange manager from the command handler object for the RetrieveLogsRequest command
* @param[in] sessionHandle The session handle from the command handler object for the RetrieveLogsRequest command
* @param[in] fabricIndex The fabric index of the requestor
* @param[in] peerNodeId The node id of the requestor
* @param[in] delegate The log provider delegate that will provide the log chunks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool IsLogProviderDelegateNull(LogProviderDelegate * logProviderDelegate, Endpoi
return false;
}

} // namespace
} // anonymous namespace

DiagnosticLogsServer DiagnosticLogsServer::sInstance;

Expand Down Expand Up @@ -97,7 +97,7 @@ CHIP_ERROR DiagnosticLogsServer::HandleLogRequestForBDXProtocol(Messaging::Excha
VerifyOrReturnError(exchangeCtx != nullptr, CHIP_ERROR_INCORRECT_STATE);

mIntent = intent;
auto scopedPeerNodeId = ScopedNodeId();
ScopedNodeId scopedPeerNodeId;
if (exchangeCtx->HasSessionHandle())
{
auto sessionHandle = exchangeCtx->GetSessionHandle();
Expand Down Expand Up @@ -193,7 +193,7 @@ void DiagnosticLogsServer::HandleLogRequestForResponsePayload(CommandHandler * c

bool isEOF = false;

// Get the log chunk of size kMaxLogContentSize to send in the response payload.
// Get the log chunk of size up to kMaxLogContentSize to send in the response payload.
CHIP_ERROR err = logProviderDelegate->GetNextChunk(mLogSessionHandle, mutableBuffer, isEOF);

if (err != CHIP_NO_ERROR)
Expand Down
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDiagnosticsLogDownloadTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
NS_ASSUME_NONNULL_BEGIN

/**
* This class handles the task downloading a log file requested by the MTRDevice. It creates a new
* This class handles downloading a log file requested by the MTRDevice. It creates a new
* MTRDiagnosticsLogTransferHandler to prepare for the BDX transfer session and handle the BDX
* messages and transfer events and downloads the file.
*
Expand Down
6 changes: 3 additions & 3 deletions src/darwin/Framework/CHIPTests/MTRDeviceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ - (void)test029_DownloadEndUserSupportLog_NoTimeout
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, kDownloadLogDelayTimeoutInSeconds * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self testDownloadLogOfType:MTRDiagnosticLogTypeEndUserSupport timeout:0 logFilePath:outFile logFileSize:(10 * 1024) expectation:expectation];
});
[self waitForExpectations:[NSArray arrayWithObject:expectation] timeout:(kDownloadLogTimeoutInSeconds + kDownloadLogDelayTimeoutInSeconds)];
[self waitForExpectations:@[ expectation ] timeout:(kDownloadLogTimeoutInSeconds + kDownloadLogDelayTimeoutInSeconds)];
}

- (void)test030_DownloadNetworkDiagnosticsLog_NoTimeout
Expand All @@ -2730,7 +2730,7 @@ - (void)test030_DownloadNetworkDiagnosticsLog_NoTimeout
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, kDownloadLogDelayTimeoutInSeconds * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self testDownloadLogOfType:MTRDiagnosticLogTypeNetworkDiagnostics timeout:0 logFilePath:outFile logFileSize:(4 * 1024) expectation:expectation];
});
[self waitForExpectations:[NSArray arrayWithObject:expectation] timeout:(kDownloadLogTimeoutInSeconds + kDownloadLogDelayTimeoutInSeconds)];
[self waitForExpectations:@[ expectation ] timeout:(kDownloadLogTimeoutInSeconds + kDownloadLogDelayTimeoutInSeconds)];
}

- (void)test031_DownloadCrashLog_NoTimeout
Expand All @@ -2743,7 +2743,7 @@ - (void)test031_DownloadCrashLog_NoTimeout
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, kDownloadLogDelayTimeoutInSeconds * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self testDownloadLogOfType:MTRDiagnosticLogTypeCrash timeout:0 logFilePath:outFile logFileSize:(3 * 1024) expectation:expectation];
});
[self waitForExpectations:[NSArray arrayWithObject:expectation] timeout:(kDownloadLogTimeoutInSeconds + kDownloadLogDelayTimeoutInSeconds)];
[self waitForExpectations:@[ expectation ] timeout:(kDownloadLogTimeoutInSeconds + kDownloadLogDelayTimeoutInSeconds)];
}

- (void)test900_SubscribeAllAttributes
Expand Down

0 comments on commit 5a37be1

Please sign in to comment.