From 4cb187c634bd723fdbd8201bd2908d028c6d8c1f Mon Sep 17 00:00:00 2001 From: Christophe Calmejane Date: Mon, 30 Oct 2023 12:20:04 +0100 Subject: [PATCH] Added comment regarding #141 --- src/controller/avdeccControllerImplHandlers.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/controller/avdeccControllerImplHandlers.cpp b/src/controller/avdeccControllerImplHandlers.cpp index df86c1d6..c2a2b3b9 100644 --- a/src/controller/avdeccControllerImplHandlers.cpp +++ b/src/controller/avdeccControllerImplHandlers.cpp @@ -149,6 +149,15 @@ void ControllerImpl::onGetDynamicInfoResult(entity::controller::Interface const* } } + /* + For the time being, we reject the whole command if there is at least one error in a sub-command. + This is easier to handle, as the fallback will be to query everything again one by one without having to keep track of what was already queried. + Improvement would be to handle each sub-command error individually and only retrieve the missing information. + When doing this, we shall probably remove the generic handle of the error (the 'if' with the 'break' inside it) and handle errors in each commandType so we can query what we are missing. + We'll probably no longer the 'gotError' variable either as we'll have some sort of 'processGetDynamicInfoFailureStatus' for each commandType to fallback if needed. Be careful with the main status code as well, as processGetDynamicInfoFailureStatus doesn't expect to be called with SUCCESS. + The best solution would be to be able to dispatch to the real onXXXResult handler for each commandType. + See https://github.com/L-Acoustics/avdecc/issues/141 + */ auto gotError = !updatedStatus; if (!gotError) { @@ -159,6 +168,7 @@ void ControllerImpl::onGetDynamicInfoResult(entity::controller::Interface const* gotError |= !st; if (gotError) { + updatedStatus = st; LOG_CONTROLLER_DEBUG(entityID, "GetDynamicInfo failed for commandType={} with status={}", static_cast(commandType), entity::ControllerEntity::statusToString(st)); break; }