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 NS_UtilityCenter
19 /// \brief This file contains declaration of APIs to calcuate 16-bit and 32-bit CRC checksum of file.
21 ////////////////////////////////////////////////////////////////////////////////////////////////////
27 #ifndef NS_NS_UTILITYCENTER_INC_NS_UTIL_CRC_H_ // NOLINT (build/header_guard)
28 #define NS_NS_UTILITYCENTER_INC_NS_UTIL_CRC_H_
30 #include <native_service/frameworkunified_types.h>
32 /** @addtogroup BaseSystem
35 /** @addtogroup native_service
39 /** @addtogroup framework_unified
40 * @ingroup native_service
43 /** @addtogroup utility
44 * @ingroup framework_unified
48 ////////////////////////////////////////////////////////////////////////////////////////////////
49 /// \ingroup NS_UtilityCenter
50 /// \~english @par Brief
51 /// Calculate the CRC value of the file
52 /// \~english @param [in] f_c_file_name
53 /// PCSTR - the file to be calculated
54 /// \~english @param [out] f_ui_check_sum
55 /// UI_16 - the CRC value of the file
56 /// \~english @retval eFrameworkunifiedStatusOK : Success
57 /// \~english @retval eFrameworkunifiedStatusFileLoadError : File Load Error
58 /// \~english @retval eFrameworkunifiedStatusInvldParam : Invalid Param
60 /// \~english @par Prerequisite
62 /// \~english @par Change of internal state
64 /// \~english @par Conditions of processing failure
65 /// - Failed to open the file. [eFrameworkunifiedStatusFileLoadError]
66 /// - The pointer f_c_file_name is NULL. [eFrameworkunifiedStatusInvldParam]
67 /// \~english @par Classification
69 /// \~english @par Type
71 /// \~english @par Detail
72 /// The function calculates the CRC value(16 bit) of the file f_c_file_name.
74 ////////////////////////////////////////////////////////////////////////////////////////////////
75 EFrameworkunifiedStatus CalculateCRC16(PCSTR f_c_file_name, UI_16 & f_ui_check_sum); // NOLINT (readability/nolint)
77 ////////////////////////////////////////////////////////////////////////////////////////////////
78 /// \ingroup NS_UtilityCenter
79 /// \~english @par Brief
80 /// Calculate the CRC value of the file
81 /// \~english @param [in] f_c_file_name
82 /// PCSTR - the file to be calculated
83 /// \~english @param [out] f_ui_check_sum
84 /// UI_32 - the CRC value of the file
85 /// \~english @retval eFrameworkunifiedStatusOK : Success
86 /// \~english @retval eFrameworkunifiedStatusFileLoadError : File Load Error
87 /// \~english @retval eFrameworkunifiedStatusInvldParam : Invalid Param
89 /// \~english @par Prerequisite
91 /// \~english @par Change of internal state
93 /// \~english @par Conditions of processing failure
94 /// - Failed to open the file. [eFrameworkunifiedStatusFileLoadError]
95 /// - The pointer f_c_file_name is NULL. [eFrameworkunifiedStatusInvldParam]
96 /// \~english @par Classification
98 /// \~english @par Type
100 /// \~english @par Detail
101 /// The function calculates the CRC value(32 bit) of the file f_c_file_name.
103 ////////////////////////////////////////////////////////////////////////////////////////////////
104 EFrameworkunifiedStatus CalculateCRC32(PCSTR f_c_file_name, UI_32 & f_ui_check_sum); // NOLINT (readability/nolint)
106 #endif // NS_NS_UTILITYCENTER_INC_NS_UTIL_CRC_H_ // NOLINT (build/header_guard)
108 /** @}*/ // end of utility
109 /** @}*/ // end of framework_unified
110 /** @}*/ // end of native_service
111 /** @}*/ // end of BaseSystem