Remove unused directories and files in video_in_hal
[staging/basesystem.git] / vehicleservice / positioning / server / src / Sensor / VehicleSens_Did_GyroTemp_l.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  * @file
19  *  VehicleSens_Did_GyroTemp_l.cpp
20  * @brief
21  *  Vehicle sensor data master(POSHAL_DID_GYRO_TEMP)
22  */
23
24 #include <vehicle_service/positioning_base_library.h>
25 #include "VehicleSens_DataMaster.h"
26
27 /*************************************************/
28 /*           Global variable                      */
29 /*************************************************/
30 static  VEHICLESENS_DATA_MASTER  gstGyroTemp_l;     // NOLINT(readability/nolint)
31
32 /**
33  * @brief
34  *   Vehicle sensor gyro temperature initialization function
35  *
36  *   Gyro Temperature Data Master Initialization Processing
37  */
38 void VehicleSensInitGyroTempl(void) {
39     (void)memset(reinterpret_cast<void *>(&gstGyroTemp_l), 0, sizeof(VEHICLESENS_DATA_MASTER));
40     gstGyroTemp_l.ul_did    = POSHAL_DID_GYRO_TEMP;
41     gstGyroTemp_l.us_size  = VEHICLE_DSIZE_GYRO_TEMP;
42     gstGyroTemp_l.uc_rcvflag  = VEHICLE_RCVFLAG_OFF;
43 }
44
45 /**
46  * @brief
47  *   Vehicle Sensor Gyro Temperature SET Function
48  *
49  *   Update the gyro temperature data master
50  *
51  * @param[in]  *pst_data : Pointer to the message data received by the direct line
52  *
53  * @return  VEHICLESENS_EQ  No data change<br>
54  *      VEHICLESENS_NEQ Data change
55  */
56 u_int8 VehicleSensSetGyroTemplG(const LSDRV_LSDATA_G *pst_data) {
57     u_int8 uc_ret;
58     VEHICLESENS_DATA_MASTER *pst_master;
59
60     pst_master = &gstGyroTemp_l;
61
62     /* Compare data master and received data */
63     uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
64
65     /* Received data is set in the data master. */
66     pst_master->ul_did    = pst_data->ul_did;
67     pst_master->us_size    = pst_data->uc_size;
68     pst_master->uc_rcvflag  = VEHICLE_RCVFLAG_ON;
69     (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
70         (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
71
72     return(uc_ret);
73 }
74
75 /**
76  * @brief
77  *   Vehicle Sensor Gyro Temperature GET Function
78  *
79  *   Provide a gyro temperature data master
80  *
81  * @param[in]  Pointer to the data master acquisition destination
82  */
83 void VehicleSensGetGyroTempl(VEHICLESENS_DATA_MASTER *pst_data) {
84     const VEHICLESENS_DATA_MASTER *pst_master;
85
86     pst_master = &gstGyroTemp_l;
87
88     /* Store the data master in the specified destination. */
89     pst_data->ul_did    = pst_master->ul_did;
90     pst_data->us_size    = pst_master->us_size;
91     pst_data->uc_rcvflag  = pst_master->uc_rcvflag;
92     pst_data->uc_snscnt  = pst_master->uc_snscnt;
93     (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
94         (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
95 }