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 name :VehicleSens_Did_SysGpsInterruptSignal.cpp
19 * System name :PastModel002
20 * Subsystem name :Vehicle sensor process
21 * Program name :Vehicle sensor data master(VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL)
22 * Module configuration :VehicleSensInitSysGpsInterruptSignal() Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL initialization function
23 * :VehicleSensSetSysGpsInterruptSignal() Vehicle Sensor Sys_GPS_INTERRUPT_SIGNAL SET Function
24 * :VehicleSensGetSysGpsInterruptSignal() Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL GET function
25 ******************************************************************************/
27 #include <vehicle_service/positioning_base_library.h>
28 #include "VehicleSens_DataMaster.h"
30 #define VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY 0
32 /*************************************************/
34 /*************************************************/
35 static VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL gstSysGpsInterruptSignal; // NOLINT(readability/nolint)
37 /*******************************************************************************
38 * MODULE : VehicleSensInitSysGpsInterruptSignal
39 * ABSTRACT : Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL initialization function
40 * FUNCTION : Sys_GPS_INTERRUPT_SIGNAL data master initialization processing
44 ******************************************************************************/
45 void VehicleSensInitSysGpsInterruptSignal(void) {
46 (void)memset(reinterpret_cast<void *>(&(gstSysGpsInterruptSignal)), static_cast<int>(0x00),
47 sizeof(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL));
48 gstSysGpsInterruptSignal.ul_did = VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL;
49 gstSysGpsInterruptSignal.us_size = VEHICLE_DSIZE_SYS_GPS_INTERRUPT_SIGNAL;
50 gstSysGpsInterruptSignal.uc_data = VEHICLE_DINIT_SYS_GPS_INTERRUPT_SIGNAL;
52 #if VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY
53 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
54 "#[FACTORY] gstSysGpsInterruptSignal.uc_data == 0x%x\r\n", gstSysGpsInterruptSignal.uc_data);
58 /*******************************************************************************
59 * MODULE : VehicleSensSetSysGpsInterruptSignal
60 * ABSTRACT : Vehicle sensor SYS_GPS_INTERRUPT_SIGNAL SET function
61 * FUNCTION : Update the Sys_GPS_INTERRUPT_SIGNAL data master
62 * ARGUMENT : *pst_data : Pointer to received message data
64 * RETURN : VEHICLESENS_EQ : No data change
65 * VEHICLESENS_NEQ : Data change
66 ******************************************************************************/
67 u_int8 VehicleSensSetSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
68 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
69 u_int8 uc_ret = VEHICLESENS_EQ;
70 VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master;
72 if (pst_data == NULL) {
73 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
75 pst_master = &gstSysGpsInterruptSignal;
77 /* Compare data master and received data */
78 uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)),
79 (const void *)(&(pst_data->uc_data)), (size_t)(pst_data->uc_size));
81 /* Received data is set in the data master. */
82 pst_master->ul_did = pst_data->ul_did;
83 pst_master->us_size = (u_int16)pst_data->uc_size;
84 pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
85 (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)),
86 (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data));
88 #if VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY
89 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
90 "#[FACTORY] pst_data->ul_did == 0x%x", pst_data->ul_did);
91 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
92 "#[FACTORY] gstSysGpsInterruptSignal.ul_did == 0x%x\r\n", gstSysGpsInterruptSignal.ul_did);
93 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
94 "#[FACTORY] (u_int8)pst_data->ucSize == 0x%x", (u_int8)pst_data->uc_size);
95 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
96 "#[FACTORY] gstSysGpsInterruptSignal.us_size == 0x%x\r\n", gstSysGpsInterruptSignal.us_size);
97 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
98 "#[FACTORY] pst_data->uc_data == 0x%x", pst_data->uc_data);
99 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
100 "#[FACTORY] gstSysGpsInterruptSignal.uc_data == 0x%x\r\n", gstSysGpsInterruptSignal.uc_data);
107 /*******************************************************************************
108 * MODULE : VehicleSensGetSysGpsInterruptSignal
109 * ABSTRACT : Vehicle sensor SYS_GPS_INTERRUPT_SIGNAL GET function
110 * FUNCTION : Provide the SYS_GPS_INTERRUPT_SIGNAL data master
111 * ARGUMENT : *pst_data : Pointer to the data master acquisition destination
114 ******************************************************************************/
115 void VehicleSensGetSysGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) {
116 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
117 const VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master;
119 if (pst_data == NULL) {
120 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
122 pst_master = &gstSysGpsInterruptSignal;
124 /* Store the data master in the specified destination. */
125 pst_data->ul_did = pst_master->ul_did;
126 pst_data->us_size = pst_master->us_size;
127 pst_data->uc_rcvflag = pst_master->uc_rcvflag;
128 (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)),
129 (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data));