2 * @copyright Copyright (c) 2018-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.
19 * VehicleSens_Did_LocationInfoNmea_n.cpp
22 /*---------------------------------------------------------------------------------*
24 *---------------------------------------------------------------------------------*/
25 #include <vehicle_service/positioning_base_library.h>
26 #include "VehicleSens_DataMaster.h"
27 #include "SensorLocation_API.h"
29 /*---------------------------------------------------------------------------------*
31 *---------------------------------------------------------------------------------*/
32 static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstLocationInfoNmea_n;
36 * Location Information (NMEA) Initialization of information data master(NAVI information)
38 * Location Information (NMEA) Initialize the information data master
44 void VehicleSens_InitLocationInfoNmea_n(void)
46 POS_LOCATIONINFO_NMEA stLocInfoNmea;
48 _pb_memset(&gstLocationInfoNmea_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
51 gstLocationInfoNmea_n.ul_did = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI;
54 gstLocationInfoNmea_n.us_size = sizeof(POS_LOCATIONINFO_NMEA);
56 /** Set Data itself */
57 _pb_memset(&stLocInfoNmea, 0x00, sizeof(stLocInfoNmea));
58 _pb_memcpy(&gstLocationInfoNmea_n.uc_data[0], &stLocInfoNmea, sizeof(stLocInfoNmea));
65 * Location Information (NMEA) Information data master SET process(NAVI information)
67 * Location Information (NMEA) Update the information data master
69 * @param[in] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination
72 * @retval VEHICLESENS_EQ : No data change
73 * @retval VEHICLESENS_NEQ : Data change
75 u_int8 VehicleSens_SetLocationInfoNmea_n( const POS_LOCATIONINFO_NMEA *pstLocInfoNmea )
78 VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster;
80 pstMaster = &gstLocationInfoNmea_n;
82 /* Compare Received Data with Master Data */
83 ucRet = VehicleSensmemcmp( pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA) );
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));
96 * Location Information (NMEA) Information Data Master GET Processing(NAVI information)
98 * Location Information (NMEA) Provide an information data master
101 * @param[out] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination
105 void VehicleSens_GetLocationInfoNmea_n(VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData)
107 const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster;
109 pstMaster = &gstLocationInfoNmea_n;
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);