From 7f85d1d9dcf32337bf466f36f2421301c97bb064 Mon Sep 17 00:00:00 2001 From: Joonhaeng Heo Date: Fri, 29 Nov 2024 16:11:11 +0900 Subject: [PATCH] Restyled --- .../clusterclient/DiagnosticLogFragment.kt | 15 ++-- .../java/AndroidLogDownloadFromNode.cpp | 73 +++++++++++-------- .../java/AndroidLogDownloadFromNode.h | 20 +++-- .../java/BdxDiagnosticLogsReceiver.cpp | 38 ++++++---- .../java/BdxDiagnosticLogsReceiver.h | 15 ++-- 5 files changed, 95 insertions(+), 66 deletions(-) diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/DiagnosticLogFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/DiagnosticLogFragment.kt index 26d09051814746..41da838f4ef103 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/DiagnosticLogFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/DiagnosticLogFragment.kt @@ -21,7 +21,8 @@ import com.google.chip.chiptool.databinding.DiagnosticLogFragmentBinding import java.io.File import java.io.FileOutputStream import java.io.IOException -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch class DiagnosticLogFragment : Fragment() { private val deviceController: ChipDeviceController @@ -87,18 +88,18 @@ class DiagnosticLogFragment : Fragment() { mDownloadFile?.let { showNotification(it) } ?: return } - override fun onTransferData( - fabricIndex: Int, - nodeId: Long, - data: ByteArray - ): Boolean { + override fun onTransferData(fabricIndex: Int, nodeId: Long, data: ByteArray): Boolean { Log.d(TAG, "onTransferData : ${data.size}") if (mDownloadFileOutputStream == null) { Log.d(TAG, "mDownloadFileOutputStream or mDownloadFile is null") return false } + return addData(mDownloadFileOutputStream!!, data) + } + + private fun addData(outputStream: FileOutputStream, data: ByteArray): Boolean { try { - mDownloadFileOutputStream!!.write(data) + outputStream.write(data) } catch (e: IOException) { Log.d(TAG, "IOException", e) return false diff --git a/src/controller/java/AndroidLogDownloadFromNode.cpp b/src/controller/java/AndroidLogDownloadFromNode.cpp index 2b766fa36c47f7..621ece6887fd57 100644 --- a/src/controller/java/AndroidLogDownloadFromNode.cpp +++ b/src/controller/java/AndroidLogDownloadFromNode.cpp @@ -18,10 +18,10 @@ #include "AndroidLogDownloadFromNode.h" -#include -#include #include #include +#include +#include using namespace chip::app::Clusters; @@ -30,8 +30,9 @@ namespace Controller { // Max Length is below 8 CharSpan toIntentCharSpan(DiagnosticLogs::IntentEnum intent) -{ - switch (intent) { +{ + switch (intent) + { case DiagnosticLogs::IntentEnum::kEndUserSupport: return CharSpan::fromCharString("EndUser"); case DiagnosticLogs::IntentEnum::kNetworkDiag: @@ -43,16 +44,17 @@ CharSpan toIntentCharSpan(DiagnosticLogs::IntentEnum intent) } } -AndroidLogDownloadFromNode::AndroidLogDownloadFromNode(chip::Controller::DeviceController * controller, NodeId remoteNodeId, DiagnosticLogs::IntentEnum intent, uint16_t timeout, jobject jCallbackObject) - : mController(controller), mOnDeviceConnectedCallback(&OnDeviceConnectedFn, this), - mOnDeviceConnectionFailureCallback(&OnDeviceConnectionFailureFn, this), - mOnBdxTransferCallback(&OnBdxTransferCallback, this), - mOnBdxTransferSuccessCallback(&OnBdxTransferSuccessCallback, this), +AndroidLogDownloadFromNode::AndroidLogDownloadFromNode(chip::Controller::DeviceController * controller, NodeId remoteNodeId, + DiagnosticLogs::IntentEnum intent, uint16_t timeout, + jobject jCallbackObject) : + mController(controller), + mOnDeviceConnectedCallback(&OnDeviceConnectedFn, this), mOnDeviceConnectionFailureCallback(&OnDeviceConnectionFailureFn, this), + mOnBdxTransferCallback(&OnBdxTransferCallback, this), mOnBdxTransferSuccessCallback(&OnBdxTransferSuccessCallback, this), mOnBdxTransferFailureCallback(&OnBdxTransferFailureCallback, this) { mRemoteNodeId = remoteNodeId; - mIntent = intent; - mTimeout = timeout; + mIntent = intent; + mTimeout = timeout; if (mJavaCallback.Init(jCallbackObject) != CHIP_NO_ERROR) { @@ -61,9 +63,11 @@ AndroidLogDownloadFromNode::AndroidLogDownloadFromNode(chip::Controller::DeviceC } } -CHIP_ERROR AndroidLogDownloadFromNode::LogDownloadFromNode(DeviceController * controller, NodeId remoteNodeId, DiagnosticLogs::IntentEnum intent, uint16_t timeout, jobject jcallback) +CHIP_ERROR AndroidLogDownloadFromNode::LogDownloadFromNode(DeviceController * controller, NodeId remoteNodeId, + DiagnosticLogs::IntentEnum intent, uint16_t timeout, jobject jcallback) { - VerifyOrReturnValue(controller != nullptr && jcallback != nullptr && remoteNodeId != kUndefinedNodeId, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnValue(controller != nullptr && jcallback != nullptr && remoteNodeId != kUndefinedNodeId, + CHIP_ERROR_INVALID_ARGUMENT); auto * logDownload = new AndroidLogDownloadFromNode(controller, remoteNodeId, intent, timeout, jcallback); VerifyOrReturnValue(logDownload != nullptr, CHIP_ERROR_NO_MEMORY); @@ -84,10 +88,11 @@ CHIP_ERROR AndroidLogDownloadFromNode::GetConnectedDevice() return mController->GetConnectedDevice(mRemoteNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); } -CHIP_ERROR AndroidLogDownloadFromNode::SendRetrieveLogsRequest(Messaging::ExchangeManager & exchangeMgr, const SessionHandle & sessionHandle) +CHIP_ERROR AndroidLogDownloadFromNode::SendRetrieveLogsRequest(Messaging::ExchangeManager & exchangeMgr, + const SessionHandle & sessionHandle) { DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; - request.intent = mIntent; + request.intent = mIntent; request.requestedProtocol = DiagnosticLogs::TransferProtocolEnum::kBdx; CHIP_ERROR err = chip::bdx::MakeURI(mRemoteNodeId, toIntentCharSpan(mIntent), mFileDesignator); @@ -97,7 +102,9 @@ CHIP_ERROR AndroidLogDownloadFromNode::SendRetrieveLogsRequest(Messaging::Exchan FinishLogDownloadFromNode(err); } - mBdxReceiver = new BdxDiagnosticLogsReceiver(&mOnBdxTransferCallback, &mOnBdxTransferSuccessCallback, &mOnBdxTransferFailureCallback, mController->GetFabricIndex(), mRemoteNodeId, mFileDesignator); + mBdxReceiver = + new BdxDiagnosticLogsReceiver(&mOnBdxTransferCallback, &mOnBdxTransferSuccessCallback, &mOnBdxTransferFailureCallback, + mController->GetFabricIndex(), mRemoteNodeId, mFileDesignator); VerifyOrReturnValue(mBdxReceiver != nullptr, CHIP_ERROR_NO_MEMORY); auto systemState = DeviceControllerFactory::GetInstance().GetSystemState(); @@ -107,7 +114,7 @@ CHIP_ERROR AndroidLogDownloadFromNode::SendRetrieveLogsRequest(Messaging::Exchan { mBdxReceiver->StartBDXTransferTimeout(mTimeout); } - + request.transferFileDesignator = MakeOptional(mFileDesignator); ClusterBase cluster(exchangeMgr, sessionHandle, 0); @@ -115,7 +122,7 @@ CHIP_ERROR AndroidLogDownloadFromNode::SendRetrieveLogsRequest(Messaging::Exchan } void AndroidLogDownloadFromNode::OnDeviceConnectedFn(void * context, Messaging::ExchangeManager & exchangeMgr, - const SessionHandle & sessionHandle) + const SessionHandle & sessionHandle) { CHIP_ERROR err = CHIP_NO_ERROR; auto * self = static_cast(context); @@ -139,7 +146,8 @@ void AndroidLogDownloadFromNode::OnDeviceConnectionFailureFn(void * context, con self->FinishLogDownloadFromNode(err); } -void AndroidLogDownloadFromNode::OnResponseRetrieveLogs(void * context, const DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) +void AndroidLogDownloadFromNode::OnResponseRetrieveLogs(void * context, + const DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) { auto * self = static_cast(context); VerifyOrReturn(self != nullptr, @@ -189,7 +197,7 @@ void AndroidLogDownloadFromNode::OnCommandFailure(void * context, CHIP_ERROR err void AndroidLogDownloadFromNode::FinishLogDownloadFromNode(CHIP_ERROR err) { CHIP_ERROR jniErr = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); JniLocalReferenceScope scope(env); if (err == CHIP_NO_ERROR) @@ -201,7 +209,8 @@ void AndroidLogDownloadFromNode::FinishLogDownloadFromNode(CHIP_ERROR err) VerifyOrReturn(jniErr == CHIP_NO_ERROR, ChipLogError(Controller, "Could not find onSuccess method")); - env->CallVoidMethod(mJavaCallback.ObjectRef(), onSuccessMethod, static_cast(mController->GetFabricIndex()), static_cast(mRemoteNodeId)); + env->CallVoidMethod(mJavaCallback.ObjectRef(), onSuccessMethod, static_cast(mController->GetFabricIndex()), + static_cast(mRemoteNodeId)); return; } @@ -222,10 +231,12 @@ void AndroidLogDownloadFromNode::FinishLogDownloadFromNode(CHIP_ERROR err) jniErr = JniReferences::GetInstance().FindMethod(env, mJavaCallback.ObjectRef(), "onError", "(IJJ)V", &onErrorMethod); VerifyOrReturn(jniErr == CHIP_NO_ERROR, ChipLogError(Controller, "Could not find onError method")); - env->CallVoidMethod(mJavaCallback.ObjectRef(), onErrorMethod, static_cast(mController->GetFabricIndex()), static_cast(mRemoteNodeId), static_cast(err.AsInteger())); + env->CallVoidMethod(mJavaCallback.ObjectRef(), onErrorMethod, static_cast(mController->GetFabricIndex()), + static_cast(mRemoteNodeId), static_cast(err.AsInteger())); } -void AndroidLogDownloadFromNode::OnBdxTransferCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, CHIP_ERROR *errInfoOnFailure) +void AndroidLogDownloadFromNode::OnBdxTransferCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, + const chip::ByteSpan & data, CHIP_ERROR * errInfoOnFailure) { auto * self = static_cast(context); VerifyOrReturn(self != nullptr, ChipLogProgress(Controller, "Send command failure callback with null context. Ignoring")); @@ -233,7 +244,8 @@ void AndroidLogDownloadFromNode::OnBdxTransferCallback(void * context, FabricInd self->OnTransferCallback(fabricIndex, remoteNodeId, data, errInfoOnFailure); } -void AndroidLogDownloadFromNode::OnTransferCallback(FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, CHIP_ERROR *errInfoOnFailure) +void AndroidLogDownloadFromNode::OnTransferCallback(FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, + CHIP_ERROR * errInfoOnFailure) { VerifyOrReturn(mJavaCallback.HasValidObjectRef(), ChipLogError(Controller, "mJavaCallback is invalid")); @@ -242,17 +254,17 @@ void AndroidLogDownloadFromNode::OnTransferCallback(FabricIndex fabricIndex, Nod jmethodID onTransferDataMethod; // Java method signature : boolean onTransferData(int fabricIndex, long nodeId, byte[] data) - *errInfoOnFailure = JniReferences::GetInstance().FindMethod(env, mJavaCallback.ObjectRef(), "onTransferData", - "(IJ[B)Z", &onTransferDataMethod); + *errInfoOnFailure = + JniReferences::GetInstance().FindMethod(env, mJavaCallback.ObjectRef(), "onTransferData", "(IJ[B)Z", &onTransferDataMethod); VerifyOrReturn(*errInfoOnFailure == CHIP_NO_ERROR, ChipLogError(Controller, "Could not find onTransferData method")); chip::ByteArray dataByteArray(env, data); - jboolean ret = env->CallBooleanMethod(mJavaCallback.ObjectRef(), onTransferDataMethod, static_cast(fabricIndex), static_cast(remoteNodeId), dataByteArray.jniValue()); + jboolean ret = env->CallBooleanMethod(mJavaCallback.ObjectRef(), onTransferDataMethod, static_cast(fabricIndex), + static_cast(remoteNodeId), dataByteArray.jniValue()); if (ret != JNI_TRUE) { - ChipLogError(Controller, "Transfer will be rejected.") - *errInfoOnFailure = CHIP_ERROR_INTERNAL; + ChipLogError(Controller, "Transfer will be rejected.") * errInfoOnFailure = CHIP_ERROR_INTERNAL; } } @@ -266,7 +278,8 @@ void AndroidLogDownloadFromNode::OnBdxTransferSuccessCallback(void * context, Fa self->FinishLogDownloadFromNode(CHIP_NO_ERROR); } -void AndroidLogDownloadFromNode::OnBdxTransferFailureCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, CHIP_ERROR status) +void AndroidLogDownloadFromNode::OnBdxTransferFailureCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, + CHIP_ERROR status) { ChipLogProgress(Controller, "OnBdxTransferFailureCallback: %" CHIP_ERROR_FORMAT, status.Format()); diff --git a/src/controller/java/AndroidLogDownloadFromNode.h b/src/controller/java/AndroidLogDownloadFromNode.h index e10515823a5d00..9d5c3d098afde2 100644 --- a/src/controller/java/AndroidLogDownloadFromNode.h +++ b/src/controller/java/AndroidLogDownloadFromNode.h @@ -46,10 +46,13 @@ class AndroidLogDownloadFromNode * @param[in] timeout Download log timeout value. If this value is 0, controller does not handle timeouts. * @param[in] callback The callback to call when Log Download data is received and when an error occurs */ - static CHIP_ERROR LogDownloadFromNode(DeviceController * controller, NodeId remoteNodeId, app::Clusters::DiagnosticLogs::IntentEnum intent, uint16_t timeout, jobject jCallbackObject); + static CHIP_ERROR LogDownloadFromNode(DeviceController * controller, NodeId remoteNodeId, + app::Clusters::DiagnosticLogs::IntentEnum intent, uint16_t timeout, + jobject jCallbackObject); private: - AndroidLogDownloadFromNode(DeviceController * controller, NodeId remoteNodeId, app::Clusters::DiagnosticLogs::IntentEnum intent, uint16_t timeout, jobject javaCallback); + AndroidLogDownloadFromNode(DeviceController * controller, NodeId remoteNodeId, app::Clusters::DiagnosticLogs::IntentEnum intent, + uint16_t timeout, jobject javaCallback); DeviceController * mController; @@ -67,20 +70,23 @@ class AndroidLogDownloadFromNode char mFileDesignatorBuffer[bdx::DiagnosticLogs::kMaxFileDesignatorLen]; MutableCharSpan mFileDesignator = MutableCharSpan(mFileDesignatorBuffer, bdx::DiagnosticLogs::kMaxFileDesignatorLen); - BdxDiagnosticLogsReceiver *mBdxReceiver = nullptr; - + BdxDiagnosticLogsReceiver * mBdxReceiver = nullptr; + CHIP_ERROR GetConnectedDevice(); CHIP_ERROR SendRetrieveLogsRequest(Messaging::ExchangeManager & exchangeMgr, const SessionHandle & sessionHandle); - void OnTransferCallback(FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, CHIP_ERROR *errInfoOnFailure); + void OnTransferCallback(FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, + CHIP_ERROR * errInfoOnFailure); void FinishLogDownloadFromNode(CHIP_ERROR err); static void OnDeviceConnectedFn(void * context, Messaging::ExchangeManager & exchangeMgr, const SessionHandle & sessionHandle); static void OnDeviceConnectionFailureFn(void * context, const ScopedNodeId & peerId, CHIP_ERROR error); - static void OnResponseRetrieveLogs(void * context, const app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data); + static void OnResponseRetrieveLogs(void * context, + const app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data); static void OnCommandFailure(void * context, CHIP_ERROR err); - static void OnBdxTransferCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, CHIP_ERROR *errInfoOnFailure); + static void OnBdxTransferCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, + CHIP_ERROR * errInfoOnFailure); static void OnBdxTransferSuccessCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId); static void OnBdxTransferFailureCallback(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, CHIP_ERROR status); }; diff --git a/src/controller/java/BdxDiagnosticLogsReceiver.cpp b/src/controller/java/BdxDiagnosticLogsReceiver.cpp index 7b6b0b510972f0..afb854024bd7ee 100644 --- a/src/controller/java/BdxDiagnosticLogsReceiver.cpp +++ b/src/controller/java/BdxDiagnosticLogsReceiver.cpp @@ -25,14 +25,18 @@ namespace Controller { using namespace ::chip::DeviceLayer; -BdxDiagnosticLogsReceiver::BdxDiagnosticLogsReceiver(Callback::Callback * onTransfer, Callback::Callback * onSuccess, Callback::Callback * onFailure, chip::FabricIndex fabricIndex, chip::NodeId nodeId, chip::CharSpan fileDesignator) +BdxDiagnosticLogsReceiver::BdxDiagnosticLogsReceiver(Callback::Callback * onTransfer, + Callback::Callback * onSuccess, + Callback::Callback * onFailure, + chip::FabricIndex fabricIndex, chip::NodeId nodeId, + chip::CharSpan fileDesignator) { - mOnBdxTransferCallback = onTransfer; + mOnBdxTransferCallback = onTransfer; mOnBdxTransferSuccessCallback = onSuccess; mOnBdxTransferFailureCallback = onFailure; - mFabricIndex = fabricIndex; - mNodeId = nodeId; + mFabricIndex = fabricIndex; + mNodeId = nodeId; mFileDesignator = fileDesignator; } @@ -40,7 +44,7 @@ CHIP_ERROR BdxDiagnosticLogsReceiver::OnTransferBegin(chip::bdx::BDXTransferProx { chip::CharSpan fileDesignator = transfer->GetFileDesignator(); chip::FabricIndex fabricIndex = transfer->GetFabricIndex(); - chip::NodeId nodeId = transfer->GetPeerNodeId(); + chip::NodeId nodeId = transfer->GetPeerNodeId(); if (mFileDesignator.data_equal(fileDesignator) && mFabricIndex == fabricIndex && mNodeId == nodeId) { @@ -58,7 +62,7 @@ CHIP_ERROR BdxDiagnosticLogsReceiver::OnTransferEnd(chip::bdx::BDXTransferProxy { ChipLogProgress(Controller, "OnTransferEnd: %" CHIP_ERROR_FORMAT, error.Format()); chip::FabricIndex fabricIndex = transfer->GetFabricIndex(); - chip::NodeId nodeId = transfer->GetPeerNodeId(); + chip::NodeId nodeId = transfer->GetPeerNodeId(); if (error == CHIP_NO_ERROR) { mOnBdxTransferSuccessCallback->mCall(mOnBdxTransferCallback->mContext, fabricIndex, nodeId); @@ -74,7 +78,7 @@ CHIP_ERROR BdxDiagnosticLogsReceiver::OnTransferData(chip::bdx::BDXTransferProxy { ChipLogProgress(Controller, "OnTransferData"); chip::FabricIndex fabricIndex = transfer->GetFabricIndex(); - chip::NodeId nodeId = transfer->GetPeerNodeId(); + chip::NodeId nodeId = transfer->GetPeerNodeId(); CHIP_ERROR err = CHIP_NO_ERROR; @@ -93,21 +97,23 @@ CHIP_ERROR BdxDiagnosticLogsReceiver::OnTransferData(chip::bdx::BDXTransferProxy CHIP_ERROR BdxDiagnosticLogsReceiver::StartBDXTransferTimeout(uint16_t timeoutInSeconds) { - ChipLogProgress(Controller, "StartBDXTransferTimeout %u", timeoutInSeconds); - return chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(timeoutInSeconds), OnTransferTimeout, static_cast(this)); + ChipLogProgress(Controller, "StartBDXTransferTimeout %u", timeoutInSeconds); + return chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(timeoutInSeconds), OnTransferTimeout, + static_cast(this)); } void BdxDiagnosticLogsReceiver::CancelBDXTransferTimeout() { - ChipLogProgress(Controller, "CancelBDXTransferTimeout"); - chip::DeviceLayer::SystemLayer().CancelTimer(OnTransferTimeout, static_cast(this)); + ChipLogProgress(Controller, "CancelBDXTransferTimeout"); + chip::DeviceLayer::SystemLayer().CancelTimer(OnTransferTimeout, static_cast(this)); } void BdxDiagnosticLogsReceiver::OnTransferTimeout(chip::System::Layer * layer, void * context) { - ChipLogProgress(Controller, "OnTransferTimeout"); - auto * self = static_cast(context); - self->mOnBdxTransferFailureCallback->mCall(self->mOnBdxTransferFailureCallback->mContext, self->mFabricIndex, self->mNodeId, CHIP_ERROR_TIMEOUT); + ChipLogProgress(Controller, "OnTransferTimeout"); + auto * self = static_cast(context); + self->mOnBdxTransferFailureCallback->mCall(self->mOnBdxTransferFailureCallback->mContext, self->mFabricIndex, self->mNodeId, + CHIP_ERROR_TIMEOUT); } -} -} \ No newline at end of file +} // namespace Controller +} // namespace chip diff --git a/src/controller/java/BdxDiagnosticLogsReceiver.h b/src/controller/java/BdxDiagnosticLogsReceiver.h index 35156d5306be47..46cdbfab8e50a9 100644 --- a/src/controller/java/BdxDiagnosticLogsReceiver.h +++ b/src/controller/java/BdxDiagnosticLogsReceiver.h @@ -26,7 +26,8 @@ namespace chip { namespace Controller { -typedef void (*OnBdxTransfer)(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, CHIP_ERROR *errInfoOnFailure); +typedef void (*OnBdxTransfer)(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, const chip::ByteSpan & data, + CHIP_ERROR * errInfoOnFailure); typedef void (*OnBdxTransferSuccess)(void * context, FabricIndex fabricIndex, NodeId remoteNodeId); typedef void (*OnBdxTransferFailure)(void * context, FabricIndex fabricIndex, NodeId remoteNodeId, CHIP_ERROR status); @@ -35,7 +36,9 @@ constexpr uint32_t kMaxBDXReceiverURILen = 256; class BdxDiagnosticLogsReceiver : public chip::bdx::BDXTransferServerDelegate { public: - BdxDiagnosticLogsReceiver(Callback::Callback * onTransfer, Callback::Callback * onSuccess, Callback::Callback * onFailure, chip::FabricIndex fabricIndex, chip::NodeId nodeId, chip::CharSpan fileDesignator); + BdxDiagnosticLogsReceiver(Callback::Callback * onTransfer, Callback::Callback * onSuccess, + Callback::Callback * onFailure, chip::FabricIndex fabricIndex, + chip::NodeId nodeId, chip::CharSpan fileDesignator); ~BdxDiagnosticLogsReceiver() {} @@ -49,14 +52,14 @@ class BdxDiagnosticLogsReceiver : public chip::bdx::BDXTransferServerDelegate private: static void OnTransferTimeout(chip::System::Layer * layer, void * context); - + chip::Callback::Callback * mOnBdxTransferCallback; chip::Callback::Callback * mOnBdxTransferSuccessCallback; chip::Callback::Callback * mOnBdxTransferFailureCallback; chip::FabricIndex mFabricIndex = kUndefinedFabricIndex; - chip::NodeId mNodeId = kUndefinedNodeId; + chip::NodeId mNodeId = kUndefinedNodeId; chip::CharSpan mFileDesignator; }; -} -} \ No newline at end of file +} // namespace Controller +} // namespace chip