From ae9f3ab5472f45d6f8826e27572b0b77e398376f Mon Sep 17 00:00:00 2001 From: Florent Peyrusse Date: Tue, 24 Oct 2023 16:38:02 +0200 Subject: [PATCH] refs #1210 Forward result of NorthService::sendToDispatcher() to the output of NorthService::operation(). Signed-off-by: Florent Peyrusse --- C/services/north/north.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C/services/north/north.cpp b/C/services/north/north.cpp index e9c81fb15e..01315d96c9 100755 --- a/C/services/north/north.cpp +++ b/C/services/north/north.cpp @@ -923,6 +923,7 @@ void NorthService::addConfigDefaults(DefaultConfigCategory& defaultConfig) * @param name Name of the variable to write * @param value Value to write to the variable * @param destination Where to write the value + * @return true if write was succesfully sent to dispatcher, else false */ bool NorthService::write(const string& name, const string& value, const ControlDestination destination) { @@ -952,6 +953,7 @@ bool NorthService::write(const string& name, const string& value, const ControlD * @param value Value to write to the variable * @param destination Where to write the value * @param arg Argument used to determine destination + * @return true if write was succesfully sent to dispatcher, else false */ bool NorthService::write(const string& name, const string& value, const ControlDestination destination, const string& arg) { @@ -999,6 +1001,7 @@ bool NorthService::write(const string& name, const string& value, const ControlD * @param paramCount The number of parameters * @param parameters The parameters to the operation * @param destination Where to write the value + * @return -1 in case of error on operation destination, 1 if operation was succesfully sent to dispatcher, else 0 */ int NorthService::operation(const string& name, int paramCount, char *names[], char *parameters[], const ControlDestination destination) { @@ -1030,8 +1033,7 @@ int NorthService::operation(const string& name, int paramCount, char *names[], payload += ","; } payload += " } } }"; - sendToDispatcher("/dispatch/operation", payload); - return -1; + return static_cast(sendToDispatcher("/dispatch/operation", payload)); } /** @@ -1042,6 +1044,7 @@ int NorthService::operation(const string& name, int paramCount, char *names[], * @param parameters The parameters to the operation * @param destination Where to write the value * @param arg Argument used to determine destination + * @return 1 if operation was succesfully sent to dispatcher, else 0 */ int NorthService::operation(const string& name, int paramCount, char *names[], char *parameters[], const ControlDestination destination, const string& arg) { @@ -1090,8 +1093,7 @@ int NorthService::operation(const string& name, int paramCount, char *names[], c payload += ","; } payload += "} } }"; - sendToDispatcher("/dispatch/operation", payload); - return -1; + return static_cast(sendToDispatcher("/dispatch/operation", payload)); } /**