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 @file DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp
19 @detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL)
20 *****************************************************************************/
22 #include <vehicle_service/positioning_base_library.h>
23 #include "DeadReckoning_DataMaster.h"
25 /*************************************************/
27 /*************************************************/
28 static DEADRECKONING_DATA_MASTER gst_gyroscalefactor_level; // NOLINT(readability/nolint)
30 /************************************************************************
31 @brief GyroScaleFactorLevel initialization function
32 @outline GyroScaleFactorLevel initialization process data master
33 @type Completion return type
39 **************************************************************************** */
40 void DeadReckoningInitGyroScaleFactorLevelDr(void) { // LCOV_EXCL_START 8: dead code.
41 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
42 (void)memset(reinterpret_cast<void *>(&gst_gyroscalefactor_level), 0x00, sizeof(gst_gyroscalefactor_level));
43 gst_gyroscalefactor_level.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL;
44 gst_gyroscalefactor_level.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR_LEVEL;
45 gst_gyroscalefactor_level.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
46 gst_gyroscalefactor_level.dr_status = 0U; /* Not used */
49 /*************************************************************************
50 @brief GyroScaleFactorLevel SET function
51 @outline To update the master data GyroScaleFactorLevel
52 @type Completion return type
53 @param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data
56 @retval DEADRECKONING_EQ : No data changes<BR>
57 @retval DEADRECKONING_NEQ : With data changes<BR>
59 *****************************************************************************/
60 u_int8 DeadReckoningSetGyroScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
61 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
62 u_int8 uc_ret = DEADRECKONING_EQ;
63 DEADRECKONING_DATA_MASTER *p_st_master;
65 if (p_st_data == NULL) {
66 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
68 p_st_master = &gst_gyroscalefactor_level;
70 /** Compare data master and received data */
71 uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)),
72 (const void *)( &(p_st_data->uc_data)), (size_t)(p_st_data->us_size));
74 /** Received data is set in the data master. */
75 p_st_master->ul_did = p_st_data->ul_did;
76 p_st_master->us_size = p_st_data->us_size;
77 p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
78 p_st_master->dr_status = 0U; /* Not used */
80 (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)),
81 (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data));
87 /*************************************************************************
88 @brief GyroScaleFactorLevel GET function
89 @outline Master Data provides the GyroScaleFactorLevel
90 @type Completion return type
91 @param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
96 *****************************************************************************/
97 void DeadReckoningGetGyroScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *p_st_data) {
98 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
99 const DEADRECKONING_DATA_MASTER *p_st_master;
101 if (p_st_data == NULL) {
102 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
104 p_st_master = &gst_gyroscalefactor_level;
106 /** Store the data master in the specified destination. */
107 p_st_data->ul_did = p_st_master->ul_did;
108 p_st_data->us_size = p_st_master->us_size;
109 p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
110 p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */
111 (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)),
112 (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size);