diff --git a/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp b/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp index 825404005..242897d9d 100644 --- a/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp +++ b/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp @@ -26,18 +26,22 @@ namespace ${info.Title} { std::string ${info.Title}Impl::version(Firebolt::Error *err) const { JsonObject jsonParameters; - FireboltSDK::JSON::String jsonResult; + JsonData_Versions jsonResult; std::string version; Firebolt::Error status = Firebolt::Error::NotConnected; FireboltSDK::Transport* transport = FireboltSDK::Accessor::Instance().GetTransport(); if (transport != nullptr) { - + status = transport->Invoke("${info.title.lowercase}.version", jsonParameters, jsonResult); if (status == Firebolt::Error::None) { - FIREBOLT_LOG_INFO(FireboltSDK::Logger::Category::OpenRPC, FireboltSDK::Logger::Module(), "${info.Title}.version is successfully invoked, status: %s", jsonResult.Value().c_str()); - version = jsonResult.Value().c_str(); - /* TODO: Set major, minor values here*/ + !jsonResult.IsSet() ? jsonResult.Clear() : (void)0; + !jsonResult.Sdk.IsSet() ? jsonResult.Sdk.Clear() : (void)0; + jsonResult.Sdk.Major = static_cast(${major}); + jsonResult.Sdk.Minor = static_cast(${minor}); + jsonResult.Sdk.Patch = static_cast(${patch}); + jsonResult.Sdk.Readable = "${readable}"; + jsonResult.ToString(version); } } else {