From 06ee911f4bcfa88481c6463d35f6ea6b5a4886e6 Mon Sep 17 00:00:00 2001 From: Tapasya Patki Date: Thu, 1 Aug 2024 18:30:59 -0700 Subject: [PATCH] Remove any debuggind related print statements. --- src/services/variorum/Variorum.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/services/variorum/Variorum.cpp b/src/services/variorum/Variorum.cpp index 1f807a9d1..468d1a071 100644 --- a/src/services/variorum/Variorum.cpp +++ b/src/services/variorum/Variorum.cpp @@ -46,21 +46,24 @@ std::tuple measure(const std::string& name) return std::make_tuple(false, val); } - //Extract and print values from JSON object + //Extract the values from JSON object energy_obj = json_loads(s, JSON_DECODE_ANY, NULL); void *iter = json_object_iter(energy_obj); while (iter) { - node_obj = json_object_iter_value(iter); - if (node_obj == NULL) - { - printf("JSON object not found"); - exit(0); - } + node_obj = json_object_iter_value(iter); + if (node_obj == NULL) + { + printf("JSON object not found."); + exit(0); + } /* The following should return NULL after the first call per our object. */ iter = json_object_iter_next(energy_obj, iter); - } + + } + + energy_joules = json_integer_value(json_object_get(node_obj, name.c_str())); //Deallocate the string free(s);