2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_SystemManager
19 /// \brief This file provides support for module version management.
21 ///////////////////////////////////////////////////////////////////////////////
22 #include <system_service/ss_package.h>
23 #include <system_service/ss_ver.h>
24 #include <system_service/ss_templates.h>
25 #include <system_service/ss_string_maps.h>
26 #include <system_service/ss_system_manager_protocol.h>
27 #include <system_service/ss_system_manager_protocol_local.h>
32 #include "ss_sm_systemmanagerlog.h"
33 #include "ss_sm_version.h"
35 using namespace std; // NOLINT
37 CSMVersion::CSMVersion() {
40 CSMVersion::~CSMVersion() {
43 EFrameworkunifiedStatus CSMVersion::get_version(SS_VersionNumberType& f_VersionNumber) {
44 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
47 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
51 l_eStatus = ver.getPkgInfo(SS_PKG_MAIN_EMMC, &info);
52 if (l_eStatus == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 6: To initialize conditions for launching SystemManager
53 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
54 f_VersionNumber = strtoull(info.version, NULL, 10); // LCOV_EXCL_LINE 6: To initialize conditions for launching SystemManager
56 SS_ASERT(0); // LCOV_EXCL_BR_LINE 15: marco defined in ss_templates.h // NOLINT(whitespace/line_length)
58 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
60 } // End of EFrameworkunifiedStatus CSMVersion::get_version(SS_VersionNumberType &f_VersionNumber)
62 EFrameworkunifiedStatus CSMVersion::get_build_info(std::string& f_buildInfoStr) {
63 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
64 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
65 std::string build_info_str;
68 l_eStatus = ver.getPkgInfo(SS_PKG_MAIN_PRODUCT_SI, &info);
69 if (l_eStatus == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 6: To initialize conditions for launching SystemManager
70 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
71 build_info_str += info.version; // LCOV_EXCL_LINE 6: To initialize conditions for launching SystemManager
73 SS_ASERT(0); // LCOV_EXCL_BR_LINE 15: marco defined in ss_templates.h // NOLINT(whitespace/line_length)
75 f_buildInfoStr = build_info_str;
76 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
78 } // LCOV_EXCL_BR_LINE 10: Final line End of EFrameworkunifiedStatus CSMVersion::get_build_info(SS_String &f_buildInfoStr)
79 // EOF /SS_SystemManager/src/ss_sm_version.cpp