Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / vehicle / positioning / server / src / Sensor / VehicleSens_Did_LocationInfoNmea_n.cpp
1 /*
2  * @copyright Copyright (c) 2018-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_LocationInfoNmea_n.cpp
20  * @brief
21  */
22 /*---------------------------------------------------------------------------------*
23  * Include Files                                                                   *
24  *---------------------------------------------------------------------------------*/
25 #include <vehicle_service/positioning_base_library.h>
26 #include "VehicleSens_DataMaster.h"
27 #include "SensorLocation_API.h"
28
29 /*---------------------------------------------------------------------------------*
30  * Global Value                                                                    *
31  *---------------------------------------------------------------------------------*/
32 static  VEHICLESENS_DATA_MASTER_GPS_FORMAT      gstLocationInfoNmea_n;
33
34 /**
35  * @brief
36  *  Location Information (NMEA) Initialization of information data master(NAVI information)
37  *
38  *  Location Information (NMEA) Initialize the information data master
39  *
40  * @param[in]   none
41  * @param[out]  none
42  * @return      none
43  */
44 void VehicleSens_InitLocationInfoNmea_n(void)
45 {
46     POS_LOCATIONINFO_NMEA       stLocInfoNmea;
47
48     _pb_memset(&gstLocationInfoNmea_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
49
50     /* Set Data ID */
51     gstLocationInfoNmea_n.ul_did        = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI;
52
53     /* Set Data Size */
54     gstLocationInfoNmea_n.us_size       = sizeof(POS_LOCATIONINFO_NMEA);
55
56     /** Set Data itself */
57     _pb_memset(&stLocInfoNmea, 0x00, sizeof(stLocInfoNmea));
58     _pb_memcpy(&gstLocationInfoNmea_n.uc_data[0], &stLocInfoNmea, sizeof(stLocInfoNmea));
59
60     return;
61 }
62
63 /**
64  * @brief
65  *  Location Information (NMEA) Information data master SET process(NAVI information)
66  *
67  *  Location Information (NMEA) Update the information data master
68  *
69  * @param[in]  VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData     : Pointer to the data master acquisition destination
70  * @param[out] none
71  * @return     u_int8
72  * @retval     VEHICLESENS_EQ  : No data change
73  * @retval     VEHICLESENS_NEQ : Data change
74  */
75 u_int8 VehicleSens_SetLocationInfoNmea_n( const POS_LOCATIONINFO_NMEA *pstLocInfoNmea )
76 {
77     u_int8                                              ucRet;
78     VEHICLESENS_DATA_MASTER_GPS_FORMAT          *pstMaster;
79
80     pstMaster = &gstLocationInfoNmea_n;
81
82     /* Compare Received Data with Master Data */
83     ucRet = VehicleSensmemcmp( pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA) );
84
85     /* Set Received Data as Master Data */
86     pstMaster->ul_did           = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI;
87     pstMaster->us_size          = sizeof(POS_LOCATIONINFO_NMEA);
88     pstMaster->uc_rcvflag       = VEHICLE_RCVFLAG_ON;
89     _pb_memcpy(pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA));
90
91     return ucRet;
92 }
93
94 /**
95  * @brief
96  *  Location Information (NMEA) Information Data Master GET Processing(NAVI information)
97  *
98  *  Location Information (NMEA) Provide an information data master
99  *
100  * @param[in]  none
101  * @param[out] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination
102  * @return     none
103  * @retval     none
104  */
105 void VehicleSens_GetLocationInfoNmea_n(VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData)
106 {
107     const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster;
108
109     pstMaster = &gstLocationInfoNmea_n;
110
111     /* Set Master Data to Indicated Region */
112     pstData->ul_did             = pstMaster->ul_did;
113     pstData->us_size    = pstMaster->us_size;
114     pstData->uc_rcvflag = pstMaster->uc_rcvflag;
115     _pb_memcpy(pstData->uc_data, pstMaster->uc_data, pstMaster->us_size);
116
117     return;
118 }