From 17cf21bcf8a2e29d2cbcf0a313474d2a4ee44f5d Mon Sep 17 00:00:00 2001 From: Tadao Tanikawa Date: Fri, 20 Nov 2020 23:36:23 +0900 Subject: Re-organized sub-directory by category Since all the sub-directories were placed in the first level, created sub-directories, "hal", "module", and "service" for classification and relocated each component. Signed-off-by: Tadao Tanikawa Change-Id: Ifdf743ac0d1893bd8e445455cf0d2c199a011d5c --- .../src/Sensor/VehicleSens_Did_GyroTrouble.cpp | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100755 service/vehicle/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp (limited to 'service/vehicle/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp') diff --git a/service/vehicle/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp b/service/vehicle/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp new file mode 100755 index 0000000..e588c39 --- /dev/null +++ b/service/vehicle/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp @@ -0,0 +1,121 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/******************************************************************************* + * File name :VehicleSens_Did_GyroTrouble.cpp + * System name :PastModel002 + * Subsystem name :Vehicle sensor process + * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_TROUBLE) + * Module configuration :VehicleSensInitGyroTrouble() Vehicle Sensor GYRO TROUBLE Initialization Functions + * :VehicleSensSetGyroTrouble() Vehicle Sensor GYRO TROUBLE SET Functions + * :VehicleSensGetGyroTrouble() Vehicle Sensor GYRO TROUBLE GET Functions + ******************************************************************************/ + +#include +#include "VehicleSens_DataMaster.h" + +#define VEHICLE_SENS_DID_GYRO_TROUBLE_DEBUG_FACTORY 0 + +/*************************************************/ +/* Global variable */ +/*************************************************/ +static VEHICLESENS_DATA_MASTER_GYRO_TROUBLE gstGyroTrouble; // NOLINT(readability/nolint) + +/******************************************************************************* +* MODULE : VehicleSensInitGyroTrouble +* ABSTRACT : Vehicle sensor GYRO_TROUBLE initialization function +* FUNCTION : GYRO_TROUBLE data master initialization processing +* ARGUMENT : void +* NOTE : +* RETURN : void +******************************************************************************/ +void VehicleSensInitGyroTrouble(void) { + (void)memset(reinterpret_cast(&(gstGyroTrouble)), + static_cast(0x00), sizeof(VEHICLESENS_DATA_MASTER_GYRO_TROUBLE)); + gstGyroTrouble.ul_did = VEHICLE_DID_GYRO_TROUBLE; + gstGyroTrouble.us_size = VEHICLE_DSIZE_GYRO_TROUBLE; + gstGyroTrouble.uc_data = VEHICLE_DINIT_GYRO_TROUBLE; +} + +/******************************************************************************* +* MODULE : VehicleSensSetGyroTrouble +* ABSTRACT : Vehicle Sensor GYRO_TROUBLE SET Function +* FUNCTION : Update the GYRO_TROUBLE data master +* ARGUMENT : *pst_data : Pointer to received message data +* NOTE : +* RETURN : VEHICLESENS_EQ : No data change +* VEHICLESENS_NEQ : Data change +******************************************************************************/ +u_int8 VehicleSensSetGyroTrouble(const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *pst_data) { // LCOV_EXCL_START 8: dead code. + AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert + u_int8 uc_ret = VEHICLESENS_EQ; + VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_master; + + if (pst_data == NULL) { + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); + } else { + pst_master = &gstGyroTrouble; + + /* Compare data master and received data */ + uc_ret = VehicleSensmemcmp(&(pst_master->uc_data), &(pst_data->uc_data), pst_data->uc_size); + + /* Received data is set in the data master. */ + pst_master->ul_did = pst_data->ul_did; + pst_master->us_size = (u_int16)pst_data->uc_size; + pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; + pst_master->uc_data = pst_data->uc_data; + (void)memcpy(reinterpret_cast(&(pst_master->uc_data)), + (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data)); + } + +#if VEHICLE_SENS_DID_GYRO_TROUBLE_DEBUG_FACTORY + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] pst_data->ul_did == 0x%x", pst_data->ul_did); + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] gstGyroTrouble.ul_did == 0x%x\r\n", gstGyroTrouble.ul_did); + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] (u_int8)pst_data->ucSize == 0x%x", (u_int8)pst_data->uc_size); + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] gstGyroTrouble.us_size == 0x%x\r\n", gstGyroTrouble.us_size); + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] pst_data->uc_data == 0x%x", pst_data->uc_data); + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] gstGyroTrouble.uc_data == 0x%x\r\n", gstGyroTrouble.uc_data); +#endif + + return(uc_ret); +} + +/******************************************************************************* +* MODULE : VehicleSensGetGyroTrouble +* ABSTRACT : Vehicle Sensor GYRO TROUBLE GET Functions +* FUNCTION : Provide a GYRO TROUBLE data master +* ARGUMENT : *pst_data : Pointer to the data master acquisition destination +* NOTE : +* RETURN : void +******************************************************************************/ +void VehicleSensGetGyroTrouble(VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_data) { + AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert + const VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_master; + + if (pst_data == NULL) { + FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); + } else { + pst_master = &gstGyroTrouble; + + /* Store the data master in the specified destination. */ + pst_data->ul_did = pst_master->ul_did; + pst_data->us_size = pst_master->us_size; + pst_data->uc_rcvflag = pst_master->uc_rcvflag; + (void)memcpy(reinterpret_cast(&(pst_data->uc_data)), + (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data)); + } +} +// LCOV_EXCL_STOP -- cgit 1.2.3-korg