Remove unused directories and files in video_in_hal
[staging/basesystem.git] / systemservice / system_manager / server / src / ss_sm_version.cpp
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_SystemManager
19 /// \brief    This file provides support for module version management.
20 ///
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>
28 #include <iostream>
29 #include <string>
30 #include <sstream>
31 #include <fstream>
32 #include "ss_sm_systemmanagerlog.h"
33 #include "ss_sm_version.h"
34
35 using namespace std;  // NOLINT
36
37 CSMVersion::CSMVersion() {
38 }
39
40 CSMVersion::~CSMVersion() {
41 }
42
43 EFrameworkunifiedStatus CSMVersion::get_version(SS_VersionNumberType& f_VersionNumber) {
44   FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
45   CSSVer ver;
46
47   EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
48   f_VersionNumber = 0;
49
50   SSVER_PkgInfo info;
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
55   } else {
56     SS_ASERT(0);  // LCOV_EXCL_BR_LINE 15: marco defined in ss_templates.h  // NOLINT(whitespace/line_length)
57   }
58   FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
59   return l_eStatus;
60 }  // End of EFrameworkunifiedStatus CSMVersion::get_version(SS_VersionNumberType &f_VersionNumber)
61
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;
66   CSSVer ver;
67   SSVER_PkgInfo info;
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
72   } else {
73     SS_ASERT(0);  // LCOV_EXCL_BR_LINE 15: marco defined in ss_templates.h  // NOLINT(whitespace/line_length)
74   }
75   f_buildInfoStr = build_info_str;
76   FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
77   return l_eStatus;
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