summaryrefslogtreecommitdiffstats
path: root/vehicleservice
diff options
context:
space:
mode:
authorRiku Nomoto <riku_nomoto@mail.toyota.co.jp>2020-11-19 12:45:32 +0900
committerRiku Nomoto <riku_nomoto@mail.toyota.co.jp>2020-11-19 12:45:32 +0900
commit8e0e00d21146a84c18f9cf9409e187b4fb0248aa (patch)
treeef791689dad216ac61091a1d1bd3b928d563aba6 /vehicleservice
parent18df6e21c6743a137e2760c52ca89d0789e90417 (diff)
Init basesystem source codes.
Signed-off-by: Riku Nomoto <riku_nomoto@mail.toyota.co.jp> Change-Id: I55aa2f1406ce7f751ae14140b613b53b68995528
Diffstat (limited to 'vehicleservice')
-rwxr-xr-xvehicleservice/.gitattributes128
-rwxr-xr-xvehicleservice/positioning/LICENSE177
-rwxr-xr-xvehicleservice/positioning/Makefile.client20
-rwxr-xr-xvehicleservice/positioning/Makefile.server20
-rwxr-xr-xvehicleservice/positioning/client/Makefile31
-rwxr-xr-xvehicleservice/positioning/client/include/CanInput_API.h98
-rwxr-xr-xvehicleservice/positioning/client/include/CanInput_API_private.h68
-rwxr-xr-xvehicleservice/positioning/client/include/Clock_API.h258
-rwxr-xr-xvehicleservice/positioning/client/include/CommonDefine.h72
-rwxr-xr-xvehicleservice/positioning/client/include/DR_API.h148
-rwxr-xr-xvehicleservice/positioning/client/include/DeadReckoning_DbgLogSim.h50
-rwxr-xr-xvehicleservice/positioning/client/include/Dead_Reckoning_API.h229
-rwxr-xr-xvehicleservice/positioning/client/include/Dead_Reckoning_Local_Api.h147
-rwxr-xr-xvehicleservice/positioning/client/include/Gps_API_private.h64
-rwxr-xr-xvehicleservice/positioning/client/include/INI_API.h259
-rwxr-xr-xvehicleservice/positioning/client/include/Naviinfo_API.h110
-rwxr-xr-xvehicleservice/positioning/client/include/POS_common_private.h62
-rwxr-xr-xvehicleservice/positioning/client/include/POS_private.h981
-rwxr-xr-xvehicleservice/positioning/client/include/POS_sensor_private.h163
-rwxr-xr-xvehicleservice/positioning/client/include/SensorLocation_API.h124
-rwxr-xr-xvehicleservice/positioning/client/include/SensorLocation_API_private.h39
-rwxr-xr-xvehicleservice/positioning/client/include/SensorMotion_API.h178
-rwxr-xr-xvehicleservice/positioning/client/include/Sensor_API.h36
-rwxr-xr-xvehicleservice/positioning/client/include/Sensor_API_private.h174
-rwxr-xr-xvehicleservice/positioning/client/include/Sensor_Common_API.h193
-rwxr-xr-xvehicleservice/positioning/client/include/VehicleDebug_API.h110
-rwxr-xr-xvehicleservice/positioning/client/include/Vehicle_API.h115
-rwxr-xr-xvehicleservice/positioning/client/include/Vehicle_API_Dummy.h142
-rwxr-xr-xvehicleservice/positioning/client/include/Vehicle_API_private.h129
-rwxr-xr-xvehicleservice/positioning/client/include/vehicle_service/POS_common_API.h1663
-rwxr-xr-xvehicleservice/positioning/client/include/vehicle_service/POS_define.h134
-rwxr-xr-xvehicleservice/positioning/client/include/vehicle_service/POS_gps_API.h1135
-rwxr-xr-xvehicleservice/positioning/client/include/vehicle_service/POS_sensor_API.h716
-rwxr-xr-xvehicleservice/positioning/client/include/vehicle_service/positioning.h46
-rwxr-xr-xvehicleservice/positioning/client/src/POS_common_API/Common_API.cpp889
-rwxr-xr-xvehicleservice/positioning/client/src/POS_common_API/Makefile47
-rwxr-xr-xvehicleservice/positioning/client/src/POS_common_API/libPOS_common_API.ver37
-rwxr-xr-xvehicleservice/positioning/client/src/POS_gps_API/Gps_API.cpp456
-rwxr-xr-xvehicleservice/positioning/client/src/POS_gps_API/Makefile51
-rwxr-xr-xvehicleservice/positioning/client/src/POS_gps_API/Naviinfo_API.cpp404
-rwxr-xr-xvehicleservice/positioning/client/src/POS_gps_API/libPOS_gps_API.ver34
-rwxr-xr-xvehicleservice/positioning/client/src/POS_sensor_API/Makefile48
-rwxr-xr-xvehicleservice/positioning/client/src/POS_sensor_API/Sensor_API.cpp784
-rwxr-xr-xvehicleservice/positioning/client/src/POS_sensor_API/Vehicle_API.cpp292
-rwxr-xr-xvehicleservice/positioning/client/src/POS_sensor_API/libPOS_sensor_API.ver32
-rwxr-xr-xvehicleservice/positioning/server/Makefile22
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/ClockDataMng.h100
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/ClockGPS_Process_Proto.h37
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/ClockUtility.h46
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/ClockUtility_private.h49
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/DeadReckoning_Common.h84
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/DeadReckoning_DataMaster.h127
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/DeadReckoning_DeliveryCtrl.h137
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/DeadReckoning_main.h146
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/GpsInt.h68
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/SensorLog.h114
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_Common.h131
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_DataMaster.h1091
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_DeliveryCtrl.h253
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_FromAccess.h69
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_SelectionItemList.h116
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_SharedMemory.h48
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSens_Thread.h185
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleSensor_Thread.h33
-rwxr-xr-xvehicleservice/positioning/server/include/Sensor/VehicleUtility.h128
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/BackupMgrIf.h65
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/ClockIf.h61
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/CommUsbIf.h64
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/DevDetectSrvIf.h69
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/DiagSrvIf.h55
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/PSMShadowIf.h58
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/VehicleIf.h82
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/ps_psmshadow_notifications.h62
-rwxr-xr-xvehicleservice/positioning/server/include/ServiceInterface/ps_version.h45
-rwxr-xr-xvehicleservice/positioning/server/include/nsfw/positioning_common.h90
-rwxr-xr-xvehicleservice/positioning/server/include/nsfw/vehicle_version.h29
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/ClockUtility.cpp414
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp127
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp298
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp835
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp106
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp115
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp115
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp115
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp106
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp105
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp105
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp103
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp116
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp115
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp105
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp1086
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/GpsInt.cpp171
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/Makefile181
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/SensorLog.cpp1307
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp47
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp429
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp1880
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp2243
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp105
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp58
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp112
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp97
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp51
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp102
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp51
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp102
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp98
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp89
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp53
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp51
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp107
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp102
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp99
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp102
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp101
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp119
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp145
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp127
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp98
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.cpp121
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp145
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp128
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp99
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp116
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp142
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp127
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp97
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp110
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp257
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp114
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp140
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp128
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp95
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp121
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp145
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp176
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp128
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp113
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp148
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp169
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp126
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp113
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp148
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp169
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp126
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp55
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp105
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.cpp121
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp50
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp118
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp56
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp163
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp132
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp55
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp105
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp162
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp57
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp107
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp103
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp103
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp108
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp104
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp94
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp115
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp143
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp93
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp118
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp134
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp171
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp157
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp58
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp116
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp90
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp155
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp124
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp57
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp156
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp117
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp150
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp133
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp91
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp172
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp128
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp132
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp51
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp102
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp319
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp466
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp521
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp2144
-rwxr-xr-xvehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp455
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp211
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp138
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp147
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp279
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp64
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/Makefile54
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp102
-rwxr-xr-xvehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp364
-rwxr-xr-xvehicleservice/positioning/server/src/nsfw/Makefile89
-rwxr-xr-xvehicleservice/positioning/server/src/nsfw/positioning_application.cpp2593
-rwxr-xr-xvehicleservice/positioning/server/src/nsfw/ps_main.cpp59
-rwxr-xr-xvehicleservice/positioning_base_library/LICENSE177
-rwxr-xr-xvehicleservice/positioning_base_library/Makefile.client20
-rwxr-xr-xvehicleservice/positioning_base_library/library/Makefile87
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h76
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/TimerEntryDrv_If.h111
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/WPF_STD_private.h295
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/_pbCommon.h36
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/_pbEvent_Internal.h128
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/_pbInternalProc.h41
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/_pbSerial.h32
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/_pbWaitforsingleobject.h40
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/sysup.h24
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/sysup_addr.h227
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/tchar.h256
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/vehicle_service/WPF_STD.h1653
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/vehicle_service/pos_message_header.h77
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/vehicle_service/positioning_base_library.h46
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h91
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/vehicle_service/std_types.h55
-rwxr-xr-xvehicleservice/positioning_base_library/library/include/vehicle_service/sys_timerapi.h359
-rwxr-xr-xvehicleservice/positioning_base_library/library/libPOS_base_API.ver39
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/MsgBapi.cpp347
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_CWORD64_api.cpp254
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbCSection.cpp131
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbCommon.cpp928
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbDram.cpp284
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbEvent.cpp1695
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbFsys.cpp171
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbMem.cpp989
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbMisc.cpp226
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbMsg.cpp1572
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbMutex.cpp1423
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbOSCtrl.cpp541
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbOther.cpp799
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbProcMng.cpp207
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbSem.cpp780
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbSerial.cpp525
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbSram.cpp316
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbSum.cpp95
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbTimer.cpp1115
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/_pbWaitforsingleobject.cpp358
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/memcpy_64p_sync.cpp25
-rwxr-xr-xvehicleservice/positioning_base_library/library/src/memset_64p_sync.cpp25
-rwxr-xr-xvehicleservice/vehicle_service.mk42
255 files changed, 60567 insertions, 0 deletions
diff --git a/vehicleservice/.gitattributes b/vehicleservice/.gitattributes
new file mode 100755
index 0000000..445b3c2
--- /dev/null
+++ b/vehicleservice/.gitattributes
@@ -0,0 +1,128 @@
+*.doc filter=lfs diff=lfs merge=lfs -text
+*.docx filter=lfs diff=lfs merge=lfs -text
+*.pdf filter=lfs diff=lfs merge=lfs -text
+*.ppt filter=lfs diff=lfs merge=lfs -text
+*.pptx filter=lfs diff=lfs merge=lfs -text
+*.vsd filter=lfs diff=lfs merge=lfs -text
+*.xls filter=lfs diff=lfs merge=lfs -text
+*.xlsm filter=lfs diff=lfs merge=lfs -text
+*.xlsx filter=lfs diff=lfs merge=lfs -text
+*.doC filter=lfs diff=lfs merge=lfs -text
+*.dOc filter=lfs diff=lfs merge=lfs -text
+*.dOC filter=lfs diff=lfs merge=lfs -text
+*.Doc filter=lfs diff=lfs merge=lfs -text
+*.DoC filter=lfs diff=lfs merge=lfs -text
+*.DOc filter=lfs diff=lfs merge=lfs -text
+*.DOC filter=lfs diff=lfs merge=lfs -text
+*.docX filter=lfs diff=lfs merge=lfs -text
+*.doCx filter=lfs diff=lfs merge=lfs -text
+*.doCX filter=lfs diff=lfs merge=lfs -text
+*.dOcx filter=lfs diff=lfs merge=lfs -text
+*.dOcX filter=lfs diff=lfs merge=lfs -text
+*.dOCx filter=lfs diff=lfs merge=lfs -text
+*.dOCX filter=lfs diff=lfs merge=lfs -text
+*.Docx filter=lfs diff=lfs merge=lfs -text
+*.DocX filter=lfs diff=lfs merge=lfs -text
+*.DoCx filter=lfs diff=lfs merge=lfs -text
+*.DoCX filter=lfs diff=lfs merge=lfs -text
+*.DOcx filter=lfs diff=lfs merge=lfs -text
+*.DOcX filter=lfs diff=lfs merge=lfs -text
+*.DOCx filter=lfs diff=lfs merge=lfs -text
+*.DOCX filter=lfs diff=lfs merge=lfs -text
+*.pdF filter=lfs diff=lfs merge=lfs -text
+*.pDf filter=lfs diff=lfs merge=lfs -text
+*.pDF filter=lfs diff=lfs merge=lfs -text
+*.Pdf filter=lfs diff=lfs merge=lfs -text
+*.PdF filter=lfs diff=lfs merge=lfs -text
+*.PDf filter=lfs diff=lfs merge=lfs -text
+*.PDF filter=lfs diff=lfs merge=lfs -text
+*.ppT filter=lfs diff=lfs merge=lfs -text
+*.pPt filter=lfs diff=lfs merge=lfs -text
+*.pPT filter=lfs diff=lfs merge=lfs -text
+*.Ppt filter=lfs diff=lfs merge=lfs -text
+*.PpT filter=lfs diff=lfs merge=lfs -text
+*.PPt filter=lfs diff=lfs merge=lfs -text
+*.PPT filter=lfs diff=lfs merge=lfs -text
+*.pptX filter=lfs diff=lfs merge=lfs -text
+*.ppTx filter=lfs diff=lfs merge=lfs -text
+*.ppTX filter=lfs diff=lfs merge=lfs -text
+*.pPtx filter=lfs diff=lfs merge=lfs -text
+*.pPtX filter=lfs diff=lfs merge=lfs -text
+*.pPTx filter=lfs diff=lfs merge=lfs -text
+*.pPTX filter=lfs diff=lfs merge=lfs -text
+*.Pptx filter=lfs diff=lfs merge=lfs -text
+*.PptX filter=lfs diff=lfs merge=lfs -text
+*.PpTx filter=lfs diff=lfs merge=lfs -text
+*.PpTX filter=lfs diff=lfs merge=lfs -text
+*.PPtx filter=lfs diff=lfs merge=lfs -text
+*.PPtX filter=lfs diff=lfs merge=lfs -text
+*.PPTx filter=lfs diff=lfs merge=lfs -text
+*.PPTX filter=lfs diff=lfs merge=lfs -text
+*.vsD filter=lfs diff=lfs merge=lfs -text
+*.vSd filter=lfs diff=lfs merge=lfs -text
+*.vSD filter=lfs diff=lfs merge=lfs -text
+*.Vsd filter=lfs diff=lfs merge=lfs -text
+*.VsD filter=lfs diff=lfs merge=lfs -text
+*.VSd filter=lfs diff=lfs merge=lfs -text
+*.VSD filter=lfs diff=lfs merge=lfs -text
+*.xlS filter=lfs diff=lfs merge=lfs -text
+*.xLs filter=lfs diff=lfs merge=lfs -text
+*.xLS filter=lfs diff=lfs merge=lfs -text
+*.Xls filter=lfs diff=lfs merge=lfs -text
+*.XlS filter=lfs diff=lfs merge=lfs -text
+*.XLs filter=lfs diff=lfs merge=lfs -text
+*.XLS filter=lfs diff=lfs merge=lfs -text
+*.xlsM filter=lfs diff=lfs merge=lfs -text
+*.xlSm filter=lfs diff=lfs merge=lfs -text
+*.xlSM filter=lfs diff=lfs merge=lfs -text
+*.xLsm filter=lfs diff=lfs merge=lfs -text
+*.xLsM filter=lfs diff=lfs merge=lfs -text
+*.xLSm filter=lfs diff=lfs merge=lfs -text
+*.xLSM filter=lfs diff=lfs merge=lfs -text
+*.Xlsm filter=lfs diff=lfs merge=lfs -text
+*.XlsM filter=lfs diff=lfs merge=lfs -text
+*.XlSm filter=lfs diff=lfs merge=lfs -text
+*.XlSM filter=lfs diff=lfs merge=lfs -text
+*.XLsm filter=lfs diff=lfs merge=lfs -text
+*.XLsM filter=lfs diff=lfs merge=lfs -text
+*.XLSm filter=lfs diff=lfs merge=lfs -text
+*.XLSM filter=lfs diff=lfs merge=lfs -text
+*.xlsX filter=lfs diff=lfs merge=lfs -text
+*.xlSx filter=lfs diff=lfs merge=lfs -text
+*.xlSX filter=lfs diff=lfs merge=lfs -text
+*.xLsx filter=lfs diff=lfs merge=lfs -text
+*.xLsX filter=lfs diff=lfs merge=lfs -text
+*.xLSx filter=lfs diff=lfs merge=lfs -text
+*.xLSX filter=lfs diff=lfs merge=lfs -text
+*.Xlsx filter=lfs diff=lfs merge=lfs -text
+*.XlsX filter=lfs diff=lfs merge=lfs -text
+*.XlSx filter=lfs diff=lfs merge=lfs -text
+*.XlSX filter=lfs diff=lfs merge=lfs -text
+*.XLsx filter=lfs diff=lfs merge=lfs -text
+*.XLsX filter=lfs diff=lfs merge=lfs -text
+*.XLSx filter=lfs diff=lfs merge=lfs -text
+*.XLSX filter=lfs diff=lfs merge=lfs -text
+*.json filter=lfs diff=lfs merge=lfs -text
+*.jsoN filter=lfs diff=lfs merge=lfs -text
+*.jsOn filter=lfs diff=lfs merge=lfs -text
+*.jsON filter=lfs diff=lfs merge=lfs -text
+*.jSon filter=lfs diff=lfs merge=lfs -text
+*.jSoN filter=lfs diff=lfs merge=lfs -text
+*.jSOn filter=lfs diff=lfs merge=lfs -text
+*.jSON filter=lfs diff=lfs merge=lfs -text
+*.Json filter=lfs diff=lfs merge=lfs -text
+*.JsoN filter=lfs diff=lfs merge=lfs -text
+*.JsOn filter=lfs diff=lfs merge=lfs -text
+*.JsON filter=lfs diff=lfs merge=lfs -text
+*.JSon filter=lfs diff=lfs merge=lfs -text
+*.JSoN filter=lfs diff=lfs merge=lfs -text
+*.JSOn filter=lfs diff=lfs merge=lfs -text
+*.JSON filter=lfs diff=lfs merge=lfs -text
+*.ods filter=lfs diff=lfs merge=lfs -text
+*.odS filter=lfs diff=lfs merge=lfs -text
+*.oDs filter=lfs diff=lfs merge=lfs -text
+*.oDS filter=lfs diff=lfs merge=lfs -text
+*.Ods filter=lfs diff=lfs merge=lfs -text
+*.OdS filter=lfs diff=lfs merge=lfs -text
+*.ODs filter=lfs diff=lfs merge=lfs -text
+*.ODS filter=lfs diff=lfs merge=lfs -text
diff --git a/vehicleservice/positioning/LICENSE b/vehicleservice/positioning/LICENSE
new file mode 100755
index 0000000..f433b1a
--- /dev/null
+++ b/vehicleservice/positioning/LICENSE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/vehicleservice/positioning/Makefile.client b/vehicleservice/positioning/Makefile.client
new file mode 100755
index 0000000..7236c74
--- /dev/null
+++ b/vehicleservice/positioning/Makefile.client
@@ -0,0 +1,20 @@
+#
+# @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.
+#
+
+######### subdirectories #########
+SUBDIRS += client
+
+include ../vehicle_service.mk
diff --git a/vehicleservice/positioning/Makefile.server b/vehicleservice/positioning/Makefile.server
new file mode 100755
index 0000000..d0fda9c
--- /dev/null
+++ b/vehicleservice/positioning/Makefile.server
@@ -0,0 +1,20 @@
+#
+# @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.
+#
+
+######### subdirectories #########
+SUBDIRS += server
+
+include ../vehicle_service.mk
diff --git a/vehicleservice/positioning/client/Makefile b/vehicleservice/positioning/client/Makefile
new file mode 100755
index 0000000..d7fce28
--- /dev/null
+++ b/vehicleservice/positioning/client/Makefile
@@ -0,0 +1,31 @@
+#
+# @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.
+#
+
+######### installed header #########
+VPATH = ./include/$(COMPONENT_NAME)
+
+INST_HEADERS += POS_define.h
+INST_HEADERS += POS_sensor_API.h
+INST_HEADERS += POS_gps_API.h
+INST_HEADERS += POS_common_API.h
+INST_HEADERS += positioning.h
+
+######### subdirectories #########
+SUBDIRS += src/POS_common_API
+SUBDIRS += src/POS_gps_API
+SUBDIRS += src/POS_sensor_API
+
+include ../../vehicle_service.mk
diff --git a/vehicleservice/positioning/client/include/CanInput_API.h b/vehicleservice/positioning/client/include/CanInput_API.h
new file mode 100755
index 0000000..1449b25
--- /dev/null
+++ b/vehicleservice/positioning/client/include/CanInput_API.h
@@ -0,0 +1,98 @@
+/*
+ * @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 : CanInput_API.h
+ * System name : PastModel002
+ * Sub System name : CanInput_API library
+ ******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_CANINPUT_API_H_
+#define POSITIONING_CLIENT_INCLUDE_CANINPUT_API_H_
+
+/************************************************************************
+ * Include *
+ ***********************************************************************/
+#include <vehicle_service/positioning_base_library.h> /* for type definitions */
+
+/************************************************************************
+* Definition *
+************************************************************************/
+/*----------------------------------------------------------------------*
+ * CAN_INPUT_RET_API Definition *
+ *----------------------------------------------------------------------*/
+/* Normal */
+#define CAN_INPUT_RET_NORMAL 0 /* Successful completion */
+
+/* Abnormal */
+#define CAN_INPUT_RET_ERROR (-1) /* An error has occurred */
+#define CAN_INPUT_RET_ERROR_PARAM (-2) /* Parameter error */
+
+/*----------------------------------------------------------------------*
+ * Message Definition *
+ *----------------------------------------------------------------------*/
+/* Command ID */
+#define CANINPUT_CID_LOCALTIME_NOTIFICATION 0x0220
+
+/*----------------------------------------------------------------------*
+ * Localtime status Definition *
+ *----------------------------------------------------------------------*/
+#define CANINPUT_LOCALTIME_STATUS_INVALID 0U
+#define CANINPUT_LOCALTIME_STATUS_INIT 1U
+#define CANINPUT_LOCALTIME_STATUS_PLAUSIBLE 2U
+#define CANINPUT_LOCALTIME_STATUS_NEW 3U
+#define CANINPUT_LOCALTIME_STATUS_DIAG 4U
+#define CANINPUT_LOCALTIME_STATUS_INCOMPLETE 5U
+
+/************************************************************************
+* type Definition *
+************************************************************************/
+typedef RET_API CAN_INPUT_RET_API; /* API return value */
+
+/************************************************************************
+* struct Definition *
+************************************************************************/
+/************************************************************************
+ * TAG : CANINPUT_MSG_LOCALTIMEINFO_DAT
+ * ABSTRACT : Localtime data structure
+ * NOTE :
+ ************************************************************************/
+typedef struct {
+ u_int8 status; /* status : Refer to Localtime status Definition */
+ u_int8 year; /* year : 0..99 (FFh:invalid) */
+ u_int8 month; /* month : 1..12 (FFh:invalid) */
+ u_int8 date; /* date : 1..31 (FFh:invalid) */
+ u_int8 hour; /* hour : 0..23 (FFh:invalid) */
+ u_int8 minute; /* minute : 0..59 (FFh:invalid) */
+ u_int8 second; /* second : 0..59 (FFh:invalid) */
+ u_int8 reserve; /* reserve */
+} CANINPUT_MSG_LOCALTIMEINFO_DAT;
+
+/************************************************************************
+ * Function prototypes *
+ ************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*[CanInput_API Public API]*/
+CAN_INPUT_RET_API CanInputInitialize(void);
+CAN_INPUT_RET_API CanInputSndMsg(PNO pno, CID cid, u_int16 msg_len, const void *msg_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_CANINPUT_API_H_
diff --git a/vehicleservice/positioning/client/include/CanInput_API_private.h b/vehicleservice/positioning/client/include/CanInput_API_private.h
new file mode 100755
index 0000000..d7c8e8e
--- /dev/null
+++ b/vehicleservice/positioning/client/include/CanInput_API_private.h
@@ -0,0 +1,68 @@
+/*
+ * @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 : CanInput_API_private.h
+ * System name : PastModel002
+ * Sub System name : CanInput_API library
+ ******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_CANINPUT_API_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_CANINPUT_API_PRIVATE_H_
+
+/************************************************************************
+ * Include *
+ ***********************************************************************/
+
+/************************************************************************
+* Definition *
+************************************************************************/
+/*----------------------------------------------------------------------*
+ * Message Definition *
+ *----------------------------------------------------------------------*/
+/* Message body size (byte) */
+#define CANINPUT_MSGBUF_DSIZE 8 /* Maximum message body size */
+
+/************************************************************************
+* type Definition *
+************************************************************************/
+
+/************************************************************************
+* struct Definition *
+************************************************************************/
+/*****************************************************************************
+ * TAG : CANINPUT_MSG_INFO
+ * ABSTRACT : CanInput_API message structure
+ * NOTE : Message structure
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ uint8_t data[CANINPUT_MSGBUF_DSIZE]; /* Message data (Localtime) */
+} CANINPUT_MSG_INFO;
+
+/************************************************************************
+ * Function prototypes *
+ ************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*[CanInput_API Private API]*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_CANINPUT_API_PRIVATE_H_
diff --git a/vehicleservice/positioning/client/include/Clock_API.h b/vehicleservice/positioning/client/include/Clock_API.h
new file mode 100755
index 0000000..1987999
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Clock_API.h
@@ -0,0 +1,258 @@
+/*
+ * @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.
+ */
+
+/*******************************************************************************
+* $Header:: $
+* $Revision:: $
+*******************************************************************************/
+
+/******************************************************************************
+* File name :Clock_API.h
+* System name :_CWORD107__PND-A
+* Subsystem name :System common functions header file
+* Program name :
+* Publishing department
+****************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_CLOCK_API_H_
+#define POSITIONING_CLIENT_INCLUDE_CLOCK_API_H_
+
+#include <vehicle_service/positioning_base_library.h>
+#include "CommonDefine.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ Macro definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* For time calculation */
+#define CLOCK_TIMESTAMP_GETTIME(x) ((x) & (0x00FFFFFFU)) /* Macros that Get Time Counter Values */
+#define CLOCK_TIMESTAMP_GETFLAG(x) (((x) & (0xE0000000U)) >> (29U)) /* Macros that Get Your Own Count Values */
+#define CLOCK_TIMESTAMP_NORMAL (0U) /* Normal count */
+#define CLOCK_TIMESTAMP_INDIPENDENT (1U) /* Own count */
+
+#define CLOCK_TIMESTAMP_UNION(x, y) (((x) << (29U)) | (y)) /* Macro that combines the unique count value (x) and the time counter value (y) */
+
+ /* Timestamp Shared Memory Related */
+#define TIMESTAMP_RETRY_COUNTE (10U) /* Number of time stamp retries */
+#define TIMESTAMP_RETRY_INTERVAL (10U) /* Time stamp retry interval(100[msec]) */
+
+ /* Time Management Shared Memory Related */
+#define CLKMNG_RETRY_COUNTE (10U) /* Time management retries */
+#define CLKMNG_RETRY_INTERVAL (10U) /* Time Management Retry Interval(100[msec]) */
+
+ /* Day of the week definition */
+#define CLKMNG_SUN (0U) /* Sunday */
+#define CLKMNG_MON (1U) /* Mondays */
+#define CLKMNG_TUE (2U) /* Tuesdays */
+#define CLKMNG_WED (3U) /* Wednesdays */
+#define CLKMNG_THU (4U) /* Thursdays */
+#define CLKMNG_FRI (5U) /* Fridays */
+#define CLKMNG_SAT (6U)
+
+ /* Related to the accuracy of time */
+#define CLOCK_CORRECTED_TIME (0U) /* GPS corrected time completed */
+#define CLOCK_NOT_CORRECTED_TIME (1U) /* GPS uncorrected time */
+#define CLOCK_RTC_TIME (2U) /* GPS RTC time */
+#define CLOCK_INVALID_TIME (3U) /* GPS error time */
+
+ /* Time Stamp Status Storage Data Module Related Definition */
+#define TIMESTAMPDM_NAME "TIMESTAMP_DATA" /* Name of time stamp status storage data module */
+#define TIMESTAMPDM_SEM_NAME "TIMESTAMP_SEM" /* Timestamp status storage data module semaphore name */
+
+ /* Time Management Status Storage Data Module Related Definition */
+#define CLKMNG_DM_NAME "CLOCK_GPS_DATA" /* Name of time management status storage data module */
+#define CLKMNG_DM_SEM_NAME "CLOCK_GPS_SEM" /* Time management status storage data module semaphore name */
+
+ /* Messaging communication */
+#define CLKMNG_MSG_BUF_SIZE (128U) /* Message communication buffer size */
+#define CLKMNG_SETTIME_MSGBODYSIZE (4U) /* Date/Time Setting Response Notification Data Size */
+#define CLKMNG_NOTIOBSERVERS_MSGSZ (4U) /* Time change notification data body size */
+#define CLKMNG_NOTIACCURACY_MSGSZ (4U) /* Change notification data body size from time accuracy */
+#define CLKMNG_NOTIOBSERVERS_ENTRY_MSGSZ (4U) /* Time change notification registration data body size */
+#define CLKMNG_NOTIACCURACY_ENTRY_MSGSZ (0U) /* Change Notification Stored Data Size from Time Accuracy */
+
+ /* Semaphore Related Extensions */
+#define CLOCK_SEM_RETRY_INTERVAL (10) /* Retry interval for semaphore acquisition/release processing 10ms */
+
+/*
+ Data typing
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* Time-stamped data */
+typedef struct TagTimestampData {
+ u_int16 trip; /* Trip counters */
+ u_int16 reserve; /* Reservation(Always 0) */
+ u_int32 time; /* Time counter */
+ u_int8 day; /* Number of days */
+ u_int8 hour; /* Time */
+ u_int8 min; /* Minutes */
+ u_int8 sec; /* Second */
+} TimestampData;
+
+/* TIMESTAMP INTERNAL COUNTER MODULE STRUCTURE DEFINITION */
+typedef struct {
+ u_int16 trip; /* Trip counters */
+ u_int32 time; /* Time counter */
+} TIMESTAMP_CNT;
+
+/* Time management status storage area */
+typedef struct TagClockStatus {
+ u_int8 status; /* GPS status */
+ u_int8 hour; /* Time of final correction */
+ u_int8 min; /* Minutes */
+ u_int8 sec; /* Second */
+} ClockStatus;
+
+/* Status storage area for writing time management shared memory */
+typedef struct TagClkMngTimerSetTime {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ u_int8 reserve1[1]; /* (Not used) */
+ u_int8 gps_timer_state; /* GPS time status */
+ u_int16 year; /* Year */
+ u_int8 month; /* Month */
+ u_int8 day; /* Day */
+ u_int8 hour; /* Hour */
+ u_int8 min; /* Minutes */
+ u_int8 sec; /* Second */
+ u_int8 reserve2[3]; /* (Not used) */
+} CLKMNG_TIMER_SET_TIME;
+
+/* Existing sys_timerapi.h data */
+
+/* User time status */
+#define TIMEDATA_INVALID 0 /* Time invalid */
+#define TIMEDATA_VALID 1 /* Time valid */
+
+/* Time Definition AM/PM */
+#define CLOCK_AM 0
+#define CLOCK_PM 1
+/* Change to Enumeration */
+/* Time notification unit */
+typedef enum TagNotifyUnit {
+ CLOCK_NOTIFY_SECOND = (1U), /* Second notifications */
+ CLOCK_NOTIFY_MINUTE, /* Minute Notification */
+ CLOCK_NOTIFY_HOUR /* Hourly notification */
+} NOTIFYUNIT;
+
+/* Return value definition */
+typedef enum TagClockReturn {
+ CLOCK_OK, /* Normal completion */
+ CLOCK_ERROR, /* ABENDs */
+ CLOCK_ERROR_ARGUMENTS /* Invalid argument */
+} CLOCK_RETURN;
+
+/* Time Type Definition */
+typedef struct TagTimeData {
+ u_int16 year; /* Year */
+ u_int8 month; /* Month */
+ u_int8 day; /* Day */
+ u_int8 hour; /* Hour */
+ u_int8 minute; /* Minutes */
+ u_int8 second; /* Second */
+} TimeData;
+
+/* Offset time type definition */
+typedef struct TagOffsetData {
+ BOOL sign; /* Operator */
+ TimeData time; /* Date and time */
+} OffsetData;
+
+/* Data Definition for System Time Delivery Registration */
+typedef struct TagSystemTimeRegistData {
+ NOTIFYUNIT unit; /* Notification unit(Hour,Minutes,One of the seconds) */
+} SYSTEMTIME_REGISTDATA;
+
+/* Data Definition for Setting User Time */
+typedef struct TagUserTimSetData {
+ TimeData time; /* Time */
+ u_int8 day_of_week; /* Day-of-week */
+} USERTIME_SETDATA;
+
+/* Data Definition for User Time Delivery Registration */
+typedef struct TagUserTimeRegistData {
+ NOTIFYUNIT unit; /* Notification unit(Hour,Minutes,One of the seconds) */
+} USERTIME_REGISTDATA;
+
+
+/*
+ Time Management Thread -> External Message Definition
+- - - - - - - - - - - - - - - - - - - - - - */
+/* Message data type */
+typedef struct TagClkMngRecMsg {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ u_int8 data[CLKMNG_MSG_BUF_SIZE];
+} CLKMNG_RCV_MSG;
+
+/* For time management Time Set Response Message */
+typedef struct TagClkMngRetTimeMsg { /* Time Set Response Message */
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+ int8 result; /* Processing result */
+ int8 dummy[3];
+} CLKMNG_RETTIME_MSG;
+
+/* Change Notification Message from Time for Time Management */
+typedef struct TagClkMngNotiAccuracyMsg {
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+ u_int8 gps_status; /* GPS time status(Likelihood) */
+ int8 dummy[3];
+} CLKMNG_NOTIACCURACY_MSG;
+
+/* Time change notification message for time management */
+typedef struct TagClkMngNotiObserversMsg {
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+ u_int8 hour; /* Hour */
+ u_int8 min; /* Minutes */
+ u_int8 sec; /* Second */
+ int8 dummy[1];
+} CLKMNG_NOTIOBSERVERS_MSG;
+
+/*
+ Time Management API -> Time Management Thread Message Definition
+- - - - - - - - - - - - - - - - - - - - - - */
+/* Change Notification Registration Message from the Accuracy of Time for Time Management */
+typedef struct TagClkMngNotAccuracyEntryMsg {
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+} CLKMNG_NOTIACCURACY_ENTRY_MSG;
+
+/* Time change notification registration message for time management */
+typedef struct TagClkMngNotiObserversEntryMsg {
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+ u_int8 notify_time; /* Notification unit (Hour,Minutes,One of the seconds) */
+ int8 dummy[3];
+} CLKMNG_NOTIOBSERVERS_ENTRY_MSG;
+
+/*
+ API Function Prototype Declaration
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API ClockInitApi(void); /* API initialization processing */
+RET_API ClockGetLocalTime(RealTimeData *real_time, TimestampData *timestamp); /* Current time reference processing */
+RET_API ClockGetLocalTimeBcd(RealTimeDataBcd *real_time_bcd, TimestampData *timestamp); /* Current time reference processing(BCD) */
+RET_API ClockGetUtcTime(RealTimeData* real_time, TimestampData *timestamp); /* Current UTC time reference processing */
+RET_API ClockCnvDateToSec(const LPSYSTEMTIME sys_time, u_int32* sec); /* Date and time,Total seconds conversion */
+RET_API ClockCnvSecToDate(const u_int32* sec, LPSYSTEMTIME sys_time); /* Total seconds,Date and time conversion */
+RET_API ClockGetAddOpeTime(u_int32 *ope_time); /* Accumulated operating time reference processing */
+RET_API ClockSetSystemTime(PNO snd_pno, const SysTimeData* sys_time, u_int8 gps_status); /* System time setting process */
+
+RET_API ClockNotifyObserversClock(PNO snd_pno, u_int8 rsc_id, u_int8 notify_time); /* Fixed period time change notification registration */
+RET_API ClockNotifyObserversAccuracy(PNO snd_pno, u_int8 rsc_id); /* Register change notification based on the time probability */
+RET_API ClockNotifyObserversAdjustClock(PNO snd_pno, u_int8 rsc_id); /* System time setting change notification registration */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_CLOCK_API_H_
diff --git a/vehicleservice/positioning/client/include/CommonDefine.h b/vehicleservice/positioning/client/include/CommonDefine.h
new file mode 100755
index 0000000..2e9e3e6
--- /dev/null
+++ b/vehicleservice/positioning/client/include/CommonDefine.h
@@ -0,0 +1,72 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_COMMONDEFINE_H_
+#define POSITIONING_CLIENT_INCLUDE_COMMONDEFINE_H_
+
+/**
+ * @file CommonDefine.h
+ */
+
+/** @addtogroup vehicle_service
+ * @{
+ */
+/** @addtogroup positioning
+ * @ingroup vehicle_service
+ * @{
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/POS_define.h>
+#include <vehicle_service/pos_message_header.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* Date and Time Status Definition */
+#define NAVIINFO_NAVI_GPS_TD_STS_NOTFIX (0)
+//!< \~english time has not been adjusted after GPS receiver reset
+#define NAVIINFO_NAVI_GPS_TD_STS_RTCBACKUP (1) // !<\~english time output from RTC Backup(have time adjustment)
+#define NAVIINFO_NAVI_GPS_TD_STS_FIX (2) //!< \~english time adjustment completed
+
+/* Vehicle sensor data information */
+#define POS_SNS_CONNECTION (0x01U) //!< \~english connected
+#define POS_SNS_UNCONNECTION (0x00U) //!< \~english not connected
+#define POS_SNS_SHORT (0x02U) //!< \~english short
+#define POS_SNS_UNSPECIFIED (0x03U) //!< \~english not specified
+
+/* NMEA Receive Flag(_CWORD82_) */
+#define POS_SNS__CWORD82__DRMC (0x01U) //!< \~english DRMC sentence
+#define POS_SNS__CWORD82__GSA (0x02U) //!< \~english GSA sentence
+#define POS_SNS__CWORD82__GSV_1 (0x04U) //!< \~english GSV_1 sentence
+#define POS_SNS__CWORD82__GSV_2 (0x08U) //!< \~english GSV_2 sentence
+#define POS_SNS__CWORD82__GSV_3 (0x10U) //!< \~english GSV_3 sentence
+#define POS_SNS__CWORD82__PJRDC_GP_3 (0x20U) //!< \~english PJRDC_GP_3 sentence
+
+/* NMEA Receive Flag */
+#define POS_SNS_GPS_NMEA_PASCD (0x01000000U) //!< \~english pascd sentence
+
+typedef u_int16 PNO; //!< \~english PNo.
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/** @}*/ // end of positioning
+/** @}*/ // end of vehicle_service
+#endif // POSITIONING_CLIENT_INCLUDE_COMMONDEFINE_H_
diff --git a/vehicleservice/positioning/client/include/DR_API.h b/vehicleservice/positioning/client/include/DR_API.h
new file mode 100755
index 0000000..6362f8c
--- /dev/null
+++ b/vehicleservice/positioning/client/include/DR_API.h
@@ -0,0 +1,148 @@
+/*
+ * @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 DR_API.h
+@detail DR_API external header file<BR>
+ DR_API External public header
+******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_DR_API_H_
+#define POSITIONING_CLIENT_INCLUDE_DR_API_H_
+
+/*****************************************************************************
+ * Include *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Define *
+ *****************************************************************************/
+/* Command ID */
+#define CID_DR_MAP_MATCHING_DATA (0x0209)
+#define CID_DR_CLEAR_BACKUP_DATA (0x020F)
+
+/* DR_EXT_RET_API definition */
+#define DR_EXT_RET_NORMAL (0) /* Successful completion */
+#define DR_EXT_RET_ERROR (-1) /* Setup failure */
+
+/*****************************************************************************
+ * Typedef *
+ *****************************************************************************/
+typedef int32 DR_EXT_RET_API;
+
+/*****************************************************************************
+ * Enumeration *
+ *****************************************************************************/
+typedef enum {
+ NAVI_DATA_STATUS_2D_FIX = 0x00,
+ NAVI_DATA_STATUS_3D_FIX,
+ NAVI_DATA_STATUS_DR_COMBINED,
+ NAVI_DATA_STATUS_DR_ONLY,
+ NAVI_DATA_STATUS_MAP_2D_GPS_FIX,
+ NAVI_DATA_STATUS_MAP_3D_GPS_FIX,
+ NAVI_DATA_STATUS_MAP_DR_COMBINED,
+ NAVI_DATA_STATUS_MAP_DR_ONLY,
+ NAVI_DATA_STATUS_MAP_NO_FIX,
+ NAVI_DATA_STATUS_AWAITING_FIRST_FIX,
+ NAVI_DATA_STATUS_DATA_INVALID,
+ NAVI_DATA_STATUS_NO_FIX,
+ NAVI_DATA_STATUS_TIME_ONLY_FIX
+} NAVI_DATA_STATUS;
+
+typedef enum {
+ NAVI_DATA_INVALID = 0x00,
+ NAVI_DATA_VALID
+} NAVI_DATA_AVAILABLE;
+
+/*****************************************************************************
+ * Struct *
+ *****************************************************************************/
+/*****************************************************************************
+ * TAG : POSITION_INFO
+ * ABSTRACT : Position information structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ int32 latitude; /* 10^-7deg North : plus, South : minus */
+ int32 longitude; /* 10^-7deg East : plus, West : minus */
+ NAVI_DATA_AVAILABLE status; /* Status of data */
+} POSITION_INFO;
+
+/*****************************************************************************
+ * TAG : RATE_INFO
+ * ABSTRACT : Rate information structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 rate; /* 10^-2m/sec */
+ u_int8 reserve[2]; /* reserve */
+ NAVI_DATA_AVAILABLE status; /* Status of data */
+} RATE_INFO;
+
+/*****************************************************************************
+ * TAG : ORIENT_INFO
+ * ABSTRACT : Orient information structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 orient; /* 10^-2deg N : 0, E : 90, S : 180, W : 270 */
+ u_int8 reserve[2]; /* reserve */
+ NAVI_DATA_AVAILABLE status; /* Status of data */
+} ORIENT_INFO;
+
+/*****************************************************************************
+ * TAG : MAP_MATCHING_DATA
+ * ABSTRACT : Map-Matching information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ POSITION_INFO position_info; /* Position information */
+ RATE_INFO rate_info; /* Rate information */
+ ORIENT_INFO orient_info; /* Orient information */
+ NAVI_DATA_STATUS status; /* Status */
+} MAP_MATCHING_DATA;
+
+/*****************************************************************************
+ * TAG : DR_MSG_MAP_MATCHING_DATA
+ * ABSTRACT : Map-Matching information data message buffer structure
+ * NOTE : Message structure(User -> VehicleSens)
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ MAP_MATCHING_DATA data; /* Message data (Map-Matching information) */
+} DR_MSG_MAP_MATCHING_DATA;
+
+/*****************************************************************************
+ * TAG : DR_MSG_CLEAR_BACKUP_DATA
+ * ABSTRACT : Clear backup data message buffer structure
+ * NOTE : Message structure(User -> VehicleSens)
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+} DR_MSG_CLEAR_BACKUP_DATA;
+
+/*****************************************************************************
+* Function prototypes *
+*****************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern DR_EXT_RET_API DrSetMapMatchingData(PNO pno, MAP_MATCHING_DATA* map_matching_data);
+extern DR_EXT_RET_API DrClearBackupData(PNO pno);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_DR_API_H_
diff --git a/vehicleservice/positioning/client/include/DeadReckoning_DbgLogSim.h b/vehicleservice/positioning/client/include/DeadReckoning_DbgLogSim.h
new file mode 100755
index 0000000..bd57de7
--- /dev/null
+++ b/vehicleservice/positioning/client/include/DeadReckoning_DbgLogSim.h
@@ -0,0 +1,50 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_DEADRECKONING_DBGLOGSIM_H_
+#define POSITIONING_CLIENT_INCLUDE_DEADRECKONING_DBGLOGSIM_H_
+
+/*******************************************************************************
+ FILE : DeadReckoning_DbgLogSim.h
+ SYSTEM : _CWORD64_ platform development
+ SUBSYSTEM : Log Simulator for Debugging
+ PROGRAM : PastModel002*1 log read
+ FUNC LIST :
+--------------------------------------------------------------------------------
+
+*******************************************************************************/
+
+#include "Dead_Reckoning_API.h"
+
+#define DR_DBG_LOG_PACKET_HEAD_SIZE (4) /* DR_LOG_PACKET_HEAD_SIZE */
+#define DR_DBG_LOG_SIM_BUFF_SIZE (0x200)
+
+#define DR_DBG_LOG_SIM_DATA_NONE (-1)
+#define DR_DBG_LOG_SIM_DATA_GPS (1)
+#define DR_DBG_LOG_SIM_DATA_SENSOR (2)
+
+/*
+ * prototype
+ * public functions
+ */
+
+void DeadReckoningDbgLogSimInit(void);
+void DeadReckoningDbgLogSimDispose(void);
+
+BOOL DeadReckoningDbgLogSimIsDbgLogSimMode(void);
+int DeadReckoningDbgLogSimReadPacket(u_int8 *, size_t, int16 *);
+
+#endif // POSITIONING_CLIENT_INCLUDE_DEADRECKONING_DBGLOGSIM_H_
diff --git a/vehicleservice/positioning/client/include/Dead_Reckoning_API.h b/vehicleservice/positioning/client/include/Dead_Reckoning_API.h
new file mode 100755
index 0000000..bd2e031
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Dead_Reckoning_API.h
@@ -0,0 +1,229 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_API_H_
+#define POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_API_H_
+/****************************************************************************
+ * File name :Dead_Reckoning_API.h
+ * System name :PastModel002
+ * Subsystem name :
+ ******************************************************************************/
+
+/*****************************************************************************
+ * Include *
+ *****************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "Sensor_Common_API.h"
+#include <native_service/frameworkunified_types.h>
+
+/*****************************************************************************
+ * Define *
+ *****************************************************************************/
+#define NUM_OF_100msData (10) /* Number of gyro data items delivered every 100 ms */
+
+/*****************************************************************************
+ * Typedef *
+ *****************************************************************************/
+typedef RET_API DR_RET_API;
+
+/*****************************************************************************
+ * Enumeration *
+ *****************************************************************************/
+/*******************************************************************************
+ TAG : NAVI_MATCHING_STATUS
+ ABSTRACT : Map matching data(Status)
+ NOTE :
+*******************************************************************************/
+typedef enum NaviMatchingStatus {
+ NAVI_MATCHING_STS_2D_FIX = 0x00,
+ NAVI_MATCHING_STS_3D_FIX,
+ NAVI_MATCHING_STS_DR_COMBINED,
+ NAVI_MATCHING_STS_DR_ONLY,
+ NAVI_MATCHING_STS_MAP_2D_GPS_FIX,
+ NAVI_MATCHING_STS_MAP_3D_GPS_FIX,
+ NAVI_MATCHING_STS_MAP_DR_COMBINED,
+ NAVI_MATCHING_STS_MAP_DR_ONLY,
+ NAVI_MATCHING_STS_MAP_NO_FIX,
+ NAVI_MATCHING_STS_AWAITING_FIRST_FIX,
+ NAVI_MATCHING_STS_DATA_INVALID,
+ NAVI_MATCHING_STS_NO_FIX,
+ NAVI_MATCHING_STS_TIME_ONLY_FIX
+} NAVI_MATCHING_STATUS;
+
+/*******************************************************************************
+ TAG : NAVI_MATCHING_DATA_AVAILABLE
+ ABSTRACT : Map matching data(Availability)
+ NOTE :
+*******************************************************************************/
+typedef enum {
+ NAVI_MATCHING_DATA_INVALID = 0x00,
+ NAVI_MATCHING_DATA_VALID
+} NAVI_MATCHING_DATA_AVAILABLE;
+
+/*****************************************************************************
+ * Struct *
+ *****************************************************************************/
+/* Sensor data */
+/*******************************************************************************
+ TAG : Struct_PulseRevTbl
+ ABSTRACT : Vehicle speed/REV data table structure
+ NOTE : 4byte
+*******************************************************************************/
+typedef struct {
+ u_int8 reverse_flag; /* 0:Forward march 1:Backward 3:Disabled Reverse signal status */
+ u_int8 pulse_flag; /* Vehicle speed pulse flag */
+ /* 0:Enabled 1:Receive invalid value from CAN 2:Unable to receive at download timing */
+ u_int16 pulse_sum_cyclic; /* Vehicle speed pulse counter value */
+} Struct_PulseRevTbl;
+/*******************************************************************************
+ TAG : Struct_GyroTbl
+ ABSTRACT : Gyro Data Table Structure
+ NOTE : 20byte
+*******************************************************************************/
+typedef struct {
+ u_int16 gyro_data[NUM_OF_100msData]; /* A/D-converted gyro data */
+} Struct_GyroTbl;
+/*******************************************************************************
+ TAG : Struct_SensData
+ ABSTRACT : Sensor data structure
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ u_int8 sens_cnt_flag; /* Sensor data transmission counter flag */
+ /* 0:Disabled(->Initial Sensor) 1:Enabled(->100 ms periodic transmission) */
+ /* Set "0" for initial sensor transmission and "1" for periodic transmission. */
+ u_int8 sens_cnt; /* Sensor data transmission counter value Set "0" at initial transmission of sensor */
+ Struct_PulseRevTbl pulse_rev_tbl; /* Vehicle speed/REV Data table */
+ Struct_GyroTbl gyro_x_tbl; /* Gyro(X axis) data table */
+ Struct_GyroTbl gyro_y_tbl; /* Gyro(Y axis) data table */
+ Struct_GyroTbl gyro_z_tbl; /* Gyro(Z axis) data table */
+} Struct_SensData;
+
+/* GPS data */
+/*******************************************************************************
+ TAG : Struct_GpsData
+ ABSTRACT : GPS data structure
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ u_int8 sens_cnt; /* Sensor data transmission counter value */
+ u_int8 sens_cnt_flag; /* Sensor data transmission counter flag */
+ /* 0:Disabled(Incorrect GPS sensor counter) */
+ /* 1:Enabled */
+ u_int16 gps_data_size; /* GPS data storage area size */
+ DID did; /* Data ID */
+ const void* gps_data; /* GPS data storage area */
+} Struct_GpsData;
+
+/* Estimated Navigation Calculation Result */
+/*******************************************************************************
+ TAG : Struct_DR_DATA
+ ABSTRACT : Estimated Navigation Calculation Result
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ int64_t latitude; /* Latitude(WGS-84) 10^-7deg */
+ int64_t longitude; /* Longitude(WGS-84) 10^-7deg */
+ int64_t altitude; /* Altitude 10^-2m */
+ u_int16 rate; /* Speeds 10^-2m/sec */
+ u_int16 heading; /* Orientation North-reference clockwise 10^-2deg */
+ u_int16 reserve; /* RESERVE */
+ u_int8 dr_status; /* DR calculation status */
+ u_int8 positioning_time; /* Sensor Counter */
+} Struct_DR_DATA;
+
+/*******************************************************************************
+ TAG : DR_CALC_INFO
+ ABSTRACT : Estimated navigation information
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ u_int16 gyro_offset; /* Correction coefficient:Gyro offset */
+ u_int8 gyro_scale_factor; /* Correction coefficient:Gyro Sensitivity */
+ u_int8 gyro_scale_factor_level; /* Learning Level(Gyro Sensitivity) */
+ u_int16 speed_pulse_scale_factor; /* Correction coefficient:Vehicle speed factor */
+ u_int8 speed_pulse_scale_factor_level; /* Learning Level(Vehicle speed factor) */
+ u_int8 reserve; /* Reserve(1Byte) */
+} DR_CALC_INFO;
+
+/*******************************************************************************
+ TAG : DR_POSITION_INFO
+ ABSTRACT : Location information
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ int64_t latitude;
+ int64_t longitude;
+ NAVI_MATCHING_DATA_AVAILABLE status;
+} DR_POSITION_INFO;
+
+/*******************************************************************************
+ TAG : DR_RATE_INFO
+ ABSTRACT : Location information
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ u_int16 rate;
+ u_int8 reserve[2];
+ NAVI_MATCHING_DATA_AVAILABLE status;
+} DR_RATE_INFO;
+
+/*******************************************************************************
+ TAG : DR_ORIENT_INFO
+ ABSTRACT : Location information
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ u_int16 orient;
+ u_int8 reserve[2];
+ NAVI_MATCHING_DATA_AVAILABLE status;
+} DR_ORIENT_INFO;
+
+/*******************************************************************************
+ TAG : NAVI_MATCHING_DATA
+ ABSTRACT : Map matching data
+ NOTE :
+*******************************************************************************/
+typedef struct {
+ DR_POSITION_INFO position_info;
+ DR_RATE_INFO rate_info;
+ DR_ORIENT_INFO orient_info;
+ NAVI_MATCHING_STATUS status;
+} NAVI_MATCHING_DATA;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+DR_RET_API DeadReckoningLibraryInit(void);
+DR_RET_API SetGpsData(Struct_GpsData *st_gps_data);
+DR_RET_API CalculateDeadReckoningData(Struct_SensData *st_sensor_data,
+ Struct_DR_DATA *st_dr_data, DR_CALC_INFO *dr_calc_data);
+DR_RET_API SetMatchingData(NAVI_MATCHING_DATA *st_matching_data);
+
+DR_RET_API ClearBackupData(void); /* Clear DR backup data */
+/* BOOL Problem Avoidance */
+DR_RET_API GetLocationLogSetting(int *log_sw, unsigned char *severity); /* Location log output ON/OFF acquisition */
+DR_RET_API SetLocationLogStatus(int log_sw, unsigned char severity); /* Location log output ON/OFF setting */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_API_H_
diff --git a/vehicleservice/positioning/client/include/Dead_Reckoning_Local_Api.h b/vehicleservice/positioning/client/include/Dead_Reckoning_Local_Api.h
new file mode 100755
index 0000000..c513e9b
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Dead_Reckoning_Local_Api.h
@@ -0,0 +1,147 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_LOCAL_API_H_
+#define POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_LOCAL_API_H_
+/****************************************************************************
+ * File name :Dead_Reckoning_Local_Api.h
+ * System name :PastModel002
+ * Subsystem name :
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "Sensor_Common_API.h"
+#include "SensorLocation_API.h"
+#include "SensorMotion_API.h"
+#include "DR_API.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+
+/*----------------------------------------------------------------------*
+ * DEADRECKONING_RET_API define *
+ *----------------------------------------------------------------------*/
+/* Normal system */
+#define DEAD_RECKONING_RET_NORMAL 0 /* Normal completion */
+/* Abnormal system */
+#define DEADRECKONING_RET_ERROR_PID (-1) /* Thread ID error */
+#define DEADRECKONING_RET_ERROR_DID (-2) /* Unregistered DID */
+#define DEADRECKONING_RET_ERROR_PARAM (-4) /* Parameter error */
+#define DEADRECKONING_RET_ERROR_BUFFULL (-5) /* FULL of registered numbers */
+#define DEADRECKONING_RET_ERROR_CREATE_EVENT (-6) /* Event generation failure */
+#define DEADRECKONING_RET_ERROR_OUTOF_MEMORY (-8) /* Shared memory allocation failed */
+#define DEADRECKONING_RET_ERROR_SIZE (-9) /* Storage destination size error */
+#define DEADRECKONING_RET_ERROR_MIN (-10)
+
+/*----------------------------------------------------------------------*
+ * DEADRECKONING delivery registry APIs *
+ *----------------------------------------------------------------------*/
+/* Delivery control */
+#define DEADRECKONING_DELIVERY_REGIST 0x01 /* Delivery registration */
+
+/* Delivery timing */
+#define DEADRECKONING_DELIVERY_TIMING_UPDATE 0x01 /* Updating */
+
+/*----------------------------------------------------------------------*
+ * Command ID *
+ *----------------------------------------------------------------------*/
+/* Vehicle Sensor -> Vehicle Sensor(DR) */
+#define CID_DEAD_RECKONING_DELIVERY_ENTRY 0x0310 /* DR Transmission Registration Signal Notification */
+
+/* Vehicle Sensor -> Vehicle Sensor(DR) */
+#define CID_DEAD_RECKONING_SENS_DATA 0x0311 /* DR data signal notification */
+#define CID_DEAD_RECKONING_GPS_DATA 0x0312 /* DR data signal notification */
+#define CID_DEAD_RECKONING_SENS_FST_DATA 0x0313 /* DR data signal notification */
+
+/* Message Data Size(byte) */
+#define DEADRECKONING_MSGBUF_DSIZE 512 /* Message body MAX */
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+/* Semaphore name(MAX 32Byte) Synchronize with VehicleDebug_API_private.h */
+#define SENSOR_LOG_SETTING_SEMAPHO_NAME ("SEBSIR_GET_LOG_SETTING_SEMAPHO")
+
+/* Shared memory name(MAX 32Byte) Synchronize with VehicleDebug_API_private */
+#define LOG_SETTING_SHARE_MEMORY_NAME ("LOG_SETTING_SHARE_MEMORY")
+
+/************************************************************************
+* typedef Definition *
+************************************************************************/
+typedef RET_API DEAD_RECKONING_RET_API; /* API return value */
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/************************************************************************
+* TAG : DEADRECKONING_MSG_BUF
+* ABSTRACT : message buffer
+************************************************************************/
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ u_int8 data[DEADRECKONING_MSGBUF_DSIZE]; /* Message data */
+} DEADRECKONING_MSG_BUF;
+
+/************************************************************************
+* TAG : DEADRECKONING_MSG_DELIVERY_ENTRY
+* ABSTRACT : Registration message delivery vehicle sensor information(->Vehicle sensor)
+************************************************************************/
+typedef struct {
+ DID did; /* ID data corresponding to the vehicle sensor information */
+ PNO pno; /* Shipping addressPNO */
+ u_int8 delivery_timing; /* Delivery opportunity */
+ u_int8 ctrl_flg; /* Delivery control */
+ EventID event_id; /* Event ID */
+} DEADRECKONING_MSG_DELIVERY_ENTRY_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ DEADRECKONING_MSG_DELIVERY_ENTRY_DAT data; /* Message data */
+} DEADRECKONING_MSG_DELIVERY_ENTRY;
+
+/************************************************************************
+* TAG : DEADRECKONING_MSG_GET_DR_DATA
+* ABSTRACT : Vehicle sensor information acquisition message(->Vehicle sensor)
+************************************************************************/
+typedef struct {
+ DID did; /* Data ID corresponding to vehicle sensor information */
+ PNO pno; /* Destination PNO */
+ u_int16 offset; /* Offset to shared memory storage area */
+ u_int16 size; /* Size of shared memory storage area */
+ u_int8 reserve[2];
+ EventID event_id; /* Event ID */
+} DEADRECKONING_MSG_GET_DR_DATA_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ DEADRECKONING_MSG_GET_DR_DATA_DAT data; /* Message data */
+} DEADRECKONING_MSG_GET_DR_DATA;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_DEAD_RECKONING_LOCAL_API_H_
diff --git a/vehicleservice/positioning/client/include/Gps_API_private.h b/vehicleservice/positioning/client/include/Gps_API_private.h
new file mode 100755
index 0000000..7026ce9
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Gps_API_private.h
@@ -0,0 +1,64 @@
+/*
+ * @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
+ * Gps_API_private.h
+ * @brief
+ * Definition for GPS Internal I/F Liblary
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_GPS_API_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_GPS_API_PRIVATE_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/*--- for message ---*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief message delivery GPS reset information
+ */
+typedef struct {
+ uint8_t mode; /**< Reset mode */
+ uint8_t reserve[3]; /**< reserve */
+ PNO snd_pno; /**< Caller PNO */
+ PNO res_pno; /**< Destination PNO */
+} POS_RESETINFO;
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_GPS_API_PRIVATE_H_
diff --git a/vehicleservice/positioning/client/include/INI_API.h b/vehicleservice/positioning/client/include/INI_API.h
new file mode 100755
index 0000000..f16a4c6
--- /dev/null
+++ b/vehicleservice/positioning/client/include/INI_API.h
@@ -0,0 +1,259 @@
+/*
+ * @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 : INI_API.h
+* System name : _CWORD107_
+* Subsystem name : Staged Start and Termination Framework
+* Title : Staged Start and End Framework API Header Files
+************************************************************************/
+
+#ifndef POSITIONING_CLIENT_INCLUDE_INI_API_H_
+#define POSITIONING_CLIENT_INCLUDE_INI_API_H_
+
+#include <vehicle_service/positioning_base_library.h>
+
+/*
+***** DEFINE *****
+*/
+
+#define INI_EXTMEM_DUM 0 /* Message buffer header extension member */
+
+/* Return value */
+#define INI_SUCCESS 0 /* Normal */
+#define INI_FALSE (-1) /* Fail */
+#define INI_ERRNOTRDY (-2) /* No destination process(Not wakeup) */
+
+/* Stage start completion notification ID related Note: ACC-OFF process completion notification is also used. */
+#define GINI_COMPID_INI 0x00000000 /* Initial value of completion notification ID */
+#define GINI_COMPID_MASK 0x80000000 /* Completion notification ID mask value(Startup completion or for event completion determination) */
+
+/* ID for Phase Start Event Completion Notification */
+
+#define INI_INITCOMP_BTCOM_PRT 0x80000001 /* BT Communication Protocol Thread Startup Complete */
+#define INI_INITCOMP_BTCOM_MNG 0x80000002 /* BT Communication Protocol Thread Startup Complete */
+#define INI_INITCOMP_BTCOM_RCV 0x80000004 /* BT Communication Protocol Thread Startup Complete */
+#define INI_INITCOMP_MC_UPCHK 0x80000008 /* To receive the confirmation notice of connection between microcomputers */
+
+/************************************************************************
+ ID for Phase Start Event Completion Notification (For VUP)
+ ************************************************************************/
+#define INI_FWRDCOMP__CWORD24_ 0x80000008 /* _CWORD24_ transmission completed */
+#define INI_FWRDCOMP_VUP 0x80000010 /* VUPLoader transmission completed */
+#define INI_INITCOMP_MFT 0x80000020 /* Module transfer thread start completion */
+#define INI_INITCOMP_UPCHK 0x80000040 /* Receive Start Type Confirmation Notification */
+
+/* ID for Phase ACC-OFF Event Completion Notification ID */
+
+/* Boot phase */
+/*************************************************************************
+ Note: Maintenance Precautions*
+ Initial only affects the addition and deletion of startup parameters.
+ For addition or deletion of shared memory creation,The primary of each process is also affected
+*************************************************************************/
+/* --->CHG */
+enum IniStep {
+ GINI_STEPFORK_INI = 0, /* Initial state */
+ GINI_STEPFORK_COMMEM, /* Shared Memory Generation */
+ GINI_STEPFORK_FIRST, /* First start */
+ GINI_STEPFORK_SECOND, /* 2nd start */
+ GINI_STEPFORK_THIRD, /* 3rd start */
+ GINI_STEPFORK_FOURTH, /* 4th start */
+ GINI_STEPFORK_BUPCHK, /* Backup Data Check/Initialization */
+ GINI_STEPFORK_FIFTH, /* 5th start */
+ GINI_STEPFORK_SIXTH, /* 6th start */
+ GINI_STEPFORK_SEVENTH, /* 7th start */
+ GINI_STEPFORK_EIGHTH, /* 8th start */
+ GINI_STEPFORK_NINTH, /* 9th start */
+ GINI_STEPFORK_TENTH, /* 10th start */
+ GINI_STEPFORK_ELEVENTH, /* 11th start */
+ GINI_STEPFORK_TWELFTH, /* 12th start */
+ GINI_STEPFORK_THIRTEENTH, /* 13th start */
+ GINI_STEPFORK_FOURTEENTH, /* 14th start */
+ GINI_STEPFORK_FIFTEENTH, /* 15th Start */
+ GINI_STEPFORK_SIXTEENTH, /* 16th start */
+ GINI_STEPFORK_SEVENTEENTH, /* 17th Start */
+ GINI_STEPFORK_EIGHTEENTH, /* 18th Start */
+ GINI_STEPFORK_MAX /* Total number of startup phases */
+};
+/* <--- CHG */
+
+/* ACC-OFF phase */
+enum AccOffStep {
+ GINI_ACCOFF_INI = 0, /* Early stage(Normal state) */
+ GINI_ACCOFF_FIRST, /* Stage 1 */
+ GINI_ACCOFF_SECOND, /* Step 2 */
+ GINI_ACCOFF_THIRD, /* Step 3 */
+ GINI_ACCOFF_FOURTH, /* Step 4 */
+ GINI_ACCOFF_FIFTH, /* Step 5 */
+ GINI_ACCOFF_MAX /* Total number of ACC-OFF steps */
+};
+
+/* Backup data check process type */
+enum IniDramBkup {
+ INI_BUPCHK_SRAM_INIT = 0, /* Initialization of SRAM */
+ INI_BUPCHK_SRAM_CHK, /* SRAM range-checking process */
+ INI_BUPCHK_USER_INIT, /* Initialization of personal information */
+ INI_BUPCHK_DRAM_INIT /* Initializing DRAM backups */
+};
+
+/* ---> */
+/*************************************************
+ Startup identification
+*************************************************/
+enum {
+ INI_CND_UNSET = 0, /* Startup identification value not set */
+ INI_CND_UNKNOWN, /* Startup identification unknown */
+ INI_CND_CLSTART, /* COLD START */
+ INI_CND_HTSTART, /* HOT START */
+ INI_CND_ERRRESET, /* Error Reset */
+ INI_CND_USERCL /* User-specified COLD */
+};
+
+/*************************************************
+ Startup Security State
+*************************************************/
+enum {
+ INI_ANTITHEFT_UNSET = 0, /* Not set condition */
+ INI_ANTITHEFT_UNLOCK, /* Unlocked status */
+ INI_ANTITHEFT_LOCK, /* Lock state */
+ INI_ANTITHEFT_INITIAL /* Initial state(Not used) */
+};
+
+/*************************************************
+ Version upgrade completion information
+*************************************************/
+enum {
+ INI_VUP_INFO_UNSET = 0, /* VUP information not set */
+ INI_VUP_INFO_NORMAL, /* VUP Information Normal(VUP not executed) */
+ INI_VUP_INFO_ERROR, /* VUP information error(VUP incomplete) */
+ INI_VUP_INFO_VUPFIN /* Completion of VUP information */
+};
+
+/*************************************************
+ +B Disconnect Information
+*************************************************/
+enum {
+ INI_BATTERY_INFO_UNSET = 0, /* +B Information not set */
+ INI_BATTERY_INFO_NORMAL, /* +B Information Normal(no disconnected) */
+ INI_BATTERY_INFO_DISCON /* +B Information with disconnected */
+};
+
+/*************************************************
+ User information initialization information
+*************************************************/
+enum {
+ INI_INITUSERDAT_UNSET = 0, /* User information not set */
+ INI_INITUSERDAT_ON, /* Personal Information Initialization Status Setting ON */
+ INI_INITUSERDAT_OFF /* Personal information initialization status setting OFF */
+};
+
+/*************************************************
+ DRAM back-up status at startup
+*************************************************/
+enum {
+ INI_DRAMBKUP_UNSET = 0, /* DRAM back-up status not set */
+ INI_DRAMBKUP_OK, /* DRAM back-up status OK */
+ INI_DRAMBKUP_NG /* DRAM backup status NG */
+};
+
+/****** STRUCT ******/
+/*************************************************
+ Startup system information
+*************************************************/
+typedef struct {
+ u_int8 boot_type; /* Startup identification */
+ u_int8 security_sts; /* Startup Security State */
+ u_int8 vup_info; /* Version upgrade completion information */
+ u_int8 battery_off_info; /* +B Disconnect Information */
+ u_int8 usrdat_init_info; /* User data initialization information */
+ u_int8 dram_bup_sts; /* DRAM back-up status */
+ u_int8 reserve[2]; /* Reserved */
+ u_int32 boot_time; /* Passed Time */
+} T_INI_BOOTINFO;
+
+/* <--- */
+
+/*
+***** STRUCTURE *****
+*/
+/******************************************************************************
+* TAG : T_PRIM_FORKCOMP
+* ABSTRACT : Stage-up completion notification structure
+* NOTE : Body portion of messages generated from API (Staged Start Completion Notification)
+******************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER head; /* Message buffer header */
+ u_int32 id; /* ID for start phase completion notification */
+} T_PRIM_FORKCOMP;
+
+/******************************************************************************
+* TAG : T_PRIM_ACCOFFSTART
+* ABSTRACT : Structures for ACC-OFF Process Instructions
+* NOTE : Body of messages generated from API(ACC-OFF process instructions)
+******************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER head; /* Message buffer header */
+ u_int32 id; /* ID for start phase completion notification */
+} T_PRIM_ACCOFFSTART;
+
+/******************************************************************************
+* TAG : T_PRIM_ACCOFFCOMP
+* ABSTRACT : Structures for notifying completion of ACC-OFF process
+* NOTE : Main body of messages generated from API(ACC-OFF process completion notification)
+******************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER head; /* Message buffer header */
+ u_int32 id; /* Identifier for notifying completion of ACC-OFF process */
+} T_PRIM_ACCOFFCOMP;
+
+/******************************************************************************
+* TAG : T_PRIM_INTERNAL_ACCOFFSTART
+* ABSTRACT : Structures for in-function ACC-OFF indication
+* NOTE : Body portion of messages generated from API (notification of completion of ACC-OFF process in function)
+******************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER head; /* Message buffer header */
+ u_int32 id; /* Identifier for notifying completion of ACC-OFF process */
+} T_PRIM_INTERNAL_ACCOFFSTART;
+
+/******************************************************************************
+* TAG : T_PRIM_INTERNAL_ACCOFFCOMP
+* ABSTRACT : Structures for notifying completion of ACC-OFF in functions
+* NOTE : Body portion of messages generated from NOTEAPI (notification of completion of ACC-OFF process in function)
+******************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER head; /* Message buffer header */
+ u_int32 id; /* Identifier for notifying completion of ACC-OFF process */
+} T_PRIM_INTERNAL_ACCOFFCOMP;
+
+/*
+***** PROTOTYPE *****
+*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int32 IniInternalAccOffComp(PNO pno , u_int32 id);
+void IniNotifyInit_CWORD69_Comp(void);
+void IniWaitInit_CWORD69_Comp(void);
+BOOL IniIsInit_CWORD69_Comp(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_INI_API_H_
diff --git a/vehicleservice/positioning/client/include/Naviinfo_API.h b/vehicleservice/positioning/client/include/Naviinfo_API.h
new file mode 100755
index 0000000..12caa84
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Naviinfo_API.h
@@ -0,0 +1,110 @@
+/*
+ * @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 Naviinfo_API.h
+@detail Naviinfo_API external header file<BR>
+ Naviinfo_API External Public Header
+******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_NAVIINFO_API_H_
+#define POSITIONING_CLIENT_INCLUDE_NAVIINFO_API_H_
+
+/*****************************************************************************
+ * Include *
+ *****************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "Sensor_Common_API.h"
+#include "Vehicle_API.h"
+#include "Sensor_API.h"
+#include <vehicle_service/POS_gps_API.h>
+
+/*****************************************************************************
+ * Define *
+ *****************************************************************************/
+/* Command ID Definition */
+#define CID_NAVIINFO_DELIVER (0x0205) /* Navigation information setting CID */
+#define CID_NAVIINFO_SPEED_DELIVER (0x0206) /* Vehicle speed setting CID */
+#define CID_NAVIINFO_SETGPSTIME (0x0207) /* GPS time delivery CID */
+
+/* Positioning Level/GPS Information Positioning Status Information Definition */
+#define NAVIINFO_DIAG_GPS_FIX_STS_NON (0) /* Not fix */
+#define NAVIINFO_DIAG_GPS_FIX_STS_2D (1) /* 2D positioning */
+#define NAVIINFO_DIAG_GPS_FIX_STS_3D (2) /* 3D positioning */
+
+/* Reception status definition */
+#define NAVIINFO_DIAG_GPS_RCV_STS_NOTUSE (0) /* Not used */
+#define NAVIINFO_DIAG_GPS_RCV_STS_SEARCHING (1) /* Searching */
+#define NAVIINFO_DIAG_GPS_RCV_STS_TRACHING (2) /* Tracking in progress */
+#define NAVIINFO_DIAG_GPS_RCV_STS_NOTUSEFIX (3) /* Positioning not used */
+#define NAVIINFO_DIAG_GPS_RCV_STS_USEFIX (4) /* Positioning use */
+
+/* Date and Time Status Definition */
+#define NAVIINFO_NAVI_GPS_TD_STS_NOTFIX (0)
+/* Time not calibrated after receiver reset */
+#define NAVIINFO_NAVI_GPS_TD_STS_RTCBACKUP (1)
+/* Time output by RTC backup(Time Calibration Result)*/
+#define NAVIINFO_NAVI_GPS_TD_STS_FIX (2) /* Time calibration completed */
+
+/* ++ Porting from PastModel002 enabled APIs */
+#define CID_VEHICLEIF_GET_VEHICLE_DATA 0x0102 /* Vehicle sensor information acquisition CID */
+#define CID_VEHICLEIF_COMM_WATCH 0x0103 /* Vehicle Sensor Information Disruption Monitoring CID */
+#define CID_SENSORIF__CWORD82__REQUEST 0x0800 /* Vehicle sensor information setting CID */
+
+#define VEHICLE_RET_ERROR_OUTOF_MEMORY (-8) /* Shared memory allocation failure */
+#define VEHICLE_RET_ERROR_INVALID (-10) /* CANID undetermined */
+
+/* -- Porting from PastModel002 enabled APIs */
+
+/*****************************************************************************
+ * Typedef *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Struct *
+ *****************************************************************************/
+/*****************************************************************************
+ * TAG : NAVIINFO_DELIVER_MSG
+ * ABSTRACT : Navigation information delivery message structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ NAVIINFO_ALL dat; /* Message data section */
+} NAVIINFO_DELIVER_MSG;
+
+/*****************************************************************************
+ * TAG : NAVIINFO_SPEED_DELIVER_MSG
+ * ABSTRACT : Navigation Information (Vehicle Speed) Delivery Message Structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ u_int16 navi_speed; /* Vehicle speed information */
+ u_int8 reserve[2]; /* reserve */
+} NAVIINFO_SPEED_DELIVER_MSG;
+
+/*****************************************************************************
+* Function prototype *
+*****************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int32 VehicleSetVehicleData(PNO pid, VEHICLE_MSG_SEND_DAT *p_data);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_NAVIINFO_API_H_
diff --git a/vehicleservice/positioning/client/include/POS_common_private.h b/vehicleservice/positioning/client/include/POS_common_private.h
new file mode 100755
index 0000000..4dd98a2
--- /dev/null
+++ b/vehicleservice/positioning/client/include/POS_common_private.h
@@ -0,0 +1,62 @@
+/*
+ * @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
+ * POS_common_private.h
+ * @brief
+ * Definition for Common Internal I/F Liblary
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_POS_COMMON_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_POS_COMMON_PRIVATE_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/*--- for message ---*/
+/*
+ * Maximum receive message size
+ * - Set the value based on the message receiving buffer size of the local thread
+ */
+#define MAX_MSG_BUF_SIZE (4096)
+
+/* command ID */
+#define CID_POSIF_SET_DATA 0x0790 /* set data command ID */
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_POS_COMMON_PRIVATE_H_
diff --git a/vehicleservice/positioning/client/include/POS_private.h b/vehicleservice/positioning/client/include/POS_private.h
new file mode 100755
index 0000000..9f02202
--- /dev/null
+++ b/vehicleservice/positioning/client/include/POS_private.h
@@ -0,0 +1,981 @@
+/*
+ * @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
+ * POS_private.h
+ * @brief
+ * Inner functions of Positoning API
+ *
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_POS_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_POS_PRIVATE_H_
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_define.h>
+#include "Vehicle_API_Dummy.h"
+#include "Vehicle_API_private.h"
+#include "Naviinfo_API.h"
+#include "POS_common_private.h"
+#include <asm/unistd.h>
+#include <other_service/VP_GetEnv.h>
+#include <other_service/env_vehicleparameterlibrary.h>
+#include "CommonDefine.h"
+/*---------------------------------------------------------------------------------*
+ * Function Prototype *
+ *---------------------------------------------------------------------------------*/
+/* Shared Library Value Area Check Function */
+inline UNIT_TYPE GetEnvSupportInfo(void);
+inline BOOL ChkUnitType(UNIT_TYPE type);
+inline RET_API MunMapDeviceIo(HANDLE dev, uint32_t map_size);
+inline RET_API MilliSecSleep(uint32_t mill_time);
+inline POS_RET_API PosChkParam8(int8_t data, int8_t min, int8_t max, const char* fn, int32_t line);
+inline POS_RET_API PosChkParam16(int16_t data, int16_t min, int16_t max, const char* fn, int32_t line);
+inline POS_RET_API PosChkParam32(int32_t data, int32_t min, int32_t max, const char* fn, int32_t line);
+inline POS_RET_API PosChkParamU8(uint8_t data, uint8_t min, uint8_t max, const char* fn, int32_t line);
+inline POS_RET_API PosChkParamU16(uint16_t data, uint16_t min, uint16_t max, const char* fn, int32_t line);
+inline POS_RET_API PosChkParamU32(uint32_t data, uint32_t min, uint32_t max, const char* fn, int32_t line);
+
+/* Shared Intra-Library Core Functions */
+inline POS_RET_API PosSetProc(DID did, void *p_data, uint16_t size, uint8_t is_event);
+inline POS_RET_API PosGetProc(DID did, void *p_data, uint16_t dest_size);
+inline SENSOR_RET_API PosRegisterListenerProc(PCSTR notify_name,
+ DID did, u_int8 ctrl_flg, u_int8 delivery_timing);
+
+/* General Functions in Shared Libraries */
+inline EventID VehicleCreateEvent(PNO pno);
+inline RET_API VehicleDeleteEvent(EventID event_id);
+inline RET_API VehicleLinkShareData(void **share_top, uint32_t *share_size, uint16_t *offset);
+inline RET_API VehicleUnLinkShareData(VEHICLE_SHARE *share_top, uint16_t offset);
+inline RET_API VehicleSndMsg(PNO pno_src, PNO pno_dest, CID cid, uint16_t msg_len, const void *msg_data);
+inline BOOL VehicleGetResource(void);
+inline void VehicleReleaseResource(void);
+inline uint32_t GetTid(void);
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+#define POS_CHKPARAM8(data, min, max) PosChkParam8(data, min, max, __func__, __LINE__)
+#define POS_CHKPARAM16(data, min, max) PosChkParam16(data, min, max, __func__, __LINE__)
+#define POS_CHKPARAM32(data, min, max) PosChkParam32(data, min, max, __func__, __LINE__)
+#define POS_CHKPARAMU8(data, min, max) PosChkParamU8(data, min, max, __func__, __LINE__)
+#define POS_CHKPARAMU16(data, min, max) PosChkParamU16(data, min, max, __func__, __LINE__)
+#define POS_CHKPARAMU32(data, min, max) PosChkParamU32(data, min, max, __func__, __LINE__)
+#define POS_API_TIME_OUT_MS 5000 /* Timeout period(ms) */
+
+/*---------------------------------------------------------------------------------*
+ * Inline Functions *
+ *---------------------------------------------------------------------------------*/
+UNIT_TYPE GetEnvSupportInfo(void) {
+ UNIT_TYPE ret_type = UNIT_TYPE_GRADE1;
+
+ char env_area[VP_MAX_LENGTH];
+ char env_grade[VP_MAX_LENGTH];
+ char* p_env_grade = env_grade;
+ char* p_env_area = env_area;
+
+ /*
+ * Note.
+ * This feature branches processing depending on the area and grade type.
+ */
+
+ VP_GetEnv(VP_VEHICLEPARAMETERLIBRARY_AREA, p_env_area);
+
+ if (0 == strcmp(p_env_area, "AREA1")) {
+ ret_type = UNIT_TYPE_GRADE2;
+ } else if (0 == strcmp(p_env_area, "AREA2")) {
+ memset(&env_grade, 0x00, sizeof(env_grade));
+ VP_GetEnv(VP_VEHICLEPARAMETERLIBRARY_GRADE, p_env_grade);
+ if (0 == strcmp(p_env_grade, "_CWORD95_") ||
+ 0 == strcmp(p_env_grade, "_CWORD101_") ||
+ 0 == strcmp(p_env_grade, "_CWORD61_")) {
+ ret_type = UNIT_TYPE_GRADE2;
+ }
+ } else {
+ // NOP
+ }
+
+ return ret_type;
+}
+
+BOOL ChkUnitType(UNIT_TYPE type) {
+ UNIT_TYPE type_temp;
+ BOOL ret;
+
+ type_temp = GetEnvSupportInfo();
+ if ((type_temp & type) != 0) {
+ ret = TRUE;
+ } else {
+ ret = FALSE;
+ }
+
+ return ret;
+}
+
+RET_API MunMapDeviceIo(HANDLE dev, uint32_t map_size) {
+ return RET_NORMAL;
+}
+
+RET_API MilliSecSleep(uint32_t mill_time) {
+ switch (mill_time) {
+ case 0:
+ {
+ /* Discard the time slice */
+ sched_yield();
+ break;
+ }
+ case INFINITE:
+ {
+ /* Abort processing indefinitely */
+ while (1) {
+ sleep(INFINITE);
+ }
+ }
+ default:
+ /* Sleep for Specified Time */
+ usleep(mill_time * 1000);
+ break;
+ }
+
+ return RET_NORMAL;
+}
+
+/**
+ * @brief
+ * Data Valid Value Determination(int8)
+ *
+ * @param[in] date int8_t Object data
+ * @param[in] min int8_t Target Data Valid Value Range(Minimum value)
+ * @param[in] max int8_t Target Data Valid Value Range(Maximum value)
+ * @param[in] fn const char* Pointer to the function name
+ * @param[in] line int32_t Number of lines
+ *
+ * @return POS_RET_NORMAL Within the valid range<br>
+ * POS_RET_ERROR Out of scope<br>
+ * POS_RET_ERROR_PARAM Argument error
+ */
+inline POS_RET_API PosChkParam8(int8_t data, int8_t min, int8_t max, const char* fn, int32_t line) {
+ POS_RET_API ret = POS_RET_NORMAL;
+
+ if (fn == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Argument ERROR!! fn=%p", fn);
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ if ((data < min) || (max < data)) {
+ ret = POS_RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "%s/%d/Out of range!! data=%d[%d, %d]",
+ fn, line, data, min, max);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Data Valid Value Determination(int16)
+ *
+ * @param[in] date int16_t Object data
+ * @param[in] min int16_t Target Data Valid Value Range(Minimum value)
+ * @param[in] max int16_t Target Data Valid Value Range(Maximum value)
+ * @param[in] fn const char* Pointer to the function name
+ * @param[in] line int32_t Number of lines
+ *
+ * @return POS_RET_NORMAL Within the valid range<br>
+ * POS_RET_ERROR Out of scope<br>
+ * POS_RET_ERROR_PARAM Argument error
+ */
+inline POS_RET_API PosChkParam16(int16_t data, int16_t min, int16_t max, const char* fn, int32_t line) {
+ POS_RET_API ret = POS_RET_NORMAL;
+
+ if (fn == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Argument ERROR!! fn=%p", fn);
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ if ((data < min) || (max < data)) {
+ ret = POS_RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "%s/%d/Out of range!! data=%d[%d, %d]",
+ fn, line, data, min, max);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Data Valid Value Determination(int32)
+ *
+ * @param[in] date int32_t Object data
+ * @param[in] min int32_t Target Data Valid Value Range(Minimum value)
+ * @param[in] max int32_t Target Data Valid Value Range(Maximum value)
+ * @param[in] fn const char* Pointer to the function name
+ * @param[in] line int32_t Number of lines
+ *
+ * @return POS_RET_NORMAL Within the valid range<br>
+ * POS_RET_ERROR Out of scope<br>
+ * POS_RET_ERROR_PARAM Argument error
+ */
+inline POS_RET_API PosChkParam32(int32_t data, int32_t min, int32_t max, const char* fn, int32_t line) {
+ POS_RET_API ret = POS_RET_NORMAL;
+
+ if (fn == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Argument ERROR!! fn=%p", fn);
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ if ((data < min) || (max < data)) {
+ ret = POS_RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "%s/%d/Out of range!! data=%d[%d, %d]",
+ fn, line, data, min, max);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Data Valid Value Determination(unsigned int8)
+ *
+ * @param[in] date uint8_t Object data
+ * @param[in] min uint8_t Target Data Valid Value Range(Minimum value)
+ * @param[in] max uint8_t Target Data Valid Value Range(Maximum value)
+ * @param[in] fn const char* Pointer to the function name
+ * @param[in] line int32_t Number of lines
+ *
+ * @return POS_RET_NORMAL Within the valid range<br>
+ * POS_RET_ERROR Out of scope<br>
+ * POS_RET_ERROR_PARAM Argument error
+ */
+inline POS_RET_API PosChkParamU8(uint8_t data, uint8_t min, uint8_t max, const char* fn, int32_t line) {
+ POS_RET_API ret = POS_RET_NORMAL;
+
+ if (fn == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Argument ERROR!! fn=%p", fn);
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ if ((data < min) || (max < data)) {
+ ret = POS_RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "%s/%d/Out of range!! data=%u[%u, %u]",
+ fn, line, data, min, max);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Data Valid Value Determination(unsigned int16)
+ *
+ * @param[in] date uint16_t Object data
+ * @param[in] min uint16_t Target Data Valid Value Range(Minimum value)
+ * @param[in] max uint16_t Target Data Valid Value Range(Maximum value)
+ * @param[in] fn const char* Pointer to the function name
+ * @param[in] line int32_t Number of lines
+ *
+ * @return POS_RET_NORMAL Within the valid range<br>
+ * POS_RET_ERROR Out of scope<br>
+ * POS_RET_ERROR_PARAM Argument error
+ */
+inline POS_RET_API PosChkParamU16(uint16_t data, uint16_t min, uint16_t max, const char* fn, int32_t line) {
+ POS_RET_API ret = POS_RET_NORMAL;
+
+ if (fn == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Argument ERROR!! fn=%p", fn);
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ if ((data < min) || (max < data)) {
+ ret = POS_RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "%s/%d/Out of range!! data=%u[%u, %u]",
+ fn, line, data, min, max);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Data Valid Value Determination(unsigned int32)
+ *
+ * @param[in] date uint32_t Object data
+ * @param[in] min uint32_t Target Data Valid Value Range(Minimum value)
+ * @param[in] max uint32_t Target Data Valid Value Range(Maximum value)
+ * @param[in] fn const char* Pointer to the function name
+ * @param[in] line int32_t Number of lines
+ *
+ * @return POS_RET_NORMAL Within the valid range<br>
+ * POS_RET_ERROR Out of scope<br>
+ * POS_RET_ERROR_PARAM Argument error
+ */
+inline POS_RET_API PosChkParamU32(uint32_t data, uint32_t min, uint32_t max, const char* fn, int32_t line) {
+ POS_RET_API ret = POS_RET_NORMAL;
+
+ if (fn == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Argument ERROR!! fn=%p", fn);
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ if ((data < min) || (max < data)) {
+ ret = POS_RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "%s/%d/Out of range!! data=%u[%u, %u]",
+ fn, line, data, min, max);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Data setting process(Internal processing)
+ *
+ * Set the specified information
+ *
+ * @param[in] did DID - Data ID
+ * @param[in] p_data void* - Configuration data
+ * @param[in] size uint16_t - Setting data size
+ * @param[in] is_event uint8_t - Event wait status(TRUE/FALSE)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_INNER Internal error
+ */
+inline POS_RET_API PosSetProc(DID did, void *p_data, uint16_t size, uint8_t is_event) {
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ RET_API ret_api = RET_NORMAL; /* API return value */
+ POS_MSGINFO snd_msg; /* Message */
+ EventID event_id; /* Event ID */
+ int32_t event_val; /* Event value */
+ PNO pno; /* Calling thread PNO */
+ uint32_t pid; /* Process ID */
+ uint32_t tid; /* Thread ID */
+ char name[128];
+
+ /* Data size check */
+ if (POS_MSG_INFO_DSIZE < size) {
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+ /* Message data */
+ /* _CWORD71_ processing speed(Memset modification) */
+ /* Initialization of areas that do not contain values */
+ snd_msg.pno = 0;
+ snd_msg.rcv_flag = 0;
+ snd_msg.reserve = 0;
+
+ snd_msg.did = did;
+ snd_msg.size = size;
+ memcpy(snd_msg.data, p_data, size);
+
+ if (TRUE == is_event) {
+ /* After requesting data setting,Wait for the setting completion(Event Wait) */
+
+ /* Event Generation */
+ pid = static_cast<uint32_t>(getpid());
+ tid = GetTid();
+
+ snprintf(name, sizeof(name), "PS_p%u_t%u", pid, tid);
+ pno = _pb_CnvName2Pno(name);
+ event_id = VehicleCreateEvent(pno);
+
+ /* Set the source Pno of message data */
+ snd_msg.pno = pno;
+
+ if (0 != event_id) {
+ /* Successful event generation */
+
+ /* Send NAVI Sensor Data Setting to Vehicle Sensor */
+ ret_api = VehicleSndMsg(pno,
+ PNO_VEHICLE_SENSOR,
+ CID_POSIF_SET_DATA,
+
+ (uint16_t)sizeof(POS_MSGINFO) - POS_MSG_INFO_DSIZE + snd_msg.size, /* variable length */
+ (const void *)&snd_msg);
+
+ if (RET_NORMAL == ret_api) {
+ /* If the data setup process is successful,Wait for a completion event */
+ ret_api = _pb_WaitEvent(event_id,
+ SAPI_EVWAIT_VAL,
+ VEHICLE_RET_ERROR_MIN,
+ VEHICLE_RET_NORMAL, &event_val, POS_API_TIME_OUT_MS);
+ if (RET_NORMAL != ret_api) {
+ /* Return an internal error */
+ ret = POS_RET_ERROR_INNER;
+ } else {
+ /* Return from Event Wait */
+ /* Set event value (processing result) as return value */
+ ret = (POS_RET_API)event_val;
+ }
+ } else {
+ /* Message transmission processing failed */
+ ret = POS_RET_ERROR_INNER;
+ }
+ /* Event deletion */
+ ret_api = VehicleDeleteEvent(event_id);
+ } else {
+ /* Event generation failure */
+ ret = POS_RET_ERROR_INNER;
+ }
+ } else {
+ /* After setting data,Immediate termination */
+
+ /* Send NAVI Sensor Data Setting to Vehicle Sensor */
+ ret_api = _pb_SndMsg_Ext(POS_THREAD_NAME,
+ CID_POSIF_SET_DATA,
+ sizeof(POS_MSGINFO), reinterpret_cast<void*>(&snd_msg), 0);
+ if (ret_api != RET_NORMAL) {
+ /* Message transmission failure */
+ ret = POS_RET_ERROR_INNER;
+ }
+ }
+ } else {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Sensor information acquisition(Internal processing)
+ *
+ * @param[in] did DID - Data ID for vehicle information
+ * @param[in] p_data void* - Pointer representing the storage destination of vehicle sensor information
+ * @param[in] dest_size uint16_t - Storage destination size of vehicle sensor information(byte)
+ *
+ * @return 0 or more Stored data size(Include illegal)<br>
+ * POS_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * POS_RET_ERROR_OUTOF_MEMORY Shared memory allocation failed<br>
+ * POS_RET_ERROR_SIZE Storage destination size error<br>
+ * POS_RET_ERROR_DID Unregistered ID<br>
+ */
+inline POS_RET_API PosGetProc(DID did, void *p_data, uint16_t dest_size) {
+ POS_RET_API ret; /* Return value */
+ RET_API ret_api; /* System API return value */
+ EventID event_id; /* Event ID */
+ int32_t event_val; /* Event value */
+ void *share_top; /* Start address of shared memory */
+ uint32_t share_size; /* Size of shared memory area */
+ uint16_t offset; /* Offset to free shared memory area */
+ VEHICLE_SHARE_BLOCK_DAT *share_dat; /* Address of free shared memory area */
+ VEHICLE_MSG_GET_VEHICLE_DATA_DAT data; /* Message data */
+ PNO pno; /* Calling thread PNO */
+ uint32_t pid; /* Process ID */
+ uint32_t tid; /* Thread ID */
+ char name[128];
+
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+ /* Initialization */
+ event_id = 0;
+ event_val = 0;
+ memset(reinterpret_cast<void *>(&data), 0, sizeof(VEHICLE_MSG_GET_VEHICLE_DATA_DAT));
+
+ /* Event Generation */
+ pid = static_cast<uint32_t>(getpid());
+ tid = GetTid();
+
+ snprintf(name, sizeof(name), "PG_p%u_t%u", pid, tid);
+ pno = _pb_CnvName2Pno(name);
+ event_id = VehicleCreateEvent(pno);
+
+ if (0 != event_id) {
+ /* Successful event generation */
+
+ /* Allocate shared memory */
+ ret_api = VehicleLinkShareData(reinterpret_cast<void **>(&share_top), &share_size, &offset);
+ if (RET_NORMAL != ret_api) {
+ /* Failed to allocate shared memory */
+ ret = POS_RET_ERROR_OUTOF_MEMORY;
+ } else { /* When the shared memory is allocated successfully */
+ /* Calculate start address of free shared memory area */
+ share_dat = reinterpret_cast<VEHICLE_SHARE_BLOCK_DAT *>(reinterpret_cast<u_int8 *>(share_top)
+ + offset);
+
+ /* Send vehicle sensor information acquisition message */
+ data.did = did;
+ data.pno = pno;
+ data.offset = offset;
+ data.size = VEHICLE_SHARE_BLOCK_DSIZE;
+
+ /* Messaging */
+ ret_api = VehicleSndMsg(pno,
+ PNO_VEHICLE_SENSOR,
+ CID_VEHICLEIF_GET_VEHICLE_DATA,
+ sizeof(VEHICLE_MSG_GET_VEHICLE_DATA_DAT), (const void *)&data);
+
+ /* Message transmission processing is successful */
+ if (RET_NORMAL == ret_api) {
+ /* Wait for completion event from vehicle sensor thread */
+ ret_api = _pb_WaitEvent(event_id,
+ SAPI_EVWAIT_VAL,
+ VEHICLE_RET_ERROR_MIN,
+ VEHICLE_RET_NORMAL, &event_val, POS_API_TIME_OUT_MS);
+
+ if (RET_NORMAL != ret_api) {
+ /* Return an internal error */
+ ret = POS_RET_ERROR_INNER;
+ } else { /* Return from Event Wait */
+ /* Link to shared memory */
+ ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME),
+ &share_top, &share_size);
+
+ /* Calculate the address of the shared memory storage area. */
+ share_dat = reinterpret_cast<VEHICLE_SHARE_BLOCK_DAT *>(reinterpret_cast<u_int8 *>(share_top)
+ + offset);
+
+ if (event_val < 0) {
+ /* Vehicle sensor information acquisition failure */
+ ret = (VEHICLE_RET_API)event_val;
+ } else if (RET_NORMAL != ret_api) {
+ /* Shared memory error */
+ ret = POS_RET_ERROR_OUTOF_MEMORY;
+ } else if (dest_size < share_dat->size) {
+ /* Storage destination size error */
+ ret = POS_RET_ERROR_SIZE;
+ } else { /* Vehicle sensor information acquisition success */
+ /* Copy from shared memory to user memory */
+ memcpy(p_data, share_dat->data, (size_t)share_dat->size);
+
+ /* Set Write Size to Return Value */
+ ret = static_cast<int32>(share_dat->size);
+ }
+ }
+ } else { /* Message transmission processing failed */
+ /* Return an event generation failure */
+ ret = POS_RET_ERROR_CREATE_EVENT;
+ }
+ /* Free shared memory */
+ (void)VehicleUnLinkShareData(reinterpret_cast<VEHICLE_SHARE*>(share_top), offset);
+ }
+ /* Event deletion */
+ ret_api = VehicleDeleteEvent(event_id);
+ } else {
+ /* Event generation failure */
+ ret = POS_RET_ERROR_CREATE_EVENT;
+ }
+ } else {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Delivery registration process(Internal processing)
+ *
+ * @param[in] notify_name Destination thread name
+ * @param[in] did Pointer to an array of data IDs for vehicle information
+ * @param[in] ctrl_flg Delivery control<br>
+ * Delivery registration: SENSOR_DELIVERY_REGIST<br>
+ * Delivery stop: SENSOR_DELIVERY_STOP (Note: Not mounted)<br>
+ * Resume delivery: SENSOR_DELIVERY_RESTART (Note: Not mounted)
+ * @param[in] delivery_timing Delivery timing<br>
+ * Updating : SENSOR_DELIVERY_TIMING_UPDATE<br>
+ * Changing : SENSOR_DELIVERY_TIMING_CHANGE
+ *
+ * @return SENSOR_RET_NORMAL Successful registration<br>
+ * SENSOR_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * SENSOR_RET_ERROR_PARAM Parameter error<br>
+ * SENSOR_RET_ERROR_DID Unregistered ID<br>
+ * SENSOR_RET_ERROR_BUFFULL FULL of delivery registers<br>
+ * SENSOR_RET_ERROR_INNER Internal abnormality<br>
+ */
+inline SENSOR_RET_API PosRegisterListenerProc(PCSTR notify_name, DID did, u_int8 ctrl_flg, u_int8 delivery_timing) {
+ SENSOR_RET_API ret; /* Return value */
+ RET_API ret_api; /* System API return value */
+ EventID event_id; /* Event ID */
+ int32 event_val; /* Event value */
+ VEHICLE_MSG_DELIVERY_ENTRY_DAT data; /* Message data */
+ PNO pno; /* Converted internal PNO */
+
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+ /* Initialization */
+ event_id = 0;
+ event_val = 0;
+
+ /* Get PNO from Thread Name */
+ pno = _pb_CnvName2Pno(notify_name);
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(pno);
+
+ if (0 != event_id) {
+ /* Successful event generation */
+
+ /*--------------------------------------------------------------*
+ * Send Vehicle Sensor Information Delivery Registration Message *
+ *--------------------------------------------------------------*/
+ /* Create Message Data */
+ data.did = did;
+ data.pno = pno;
+ data.delivery_timing = delivery_timing;
+ data.ctrl_flg = ctrl_flg;
+ data.event_id = event_id;
+
+ /* Messaging */
+ ret_api = VehicleSndMsg(pno,
+ PNO_VEHICLE_SENSOR,
+ CID_VEHICLEIF_DELIVERY_ENTRY,
+ (uint16_t)sizeof(VEHICLE_MSG_DELIVERY_ENTRY_DAT), (const void *)&data);
+
+ if (RET_NORMAL == ret_api) {
+ /* Message transmission processing is successful */
+ /* Wait for completion event from vehicle sensor thread */
+ ret_api = _pb_WaitEvent(event_id,
+ SAPI_EVWAIT_VAL,
+ VEHICLE_RET_ERROR_MIN,
+ VEHICLE_RET_NORMAL, &event_val, POS_API_TIME_OUT_MS);
+ if (RET_NORMAL != ret_api) {
+ /* Return an internal error */
+ ret = SENSOR_RET_ERROR_INNER;
+ } else {
+ /* Return from Event Wait */
+ /* Set event value (processing result) as return value */
+ ret = (SENSOR_RET_API)event_val;
+ }
+ } else {
+ /* Message transmission processing failed */
+ /* Return an internal error */
+ ret = SENSOR_RET_ERROR_INNER;
+ }
+ /* Event deletion */
+ ret_api = VehicleDeleteEvent(event_id);
+ } else {
+ /* Event generation failure */
+ ret = SENSOR_RET_ERROR_CREATE_EVENT;
+ }
+ } else {
+ /* Insufficient resource */
+ ret = SENSOR_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+
+ return ret;
+}
+
+/*******************************************************************************
+ * MODULE : VehicleCreateEvent
+ * ABSTRACT : Event creation process
+ * FUNCTION : Generate an event
+ * ARGUMENT : pno : Thread ID
+ * NOTE :
+ * RETURN : Non-zero : Event ID
+ * : Zero : Event generation failure
+ ******************************************************************************/
+inline EventID VehicleCreateEvent(PNO pno) {
+ EventID event_id; /* Event ID */
+ char event_name[32]; /* Event name character string buffer */
+ RET_API ret_api; /* System API return value */
+
+
+ /* Initialization of event name character string buffer */
+ memset(reinterpret_cast<void *>(event_name), 0, sizeof(event_name));
+ /* Event name creation */
+ snprintf(event_name, sizeof(event_name), "VEHICLE_%X", pno);
+
+ /* Event Generation */
+ event_id = _pb_CreateEvent(FALSE, 0, event_name);
+
+ if (0 != event_id) {
+ /* For successful event generation */
+
+ /* Initialize the event */
+ ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, VEHICLE_EVENT_VAL_INIT);
+ if (RET_NORMAL != ret_api) {
+ /* Event initialization failed */
+ /* Delete Event and Return Event Generation Failed */
+ ret_api = VehicleDeleteEvent(event_id);
+ event_id = 0;
+ }
+ }
+
+ return(event_id);
+}
+
+/*******************************************************************************
+ * MODULE : VehicleDeleteEvent
+ * ABSTRACT : Event deletion processing
+ * FUNCTION : Delete events
+ * ARGUMENT : event_id : Event ID of the event to delete
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_EV_NONE : Specified event does not exist
+ ******************************************************************************/
+inline RET_API VehicleDeleteEvent(EventID event_id) {
+ return(_pb_DeleteEvent(event_id));
+}
+
+/*******************************************************************************
+ * MODULE : VehicleLinkShareData
+ * ABSTRACT : Link to shared memory
+ * FUNCTION : Link to shared memory
+ * ARGUMENT : **share_top : Storage destination of shared memory top address
+ * : *share_size : Storage destination of shared memory area size
+ * : *offset : Offset storage destination to free shared memory area
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERROR : There is no shared memory area.
+ ******************************************************************************/
+inline RET_API VehicleLinkShareData(void **share_top, uint32_t *share_size, uint16_t *offset) {
+ RET_API ret_api; /* System API return value */
+ SemID sem_id; /* Semaphore ID */
+ VEHICLE_SHARE *share_top_tmp;
+ int32 i;
+
+ /* Initialization */
+ ret_api = RET_ERROR;
+
+ /* Create Semaphore */
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(VEHICLE_SEMAPHO_NAME));
+ if (0 != sem_id) {
+ /* Semaphore Lock */
+ ret_api = _pb_SemLock(sem_id);
+ if (RET_NORMAL == ret_api) {
+ /* Link to shared memory */
+ ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME), share_top, share_size);
+ if (RET_NORMAL == ret_api) {
+ /* By searching the free shared memory area,Offset is calculated if there is free space. */
+ share_top_tmp = reinterpret_cast<VEHICLE_SHARE *>(*share_top);
+
+ /* Because the first block of the shared memory area is the control area,Loop from i = 1 */
+ for (i = 1; i < VEHICLE_SHARE_BLOCK_NUM; i++) {
+ if (VEHICLE_SHARE_UNLOCK == share_top_tmp->mng.lock_info[i]) {
+ break;
+ }
+ }
+ if (i < VEHICLE_SHARE_BLOCK_NUM) {
+ /* Empty space */
+ /* Lock the block */
+ share_top_tmp->mng.lock_info[i] = VEHICLE_SHARE_LOCK;
+
+ /* Calculate the offset to the block */
+ *offset = static_cast<u_int16>(i * VEHICLE_SHARE_BLOCK_SIZE);
+
+ /* Normal completion */
+ ret_api = RET_NORMAL;
+ } else {
+ /* No free space */
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* Failed link to shared memory */
+ ret_api = RET_ERROR;
+ }
+ /* Semaphore unlock */
+ _pb_SemUnlock(sem_id);
+ } else {
+ /* Semaphore lock failed */
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* Semaphore creation failed */
+ ret_api = RET_ERROR;
+ }
+
+ return(ret_api);
+}
+
+/*******************************************************************************
+ * MODULE : VehicleUnLinkShareData
+ * ABSTRACT : Unlinking shared memory
+ * FUNCTION : Unlink shared memory
+ * ARGUMENT : *share_top : Start address of shared memory
+ * : offset : Offset to shared memory free area
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERROR : There is no shared memory area./semaphore error
+ ******************************************************************************/
+inline RET_API VehicleUnLinkShareData(VEHICLE_SHARE *share_top, uint16_t offset) {
+ RET_API ret_api; /* System API return value */
+ SemID sem_id; /* Semaphore ID */
+ int32 i;
+
+ /* Initialization */
+ ret_api = RET_ERROR;
+
+ /* Create Semaphore */
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(VEHICLE_SEMAPHO_NAME));
+ if (0 != sem_id) {
+ /* Semaphore Lock */
+ ret_api = _pb_SemLock(sem_id);
+ if (RET_NORMAL == ret_api) {
+ /* Unlock the block */
+ i = static_cast<int32>(offset) / VEHICLE_SHARE_BLOCK_SIZE;
+ share_top->mng.lock_info[i] = VEHICLE_SHARE_UNLOCK;
+
+ /* Semaphore unlock */
+ _pb_SemUnlock(sem_id);
+
+ /* Normal completion */
+ ret_api = RET_NORMAL;
+ } else {
+ /* Semaphore lock failed */
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* Semaphore creation failed */
+ ret_api = RET_ERROR;
+ }
+
+ return(ret_api);
+}
+
+/*******************************************************************************
+ * MODULE : VehicleSndMsg
+ * ABSTRACT : Message transmission processing
+ * FUNCTION : Send a message to the specified PNO
+ * ARGUMENT : pno_src : Source PNO
+ * : pno_dest : Destination PNO
+ * : cid : Command ID
+ * : msg_len : Message data body length
+ * : *msg_data : Pointer to message data
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERRNOTRDY : Destination process is not wakeup
+ * : RET_ERRMSGFULL : Message queue overflows
+ * : RET_ERRPARAM : Buffer size error
+ ******************************************************************************/
+inline RET_API VehicleSndMsg(PNO pno_src, PNO pno_dest, CID cid, uint16_t msg_len, const void *msg_data) {
+ VEHICLE_MSG_BUF msg_buf; /* message buffer */
+ T_APIMSG_MSGBUF_HEADER *msg_hdr; /* Pointer to the message header */
+ RET_API ret_api; /* Return value */
+ PCSTR thread_name; /* Destination thread name */
+
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "+ [pno_src = 0x%x, pno_dest = 0x%x]", pno_src, pno_dest);
+
+ /* _CWORD71_ processing speed(Memset modification) */
+ /* Initializing the header of the message buffer */
+ memset(reinterpret_cast<void *>(&msg_buf.hdr), 0, sizeof(T_APIMSG_MSGBUF_HEADER));
+
+ /* Get pointer to send buffer */
+ msg_hdr = reinterpret_cast<T_APIMSG_MSGBUF_HEADER *>(reinterpret_cast<void *>(&msg_buf));
+
+ /*--------------------------------------------------------------*
+ * Create message headers *
+ *--------------------------------------------------------------*/
+ msg_hdr->hdr.sndpno = pno_src; /* Source PNO */
+ msg_hdr->hdr.cid = cid; /* Command ID */
+ msg_hdr->hdr.msgbodysize = msg_len; /* Message data body length */
+
+ /*--------------------------------------------------------------*
+ * Create message data *
+ *--------------------------------------------------------------*/
+ if ((0 != msg_data) && (0 != msg_len)) {
+ /* Set the message data */
+ memcpy(reinterpret_cast<void *>(msg_buf.data), msg_data, (size_t)msg_len);
+ }
+ /*--------------------------------------------------------------*
+ * Send messages *
+ *--------------------------------------------------------------*/
+ /* Get Thread Name from PNO */
+ if (pno_dest <= SYS_PNO_MAX) {
+ thread_name = POS_THREAD_NAME;
+ } else {
+ thread_name = _pb_CnvPno2Name(pno_dest);
+ }
+
+ if ((pno_dest <= SYS_PNO_MAX) && (pno_src <= SYS_PNO_MAX)) {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "[LOG pno_dest = 0x%x]", pno_dest);
+
+ /* Internal Process Transmission and Reception Messages */
+ ret_api = _pb_SndMsg(pno_dest,
+ (uint16_t)(sizeof(T_APIMSG_MSGBUF_HEADER) + msg_len),
+ reinterpret_cast<void *>(&msg_buf), 0);
+ } else {
+ /* External Process Transmission and Reception Messages */
+ ret_api = _pb_SndMsg_Ext(thread_name,
+ cid,
+ (uint16_t)(msg_len), /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ reinterpret_cast<void *>(&(msg_buf.data)), 0);
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+
+ return(ret_api);
+}
+
+/**
+ * @brief
+ * Resource Acquisition Decision
+ *
+ * @param[in] none
+ *
+ * @return TRUE Normal<br>
+ * FALSE Abnormality(Insufficient resource)
+ */
+inline BOOL VehicleGetResource(void) {
+ BOOL ret[4] = {TRUE, TRUE, TRUE, TRUE};
+ uint8_t idx;
+
+ ret[1] = _pb_GetMsgResource();
+ ret[2] = _pb_GetMutexResource();
+ ret[3] = _pb_GetOtherResource();
+
+ for (idx = 1; idx < 4; idx++) {
+ if (ret[idx] == FALSE) {
+ ret[0] = FALSE;
+ }
+ }
+
+ return ret[0];
+}
+
+/**
+ * @brief
+ * Resource release
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+inline void VehicleReleaseResource(void) {
+ _pb_ReleaseMsgResource();
+ _pb_ReleaseMutexResource();
+ _pb_ReleaseOtherResource();
+
+ return;
+}
+
+inline uint32_t GetTid(void) {
+ return (uint32_t)syscall(__NR_gettid);
+}
+
+
+#endif // POSITIONING_CLIENT_INCLUDE_POS_PRIVATE_H_
diff --git a/vehicleservice/positioning/client/include/POS_sensor_private.h b/vehicleservice/positioning/client/include/POS_sensor_private.h
new file mode 100755
index 0000000..1e1497f
--- /dev/null
+++ b/vehicleservice/positioning/client/include/POS_sensor_private.h
@@ -0,0 +1,163 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_POS_SENSOR_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_POS_SENSOR_PRIVATE_H_
+/******************************************************************************
+ * file name :POS_sensor_private.h
+ * system name :Positioning
+ * sub system name :Positioning internal interface library
+ ******************************************************************************/
+
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/pos_message_header.h>
+#include <native_service/frameworkunified_types.h>
+/************************************************************************
+* definition *
+************************************************************************/
+/*----------------------------------------------------------------------*
+ * for message *
+ *----------------------------------------------------------------------*/
+/* command ID */
+#define CID_SENSOR_PKG_INFO 0x0700 /* vehicle sensor package notification ID */
+
+/*----------------------------------------------------------------------*
+ * definition for GPS response *
+ *----------------------------------------------------------------------*/
+#define GPS_BUFFERFUL 2 /* transmit buffer full(rejection) */
+#define GPS_INITIAL 3 /* initialization state(rejection) */
+#define GPS_CONNECTNG 4 /* connection error(rejection) */
+
+/*----------------------------------------------------------------------*
+ * definition clock status *
+ *----------------------------------------------------------------------*/
+#define CLOCK_VALID (1U)
+#define CLOCK_INVALID (0U)
+
+/*----------------------------------------------------------------------*
+ * Message Related Extensions *
+ *----------------------------------------------------------------------*/
+#define CID_SENSORIF_SET_GPSTIME 0x0701 /* GPS time information setting CID */
+
+/*----------------------------------------------------------------------*
+ * GPS version-related definitions *
+ *----------------------------------------------------------------------*/
+#define GPS__CWORD82__VERSION_LEN (7U) /* _CWORD82_ version data length */
+
+/************************************************************************
+* struct declaration *
+************************************************************************/
+/************************************************************************
+* TAG : SENSOR_MSG_DELIVERY_ENTRY
+* ABSTRACT : vehicle sensor delivery message (to vehicle sensor)
+************************************************************************/
+typedef struct {
+ PNO pno; /* destination process number */
+ u_int8 pkg_num; /* number of package data (1 - 16) */
+ u_int8 delivery_timing; /* delivery timing */
+ u_int8 ctrl_flg; /* delivery control flag */
+ u_int8 reserve[3];
+ EventID event_id; /* event ID */
+ DID did[SENSOR_PKG_DELIVERY_MAX]; /* data ID array */
+} SENSOR_MSG_DELIVERY_ENTRY_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* message header */
+ SENSOR_MSG_DELIVERY_ENTRY_DAT data; /* message body */
+} SENSOR_MSG_DELIVERY_ENTRY;
+
+/************************************************************************
+* TAG : SENSOR_MSG_GET_SENSOR_DATA
+* ABSTRACT : vehicle sensor getter message (to vehicle sensor)
+************************************************************************/
+typedef struct {
+ PNO pno; /* destination process number */
+ u_int8 pkg_num; /* number of package data (1 - 16) */
+ u_int8 reserve;
+ u_int16 offset; /* share memory offset */
+ u_int16 size; /* share memory allocation size */
+ EventID event_id; /* event ID */
+ DID did[SENSOR_PKG_DELIVERY_MAX]; /* data ID about vehicle sensor */
+} SENSOR_MSG_GET_SENSOR_DATA_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* message header */
+ SENSOR_MSG_GET_SENSOR_DATA_DAT data; /* message body */
+} SENSOR_MSG_GET_SENSOR_DATA;
+
+/************************************************************************
+* TAG : SENSOR_INTERNAL_MSG_BUF
+* ABSTRACT : message buffer
+************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* message header */
+ u_int8 data[SENSOR_MSGBUF_DSIZE]; /* message body */
+} SENSOR_INTERNAL_MSG_BUF;
+
+/********************************************************************************
+ * TAG :TG_GPSTIME
+ * ABSTRACT :GPS Absolute Time Structure
+ * NOTE :
+ ********************************************************************************/
+typedef struct {
+ u_int16 year; /* Year information(4-digit year) */
+ u_int8 month; /* Month information */
+ u_int8 day; /* Day information */
+ u_int8 hour; /* Hour information */
+ u_int8 minute; /* Minute information */
+ u_int8 second; /* Second information */
+ u_int8 reserve; /* reserve */
+} TG_GPSTIME;
+
+/********************************************************************************
+ * TAG :TG_GPS_RTCBKUP_DATA
+ * ABSTRACT :RTC backup-related data structures
+ * NOTE :RTC-backup-related data stored in the SRAM alternate DRAM
+ ********************************************************************************/
+typedef struct {
+ u_int8 time_status; /* Time Status */
+ u_int8 reserve1[3]; /* Reserve 1 */
+ TG_GPSTIME gps_time; /* GPS Absolute Time */
+} TG_GPS_RTCBKUP_DATA; /* */
+
+/************************************************************************
+ * TAG : GPS_INTERRUPT
+ * ABSTRACT : GPS interrupt status
+ * NOTE :
+************************************************************************/
+typedef struct {
+ u_int8 _CWORD102__interrupt; /* from GPS to _CWORD102_ interrupt status */
+ u_int8 _CWORD56__interrupt; /* from GPS to _CWORD56_ interrupt status */
+} GPS_INTERRUPT;
+
+/********************************************************************************
+ * TAG :LOCALTIME
+ * ABSTRACT :LocalTime data structure
+ * NOTE :
+ ********************************************************************************/
+typedef struct {
+ u_int8 status; /* status : valid or invalid */
+ u_int8 reserve[3]; /* reserve */
+ u_int16 year; /* year : 2000..2099 (FFFFh:invalid) */
+ u_int8 month; /* month : 1..12 (FFh:invalid) */
+ u_int8 day; /* date : 1..31 (FFh:invalid) */
+ u_int8 hour; /* hour : 0..23 (FFh:invalid) */
+ u_int8 min; /* minute : 0..59 (FFh:invalid) */
+ u_int8 sec; /* second : 0..59 (FFh:invalid) */
+ u_int8 reserve2; /* reserve */
+} LOCALTIME;
+
+#endif // POSITIONING_CLIENT_INCLUDE_POS_SENSOR_PRIVATE_H_
diff --git a/vehicleservice/positioning/client/include/SensorLocation_API.h b/vehicleservice/positioning/client/include/SensorLocation_API.h
new file mode 100755
index 0000000..ae7f20a
--- /dev/null
+++ b/vehicleservice/positioning/client/include/SensorLocation_API.h
@@ -0,0 +1,124 @@
+/*
+ * @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 SensorLocation_API.h
+@detail SensorLocation_API external header file<BR>
+ SensorLocation_API External public header
+******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_H_
+#define POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_H_
+
+/*****************************************************************************
+ * Include *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Define *
+ *****************************************************************************/
+/* Command ID */
+#define CID_VEHICLE_SENSORLOCATION_LONLAT (0x0201)
+/* Vehicle sensor information notification CID (Latitude and longitude information)*/
+#define CID_VEHICLE_SENSORLOCATION_ALTITUDE (0x0202)
+/* Vehicle sensor information notification CID (Altitude Information) */
+
+/* SENSORLOCATION_RET_API definition */
+#define SENSORLOCATION_RET_NORMAL (0) /* Successful completion */
+#define SENSORLOCATION_RET_ERROR_PARAM (-1) /* Parameter error */
+#define SENSORLOCATION_RET_ERROR_BUFFULL (-2) /* Number of registered FULL */
+#define SENSORLOCATION_RET_ERROR_INNER (-3) /* Internal error */
+
+/* Delivery opportunity definition */
+#define SENSORLOCATION_DELIVERY_TIMING_CHANGE (0) /* Change */
+#define SENSORLOCATION_DELIVERY_TIMING_UPDATE (1) /* UpDate */
+
+/* Presence information definitions DR */
+#define SENSORLOCATION_EXISTDR_NODR (0) /* Without DR */
+#define SENSORLOCATION_EXISTDR_DR (1) /* There DR */
+
+/* DR state definition */
+#define SENSORLOCATION_DRSTATUS_INVALID (0) /* Invalid */
+#define SENSORLOCATION_DRSTATUS_GPS_NODR (1) /* Information use GPS, not yet implemented DR */
+#define SENSORLOCATION_DRSTATUS_NOGPS_DR (2) /* No information available GPS, DR implementation */
+#define SENSORLOCATION_DRSTATUS_GPS_DR (3) /* Information use GPS, DR implementation */
+
+/* LONLAT initial value definition */
+#define SENSORLOCATION_LATITUDE_INIT_VALUE 0x7FFFFFFFL /* initial value */
+#define SENSORLOCATION_LONGITUDE_INIT_VALUE 0x7FFFFFFFL /* initial value */
+
+/*****************************************************************************
+ * Typedef *
+ *****************************************************************************/
+typedef int32 SENSORLOCATION_RET_API;
+
+/*****************************************************************************
+ * Struct *
+ *****************************************************************************/
+/*****************************************************************************
+ * TAG : SENSORLOCATION_LONLATINFO_DAT
+ * ABSTRACT : Latitude and longitude information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int8 sensor_cnt; /* Sensor counter value */
+ u_int8 is_exist_dr; /* Presence or absence information DR */
+ u_int8 dr_status; /* DR state */
+ u_int8 reserve[3]; /* Reserve */
+ int32 longitude; /* Longitude */
+ int32 latitude; /* Latitude */
+} SENSORLOCATION_MSG_LONLATINFO_DAT;
+
+/*****************************************************************************
+ * TAG : SENSORLOCATION_ALTITUDEINFO_DAT
+ * ABSTRACT : Altitude information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int8 sensor_cnt; /* Sensor counter value */
+ u_int8 is_exist_dr; /* Presence or absence information DR */
+ u_int8 dr_status; /* DR state */
+ u_int8 reserve[3]; /* Reserve */
+ int32 altitude; /* Altitude(0.01m) */
+} SENSORLOCATION_MSG_ALTITUDEINFO_DAT;
+
+/*****************************************************************************
+ * TAG : LONLAT
+ * ABSTRACT : Latitude and Longitude data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ int32 latitude; /* Latitude */
+ int32 longitude; /* Longitude */
+} LONLAT;
+
+/*****************************************************************************
+* Function prototypes *
+*****************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern SENSORLOCATION_RET_API SensorLocationRegisterListenerLonLat(PNO pno, u_int8 delivery_timing);
+extern SENSORLOCATION_RET_API SensorLocationRegisterListenerAltitude(PNO pno, u_int8 delivery_timing);
+extern SENSORLOCATION_RET_API SensorLocationGetLonLat(SENSORLOCATION_MSG_LONLATINFO_DAT *dat);
+extern SENSORLOCATION_RET_API SensorLocationGetAltitude(SENSORLOCATION_MSG_ALTITUDEINFO_DAT *dat);
+extern SENSORLOCATION_RET_API SensorLocationGetLonLatOnShutdown(LONLAT *lonlat);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_H_
diff --git a/vehicleservice/positioning/client/include/SensorLocation_API_private.h b/vehicleservice/positioning/client/include/SensorLocation_API_private.h
new file mode 100755
index 0000000..d37d9eb
--- /dev/null
+++ b/vehicleservice/positioning/client/include/SensorLocation_API_private.h
@@ -0,0 +1,39 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_PRIVATE_H_
+/******************************************************************************
+ * File name :SensorLocation_API_private.h
+ * System name :PastModel002
+ * Subsystem name :Vehicle I/F library
+ ******************************************************************************/
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+#define LONLAT_SEMAPHO_NAME ("LONLAT_SHARE_SEMAPHO") /* Semaphore name(MAX 32Byte) */
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+#define LONLAT_SHARE_NAME ("LONLAT_SHARE_MEMORY") /* Shared memory name(MAX 32Byte) */
+
+#endif // POSITIONING_CLIENT_INCLUDE_SENSORLOCATION_API_PRIVATE_H_ */
diff --git a/vehicleservice/positioning/client/include/SensorMotion_API.h b/vehicleservice/positioning/client/include/SensorMotion_API.h
new file mode 100755
index 0000000..2db5511
--- /dev/null
+++ b/vehicleservice/positioning/client/include/SensorMotion_API.h
@@ -0,0 +1,178 @@
+/*
+ * @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 SensorMotion_API.h
+@detail SensorMotion_API external header file<BR>
+ SensorMotion_API External public header
+******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_
+#define POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_
+
+/*****************************************************************************
+ * Include *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Define *
+ *****************************************************************************/
+/* Command ID */
+/* Vehicle sensor information notification CID (Rate information) */
+#define CID_VEHICLE_SENSORMOTION_SPEED (0x0203)
+/* Vehicle sensor information notification CID (Orientation information) */
+#define CID_VEHICLE_SENSORMOTION_HEADING (0x0204)
+
+/* Vehicle sensor information notification CID (GyroTrouble information) */
+#define CID_VEHICLE_SENSORMOTION_GYROTROUBLE (0x020A)
+/* Vehicle sensor information notification CID (GyroParameter information) */
+#define CID_VEHICLE_SENSORMOTION_GYROPARAMETER (0x020B)
+/* Vehicle sensor information notification CID (SpeedParameter information) */
+#define CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER (0x020C)
+
+/* SENSORMOTION_RET_API definition */
+#define SENSORMOTION_RET_NORMAL (0) /* Successful completion */
+#define SENSORMOTION_RET_ERROR_PARAM (-1) /* Parameter error */
+#define SENSORMOTION_RET_ERROR_BUFFULL (-2) /* Number of registered FULL */
+#define SENSORMOTION_RET_ERROR_INNER (-3) /* Internal error */
+
+/* Delivery opportunity definition */
+#define SENSORMOTION_DELIVERY_TIMING_CHANGE (0) /* Change */
+#define SENSORMOTION_DELIVERY_TIMING_UPDATE (1) /* UpDate */
+
+/* Presence information definitions DR */
+#define SENSORMOTION_EXISTDR_NODR (0) /* Without DR */
+#define SENSORMOTION_EXISTDR_DR (1) /* There DR */
+
+/* DR state definition */
+#define SENSORMOTION_DRSTATUS_INVALID (0) /* Invalid */
+#define SENSORMOTION_DRSTATUS_GPS_NODR (1) /* Information use GPS, not yet implemented DR */
+#define SENSORMOTION_DRSTATUS_NOGPS_DR (2) /* No information available GPS, DR implementation */
+#define SENSORMOTION_DRSTATUS_GPS_DR (3) /* Information use GPS, DR implementation */
+
+/*----------------------------------------------------------------------*
+ * General Purpose Definition
+ *----------------------------------------------------------------------*/
+#define SENSORMOTION_NORMAL (0U)
+#define SENSORMOTION_ERROR (1U)
+#define SENSORMOTION_UNFIXED (2U)
+
+/*****************************************************************************
+ * Typedef *
+ *****************************************************************************/
+typedef int32 SENSORMOTION_RET_API;
+
+/*****************************************************************************
+ * Struct *
+ *****************************************************************************/
+/*****************************************************************************
+ * TAG : SENSORMOTION_SPEEDINFO_DAT
+ * ABSTRACT : Vehicle speed information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int8 sensor_cnt; /* Sensor counter value */
+ u_int8 is_exist_dr; /* Presence or absence information DR */
+ u_int8 dr_status; /* DR state */
+ u_int8 reserve; /* Reserve */
+ u_int16 speed; /* Speed(0.01m/sec) */
+} SENSORMOTION_MSG_SPEEDINFO_DAT;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_HEADINGINFO_DAT
+ * ABSTRACT : Orientation information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int8 sensor_cnt; /* Sensor counter value */
+ u_int8 is_exist_dr; /* Presence or absence information DR */
+ u_int8 dr_status; /* DR state */
+ u_int8 reserve; /* Reserve */
+ u_int16 heading; /* Heading */
+} SENSORMOTION_MSG_HEADINGINFO_DAT;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_GYROTROUBLEINFO_DAT
+ * ABSTRACT : GyroTrouble information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int8 gyro_trouble; /* Gyro Trouble Status */
+ u_int8 reserve; /* Reserve */
+} SENSORMOTION_MSG_GYROTROUBLEINFO_DAT;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_GYROTROUBLEINFO
+ * ABSTRACT : Delivery of the message GyroTrouble information
+ * NOTE : Message structure(VehicleSens -> User)
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ SENSORMOTION_MSG_GYROTROUBLEINFO_DAT data; /* Delivery data (GyroTrouble) */
+} SENSORMOTION_MSG_GYROTROUBLEINFO;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_GYROPARAMETERINFO_DAT
+ * ABSTRACT : GyroParameter information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int16 gyro_offset; /* Gyro Offset */
+ u_int8 gyro_scale_factor; /* Gyro Scale Factor */
+ u_int8 gyro_scale_factor_level; /* Gyro Scale Factor Level */
+ u_int8 reserve[2]; /* Reserve */
+} SENSORMOTION_MSG_GYROPARAMETERINFO_DAT;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_GYROPARAMETERINFO
+ * ABSTRACT : Delivery of the message GyroParameter information
+ * NOTE : Message structure(VehicleSens -> User)
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ SENSORMOTION_MSG_GYROPARAMETERINFO_DAT data; /* Delivery data (GyroParameter) */
+} SENSORMOTION_MSG_GYROPARAMETERINFO;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT
+ * ABSTRACT : SpeedPulseParameter information data structure
+ * NOTE :
+ *****************************************************************************/
+typedef struct {
+ u_int16 size; /* Size */
+ u_int16 speed_pulse_scale_factor; /* Speed Pulse Scale Factor */
+ u_int8 speed_pulse_scale_factor_level; /* Speed Pulse Scale Factor Level */
+ u_int8 reserve[3]; /* Reserve */
+} SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT;
+
+/*****************************************************************************
+ * TAG : SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO
+ * ABSTRACT : Delivery of the message SpeedPulseParameter information
+ * NOTE : Message structure(VehicleSens -> User)
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT data; /* Delivery data (SpeedPulseParameter) */
+} SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO;
+
+/*****************************************************************************
+ * Function prototypes *
+ *****************************************************************************/
+
+#endif // POSITIONING_CLIENT_INCLUDE_SENSORMOTION_API_H_
diff --git a/vehicleservice/positioning/client/include/Sensor_API.h b/vehicleservice/positioning/client/include/Sensor_API.h
new file mode 100755
index 0000000..b49b4ac
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Sensor_API.h
@@ -0,0 +1,36 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_SENSOR_API_H_
+#define POSITIONING_CLIENT_INCLUDE_SENSOR_API_H_
+/******************************************************************************
+ * file name :Sensor_API.h
+ * system name :GPF
+ * sub system name :sensor interface library
+ ******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "Sensor_Common_API.h"
+#include <vehicle_service/POS_sensor_API.h>
+#include "POS_sensor_private.h"
+
+/*!
+ @brief GPS Rollover Based Week Number Structure
+*/
+typedef struct {
+ uint16_t wkn; /**< GPS rollover base week number */
+} SENSOR_WKNROLLOVER;
+
+#endif // POSITIONING_CLIENT_INCLUDE_SENSOR_API_H_
diff --git a/vehicleservice/positioning/client/include/Sensor_API_private.h b/vehicleservice/positioning/client/include/Sensor_API_private.h
new file mode 100755
index 0000000..c3b5f54
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Sensor_API_private.h
@@ -0,0 +1,174 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_SENSOR_API_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_SENSOR_API_PRIVATE_H_
+/******************************************************************************
+ * File name :Sensor_API_private.h
+ * System name :GPF
+ * Subsystem name Vehicle I/F library
+ ******************************************************************************/
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#define SENSOR_PUBLIC_DID_NUM 31
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+#define SENSOR_SHARE_LOCK 0xFF /* Locking */
+#define SENSOR_SHARE_UNLOCK 0x00 /* Unlocking */
+
+#define SENSOR_SHARE_BLOCK_MNUM 1 /* Number of shared memory control blocks */
+#define SENSOR_SHARE_BLOCK_DNUM 10 /* Number of shared memory data blocks */
+/* Number of shared memory blocks */
+#define SENSOR_SHARE_BLOCK_NUM (SENSOR_SHARE_BLOCK_MNUM+SENSOR_SHARE_BLOCK_DNUM)
+
+#define SENSOR_SHARE_BLOCK_SIZE 512 /* Shared Memory Block Size(byte) */
+#define SENSOR_SHARE_HEAD_SIZE 40 /* Vehicle Sensor Information Header( (4)+1+3+16*2) */
+/* Shared Memory Data Size */
+#define SENSOR_SHARE_BLOCK_DSIZE (SENSOR_SHARE_BLOCK_SIZE - SENSOR_SHARE_HEAD_SIZE)
+/* Size of shared memory allocation area */
+#define SENSOR_SHARE_SIZE (SENSOR_SHARE_BLOCK_SIZE * SENSOR_SHARE_BLOCK_NUM)
+
+#define SENSOR_SEMAPHO_NAME ("SENSOR_SHARE_SEMAPHO") /* Semaphore name */
+#define GPS_INTERRUPT_SIGNAL_SEMAPHO_NAME ("GPS_INT_SIGNAL_SHARE_SEMAPHO") /* Semaphore name(MAX 32Byte) */
+#define GYRO_CONNECT_STATUS_SEMAPHO_NAME ("GYRO_CONNECT_STTS_SHARE_SEMAPHO") /* Semaphore name(MAX 32Byte) */
+#define EPHEMERIS_NUM_SEMAPHO_NAME ("EPHEMERIS_NUM_SHARE_SEMAPHO") /* Semaphore name(MAX 32Byte) */
+#define LOCALTIME_SEMAPHO_NAME ("LOCALTIME_SHARE_SEMAPHO") /* Semaphore name(MAX 32Byte) */
+
+/*----------------------------------------------------------------------*
+ * Event Related Extensions *
+ *----------------------------------------------------------------------*/
+#define SENSOR_EVENT_VAL_INIT (SENSOR_RET_ERROR_MIN - 1) /* Event initial value */
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+#define SENSOR_SHARE_NAME ("SENSOR_SHARE_MEMORY") /* Shared memory name */
+#define GPS_INTERRUPT_SIGNAL_SHARE_NAME ("GPS_INT_SIGNAL_SHARE_MEMORY") /* Shared memory name(MAX 32Byte) */
+#define GYRO_CONNECT_STATUS_SHARE_NAME ("GYRO_CONNECT_STTS_SHARE_MEMORY") /* Shared memory name(MAX 32Byte) */
+#define EPHEMERIS_NUM_SHARE_NAME ("EPHEMERIS_NUM_SHARE_MEMORY") /* Shared memory name(MAX 32Byte) */
+#define LOCALTIME_SHARE_NAME ("LOCALTIME_SHARE_MEMORY") /* Shared memory name(MAX 32Byte) */
+
+/*-----------------------------------------------------------------------------
+ * GPS local CID define
+ *----------------------------------------------------------------------------*/
+#define CID_DEV_REQGPS MAKECID(CID_DEVHIGH, 0x00) /* GPS request */
+#define CID_DEV_REQRST MAKECID(CID_DEVHIGH, 0x01) /* GPS reset request */
+
+#define CID_GPS_SERIAL0 (CID)0x0100 /* GPS reset request function definition */
+/* GPS reset request CID */
+
+/*---------------------------------------------------------------------------
+ * GPS error log output
+ ---------------------------------------------------------------------------*/
+#define GPS_DBGMSG 0 /* Product Shipping Log Output(WPF_DEBUGMSG) */
+#define GPS_RTLMSG 1 /* Development test log output(WPF_RETAILMSG) */
+
+/*----------------------------------------------------------------------*
+ * for message *
+ *----------------------------------------------------------------------*/
+#define CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT 0x0602 /* sensor extra package register command ID */
+
+/*----------------------------------------------------------------------*
+ * for JudgeDid *
+ *----------------------------------------------------------------------*/
+#define MODE_REGISTER_LISTENER_PKG_SENS_DATA 0 /* POS_RegisterListenerPkgSensData */
+#define MODE_REGISTER_LISTENER_SENSDATA 1 /* POS_RegisterListenerSensData */
+#define MODE_GET_SENSDATA 2 /* POS_GetSensData */
+
+/************************************************************************
+* Typedef definitions *
+************************************************************************/
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/************************************************************************
+* TAG : SENSOR_SHARE_MNG
+* ABSTRACT : Shared memory management area
+************************************************************************/
+typedef struct {
+ uint8_t lock_info[SENSOR_SHARE_BLOCK_NUM]; /* Usages */
+ uint8_t reserve[501]; /* 512-11 */
+} SENSOR_SHARE_MNG;
+
+/************************************************************************
+* TAG : SENSOR_SHARE_BLOCK_DAT_DAT
+* ABSTRACT : Shared memory data area(Data section details)
+************************************************************************/
+typedef struct {
+ uint8_t pkg_num; /* Number of packages */
+ uint8_t reserve[3];
+ uint16_t offset[SENSOR_PKG_DELIVERY_MAX]; /* Offset value */
+ uint8_t data[SENSOR_SHARE_BLOCK_DSIZE]; /* Data portion */
+} SENSOR_SHARE_BLOCK_DAT_DAT;
+
+/************************************************************************
+* TAG : SENSOR_SHARE_BLOCK_DAT
+* ABSTRACT : Shared memory data area(One block)
+************************************************************************/
+typedef struct {
+ uint16_t size; /* Size of the data */
+ uint8_t reserve[2];
+ SENSOR_SHARE_BLOCK_DAT_DAT data; /* Data portion */
+} SENSOR_SHARE_BLOCK_DAT;
+
+/************************************************************************
+* TAG : SENSOR_SHARE_BLOCK_MNG
+* ABSTRACT : Areas of memory that are shared
+************************************************************************/
+typedef struct {
+ SENSOR_SHARE_MNG mng; /* Shared memory management information */
+ SENSOR_SHARE_BLOCK_DAT data[SENSOR_SHARE_BLOCK_DNUM]; /* Shared memory data portion */
+} SENSOR_SHARE;
+
+/**
+ * @brief Return code list structure
+ */
+typedef struct {
+/*
+ * Note.
+ * This feature needs to be defined according to the unit type.
+ */
+ BOOL GRADE2_ret; /**< Return code in GRADE2 */
+ BOOL GRADE1_ret; /**< Return code in GARDE1 */
+ DID did; /**< DID */
+} SENSOR_RET_PKG;
+
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+RET_API PosDeleteEvent(EventID event_id);
+RET_API SensorLinkShareData(void **share_top, uint32_t *share_size, uint16_t *offset);
+RET_API SensorUnLinkShareData(SENSOR_SHARE *share_top, uint16_t offset);
+
+EventID PosCreateEvent(PNO pno);
+void SensorSetShareData(void *share_top, uint16_t offset, const void *data_src, uint16_t size_src);
+RET_API PosSndMsg(PNO pno_src, PNO pno_dest, CID cid, uint16_t msg_len, const void *msg_data);
+
+BOOL SensorJudgeDid(DID did, uint8_t mode);
+
+/* Function macro */
+#define SENSOR_DID_JUDGE_REGLIS_PKG(did) SensorJudgeDid(did, MODE_REGISTER_LISTENER_PKG_SENS_DATA)
+#define SENSOR_DID_JUDGE_REGLIS(did) SensorJudgeDid(did, MODE_REGISTER_LISTENER_SENSDATA)
+#define SENSOR_DID_JUDGE_GET(did) SensorJudgeDid(did, MODE_GET_SENSDATA)
+
+#endif // POSITIONING_CLIENT_INCLUDE_SENSOR_API_PRIVATE_H_ */
diff --git a/vehicleservice/positioning/client/include/Sensor_Common_API.h b/vehicleservice/positioning/client/include/Sensor_Common_API.h
new file mode 100755
index 0000000..5631e83
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Sensor_Common_API.h
@@ -0,0 +1,193 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_SENSOR_COMMON_API_H_
+#define POSITIONING_CLIENT_INCLUDE_SENSOR_COMMON_API_H_
+/******************************************************************************
+ * File name :Sensor_Common_API.h
+ * System name :PastModel002
+ * Sub System name :Vehicle I/F Liblary,Sensor I/F Liblary
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include "CommonDefine.h"
+
+/************************************************************************
+ * Definition *
+ ************************************************************************/
+/*----------------------------------------------------------------------*
+ * ID data corresponding to the vehicle sensor information *
+ *----------------------------------------------------------------------*/
+
+/*
+ * Note.
+ * This feature needs to be defined by the vendor.
+ */
+
+/* VEHICLE__DID */
+
+/* ++ PastModel002 Support_UBX_Protocol_DID */
+#define VEHICLE_DID_GPS_UBLOX_NAV_POSLLH 0x80000060
+#define VEHICLE_DID_GPS_UBLOX_NAV_STATUS 0x80000061
+#define VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC 0x80000062
+#define VEHICLE_DID_GPS_UBLOX_NAV_VELNED 0x80000063
+#define VEHICLE_DID_GPS_UBLOX_NAV_DOP 0x80000064
+#define VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS 0x80000065
+#define VEHICLE_DID_GPS_UBLOX_NAV_SVINFO 0x80000066
+#define VEHICLE_DID_GPS_UBLOX_NAV_CLOCK 0x80000067
+#define VEHICLE_DID_GPS_UBLOX_MON_HW 0x80000068
+#define VEHICLE_DID_GPS_UBLOX_ACK_ACK 0x80000069
+#define VEHICLE_DID_GPS_UBLOX_ACK_NAK 0x8000006A
+#define VEHICLE_DID_GPS_UBLOX_CFG_RST 0x8000006B
+#define VEHICLE_DID_GPS_UBLOX_AID_INI 0x8000006C
+#define VEHICLE_DID_GPS_UBLOX_AID_EPH 0x8000006D
+#define VEHICLE_DID_GPS_UBLOX_CFG_MSG 0x8000006E
+#define VEHICLE_DID_GPS_UBLOX_CFG_NAVX5 0x8000006F
+/* -- PastModel002 Support_UBX_Protocol_DID */
+
+/* ++ used internally by the DR */
+#define VEHICLE_DID_GPS_COUNTER 0x8000001B
+#define VEHICLE_DID_GYRO_EXT 0x80000027
+
+#define VEHICLE_DID_DR_LONGITUDE 0x80000070
+#define VEHICLE_DID_DR_LATITUDE 0x80000071
+#define VEHICLE_DID_DR_ALTITUDE 0x80000072
+#define VEHICLE_DID_DR_SPEED 0x80000073
+#define VEHICLE_DID_DR_HEADING 0x80000074
+#define VEHICLE_DID_DR_SNS_COUNTER 0x80000075
+#define VEHICLE_DID_DR_GYRO_OFFSET 0x80000078
+#define VEHICLE_DID_DR_GYRO_SCALE_FACTOR 0x80000079
+#define VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL 0x8000007A
+#define VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR 0x8000007B
+#define VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL 0x8000007C
+
+/* -- used internally by the DR */
+
+/* ++ PastModel002 Support_DID */
+#define VEHICLE_DID_GYRO_TROUBLE 0x80000080
+#define VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL 0x80000081
+#define VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL 0x80000082
+#define VEHICLE_DID_GYRO_CONNECT_STATUS 0x80000083
+#define VEHICLE_DID_VALID_EPH_NUM 0x80000084
+/* -- PastModel002 Support_DID */
+
+/* ++ Not supported by UBX_Protocol */
+#define VEHICLE_DID_LOCATION 0x80000020
+#define VEHICLE_DID_GPS__CWORD82__NMEA POS_DID_GPS__CWORD82__NMEA
+#define VEHICLE_DID_GPS__CWORD82__SETINITIAL POS_DID_GPS__CWORD82__SETINITIAL
+#define VEHICLE_DID_GPS__CWORD82__SETRMODE 0x80000034
+#define VEHICLE_DID_GPS__CWORD82__SETRMODEEX POS_DID_GPS__CWORD82__SETRMODEEX
+#define VEHICLE_DID_GPS__CWORD82__SELSENT POS_DID_GPS__CWORD82__SELSENT
+#define VEHICLE_DID_GPS__CWORD82__SETSBAS 0x80000037
+#define VEHICLE_DID_GPS__CWORD82__SETCONF1 0x80000038
+#define VEHICLE_DID_GPS__CWORD82__SETCONF2 0x80000039
+#define VEHICLE_DID_GPS__CWORD82__NMEA_GGA_INTERNAL 0xA050
+#define VEHICLE_DID_GPS__CWORD82__NMEA_DGGA_INTERNAL 0xA051
+#define VEHICLE_DID_GPS__CWORD82__NMEA_VTG_INTERNAL 0xA052
+#define VEHICLE_DID_GPS__CWORD82__NMEA_RMC_INTERNAL 0xA053
+#define VEHICLE_DID_GPS__CWORD82__NMEA_DRMC_INTERNAL 0xA054
+#define VEHICLE_DID_GPS__CWORD82__NMEA_GLL_INTERNAL 0xA055
+#define VEHICLE_DID_GPS__CWORD82__NMEA_DGLL_INTERNAL 0xA056
+#define VEHICLE_DID_GPS__CWORD82__NMEA_GSA_INTERNAL 0xA057
+#define VEHICLE_DID_GPS__CWORD82__NMEA_GSV1_INTERNAL 0xA058
+#define VEHICLE_DID_GPS__CWORD82__NMEA_GSV2_INTERNAL 0xA059
+#define VEHICLE_DID_GPS__CWORD82__NMEA_GSV3_INTERNAL 0xA060
+#define VEHICLE_DID_GPS__CWORD82__NMEA_PJRDC_GP_3_INTERNAL 0xA061
+#define VEHICLE_DID_LOCATION_LONLAT 0x80000095
+#define VEHICLE_DID_LOCATION_ALTITUDE 0x80000096
+#define VEHICLE_DID_MOTION_SPEED 0x80000062
+#define VEHICLE_DID_MOTION_HEADING 0x80000097
+#define VEHICLE_DID_GPS_TIME 0x80000098
+#define VEHICLE_DID_NAVIINFO_DIAG_GPS 0x80000099
+#define VEHICLE_DID_GPSWEEKCOR_CNT 0x8000009A
+
+#define VEHICLE_DID_GPS_CUSTOMDATA_NAVI 0x800000A0
+#define VEHICLE_DID_LOCATION_LONLAT_NAVI 0x800000A1
+#define VEHICLE_DID_LOCATION_ALTITUDE_NAVI 0x800000A2
+#define VEHICLE_DID_MOTION_SPEED_NAVI 0x800000A3
+#define VEHICLE_DID_MOTION_HEADING_NAVI 0x800000A4
+#define VEHICLE_DID_SETTINGTIME 0x800000A5
+
+#define VEHICLE_DID_LOCATIONINFO_NMEA_NAVI 0x800000A6
+
+#define VEHICLE_DID_MOTION_SPEED_INTERNAL 0x800000B0
+
+#define VEHICLE_DID_GPS_TIME_RAW 0x800000B1U /* QAC 1281 */
+#define VEHICLE_DID_GPS_WKNROLLOVER 0x800000B2U /* QAC 1281 */
+
+#define VEHICLE_DID_SPEED_PULSE_VEHICLE (0x80000044UL)
+
+/* -- Not supported by UBX_Protocol */
+
+/*----------------------------------------------------------------------*
+ * Vehicle sensor data information *
+ *----------------------------------------------------------------------*/
+#define VEHICLE_SNS_BATTERY_SHORT 0x02 /* BATTERY SHORT */
+#define VEHICLE_SNS_THERMAL_SHUT_DOWN 0x04 /* THERMAL SHUT DOWN */
+#define VEHICLE_SNS_UNKNOWN 0x05 /* UNKNOWN */
+
+/* Missing information data */
+#define VEHICLE_SNS_BREAK 0x01 /* Data without continuity */
+#define VEHICLE_SNS_NORMAL 0x00 /* Continuity of data */
+
+/*-------------------------------------------------------------------------------
+ * Time Status Return Values
+ -------------------------------------------------------------------------------*/
+#define GPS_TIMESTS_OK (0x00U) /* Exact values from the satellites */
+/* Ignore->MISRA-C++ Rule 16-2-2 */
+#define GPS_TIMESTS_NOTUTC (0x01U) /* Time from satellite but UTC uncorrected */
+/* Ignore->MISRA-C++ Rule 16-2-2 */
+#define GPS_TIMESTS_RTC (0x02U) /* RTC time */
+/* Ignore->MISRA-C++ Rule 16-2-2 */
+#define GPS_TIMESTS_NG (0x03U) /* Anomaly Time */
+/* Ignore->MISRA-C++ Rule 16-2-2 */
+
+/*-------------------------------------------------------------------------------
+ * NMEA Receive Flag
+ -------------------------------------------------------------------------------*/
+#define VEHICLE_SNS__CWORD82__DRMC POS_SNS__CWORD82__DRMC
+#define VEHICLE_SNS__CWORD82__GSA POS_SNS__CWORD82__GSA
+#define VEHICLE_SNS__CWORD82__GSV_1 POS_SNS__CWORD82__GSV_1
+#define VEHICLE_SNS__CWORD82__GSV_2 POS_SNS__CWORD82__GSV_2
+#define VEHICLE_SNS__CWORD82__GSV_3 POS_SNS__CWORD82__GSV_3
+#define VEHICLE_SNS__CWORD82__PJRDC_GP_3 POS_SNS__CWORD82__PJRDC_GP_3
+#define VEHICLE_SNS__CWORD82__PJRDC_GP_4 (0x40U) /* Ignore->MISRA-C++ Rule 16-2-2 */
+
+/************************************************************************
+* enum Definition *
+*************************************************************************/
+
+/*-------------------------------------------------------------------------------
+ * _CWORD71_ UNIT type
+ -------------------------------------------------------------------------------*/
+typedef enum {
+ POS_TYPE_NONE = (0U), /* Undefined */
+ POS_TYPE_GRADE1, /* GRADE1 (Integrated) */
+ POS_TYPE_GRADE2 /* GRADE2 (Binary type) */
+} POS_TYPE;
+
+/************************************************************************
+* typedef Definition *
+*************************************************************************/
+
+typedef u_int32 DID; /* DataID */
+
+/************************************************************************
+* struct Definition *
+*************************************************************************/
+
+#endif // POSITIONING_CLIENT_INCLUDE_SENSOR_COMMON_API_H_
diff --git a/vehicleservice/positioning/client/include/VehicleDebug_API.h b/vehicleservice/positioning/client/include/VehicleDebug_API.h
new file mode 100755
index 0000000..e0c9ef2
--- /dev/null
+++ b/vehicleservice/positioning/client/include/VehicleDebug_API.h
@@ -0,0 +1,110 @@
+/*
+ * @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 : VehicleDebug_API.h
+ * System name : PastModel002
+ * Sub System name : VehicleDebug_API library
+ ******************************************************************************/
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLEDEBUG_API_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLEDEBUG_API_H_
+
+/************************************************************************
+ * Include *
+ ***********************************************************************/
+
+/************************************************************************
+* Definition *
+************************************************************************/
+/*----------------------------------------------------------------------*
+ * VEHICLEDEBUG_RET_API Definition *
+ *----------------------------------------------------------------------*/
+/* Normal */
+#define VEHICLEDEBUG_RET_NORMAL 0 /* Successful completion */
+
+/* Abnormal */
+#define VEHICLEDEBUG_RET_ERROR (-1) /* An error has occurred */
+#define VEHICLEDEBUG_RET_ERROR_PARAM (-2) /* Parameter error */
+
+/*----------------------------------------------------------------------*
+ * Message Definition *
+ *----------------------------------------------------------------------*/
+/* Command ID */
+#define CID_VEHICLEDEBUG_LOG_SET 0x020D
+#define CID_VEHICLEDEBUG_LOG_GET 0x020E
+
+/* Message Length */
+#define VEHICLEDEBUG_MSGBUF_DSIZE 36U
+
+/*----------------------------------------------------------------------*
+ * Log Kind Definition *
+ *----------------------------------------------------------------------*/
+#define LOG_KIND_NUM 32U
+
+/*----------------------------------------------------------------------*
+ * Log Mask Definition *
+ *----------------------------------------------------------------------*/
+#define LOG_MASK_LOCATION_LOG 0x00000001UL
+
+/*----------------------------------------------------------------------*
+ * Log Severity Definition *
+ *----------------------------------------------------------------------*/
+/* Unused */
+
+/************************************************************************
+* type Definition *
+************************************************************************/
+typedef RET_API VEHICLEDEBUG_RET_API; /* API return value */
+
+/************************************************************************
+* struct Definition *
+************************************************************************/
+/************************************************************************
+ * TAG : VEHICLEDEBUG_MSG_LOGINFO_DAT
+ * ABSTRACT : Log data structure
+ * NOTE :
+ ************************************************************************/
+typedef struct {
+ u_int32 log_sw; /* Kind of log */
+ u_int8 severity[LOG_KIND_NUM]; /* Output level(unused) */
+} VEHICLEDEBUG_MSG_LOGINFO_DAT;
+
+/*****************************************************************************
+ * TAG : VEHICLEDEBUG_MSG_BUF
+ * ABSTRACT : VehicleDebug_API message buffer structure
+ * NOTE : Message structure
+ *****************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ u_int8 data[VEHICLEDEBUG_MSGBUF_DSIZE]; /* Message data */
+} VEHICLEDEBUG_MSG_BUF;
+
+/************************************************************************
+ * Function prototypes *
+ ************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*[VehicleDebug_API Public API]*/
+VEHICLEDEBUG_RET_API SensorGetLogSetting(PNO pno, u_int32 *log_sw, u_int8 *severity);
+VEHICLEDEBUG_RET_API SensorSetLogStatus(PNO pno, u_int32 log_sw, u_int8 *severity);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLEDEBUG_API_H_
diff --git a/vehicleservice/positioning/client/include/Vehicle_API.h b/vehicleservice/positioning/client/include/Vehicle_API.h
new file mode 100755
index 0000000..78450c5
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Vehicle_API.h
@@ -0,0 +1,115 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_API_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_API_H_
+/******************************************************************************
+ * File name :Vehicle_API.h
+ * System name :GPF
+ * Sub System name :Vehicle I/F Liblary
+ ******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_define.h>
+#include "Sensor_Common_API.h"
+
+/****************************************************************************
+* Definition *
+*****************************************************************************/
+/*--------------------------------------------------------------------------*
+ * VECHILE_RET_API Definition *
+ *--------------------------------------------------------------------------*/
+/* Normal system */
+#define VEHICLE_RET_NORMAL 0 /* Successful completion */
+
+/* Abnormal system */
+#define VEHICLE_RET_ERROR_DID (-2) /* NoneDID */
+#define VEHICLE_RET_ERROR_PARAM (-4) /* Parameter error */
+#define VEHICLE_RET_ERROR_BUFFULL (-5) /* registration number FULL */
+#define VEHICLE_RET_ERROR_CREATE_EVENT (-6) /* Failure event generation */
+#define VEHICLE_RET_ERROR_MIN POS_RET_ERROR_MIN
+
+/*----------------------------------------------------------------------*
+ * API-related registration information delivery vehicle sensor *
+ *----------------------------------------------------------------------*/
+/* Delivery control */
+#define VEHICLE_DELIVERY_REGIST 0x01 /* Shipping register */
+
+/* Delivery opportunity */
+#define VEHICLE_DELIVERY_TIMING_UPDATE 0x01 /* Update */
+#define VEHICLE_DELIVERY_TIMING_CHANGE 0x02 /* Change */
+
+/*----------------------------------------------------------------------*
+ * Message Definition *
+ *----------------------------------------------------------------------*/
+/* Command ID */
+
+/* Registration information delivery vehicle sensor CID */
+#define CID_VEHICLEIF_DELIVERY_ENTRY 0x0101
+
+/* Vehicle sensor information notification CID */
+#define CID_VEHICLESENS_VEHICLE_INFO 0x0200
+
+/* GPS time notification CID */
+#define CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME 0x0201
+
+/************************************************************************
+* typedef Definition *
+************************************************************************/
+typedef RET_API VEHICLE_RET_API; /* API return value */
+
+/************************************************************************
+* struct Definition *
+************************************************************************/
+
+/************************************************************************
+* TAG : VEHICLE_MSG_VSINFO_DAT
+* ABSTRACT : message delivery vehicle sensor information
+************************************************************************/
+typedef struct {
+ DID did;
+ u_int16 size;
+ u_int8 rcv_flag;
+ u_int8 sensor_cnt;
+ u_int8 data[256];
+} VEHICLE_MSG_VSINFO_DAT;
+
+/* ++ GPS _CWORD82_ support */
+
+/************************************************************************
+* TAG : VEHICLE_MSG_SEND_DAT
+* ABSTRACT : Vehicle sensor information setting message(-> Vehicle sensor)
+************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ VEHICLE_MSG_SEND_DAT data; /* Message data */
+} VEHICLE_MSG_SEND;
+
+/* -- GPS _CWORD82_ support */
+
+/************************************************************************
+* Function prototypes *
+************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*[VEHICLE_API Public API]*/
+VEHICLE_RET_API VehicleInitialize(u_int32(*sighand)(void)); /* QAC 3001 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_API_H_
diff --git a/vehicleservice/positioning/client/include/Vehicle_API_Dummy.h b/vehicleservice/positioning/client/include/Vehicle_API_Dummy.h
new file mode 100755
index 0000000..b242ac6
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Vehicle_API_Dummy.h
@@ -0,0 +1,142 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_API_DUMMY_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_API_DUMMY_H_
+/******************************************************************************
+ * File name : Vehicle_API_Dummy.h
+ * System name : GPF
+ * Sub System name : Vehicle I/F Liblary
+ ******************************************************************************/
+
+#include "Sensor_Common_API.h"
+
+/****************************************************************************
+* Definition *
+*****************************************************************************/
+/*--------------------------------------------------------------------------*
+ * VECHILE_RET_API Definition *
+ *--------------------------------------------------------------------------*/
+/* Normal system */
+#define VEHICLE_RET_NORMAL 0 /* Successful completion */
+
+/* Abnormal system */
+#define VEHICLE_RET_ERROR_PID (-1) /* Abnormal thread ID */
+#define VEHICLE_RET_ERROR_DID (-2) /* NoneDID */
+#define VEHICLE_RET_ERROR_DID_DIS (-3) /* Non-ID data CANID */
+#define VEHICLE_RET_ERROR_PARAM (-4) /* Parameter error */
+#define VEHICLE_RET_ERROR_BUFFULL (-5) /* registration number FULL */
+#define VEHICLE_RET_ERROR_CREATE_EVENT (-6) /* Failure event generation */
+#define VEHICLE_RET_ERROR_TIMER (-7) /* Generation failure timer */
+#define VEHICLE_RET_ERROR_OUTOF_MEMORY (-8) /* Shared memory allocation failure */
+#define VEHICLE_RET_ERROR_SIZE (-9) /* Size error destination */
+#define VEHICLE_RET_ERROR_INVALID (-10) /* CANID undetermined */
+#define VEHICLE_RET_ERROR_MIN POS_RET_ERROR_MIN
+
+/*----------------------------------------------------------------------*
+ * API-related registration information delivery vehicle sensor *
+ *----------------------------------------------------------------------*/
+/* Delivery control */
+#define VEHICLE_DELIVERY_REGIST 0x01 /* Shipping register */
+
+/* Delivery opportunity */
+#define VEHICLE_DELIVERY_TIMING_UPDATE 0x01 /* Update */
+#define VEHICLE_DELIVERY_TIMING_CHANGE 0x02 /* Change */
+
+/*----------------------------------------------------------------------*
+ * Message Definition *
+ *----------------------------------------------------------------------*/
+/* Command ID */
+
+/* Registration information delivery vehicle sensor CID */
+#define CID_VEHICLEIF_DELIVERY_ENTRY 0x0101
+
+/* Vehicle sensor information notification CID */
+#define CID_VEHICLESENS_VEHICLE_INFO 0x0200
+
+#define CID_VEHICLEIF_GET_DR_DATA 0x0205
+
+/* The message body size data(byte) */
+#define VEHICLE_MSGBUF_DSIZE (SENSOR_MSG_VSINFO_DSIZE + 12)
+/* Header size of SENSOR_MSG_VSINFO_DSIZE + SENSOR_MSG_GPSDATA_DAT (12) */
+
+/************************************************************************
+* typedef Definition *
+************************************************************************/
+
+/************************************************************************
+* struct Definition *
+************************************************************************/
+
+/************************************************************************
+* TAG : VEHICLE_MSG_BUF
+* ABSTRACT : Message buffer
+************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ u_int8 data[VEHICLE_MSGBUF_DSIZE]; /* Message data */
+} VEHICLE_MSG_BUF;
+
+/************************************************************************
+* TAG : VEHICLE_MSG_GET_VEHICLE_DATA
+* ABSTRACT : Vehicle sensor information acquisition message(-> Vehicle sensor)
+************************************************************************/
+typedef struct {
+ DID did; /* Data ID corresponding to vehicle sensor information */
+ PNO pno; /* Destination PNO */
+ u_int16 offset; /* Offset to shared memory storage area */
+ u_int16 size; /* Size of shared memory storage area */
+ u_int8 reserve[2];
+ EventID event_id; /* Event ID */
+} VEHICLE_MSG_GET_VEHICLE_DATA_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ VEHICLE_MSG_GET_VEHICLE_DATA_DAT data; /* Message data */
+} VEHICLE_MSG_GET_VEHICLE_DATA;
+
+/************************************************************************
+* TAG : VEHICLE_MSG_DELIVERY_ENTRY
+* ABSTRACT : Registration message delivery vehicle sensor information(->Vehicle sensor)
+************************************************************************/
+typedef struct {
+ DID did; /* ID data corresponding to the vehicle sensor information */
+ PNO pno; /* Shipping addressPNO */
+ u_int8 delivery_timing; /* Delivery opportunity */
+ u_int8 ctrl_flg; /* Delivery control */
+ EventID event_id; /* Event ID */
+} VEHICLE_MSG_DELIVERY_ENTRY_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ VEHICLE_MSG_DELIVERY_ENTRY_DAT data; /* Message data */
+} VEHICLE_MSG_DELIVERY_ENTRY;
+
+/************************************************************************
+* Function prototypes *
+************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*[VEHICLE_API Public API]*/
+
+int32 VehicleGetDrData(PNO pno, DID did, void *dest_data, u_int16 dest_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_API_DUMMY_H_
diff --git a/vehicleservice/positioning/client/include/Vehicle_API_private.h b/vehicleservice/positioning/client/include/Vehicle_API_private.h
new file mode 100755
index 0000000..ad92ddb
--- /dev/null
+++ b/vehicleservice/positioning/client/include/Vehicle_API_private.h
@@ -0,0 +1,129 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_API_PRIVATE_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_API_PRIVATE_H_
+/******************************************************************************
+ * File name :Vehicle_API_private.h
+ * System name :GPF
+ * Subsystem name :Vehicle I/F library
+ ******************************************************************************/
+#include <vehicle_service/POS_sensor_API.h>
+#include "Vehicle_API.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+#define VEHICLE_SHARE_LOCK 0xFF /* Locking */
+#define VEHICLE_SHARE_UNLOCK 0x00 /* Unlocking */
+
+#define VEHICLE_SHARE_BLOCK_MNUM 1 /* Number of shared memory control blocks */
+#define VEHICLE_SHARE_BLOCK_DNUM 10 /* Number of shared memory data blocks */
+/* Number of shared memory blocks */
+#define VEHICLE_SHARE_BLOCK_NUM (VEHICLE_SHARE_BLOCK_MNUM+VEHICLE_SHARE_BLOCK_DNUM)
+
+#define VEHICLE_SHARE_BLOCK_SIZE 512 /* Shared Memory Block Size(byte) */
+#define VEHICLE_SHARE_BLOCK_DSIZE SENSOR_MSG_VSINFO_DSIZE /* Shared Memory Data Size */
+/* Size of shared memory allocation area */
+#define VEHICLE_SHARE_SIZE (VEHICLE_SHARE_BLOCK_SIZE * VEHICLE_SHARE_BLOCK_NUM)
+
+#define VEHICLE_SEMAPHO_NAME ("VEHICLE_SHARE_SEMAPHO") /* Semaphore name */
+
+#define VEHICLE_INVALID 0 /* Disabled */
+#define VEHICLE_EFFECTIVE 1 /* Enabled */
+#define VEHICLE_BIT31 0x80000000
+
+/* ++ PastModel002 compliant_error compliant */
+/* Message Data Size(byte) */
+#define VEHICLE_VSINFO_DSIZE 504 /* Vehicle sensor information */
+/* -- PastModel002 compliant_error compliant */
+
+/*----------------------------------------------------------------------*
+ * Event Related Extensions *
+ *----------------------------------------------------------------------*/
+#define VEHICLE_EVENT_VAL_INIT (VEHICLE_RET_ERROR_MIN-1) /* Event initial value */
+
+/*----------------------------------------------------------------------*
+ * Shared Memory Related Extensions *
+ *----------------------------------------------------------------------*/
+#define VEHICLE_SHARE_NAME ("POS_VEHICLE_SHARE_MEMORY") /* Shared memory name */
+
+/************************************************************************
+* Typedef definitions *
+************************************************************************/
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/* ++ PastModel002 compliant_error compliant */
+
+/************************************************************************
+* TAG : VEHICLE_MSG_VSINFO_DAT
+* ABSTRACT : Vehicle sensor information notification message(-> User)
+************************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr; /* Message header */
+ VEHICLE_MSG_VSINFO_DAT data; /* Message data */
+} VEHICLE_MSG_VSINFO;
+
+/* -- PastModel002 compliant_error compliant */
+
+/************************************************************************
+* TAG : VEHICLE_SHARE_MNG
+* ABSTRACT : Shared memory management area
+************************************************************************/
+typedef struct {
+ u_int8 lock_info[VEHICLE_SHARE_BLOCK_NUM]; /* Usages */
+ u_int8 reserve[501];
+} VEHICLE_SHARE_MNG;
+
+/************************************************************************
+* TAG : VEHICLE_SHARE_BLOCK_DAT
+* ABSTRACT : Shared memory data area(One block)
+************************************************************************/
+typedef struct {
+ u_int16 size; /* Size of the data */
+ u_int8 reserve[2];
+ u_int8 data[VEHICLE_SHARE_BLOCK_DSIZE]; /* Data */
+} VEHICLE_SHARE_BLOCK_DAT;
+
+/************************************************************************
+* TAG : VEHICLE_SHARE_BLOCK_MNG
+* ABSTRACT : Areas of memory that are shared
+************************************************************************/
+typedef struct {
+ VEHICLE_SHARE_MNG mng; /* Shared memory management information */
+ VEHICLE_SHARE_BLOCK_DAT data[VEHICLE_SHARE_BLOCK_DNUM]; /* Shared memory data portion */
+} VEHICLE_SHARE;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+RET_API VehicleDeleteEvent(EventID event_id);
+RET_API VehicleLinkShareData(void **share_top, uint32_t *share_size, uint16_t *offset);
+RET_API VehicleUnLinkShareData(VEHICLE_SHARE *share_top, u_int16 offset);
+EventID VehicleCreateEvent(PNO pno);
+void PosSetShareData(void *share_top, u_int16 offset, const void *data_src, u_int16 size_src);
+RET_API VehicleSndMsg(PNO pno_src, PNO pno_dest, CID cid, u_int16 msg_len, const void *msg_data);
+
+SENSOR_RET_API PosRegisterListenerProc(PCSTR notify_name, DID did, u_int8 ctrl_flg, u_int8 delivery_timing);
+
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_API_PRIVATE_H_ */
diff --git a/vehicleservice/positioning/client/include/vehicle_service/POS_common_API.h b/vehicleservice/positioning/client/include/vehicle_service/POS_common_API.h
new file mode 100755
index 0000000..5ee3005
--- /dev/null
+++ b/vehicleservice/positioning/client/include/vehicle_service/POS_common_API.h
@@ -0,0 +1,1663 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_COMMON_API_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_COMMON_API_H_
+
+/**
+ * @file POS_common_API.h
+ * @brief API definition file for common function
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning
+ * @ingroup vehicle_service
+ * @{
+ */
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/POS_define.h>
+#include <gps_hal.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* State definitions can be used */
+#define SENSORLOCATION_STATUS_DISABLE (0) //!< \~english Not available
+#define SENSORLOCATION_STATUS_ENABLE (1) //!< \~english Available
+
+/* State definitions can be used */
+#define SENSORMOTION_STATUS_DISABLE (0) //!< \~english Not available
+#define SENSORMOTION_STATUS_ENABLE (1) //!< \~english Available
+/* Acquisition method */
+#define SENSOR_GET_METHOD_AUTO (0) //!< \~english Not specified
+#define SENSOR_GET_METHOD_GPS (1) //!< \~english GPS
+#define SENSOR_GET_METHOD_NAVI (2) //!< \~english Navigation
+#define SENSOR_GET_METHOD_DR (3) //!< \~english Dead Reckoning
+#define SENSOR_GET_METHOD_POS (4) //!< \~english positioning (Internal)
+
+
+#define LOCATIONINFO_NMEA_MAX (1020)
+//!< \~english Max length of 'Location Information'
+
+/* Command ID */
+/* Vehicle sensor information notification CID (Rate information) */
+
+/**
+ * \~english @brief Delivery speed command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_SPEED, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_SPEED (0x0203)
+
+/**
+ * \~english @brief Delivery longitude and latitude command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_LONLAT, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_LONLAT 0x0781
+
+/**
+ * \~english @brief Delivery altitude command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_ALTITUDE, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_ALTITUDE 0x0782
+
+/**
+ * \~english @brief Delivery heading command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_HEADING, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_HEADING 0x0783
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @struct POS_POSDATA
+ * \~english position information
+ */
+typedef struct {
+ int8_t status; //!< \~english data status
+ uint8_t posSts; //!< \~english position status
+ uint16_t posAcc; //!< \~english position accuracy
+ int32_t longitude; //!< \~english current longitude
+ int32_t latitude; //!< \~english current latitude
+ int32_t altitude; //!< \~english current altitude
+ int16_t heading; //!< \~english current heading
+ uint8_t reserved[2]; //!< \~english reserve
+} POS_POSDATA;
+
+/**
+ * @struct SENSORLOCATION_MSG_LONLATINFO
+ * \~english longitude and latitude information data delivery message
+ */
+typedef struct {
+ SENSORLOCATION_LONLATINFO_DAT data;
+ //!< \~english longitude and latitude information data
+} SENSORLOCATION_MSG_LONLATINFO;
+
+/**
+ * @struct SENSORLOCATION_MSG_ALTITUDEINFO
+ * \~english altitude information data delivery message
+ */
+typedef struct {
+ SENSORLOCATION_ALTITUDEINFO_DAT data; //!< \~english altitude information data
+} SENSORLOCATION_MSG_ALTITUDEINFO;
+
+/**
+ * @struct SENSORMOTION_MSG_HEADINGINFO
+ * \~english heading information data delivery message
+ */
+typedef struct {
+ SENSORMOTION_HEADINGINFO_DAT data; //!< \~english heading information data
+} SENSORMOTION_MSG_HEADINGINFO;
+
+/**
+ * @struct SENSORMOTION_MSG_SPEEDINFO
+ * \~english speed information data delivery message
+ */
+typedef struct {
+ SENSORMOTION_SPEEDINFO_DAT data; //!< \~english speed information data
+} SENSORMOTION_MSG_SPEEDINFO;
+
+
+/**
+ * @struct POS_LOCATIONINFO_NMEA
+ * \~english Structure of Location Information (NMEA)
+ */
+typedef struct {
+ uint32_t length; //!< \~english length
+ uint8_t data[LOCATIONINFO_NMEA_MAX]; //!< \~english data
+} POS_LOCATIONINFO_NMEA;
+
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+/* SENSOR_API public API */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register for longitude and lattitude delivery
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(GPS/Navigation/Not specified)
+///
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register for specified logtitude and latitude delivery
+/// - Please note if call this function for multiple times, the data will be deliveried for multiple times.
+/// - The specified longitude and latitude will be deliveried during the registration(first delivery)
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change. Specified longitude and latitude will be deliveried \n
+/// only when it has been changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update. Specified longitude and latitude will be deliveried \n
+/// every time that has been updated by the vehicle sensors.
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_GPS - GPS. The longitude and latitude from GPS will be deliveried.
+/// - SENSOR_GET_METHOD_NAVI - Navi. The longitude and latitude from Navigation will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified. The specified longitude and latitude will be deliveried \n
+/// according to the current environment.
+/// - Avaliable method is descriped as following:\n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.\n
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_BUFFULL the register count is full
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) nor change \n
+/// (SENSOR_DELIVERY_TIMING_CHANGE) [POS_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [POS_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to the max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to the max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to the max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference to the event \n
+/// is reach to the max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference to the event \n
+/// is reach to the max [POS_RET_ERROR_INNER]
+/// - Memory allocate failed during the event table creation for the event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been registered. \n
+/// [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between process. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer failed between process. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during waiting event. \n
+/// [POS_RET_ERROR_INNER]
+/// - The count of thread beyond max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during getting event. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - Getting event timeout. [POS_RET_ERROR_INNER]
+/// - Error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The result of positioning service returned is SENSOR_RET_ERROR_PARAM. [POS_RET_ERROR_PARAM]
+/// - The result of positioning service returned is SENSOR_RET_ERROR_BUFFULL. [POS_RET_ERROR_BUFFULL]
+/// - The result of positioning service returned is SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of positioning service returned is not SENSOR_RET_ERROR_PARAM and SENSOR_RET_ERROR_BUFFULL \n
+/// and SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to register longitude and latitude information delivery.\n
+/// This API return the result of registered.
+/// \n
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same time.
+/// - After call this API, if the delivery destination thread name has been changed, please call this API again.
+///
+/// \~english @par
+/// Notification of message
+/// - After registered successfully, vehicle sensor information will been sent as system API \n
+/// message with following format.\n
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_LONLAT \n
+/// message structure
+/// \~english @code
+/// typedef struct {
+/// SENSORLOCATION_LONLATINFO_DAT data; /* message data */
+/// } SENSORLOCATION_MSG_LONLATINFO;
+/// @endcode
+/// message data structure \n
+///
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* Synchrony count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t posSts; /* position status */
+/// uint16_t posAcc; /* Position accuracy */
+/// int32_t Longitude; /* Longitude */
+/// int32_t Latitude; /* Latitude */
+/// } SENSORLOCATION_LONLATINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_GPS - longitude and latitude from GPS
+/// - SENSOR_GET_METHOD_NAVI - longitude and latitude from Navigation
+/// - Synchrony count(SyncCnt)
+/// - Count for position data synchronous \n
+/// When delivery altitude and heading data, position data can be synchronized by SyncCnt.\n
+/// But the data of different method can not be synchronized by SyncCnt.\n
+/// Example 1: [LonLat from GPS] and [Heading from GPS] can be synchronized by SyncCnt.\n
+/// Example 2: [LonLat from GPS] and [LonLat from Navi] can not be synchronized by SyncCnt.\n
+/// Caution: The sensor count in sensor data delivery is another data.
+/// - Enable or not(isEnable) \n
+/// To describe this delivery message is whether can be used or not
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - when GPS data is specified,longitude and latitude is invalid at following condition:\n
+/// so [not avaliable] provieded
+/// - After system start, GPS unit has not received current location data and GPS unit \n
+/// status is not positioning fixed.
+/// - If it is not initialized status, certainly provide [avaliable] when Navigation data specified
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Position status(posSts)
+/// - Bit0 : GPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_GSP)
+/// - Bit1 : DGPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DGPS)
+/// - Bit2 : DR data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DR)
+/// - Bit3 : MapMatching data used result(1:used, 0:not used, definition of \n
+/// maskbit:POS_LOC_INFO_USE_MAPMATCHING)
+/// - Position accuracy(posAcc)
+/// - Detected accruray of current position:1LSB=1m \n
+/// - Longitude : (WGS-84)(10^-7degree as 1) \n
+/// East longitude is positive value and west longitude is negative value.
+/// - Latitude : (WGS-84)(10^-7degree as 1) \n
+/// North latitude positive value and south latitude is negative value.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - POS_GetLonLat
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_RegisterListenerLonLat(HANDLE hApp, PCSTR notifyName, uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming,
+ uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register altitude delivery
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(GPS/Not specified)
+///
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register specified altitude delivery
+/// - Please note that if the same data delivery has been registered for multiple times, the data will \n
+/// also be deliveried for registered multiple times.
+/// - The specified altitude will be deliveried at registered time (first delivery).
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change. Specified altitude will be deliveried only when it is changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update. Specified altitude will be deliveried when it is updated by \n
+/// vehicle sensor.
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_GPS - GPS. The altitude from GPS will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified. The altitude will be deliveried according to \n
+/// the current environment
+/// - Avaliable method is descriped as following in each environment. \n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_BUFFULL the register count is full
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the dispatcher \n
+/// for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) nor change \n
+/// (SENSOR_DELIVERY_TIMING_CHANGE) [POS_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not registered(SENSOR_DELIVERY_REGIST) [POS_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reached to the max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reached to the max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reached to the max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference to the event \n
+/// is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference to the event \n
+/// is reach to the max [POS_RET_ERROR_INNER]
+/// - Memory allocate failed during the event table creation for that event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been registered. \n
+/// [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during event waiting. \n
+/// [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting.[POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - Getting event timeout. [POS_RET_ERROR_INNER]
+/// - Error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The result of positioning service is SENSOR_RET_ERROR_PARAM. [POS_RET_ERROR_PARAM]
+/// - The result of positioning service is SENSOR_RET_ERROR_BUFFULL. [POS_RET_ERROR_BUFFULL]
+/// - The result of positioning service is SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of positioning service is not SENSOR_RET_ERROR_PARAM and SENSOR_RET_ERROR_BUFFULL and \n
+/// SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to register altitude delivery. \n
+/// This API will finish when get the return value.
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After call this API, if the delivery destination thread name is changed, please call this API again.
+///
+/// \~english @par
+/// Notification of message
+/// - After registered successfully, vehicle sensor will send system API message with following format. \n
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_ALTITUDE \n
+/// message structure
+/// \~english @code
+/// typedef struct {
+/// SENSORLOCATION_ALTITUDEINFO_DAT data; /* message data */
+/// } SENSORLOCATION_MSG_ALTITUDEINFO;
+/// @endcode
+/// message data structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* synchrony count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t Reserve[3]; /* Reserve */
+/// int32_t Altitude; /* Altitude(unit:0.01m) */
+/// } SENSORLOCATION_ALTITUDEINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_GPS - altitude from GPS
+/// - Synchrony count(SyncCnt)
+/// - Count for position data synchronous \n
+/// When delivery altitude and heading data, position data can be synchronized by SyncCnt. \n
+/// But the data of different method can not be synchronized by SyncCnt.\n
+/// example: [longitude and latitude from GPS] and [heading from GPS] can be synchronized by SyncCnt.\n
+/// synchronized by SyncCnt. \n
+/// Caution: The sensor count in sensor data delivery is another data.
+/// - Enable or not(isEnable) \n
+/// To describe this delivery message is whether can be used or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - when GPS data specified, Altitude is invalid at following condition(so [not avaliable] provieded):
+/// - Immediately after system start, GPS unit has not received current location data and GPS unit status \n
+/// is not positioning fix
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Altitude
+/// - altitude data(unit 0.01m)
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see delivery
+/// - POS_GetAltitude
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_RegisterListenerAltitude(HANDLE hApp, PCSTR notifyName, uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming,
+ uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register speed delivery
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(POS/Navi/Not specified)
+///
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register specified speed delivery
+/// - Please note that if the same data delivery has been registered for multiple times, the data will \n
+/// also be deliveried for registered mutiple times.
+/// - The specified speed will be deliveried at registered time (first delivery).
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change. Specified speed will be deliveried only when it is changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update. Specified speed will be deliveried when it is updated by \n
+/// vehicle sensor.
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_POS - The speed calculated in positioning based on speed pulse will be deliveried.
+/// - SENSOR_GET_METHOD_NAVI - Navi The speed from Navi will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified The speed will be deliveried according to the current environment
+/// deliveried.
+/// - Avaliable method is descriped as following in each environment. \n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+///
+/// \~english @retval POS_RET_NORMAL normal end
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_BUFFULL the register count is full
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher for App \n
+/// are completed.
+/// - Availability of service positioning is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) \n
+/// nor change(SENSOR_DELIVERY_TIMING_CHANGE) [POS_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [POS_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate failed during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been registered. \n
+/// [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer between processes.\n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during event waiting. \n
+/// [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - Getting event timeout. [POS_RET_ERROR_INNER]
+/// - Error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The result of positioning service is SENSOR_RET_ERROR_PARAM. [POS_RET_ERROR_PARAM]
+/// - The result of positioning service is SENSOR_RET_ERROR_BUFFULL. [POS_RET_ERROR_BUFFULL]
+/// - The result of positioning service is SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of positioning service is not SENSOR_RET_ERROR_PARAM and SENSOR_RET_ERROR_BUFFULL \n
+/// and SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to register speed delivery. \n
+/// This API will finish when get the return value.
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After call this API, if the delivery destination thread name is changed, please call this API again.
+///
+/// \~english @par
+/// Notification of message
+/// - After registered successfully, vehicle sensor will send system API message with following format. \n
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_SPEED \n
+/// message structure
+/// \~english @code
+/// typedef struct {
+/// SENSORMOTION_SPEEDINFO_DAT data; /* message data */
+/// } SENSORMOTION_MSG_SPEEDINFO;
+/// @endcode
+/// message data structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* synchrony count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t Reserve1[3]; /* Reserve */
+/// uint16_t Speed; /* speed(unit:0.01m/sec) */
+/// uint8_t Reserve2[2]; /* Reserve */
+/// } SENSORMOTION_SPEEDINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_POS - The speed calculated in positioning based on speed pulse will be deliveried.
+/// - SENSOR_GET_METHOD_NAVI - speed from Navi
+/// - Synchrony count(SyncCnt)
+/// - 0 (not change).
+/// - Enable or not(isEnable) \n
+/// To describe this data is whether enable or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - Speed is invalid at following condition when speed pulse specified, so [not avaliable] provieded
+/// - Immediately after system start, the sensor data have not been received from SYS micon
+/// - If it is not initialization status, certainly provide [avaliable] when Navi data specified
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Speed
+/// - speed data(unit 0.01m/sec)
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - POS_GetSpeed
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_RegisterListenerSpeed(HANDLE hApp, PCSTR notifyName, uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming,
+ uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register heading delivery
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(GPS/Navi/Not specified)
+///
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register specified heading delivery
+/// - Please note that if the same data delivery has been registered for mutiple times, the data will \n
+/// also be deliveried for registered mutiple times.
+/// - The specified heading will be deliveried at registered time (first delivery).
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change. Specified heading will be deliveried only when it is changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update. Specified heading will be deliveried when it is updated by \n
+/// vehicle sensor.
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_GPS - GPS. The heading from GPS will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified. The heading will be deliveried \n
+/// according to the current environment
+/// - Avaliable method is descriped as following in each environment. \n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_BUFFULL the register count is full
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher \n
+/// for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) nor change \n
+/// (SENSOR_DELIVERY_TIMING_CHANGE) [POS_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [POS_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate failed during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already \n
+/// been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer between \n
+/// processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during event waiting. \n
+/// [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - Getting event timeout. [POS_RET_ERROR_INNER]
+/// - Error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The result of positioning service is SENSOR_RET_ERROR_PARAM. [POS_RET_ERROR_PARAM]
+/// - The result of positioning service is SENSOR_RET_ERROR_BUFFULL. [POS_RET_ERROR_BUFFULL]
+/// - The result of positioning service is SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of positioning service is not SENSOR_RET_ERROR_PARAM and SENSOR_RET_ERROR_BUFFULL \n
+/// and SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to register heading delivery.
+/// This API will finish when get the return value.
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After call this API, if the delivery destination thread name is changed, please call this API again.
+///
+/// \~english @par
+/// Notification of message
+/// - After registered successfully, vehicle sensor will send system API message with following format. \n
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_HEADING \n
+/// message structure
+/// \~english @code
+/// typedef struct {
+/// SENSORMOTION_HEADINGINFO_DAT data; /* message data */
+/// } SENSORMOTION_MSG_HEADINGINFO;
+/// @endcode
+/// message data structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* sync count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t posSts; /* position status */
+/// uint8_t Reserve1[2]; /* Reserve */
+/// uint16_t Heading; /* heading(unit:0.01degree) */
+/// uint8_t Reserve2[2]; /* Reserve */
+/// } SENSORMOTION_HEADINGINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_GPS - Heading from GPS
+/// - SENSOR_GET_METHOD_NAVI - Heading from Navi
+/// - Synchrony count(SyncCnt)
+/// - Count for position data synchronous \n
+/// When delivery altitude and heading data, position data can be synchronized by this count. \n
+/// But the data of different method can not be synchronized by this count.\n
+/// example 1: [longitude and latitude from GPS] and [heading from GPS] can be synchronized by the count. \n
+/// example 2: [longitude and latitude from GPS] and [longitude and latitude from Navi] can not be \n
+/// synchronized by the count. \n
+/// Caution: The sensor count in sensor data delivery is another data.
+/// - Enable or not(isEnable) \n
+/// To describe this data is whether enable or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - Heading is invalid at following condition when GPS data specified, so [not avaliable] provieded \n
+/// - Immediately after system start, GPS unit has not received current location data and GPS unit status \n
+/// is not positioning fix
+/// - If it is not initialization status, certainly provide [avaliable] when Navi data specified
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Position status(posSts)
+/// - Bit0 : GPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_GSP)
+/// - Bit1 : DGPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DGPS)
+/// - Bit2 : DR data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DR)
+/// - Bit3 : MapMatching data used result(1:used, 0:not used, definition of \n
+/// maskbit:POS_LOC_INFO_USE_MAPMATCHING)
+/// - Heading
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - POS_GetHeading
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_RegisterListenerHeading(HANDLE hApp, PCSTR notifyName, uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming,
+ uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get longitude and latitude information
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [out] dat
+/// - SENSORLOCATION_LONLATINFO_DAT* - output pointer to longitude and latitude informaiton
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(GPS/Navi/Not specified)
+///
+/// \~english @par
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_GPS - GPS The longitude and latitude from GPS will be deliveried.
+/// - SENSOR_GET_METHOD_NAVI - Navi The longitude and latitude from Navi will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified The longitude and latitude will be deliveried \n
+/// according to the current environment.
+/// - Avaliable method is descriped as following in each environment. \n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+/// \~english @par
+/// - SENSORLOCATION_LONLATINFO_DAT structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* sync count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t posSts; /* position status */
+/// uint16_t posAcc; /* Position accuracy */
+/// int32_t Longitude; /* Longitude */
+/// int32_t Latitude; /* Latitude */
+/// } SENSORLOCATION_LONLATINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_GPS - longitude and latitude from GPS
+/// - SENSOR_GET_METHOD_NAVI - longitude and latitude from Navi
+/// - Synchrony count(SyncCnt)
+/// - Count for position data synchronous\n
+/// When delivery altitude and heading data, position data can be synchronized by this count. \n
+/// But the data of different method can not be synchronized by this count. \n
+/// example 1: [longitude and latitude from GPS] and [heading from GPS] can be synchronized by this count. \n
+/// example 2: [longitude and latitude from GPS] and [longitude and latitude from Navi] can not be \n
+/// synchronized by this count. \n
+/// Caution: The sensor count in sensor data delivery is another data.
+/// - Enable or not(isEnable) \n
+/// To describe this data is whether enable or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - longitude and latitude is invalid at following condition when GPS data specified, \n
+/// so [not avaliable] provieded
+/// - Immediately after system start, GPS unit has not received current location data and \n
+/// GPS unit status is not positioning fix
+/// - If it is not initialization status, certainly provide [avaliable] when Navi data specified\n
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Position status(posSts)
+/// - Bit0 : GPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_GSP)
+/// - Bit1 : DGPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DGPS)
+/// - Bit2 : DR data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DR)
+/// - Bit3 : MapMatching data used result(1:used, 0:not used, definition of \n
+/// maskbit:POS_LOC_INFO_USE_MAPMATCHING)
+/// - Position accuracy(posAcc)
+/// - Detected accruray of current position:1LSB=1m
+/// - Longitude : (WGS-84)(10^-7degree as 1) \n
+/// East longitude is positive value and west longitude is minus value.
+/// - Latitude : (WGS-84)(10^-7degree as 1)\n
+/// North latitudeis positive value and south latitude is minus value.
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher \n
+/// for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter dat is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate failed during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been registered. \n
+/// [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_INNER]
+/// - Specified semaphore ID has not been registered when lock semaphore. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE is NULL when lock mutex. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE has not been registered in mutex table when lock mutex. [POS_RET_ERROR_INNER]
+/// - The owner of specified mutex is not itself when lock mutex. [POS_RET_ERROR_INNER]
+/// - Mutex has been multiple locked [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory map. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory management. [POS_RET_ERROR_INNER]
+/// - Can not open share memory. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory. [POS_RET_ERROR_INNER]
+/// - No empty field in share memory. [POS_RET_ERROR_INNER]
+/// - Failed to guarantee share memory. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between processes. \n
+/// [POS_RET_ERROR_INNER]
+/// - Message transfer failed between process. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during event waiting. \n
+/// [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing received data. \n
+/// [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory management allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Can not open share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_INNER]
+/// - The result of getting sensor data get is POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of getting sensor data get is not POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to get longitude and latitude from vehicle sensor
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_RegisterListenerLonLat
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_GetLonLat(HANDLE hApp, SENSORLOCATION_LONLATINFO_DAT *dat, uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get altitude data
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [out] dat
+/// - SENSORLOCATION_ALTITUDEINFO_DAT* - output pointer to altitude data
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(GPS/Not specified)
+///
+/// \~english @par
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_GPS - GPS The altitude from GPS will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified The altitude will be deliveried \n
+/// according to the current environment
+/// - Avaliable method is descriped as following in each environment. \n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+/// \~english @par
+/// - SENSORLOCATION_ALTITUDEINFO_DAT structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* sync count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t Reserve[3]; /* Reserve */
+/// int32_t Altitude; /* Altitude(unit:0.01m) */
+/// } SENSORLOCATION_ALTITUDEINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_GPS - altitude from GPS
+/// - Synchrony count(SyncCnt)
+/// - Count for position data synchronous \n
+/// When delivery altitude and heading data, position data can be synchronized by this count. \n
+/// But the data of different method can not be synchronized by this count. \n
+/// example: [longitude and latitude from GPS] and [heading from GPS] can be synchronized by the count. \n
+/// synchronized by the count. \n
+/// Caution: The sensor count in sensor data delivery is another data.
+/// - Enable or not(isEnable)\n
+/// To describe this data is whether enable or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - Altitude is invalid at following condition when GPS data specified, so [not avaliable] provieded
+/// - Immediately after system start, GPS unit has not received current location data and GPS unit \n
+/// status is not positioning fix
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Altitude
+/// - altitude data(unit 0.01m)
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of \n
+/// the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter dat is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate falied during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been \n
+/// registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_INNER]
+/// - Specified semaphore ID has not been registered when lock semaphore. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE is NULL when lock mutex. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE has not been registered in mutex table when lock mutex. [POS_RET_ERROR_INNER]
+/// - The owner of specified mutex is not itself when lock mutex. [POS_RET_ERROR_INNER]
+/// - Mutex has been multiple locked [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory map. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory management. [POS_RET_ERROR_INNER]
+/// - Can not open share memory. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory. [POS_RET_ERROR_INNER]
+/// - No empty field in share memory. [POS_RET_ERROR_INNER]
+/// - Failed to guarantee share memory. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message \n
+/// transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing
+/// received data. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory management allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Can not open share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_INNER]
+/// - The result of getting sensor data is POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of getting sensor data is not POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to get altitude from vehicle sensor
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_RegisterListenerAltitude
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_GetAltitude(HANDLE hApp, SENSORLOCATION_ALTITUDEINFO_DAT *dat, uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get speed data
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [out] dat
+/// - SENSORMOTION_SPEEDINFO_DAT* - output buffer pointer to store speed data
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(POS/Navi/Not specified)
+///
+/// \~english @par
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_POS - The speed calculated in positioning based on speed pulse will be deliveried.
+/// - SENSOR_GET_METHOD_NAVI - Navi The speed from Navi will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified The speed will be deliveried according to current \n
+/// environment.
+/// - Avaliable method is descriped as following in each environment. \n
+/// In the following environment, if the SENSOR_GET_METHOD_AUTO is set,treated as default \n
+/// In the following environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+///
+/// \~english @par
+/// - SENSORMOTION_SPEEDINFO_DAT structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* sync count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t Reserve1[3]; /* Reserve */
+/// uint16_t Speed; /* speed(unit:0.01m/sec) */
+/// uint8_t Reserve2[2]; /* Reserve */
+/// } SENSORMOTION_SPEEDINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_POS - The speed calculated in positioning based on speed pulse will be deliveried.
+/// - Sync count(SyncCnt)
+/// - 0.
+/// - Enable or not(isEnable) \n
+/// To describe this data is whether enable or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - Speed is invalid at following condition when speed pulse specified, so [not avaliable] provieded
+/// - Immediately after system start, the sensor data have not been received from SYS micon
+/// - If it is not initialization status, certainly provide [avaliable] when Navi data specified
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Speed
+/// - speed data(unit 0.01m/sec)
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter dat is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate falied when the event table creation that for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table when the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been \n
+/// registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full when event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed when event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_INNER]
+/// - Specified semaphore ID has not been registered when semaphore lock. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE is NULL when mutex lock. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE has not been registered in mutex table when mutex lock. [POS_RET_ERROR_INNER]
+/// - The owner of specified mutex is not itself when mutex lock. [POS_RET_ERROR_INNER]
+/// - Mutex has been multiple locked [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory map. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory management. [POS_RET_ERROR_INNER]
+/// - Can not open share memory. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory. [POS_RET_ERROR_INNER]
+/// - No empty field in share memory. [POS_RET_ERROR_INNER]
+/// - Failed to guarantee share memory. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer \n
+/// between processes [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between \n
+/// processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during event \n
+/// waiting. [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing \n
+/// received data. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory management allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Can not open share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_INNER]
+/// - The result of getting sensor data is POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of getting sensor data is not POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to get speed from vehicle sensor.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_RegisterListenerSpeed
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_GetSpeed(HANDLE hApp, SENSORMOTION_SPEEDINFO_DAT *dat, uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get heading data
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [out] dat
+/// - SENSORMOTION_HEADINGINFO_DAT* - output buffer pointer to store heading data
+/// \~english @param [in] ucGetMethod
+/// - uint8_t - Get method(GPS/Navi/Not specified)
+///
+/// \~english @par
+/// - Get method(ucGetMethod)
+/// - SENSOR_GET_METHOD_GPS - GPS The heading from GPS will be deliveried.
+/// - SENSOR_GET_METHOD_NAVI - Navi The heading from Navi will be deliveried.
+/// - SENSOR_GET_METHOD_AUTO - Not specified The heading which most suitable in current environment \n
+/// - Avaliable method is descriped as following in each environment. \n
+/// In corresponding environment, the SENSOR_GET_METHOD_AUTO is set as default. \n
+/// In corresponding environment, if the unsupported method has been specified, \n
+/// POS_RET_ERROR_PARAM will be returned.
+/// \~english @par
+/// - SENSORMOTION_HEADINGINFO_DAT structure
+/// \~english @code
+/// typedef struct {
+/// uint8_t getMethod; /* get method */
+/// uint8_t SyncCnt; /* sync count */
+/// uint8_t isEnable; /* enable or not */
+/// uint8_t posSts; /* position status */
+/// uint8_t Reserve1[2]; /* Reserve */
+/// uint16_t Heading; /* heading(unit:0.01degree) */
+/// uint8_t Reserve2[2]; /* Reserve */
+/// } SENSORMOTION_HEADINGINFO_DAT;
+/// @endcode
+/// - Get method(getMethod)
+/// - SENSOR_GET_METHOD_GPS - Heading from GPS
+/// - SENSOR_GET_METHOD_NAVI - Heading from Navi
+/// - Synchrony count(SyncCnt)
+/// - Count for position data synchronous \n
+/// When delivery altitude and heading data, position data can be synchronized by this count. \n
+/// But the data of different method can not be synchronized by this count. \n
+/// example 1: [longitude and latitude from GPS] and [heading from GPS] can be synchronized by the count. \n
+/// example 2: [longitude and latitude from GPS] and [longitude and latitude from Navi] can not be \n
+/// synchronized by the count. \n
+/// Caution: The sensor count in sensor data delivery is another data.
+/// - Enable or not(isEnable) \n
+/// To describe this data is whether enable or not.
+/// - 0 - not avaliable
+/// - not 0 - avaliable
+/// - Heading is invalid at following condition when GPS data specified, so [not avaliable] provieded
+/// - Immediately after system start, GPS unit has not received current location data and GPS unit \n
+/// status is not positioning fix
+/// - If it is not initialization status, certainly provide [avaliable] when Navi data specified
+/// - If the status is [not avaliable], data following can not be guaranteed.
+/// - Position status(posSts)
+/// - Bit0 : GPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_GSP)
+/// - Bit1 : DGPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DGPS)
+/// - Bit2 : DR data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DR)
+/// - Bit3 : MapMatching data use result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_MAPMATCHING)
+/// - Heading
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher
+/// - for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter dat is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate falied during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been \n
+/// registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_INNER]
+/// - Specified semaphore ID has not been registered when semaphore lock. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE is NULL when mutex lock. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE has not been registered in mutex table when mutex lock. [POS_RET_ERROR_INNER]
+/// - The owner of specified mutex is not itself when mutex lock. [POS_RET_ERROR_INNER]
+/// - Mutex has been multiple locked [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory map. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory management. [POS_RET_ERROR_INNER]
+/// - Can not open share memory. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory. [POS_RET_ERROR_INNER]
+/// - No empty field in share memory. [POS_RET_ERROR_INNER]
+/// - Failed to guarantee share memory. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message transfered \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered between \n
+/// processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table \n
+/// during event waiting[POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing received \n
+/// data. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory management allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Can not open share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_INNER]
+/// - The result of getting sensor data is POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of getting sensor data is not POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to get heading from vehicle sensor.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_RegisterListenerHeading
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_GetHeading(HANDLE hApp, SENSORMOTION_HEADINGINFO_DAT *dat, uint8_t ucGetMethod);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Set speed information
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] navispeed
+/// - uint16_t - speed data[unit: 1.0km/h]
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of \n
+/// the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The data size is larger than specified value(POS_MSG_INFO_DSIZE) [POS_RET_ERROR_RESOURCE]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The message queue name has not been registered in control table. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table. [POS_RET_ERROR_INNER]
+/// - Speed data setting message transfer failed. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to set speed to vehicle sensor. \n
+/// This API will finish when get the return value. \n
+/// The speed set by this API is saved in positioning as the speed calculated by Navi.
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+/// - This API is only called by Navi proxy.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+/// \~english @see
+/// - None
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_SetSpeedInfo(HANDLE hApp, uint16_t navispeed);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Set location information
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] pstPosData
+/// - POS_POSDATA * - pointer to location information
+///
+/// \~english @par
+/// - POS_POSDATA structure
+/// \~english @code
+/// typedef struct
+/// {
+/// int8_t status; /* data status */
+/// uint8_t posSts; /* position status */
+/// uint16_t posAcc; /* Position accuracy 1LSB=1m */
+/// int32_t Longitude; /* Longitude(unit:1/128sec) */
+/// int32_t Latitude; /* Latitude(unit:1/128sec) */
+/// int32_t altitude; /* altitude (unit:0.01m) */
+/// int16_t heading; /* heading (unit:1degree) */
+/// uint8_t reserved[2]; /* reserve */
+/// } POS_POSDATA;
+/// @endcode
+///
+/// \~english @par
+/// - data status(status) \n
+/// Do not set the invalid data(do not update data).
+/// - data valid/invalid status
+/// - Bit0 : latitude(1:valid, 0:invalid, definition of maskbit:POS_LOC_INFO_LAT)
+/// - Bit1 : longitude(1:valid, 0:invalid, definition of maskbit:POS_LOC_INFO_LON)
+/// - Bit2 : altitude (1:valid, 0:invalid, definition of maskbit:POS_LOC_INFO_ALT)
+/// - Bit3 : heading (1:valid, 0:invalid, definition of maskbit:POS_LOC_INFO_HEAD)
+/// - Bit4~7 : reserve
+/// - Position status(posSts)
+/// - Bit0 : GPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_GSP)
+/// - Bit1 : DGPS data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DGPS)
+/// - Bit2 : DR data used result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_DR)
+/// - Bit3 : MapMatching data use result(1:used, 0:not used, definition of maskbit:POS_LOC_INFO_USE_MAPMATCHING)
+/// - Bit4~7 : reserve
+/// - Position accuracy(posAcc)
+/// - Detected accruray of current position:1LSB=1m
+/// - longitude
+/// - data range: -180deg ~ +180deg
+/// - +: east longitude -: west longitude
+/// - latitude
+/// - data range:-90deg ~ +90deg
+/// - +: north latitude -: south latitude
+/// - heading
+/// - data range:-179deg ~ +180deg
+/// - Based on north, west(counter-clockwise) is +, east(clockwise) is -
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher \n
+/// for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter pstPosData is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The data status in parameter pstPosData is invalid value(0). [POS_RET_ERROR_PARAM]
+/// - The data status in parameter pstPosData is abnormal value(<15). [POS_RET_ERROR_PARAM]
+/// - The data size is larger than specified value(POS_MSG_INFO_DSIZE) [POS_RET_ERROR_RESOURCE]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The message queue name has not been registered in control table. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table. [POS_RET_ERROR_INNER]
+/// - Location data setting message transfer failed. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to set location to vehicle sensor. \n
+/// This API will finish when get the return value. \n
+/// The location set by this API is saved in positioning as the location calculated by Navi. \n
+/// If one of longitude and latitude is valid, the another data will be used as valid data no \n
+/// matter what status it is. \n
+/// If one of longitude and latitude is valid, the position accuracy data will be used as valid data.
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+/// - This API is only called by Navi proxy.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+/// \~english @see
+/// - None
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_SetLocationInfo(HANDLE hApp, POS_POSDATA* pstPosData);
+
+#ifdef __cplusplus
+}
+#endif
+/** @}*/ // end of positioning
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_COMMON_API_H_
diff --git a/vehicleservice/positioning/client/include/vehicle_service/POS_define.h b/vehicleservice/positioning/client/include/vehicle_service/POS_define.h
new file mode 100755
index 0000000..2ea918d
--- /dev/null
+++ b/vehicleservice/positioning/client/include/vehicle_service/POS_define.h
@@ -0,0 +1,134 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_DEFINE_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_DEFINE_H_
+
+/**
+ * @file POS_define.h
+ * @brief Header file to define the constants and structure
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning
+ * @ingroup vehicle_service
+ * @{
+ */
+
+#include <native_service/frameworkunified_types.h>
+#include <gps_hal.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+#define POS_AVAILABILITY "Positioning/Availability" //!< \~english Availability
+
+/* message sender thread */
+#define POS_NTFY_SEND_THREAD "POS_Main" //!< \~english POS_Main thread
+#define POS_NTFY_SEND_THREAD_GPS "POS_Gps" //!< \~english POS_Gps thread
+
+/* SENSOR_RET_API */
+#define SENSOR_RET_NORMAL 0 //!< \~english normal finish
+#define SENSOR_RET_ERROR_PID (-1) //!< \~english thread ID error
+#define SENSOR_RET_ERROR_DID (-2) //!< \~english unregistered data ID error
+#define SENSOR_RET_ERROR_DID_DIS (-3) //!< \~english data ID not CAN ID
+#define SENSOR_RET_ERROR_PARAM (-4) //!< \~english parameter error
+#define SENSOR_RET_ERROR_BUFFULL (-5) //!< \~english buffer full error
+#define SENSOR_RET_ERROR_CREATE_EVENT (-6) //!< \~english create event error
+#define SENSOR_RET_ERROR_TIMER (-7) //!< \~english create timer error
+#define SENSOR_RET_ERROR_OUTOF_MEMORY (-8)
+//!< \~english share memory allocation size error
+
+#define SENSOR_RET_ERROR_SIZE (-9) //!< \~english memory size error
+#define SENSOR_RET_ERROR (-10) //!< \~english error occured
+#define SENSOR_RET_ERROR_NOSUPPORT (-11) //!< \~english no support
+#define SENSOR_RET_ERROR_INNER (-12) //!< \~english Internal error
+#define SENSOR_RET_ERROR_RESOURCE (-13) //!< \~english lack of resources
+#define SENSOR_RET_ERROR_MIN POS_RET_ERROR_MIN //!< \~english min value of error
+
+/* Data Status Definition */
+#define POS_LOC_INFO_LAT 0x01
+//!< \~english current position latitude(bit0) 1:valid 0:invalid
+
+#define POS_LOC_INFO_LON 0x02
+//!< \~english current position longitude(bit1) 1:valid 0:invalid
+
+#define POS_LOC_INFO_ALT 0x04
+//!< \~english current position altitude(bit2) 1:valid 0:invalid
+
+#define POS_LOC_INFO_HEAD 0x08
+//!< \~english current position heading(bit3) 1:valid 0:invalid
+
+/* Definition of positioning system */
+#define POS_LOC_INFO_USE_GSP 0x01
+//!< \~english GPS data used result(bit0) 1:valid 0:invalid
+
+#define POS_LOC_INFO_USE_DGPS 0x02
+//!< \~english DGPS data used result(bit1) 1:valid 0:invalid
+
+#define POS_LOC_INFO_USE_DR 0x04
+//!< \~english Dead Reckoning used result(bit2) 1:valid 0:invalid
+
+#define POS_LOC_INFO_USE_MAPMATCHING 0x08
+//!< \~english MapMatching result(bit3) 1:valid 0:invalid
+
+/*--- for message ---*/
+/* message body size (byte) */
+/* move to gps_hal.h */
+
+/*--- for register listener API ---*/
+/* control delivery */
+#define SENSOR_DELIVERY_REGIST 0x01 //!< \~english register delivery
+
+/* delivery timing control */
+#define SENSOR_DELIVERY_TIMING_UPDATE 0x01 //!< \~english delivery update timing
+#define SENSOR_DELIVERY_TIMING_CHANGE 0x02 //!< \~english delivery change timing
+
+/* POS_RET_API */
+#define POS_RET_NORMAL 0 //!< \~english normal finish
+#define POS_RET_ERROR (-1) //!< \~english error occured
+#define POS_RET_ERROR_DID (-2) //!< \~english data ID error
+#define POS_RET_ERROR_INNER (-3) //!< \~english internal error
+#define POS_RET_ERROR_PARAM (-4) //!< \~english parameter error
+#define POS_RET_ERROR_BUFFULL (-5) //!< \~english buffer full error
+#define POS_RET_ERROR_CREATE_EVENT (-6) //!< \~english create event error
+#define POS_RET_ERROR_OUTOF_MEMORY (-8)
+//!< \~english share memory allocation size error
+
+#define POS_RET_ERROR_SIZE (-9) //!< \~english memory size error
+#define POS_RET_ERROR_TIMEOUT (-10) //!< \~english timeout error
+#define POS_RET_ERROR_NOSUPPORT (-11) //!< \~english no support
+#define POS_RET_ERROR_BUSY (-12) //!< \~english busy
+#define POS_RET_ERROR_RESOURCE (-13) //!< \~english lack of resources
+#define POS_RET_ERROR_MIN (-13) //!< \~english min value of error
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+typedef int32_t SENSOR_RET_API; //!< \~english API return value
+typedef int32_t POS_RET_API; //!< \~english API return value
+typedef uint32_t DID; //!< \~english data ID
+typedef int32_t RET_API; //!< \~english _CWORD64_ API return value
+
+/** @}*/ // end of positioning
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_DEFINE_H_
diff --git a/vehicleservice/positioning/client/include/vehicle_service/POS_gps_API.h b/vehicleservice/positioning/client/include/vehicle_service/POS_gps_API.h
new file mode 100755
index 0000000..41e8e01
--- /dev/null
+++ b/vehicleservice/positioning/client/include/vehicle_service/POS_gps_API.h
@@ -0,0 +1,1135 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_GPS_API_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_GPS_API_H_
+/**
+ * @file POS_gps_API.h
+ * @brief API definition file for GPS function
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning
+ * @ingroup vehicle_service
+ * @{
+ */
+
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/POS_define.h>
+#include <gps_hal.h>
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+typedef int32_t NAVIINFO_RET_API;
+//!< \~english define return value of Get/Set GPS information API
+
+/*---------------------------------------------------------------------------------*
+ * Event declaration *
+ *---------------------------------------------------------------------------------*/
+
+
+/**
+ * \~english @brief GPS time setting result delivery command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkunifiedAttachCallbackToDispatcher(h_app,POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ 0x0780
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @struct SENSOR_MSG_SEND_DAT
+ * \~english message for setting vehicle sensor data(to vehicle sensor)
+ */
+typedef struct {
+ DID did; //!< \~english data ID
+ uint16_t usSize; //!< \~english data size
+ uint8_t data[502]; //!< \~english data body
+} SENSOR_MSG_SEND_DAT;
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+/* GPS_API public API */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - GPS setting request
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] p_data
+/// - SENSOR_MSG_SEND_DAT * - pointer of GPS setting data
+///
+/// \~english @par
+/// - SENSOR_MSG_SEND_DAT structure
+/// \~english @code
+/// typedef struct
+/// {
+/// DID did; /* Data ID */
+/// uint16_t usSize; /* Data size */
+/// uint8_t data[502]; /* Data body */
+/// } SENSOR_MSG_SEND_DAT;
+/// @endcode
+///
+/// \~english @par
+/// - Data ID(did)
+/// - POS_DID_GPS__CWORD82__SETINITIAL - setting initial location and time data to GPS \n
+/// (reference to initial location, time setting(_CWORD82_))
+/// - POS_DID_GPS__CWORD82__SETRMODEEX - setting GPS receiver mode(pull extension sentence) \n
+/// (reference to GPS receiver mode setting(_CWORD82_))
+/// - POS_DID_GPS__CWORD82__SELSENT - setting command to GPS that output any sentence \n
+/// (reference to output any sentence setting(_CWORD82_))
+///
+///
+/// \~english @retval SENSOR_RET_NORMAL normal finish
+/// \~english @retval SENSOR_RET_ERROR_CREATE_EVENT event create error
+/// \~english @retval SENSOR_RET_ERROR_PARAM parameter error
+/// \~english @retval SENSOR_RET_ERROR_DID data ID not registered
+/// \~english @retval SENSOR_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval SENSOR_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter p_data is NULL [SENSOR_RET_ERROR_PARAM]
+/// - Data ID(p_data->did) is not supported [SENSOR_RET_ERROR_DID]
+/// - GPS setting data size(p_data->usSize) is not same with the data \n
+/// that related to data ID [SENSOR_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The message queue name has not been registered in control table when GPS \n
+/// setting message transfer between processes. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Message transfer HANDLE create failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Message transfer HANDLE get failed from internal table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - GPS setting message transfer failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+///
+/// \~english @par Detail
+/// - Call this API to set GPS data. \n
+/// The GPS data specified by the parameter p_data will be set in positioning.
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+/// - This API is only called by Navigation proxy.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+/// \~english @see
+/// - None
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+int32_t POS_ReqGPSSetting(HANDLE hApp, SENSOR_MSG_SEND_DAT *p_data);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Set GPS information
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] navilocinfo
+/// - NAVIINFO_ALL * - pointer of GPS information
+///
+/// \~english @par
+/// - NAVIINFO_ALL structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint8_t ucSensorCnt; /* sensor count */
+/// uint8_t reserve[3]; /* reserve */
+/// NAVIINFO_DIAG_GPS stDiagGps; /* position fix related information */
+/// NAVIINFO_NAVI_GPS stNaviGps; /* other GPS related information */
+/// } NAVIINFO_ALL;
+/// @endcode
+/// - sensor count \n
+/// sensor count value when GPS data received
+///
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS structure
+/// \~english @code
+/// typedef struct
+/// {
+/// NAVIINFO_DIAG_GPS_FIX stFix; /* position fix information */
+/// NAVIINFO_DIAG_GPS_SAT stSat; /* all satellite information */
+/// } NAVIINFO_DIAG_GPS;
+/// @endcode
+/// \n
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_FIX structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint8_t ucFixSts; /* position fix status */
+/// uint8_t ucReserve[3]; /* reserve */
+/// NAVIINFO_DIAG_GPS_FIX_CNT stCnt; /* position fix count data */
+/// NAVIINFO_DIAG_GPS_FIX_XYZ stWgs84; /* lonlat data(WGS84 geodetic) */
+/// } NAVIINFO_DIAG_GPS_FIX;
+/// @endcode
+/// - position fix status(ucFixSts)
+/// - NAVIINFO_DIAG_GPS_FIX_STS_NON:not fixed
+/// - NAVIINFO_DIAG_GPS_FIX_STS_2D :2D fix
+/// - NAVIINFO_DIAG_GPS_FIX_STS_3D :3D fix
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_FIX_CNT structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint32_t ulCnt3d; /* position fix ratio:3D(unit:sec) */
+/// uint32_t ulCnt2d; /* position fix ratio:2D(unit:sec) */
+/// uint32_t ulCntElse; /* position fix ratio:not fix(unit:sec) */
+/// } NAVIINFO_DIAG_GPS_FIX_CNT;
+/// @endcode
+///
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_FIX_XYZ structure
+/// \~english @code
+/// typedef struct
+/// {
+/// int32_t lLat; /* GPS latitude(unit:1/256sec) (+: north latitude,-: south latitude) */
+/// int32_t lLon; /* GPS longitude(unit:1/256sec) (+: east longitude, -: west longitude) */
+/// } NAVIINFO_DIAG_GPS_FIX_XYZ;
+/// @endcode
+///
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_SAT structure
+/// \~english @code
+/// typedef struct
+/// {
+/// NAVIINFO_DIAG_GPS_PRN stPrn[12]; /* all satellite information */
+/// } NAVIINFO_DIAG_GPS_SAT;
+/// @endcode
+///
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_PRN structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint8_t ucRcvSts; /* reception status */
+/// uint8_t ucPrn; /* satellite No. */
+/// uint8_t ucelv; /* satellite angle(unit:1.0deg) */
+/// uint8_t ucLv; /* satellite level */
+/// uint16_t usAzm; /* satellite azimuth(unit:1.0deg) (clockwise from north) */
+/// uint8_t ucReserve[2]; /* reserve */
+/// } NAVIINFO_DIAG_GPS_PRN;
+/// @endcode
+/// - reception status(ucRcvSts)
+/// - NAVIINFO_DIAG_GPS_RCV_STS_NOTUSE :not used
+/// - NAVIINFO_DIAG_GPS_RCV_STS_SEARCHING :searching
+/// - NAVIINFO_DIAG_GPS_RCV_STS_TRACHING :tracking
+/// - NAVIINFO_DIAG_GPS_RCV_STS_NOTUSEFIX :not used for position fix
+/// - NAVIINFO_DIAG_GPS_RCV_STS_USEFIX :used for position fix
+/// \~english @par
+/// - NAVIINFO_NAVI_GPS structure
+/// \~english @code
+/// typedef struct
+/// {
+/// int32_t altitude; /* altitude(unit:1m) */
+/// uint16_t speed; /* speed(unit:1.00km/h) */
+/// uint16_t heading; /* heading(unit:0.1deg) (clockwise from north) */
+/// NAVIINFO_UTCTIME utc; /* UTC time */
+/// uint8_t tdsts; /* date and time status */
+/// uint8_t reserve[3]; /* reserve */
+/// } NAVIINFO_NAVI_GPS;
+/// @endcode
+/// - altitude(altitude) \n
+/// As the altitude is used as unit [0.01m] in internal, \n
+/// the altitude data range is (-21,474,839~21,474,839).
+/// - UTC(utc)
+/// - The time set after rollover.
+/// - date and time status(tdsts)
+/// - 0= time has not been adjusted after GPS receiver reset(time input or master reset or CSF start)
+/// - 1= time output from RTC Backup(have time adjustment result)
+/// - 2= time adjustment completed
+/// \~english @par
+/// - NAVIINFO_UTCTIME structure
+/// \~english @code
+/// typedef struct {
+/// uint16_t year; /* A.D. (1~) */
+/// uint8_t month; /* month(1~12) */
+/// uint8_t date; /* date(1~31) */
+/// uint8_t hour; /* hour(0~23) */
+/// uint8_t minute; /* minute(0~59) */
+/// uint8_t second; /* second(0~59) */
+/// uint8_t reserved; /* not used */
+/// } NAVIINFO_UTCTIME;
+/// @endcode
+///
+/// \~english @retval NAVIINFO_RET_NORMAL normal finish
+/// \~english @retval NAVIINFO_RET_ERROR_PARAM parameter error
+/// \~english @retval NAVIINFO_RET_ERROR_INNER internal error
+/// \~english @retval NAVIINFO_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval NAVIINFO_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter navilocinfo is NULL [NAVIINFO_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [NAVIINFO_RET_ERROR_PARAM]
+/// - GPS setting data size(p_data->usSize) is not same as the data that \n
+/// related to data ID [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The count of message in message queue is reach to max [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The message queue name has not been registered in control table. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table. [NAVIINFO_RET_ERROR_INNER]
+/// - GPS setting message transfer failed between processes. [NAVIINFO_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to set GPS information to vehicle sensor.\n
+/// - This API will finish when get the return value.
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+/// - This API is only called by Navigation proxy.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget and Method and Fire and Forget and Fire and Forget
+///
+/// \~english @see
+/// - POS_GetGPSInfo
+////////////////////////////////////////////////////////////////////////////////////////////
+NAVIINFO_RET_API POS_SetGPSInfo(HANDLE hApp, NAVIINFO_ALL *navilocinfo);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get GPS data
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [out] navidiaginfo
+/// - NAVIINFO_DIAG_GPS* - pointer to get GPS data
+///
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS structure
+/// \~english @code
+/// typedef struct
+/// {
+/// NAVIINFO_DIAG_GPS_FIX stFix; /* position fix information */
+/// NAVIINFO_DIAG_GPS_SAT stSat; /* all satellite information */
+/// } NAVIINFO_DIAG_GPS;
+/// @endcode
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_FIX structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint8_t ucFixSts; /* position fix status */
+/// uint8_t ucReserve[3]; /* reserve */
+/// NAVIINFO_DIAG_GPS_FIX_CNT stCnt; /* position fix count data */
+/// NAVIINFO_DIAG_GPS_FIX_XYZ stWgs84; /* lonlat data(WGS84 geodetic) */
+/// } NAVIINFO_DIAG_GPS_FIX;
+/// @endcode
+/// - position fix status(ucFixSts)
+/// - NAVIINFO_DIAG_GPS_FIX_STS_NON:not fixed
+/// - NAVIINFO_DIAG_GPS_FIX_STS_2D :2D fix
+/// - NAVIINFO_DIAG_GPS_FIX_STS_3D :3D fix
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_FIX_CNT structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint32_t ulCnt3d; /* position fix count:3D(unit:sec) */
+/// uint32_t ulCnt2d; /* position fix count:2D(unit:sec) */
+/// uint32_t ulCntElse; /* position fix count:not fix(unit:sec) */
+/// } NAVIINFO_DIAG_GPS_FIX_CNT;
+/// @endcode
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_FIX_XYZ structure
+/// \~english @code
+/// typedef struct
+/// {
+/// int32_t lLat; /* GPS latitude(unit:1/256sec) (+: north latitude, -: south latitude) */
+/// int32_t lLon; /* GPS longitude(unit:1/256sec) (+: east longitude, -: west longitude) */
+/// } NAVIINFO_DIAG_GPS_FIX_XYZ;
+/// @endcode
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_SAT structure
+/// \~english @code
+/// typedef struct
+/// {
+/// NAVIINFO_DIAG_GPS_PRN stPrn[12]; /* all satellite information */
+/// } NAVIINFO_DIAG_GPS_SAT;
+/// @endcode
+/// \~english @par
+/// - NAVIINFO_DIAG_GPS_PRN structure
+/// \~english @code
+/// typedef struct
+/// {
+/// uint8_t ucRcvSts; /* reception status */
+/// uint8_t ucPrn; /* satellite No. */
+/// uint8_t ucelv; /* satellite angle(unit:1.0deg) */
+/// uint8_t ucLv; /* satellite level */
+/// uint16_t usAzm; /* satellite azimuth(unit:1.0deg) (clockwise from north) */
+/// uint8_t ucReserve[2]; /* reserve */
+/// } NAVIINFO_DIAG_GPS_PRN;
+/// @endcode
+/// - reception status(ucRcvSts)
+/// - NAVIINFO_DIAG_GPS_RCV_STS_NOTUSE : not used
+/// - NAVIINFO_DIAG_GPS_RCV_STS_SEARCHING : searching
+/// - NAVIINFO_DIAG_GPS_RCV_STS_TRACHING : tracking
+/// - NAVIINFO_DIAG_GPS_RCV_STS_NOTUSEFIX : not used for position fix
+/// - NAVIINFO_DIAG_GPS_RCV_STS_USEFIX : used for position fix
+///
+/// \~english @retval NAVIINFO_RET_NORMAL normal finish
+/// \~english @retval NAVIINFO_RET_ERROR_PARAM parameter error
+/// \~english @retval NAVIINFO_RET_ERROR_INNER internal error
+/// \~english @retval NAVIINFO_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval NAVIINFO_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter navidiaginfo is NULL [NAVIINFO_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [NAVIINFO_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [NAVIINFO_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [NAVIINFO_RET_ERROR_INNER]
+/// - Memory allocate falied during the event table creation for event \n
+/// registering. [NAVIINFO_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [NAVIINFO_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [NAVIINFO_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already \n
+/// been registered. [NAVIINFO_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [NAVIINFO_RET_ERROR_INNER]
+/// - The event table is full during event creation. [NAVIINFO_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [NAVIINFO_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [NAVIINFO_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but \n
+/// failed. [NAVIINFO_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been \n
+/// registered. [NAVIINFO_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [NAVIINFO_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [NAVIINFO_RET_ERROR_INNER]
+/// - Initialize event object failed. [NAVIINFO_RET_ERROR_INNER]
+/// - The memory for storing semaphore control data allocate failed. [NAVIINFO_RET_ERROR_INNER]
+/// - Specified semaphore ID has not been registered when semaphore lock. [NAVIINFO_RET_ERROR_INNER]
+/// - Internal mutex HANDLE is NULL when mutex lock. [NAVIINFO_RET_ERROR_INNER]
+/// - Internal mutex HANDLE has not been registered in mutex table when mutex lock. [NAVIINFO_RET_ERROR_INNER]
+/// - The owner of specified mutex is not itself when mutex lock. [NAVIINFO_RET_ERROR_INNER]
+/// - Mutex has been multiple locked [NAVIINFO_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address. [NAVIINFO_RET_ERROR_INNER]
+/// - Can not get usable share memory address. [NAVIINFO_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory map. [NAVIINFO_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory management. [NAVIINFO_RET_ERROR_INNER]
+/// - Can not open share memory. [NAVIINFO_RET_ERROR_INNER]
+/// - Failed to mapping share memory. [NAVIINFO_RET_ERROR_INNER]
+/// - No empty field in share memory. [NAVIINFO_RET_ERROR_INNER]
+/// - Failed to guarantee share memory. [NAVIINFO_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message \n
+/// transfered between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message \n
+/// transfer between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [NAVIINFO_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [NAVIINFO_RET_ERROR_INNER]
+/// - The count of thread arrived max in event management table during event waiting. [NAVIINFO_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [NAVIINFO_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [NAVIINFO_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [NAVIINFO_RET_ERROR_INNER]
+/// - The interruption happened during event getting [NAVIINFO_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [NAVIINFO_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing \n
+/// received data. [NAVIINFO_RET_ERROR_INNER]
+/// - Can not get usable share memory address for accessing received data. [NAVIINFO_RET_ERROR_INNER]
+/// - Memory for share memory map allocate failed for accessing received data. [NAVIINFO_RET_ERROR_INNER]
+/// - Memory for share memory management allocate failed for accessing received data. [NAVIINFO_RET_ERROR_INNER]
+/// - Can not open share memory for accessing received data. [NAVIINFO_RET_ERROR_INNER]
+/// - Failed to mapping share memory for accessing received data. [NAVIINFO_RET_ERROR_INNER]
+/// - The size of data stored in share memory is larger than the size of \n
+/// received data. [NAVIINFO_RET_ERROR_INNER]
+/// - The result of sensor data get processing is POS_RET_ERROR_RESOURCE. [NAVIINFO_RET_ERROR_RESOURCE]
+/// - The result of sensor data get processing is not POS_RET_ERROR_RESOURCE. [NAVIINFO_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to get GPS data for diag. \n
+/// This API will finish when get the return value.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_SetGPSInfo
+////////////////////////////////////////////////////////////////////////////////////////////
+NAVIINFO_RET_API POS_GetGPSInfo(HANDLE hApp, NAVIINFO_DIAG_GPS *navidiaginfo);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - GPS reset request
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] ResName
+/// - PCSTR - response thread name
+/// \~english @param [in] mode
+/// - uint8_t - reset mode
+///
+/// \~english @par
+/// - reset mode(mode) \n
+/// If the mode is not one of the following, return POS_RET_ERROR_PARAM
+/// - GPS_RST_COLDSTART - GPS reset request(cold start) \n
+/// Automatic search, track satellite and position fix after RAM initialized(all config \n
+/// items be initialized to default value).\n
+/// Initialize data objects:almanac/ ephemeris data, current position, GPS receiver mode and etc.\n
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_BUSY GPS device is still in setting
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter ResName is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter mode is not GPS_RST_COLDSTART [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate falied when the event table creation that for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table when the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been \n
+/// registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full when event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed when event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when GPS reset \n
+/// message transfer between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when GPS reset message transfered \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when GPS reset message \n
+/// transfered between processes. [POS_RET_ERROR_INNER]
+/// - GPS reset message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event waiting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event waiting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event waiting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event waiting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event waiting. [POS_RET_ERROR_INNER]
+/// - The result of sensor data get processing is POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of sensor data get processing is not POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to reset GPS device.
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+/// - This API is only called by Navigation proxy.
+///
+/// \~english @par
+/// Notification of message
+/// - The result of communication with GPS device will be sent by system API message with following format. \n
+/// Command ID : CID_POSIF_REQ_GPS_RESET \n
+/// message structure
+/// \~english @code
+/// typedef struct
+/// {
+/// TG_GPS_RET_RESET data; /* GPS reset status data */
+/// } TG_GPS_RET_RESET_MSG;
+/// @endcode
+/// - message data body structure
+/// \~english @code
+/// typedef struct {
+/// unsigned long ret_rst_status; /* response GPS reset status */
+/// } TG_GPS_RET_RESET;
+/// @endcode
+/// - response GPS reset status(ret_rst_status)
+/// - GPS_SENDOK:acknowledge
+/// - GPS_SENDNG:connection error
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+/// \~english @see
+/// - None
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_ReqGPSReset(HANDLE hApp, PCSTR ResName, uint8_t mode);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register GPS time setting request delivery
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+///
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_BUFFULL the register count is full
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of \n
+/// the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate falied during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already been \n
+/// registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message \n
+/// transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed in process. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [POS_RET_ERROR_INNER]
+/// - The count of thread arrived max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The result from positioning service is SENSOR_RET_ERROR_PARAM. [POS_RET_ERROR_PARAM]
+/// - The result from positioning service is SENSOR_RET_ERROR_BUFFULL. [POS_RET_ERROR_BUFFULL]
+/// - The result from positioning service is SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result from positioning service is not SENSOR_RET_ERROR_PARAM or \n
+/// SENSOR_RET_ERROR_BUFFULL or SENSOR_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to register GPS time setting request delivery. \n
+/// This API will finish when get the return value.
+///
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After call this API, if the delivery destination thread name has been changed, please call this API again.
+///
+/// \~english @par
+/// Notification of message
+/// - After registered successfully, vehicle sensor information will be sent by system \n
+/// API message with following format. \n
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ \n
+/// time info structure \n
+/// The year, month, date, hour, minute and second should be the format set to GPS
+/// \~english @code
+/// typedef struct {
+/// uint16_t year; /* A.D.(1~) */
+/// uint8_t month; /* month(1~12) */
+/// uint8_t date; /* date(1~31) */
+/// uint8_t hour; /* hour(0~23) */
+/// uint8_t minute; /* minute(0~59) */
+/// uint8_t second; /* second(0~59) */
+/// uint8_t reserved; /* not used */
+/// } POS_DATETIME;
+/// @endcode
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - None
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_RegisterListenerGPSTimeSetReq(HANDLE hApp, PCSTR notifyName, uint8_t ucCtrlFlg);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Temporarily set GPS time from Diag function
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] pstDateTime
+/// - POS_DATETIME * - pointer of GPS time
+///
+/// \~english @par
+/// - POS_DATETIME structure
+/// \~english @code
+/// typedef struct {
+/// uint16_t year; /* A.D.(1~) */
+/// uint8_t month; /* month(1~12) */
+/// uint8_t date; /* date(1~31) */
+/// uint8_t hour; /* hour(0~23) */
+/// uint8_t minute; /* minute(0~59) */
+/// uint8_t second; /* second(0~59) */
+/// uint8_t reserved; /* not used */
+/// } POS_DATETIME;
+/// @endcode
+///
+/// \~english @retval NAVIINFO_RET_NORMAL normal finish
+/// \~english @retval NAVIINFO_RET_ERROR_PARAM parameter error
+/// \~english @retval NAVIINFO_RET_ERROR_INNER internal error
+/// \~english @retval NAVIINFO_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval NAVIINFO_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter pstDateTime is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - GPS time Data size is larger than 144 [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The message queue name has not been registered in control table. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table. [POS_RET_ERROR_INNER]
+/// - GPS time setting message transfer failed. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to set GPS time data to vehicle sensor. \n
+/// This API will finish when get the return value.
+///
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - This API will not notify the result of setting time to GPS device. \n
+/// Return normal only there is no error such as parameter error.
+/// - If want to get the result of setting time to GPS device, use \n
+/// POS_RegisterListnerGpsTime to get GPS time and judge it.
+/// - This API is only called by Diag service.
+/// - While GPS data is receiving from GPS device, the GPS time set by this API is ignored \n
+/// and it is set actual GPS time notified by positioning_hal.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+/// \~english @see
+/// - POS_GetGPStime
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_SetGPStime(HANDLE hApp, POS_DATETIME* pstDateTime);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register GPS time delivery
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+///
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register specified data delivery
+/// - Please note that if the same data delivery has been registered for multiple \n
+/// times, the data will also be deliveried for registered multiple times.
+/// - The specified GPS time information will be deliveried at registered time (first delivery).
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change Specified data will be deliveried only when it changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update Specified data will be deliveried as \n
+/// long as it updated by vehicle sensor.
+///
+/// \~english @retval SENSOR_RET_NORMAL normal finish
+/// \~english @retval SENSOR_RET_ERROR_CREATE_EVENT event creation error
+/// \~english @retval SENSOR_RET_ERROR_PARAM parameter error
+/// \~english @retval SENSOR_RET_ERROR_INNER internal error
+/// \~english @retval SENSOR_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval SENSOR_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of \n
+/// the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) \n
+/// nor change(SENSOR_DELIVERY_TIMING_CHANGE) [SENSOR_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to \n
+/// max [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event is created in system, but the count of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Memory allocate falied during the event table creation for event \n
+/// registering. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The thread can not register in the event table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Memory allocate failed in event table during the thread table creation. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - After register the thread table in event table, the event flag has already been \n
+/// registered. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - After register the thread table in event table, the event flag register \n
+/// failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event table is full during event creation. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The memory for event HANDLE allocate failed during event table creation. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The thread can not be registered in event table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - In event table, try to allocate the memory of the thread table creation, but \n
+/// failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - After register the thread in event table, the event flag has already been \n
+/// registered. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - After register the thread in event table, the event flag register failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Specified event ID has not been registered in table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Initialize event object failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - ProcessNo has not been registered in message control table when message \n
+/// transfered between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [SENSOR_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message \n
+/// transfer between processes. [SENSOR_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [SENSOR_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [SENSOR_RET_ERROR_INNER]
+/// - The count of thread arrived max in event management table during event waiting. [SENSOR_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event get. [SENSOR_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event get. [SENSOR_RET_ERROR_INNER]
+/// - The flagID has not been registered during event get. [SENSOR_RET_ERROR_INNER]
+/// - The interruption happened during event get [SENSOR_RET_ERROR_INNER]
+/// - Whatever error happened during event get. [SENSOR_RET_ERROR_INNER]
+/// - Get event timeout. [SENSOR_RET_ERROR_INNER]
+/// - Error happened during event get. [SENSOR_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to register GPS time delivery. \n
+/// This API will finish when get the return value.
+///
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After call this API, if the delivery destination thread name has changed, please call this API again.
+///
+/// \~english @par
+/// Notification of message
+/// - After registered successfully, vehicle sensor will send GPS time data \n
+/// as system API message with following format.
+/// - If the register successed, certainly delivery first data. And then \n
+/// delivery data according to the delivery timing.
+/// - Command ID : CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME\n
+/// - SENSOR_MSG_GPSTIME structure
+/// \~english @code
+/// typedef struct {
+/// NAVIINFO_UTCTIME utc; /* UTC time */
+/// uint8_t tdsts; /* time status */
+/// uint8_t reserve[3]; /* reserve */
+/// } SENSOR_MSG_GPSTIME;
+/// @endcode
+/// - time status(tdsts)
+/// - 0= time has not been adjusted after GPS receiver reset(time input or master reset or CSF start)
+/// - 1= time output from RTC Backup(have time adjustment result)
+/// - 2= time adjustment completed
+///
+/// \~english @par
+/// - NAVIINFO_UTCTIME structure
+/// \~english @code
+/// typedef struct {
+/// uint16_t year; /* A.D.(1~) */
+/// uint8_t month; /* month(1~12) */
+/// uint8_t date; /* date(1~31) */
+/// uint8_t hour; /* hour(0~23) */
+/// uint8_t minute; /* minute(0~59) */
+/// uint8_t second; /* second(0~59) */
+/// uint8_t reserved; /* not used */
+/// } POS_DATETIME;
+/// @endcode
+///
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - None
+////////////////////////////////////////////////////////////////////////////////////////////
+SENSOR_RET_API POS_RegisterListenerGPStime(HANDLE hApp, PCSTR notifyName, uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get GPS time
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [out] dat
+/// - SENSOR_GPSTIME* - output buffer pointer to store GPS time
+///
+/// \~english @par
+/// - SENSOR_GPSTIME structure
+/// \~english @code
+/// typedef struct {
+/// NAVIINFO_UTCTIME utc; /* UTC time */
+/// uint8_t tdsts; /* date amd time status */
+/// uint8_t reserve[3]; /* reserve */
+/// } SENSOR_GPSTIME;
+/// @endcode
+/// - date amd time status(tdsts)
+/// - 0= time has not been adjusted after GPS receiver reset(time input or master reset or CSF start)
+/// - 1= time output from RTC Backup(have time adjustment result)
+/// - 2= time adjustment completed
+///
+/// \~english @par
+/// - NAVIINFO_UTCTIME structure
+/// \~english @code
+/// typedef struct {
+/// uint16_t year; /* A.D.(1~) */
+/// uint8_t month; /* month(1~12) */
+/// uint8_t date; /* date(1~31) */
+/// uint8_t hour; /* hour(0~23) */
+/// uint8_t minute; /* minute(0~59) */
+/// uint8_t second; /* second(0~59) */
+/// uint8_t reserved; /* not used */
+/// } NAVIINFO_UTCTIME;
+/// @endcode
+///
+/// \~english @retval POS_RET_NORMAL normal finish
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the Dispatcher for App are completed.
+/// - Availability of positioning service is TRUE.
+///
+/// \~english @par changes of internal status
+/// - There is no changes of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter dat is NULL [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_INNER]
+/// - Memory allocate falied during the event table creation for event registering. [POS_RET_ERROR_INNER]
+/// - The thread can not register in the event table. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag has already \n
+/// been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread table in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - The event table is full during event creation. [POS_RET_ERROR_INNER]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_INNER]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_INNER]
+/// - In event table, try to allocate the memory of the thread table creation, but failed. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag has already been registered. [POS_RET_ERROR_INNER]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_INNER]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_INNER]
+/// - Initialize event object failed. [POS_RET_ERROR_INNER]
+/// - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_INNER]
+/// - Specified semaphore ID has not been registered when semaphore lock. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE is NULL when mutex lock. [POS_RET_ERROR_INNER]
+/// - Internal mutex HANDLE has not been registered in mutex table when mutex lock. [POS_RET_ERROR_INNER]
+/// - The owner of specified mutex is not itself when mutex lock. [POS_RET_ERROR_INNER]
+/// - Mutex has been multiple locked [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory map. [POS_RET_ERROR_INNER]
+/// - Memory allocate failed for share memory management. [POS_RET_ERROR_INNER]
+/// - Can not open share memory. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory. [POS_RET_ERROR_INNER]
+/// - No empty field in share memory. [POS_RET_ERROR_INNER]
+/// - Failed to guarantee share memory. [POS_RET_ERROR_INNER]
+/// - ProcessNo has not been registered in message control table when message \n
+/// transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message \n
+/// transfer between processes. [POS_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [POS_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [POS_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [POS_RET_ERROR_INNER]
+/// - The count of thread arrived max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event getting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event getting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event getting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event getting. [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing \n
+/// received data. [POS_RET_ERROR_INNER]
+/// - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Memory for share memory management allocate failed for accessing received data. [POS_RET_ERROR_INNER]
+/// - Can not open share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_INNER]
+/// - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_INNER]
+/// - The result of sensor data getting process is POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_RESOURCE]
+/// - The result of sensor data getting process is not POS_RET_ERROR_RESOURCE. [POS_RET_ERROR_INNER]
+///
+/// \~english @par Detail
+/// - Call this API to get GPS time from vehicle sensor.
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+///
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_SetGPStime
+////////////////////////////////////////////////////////////////////////////////////////////
+POS_RET_API POS_GetGPStime(HANDLE hApp, SENSOR_GPSTIME* dat);
+
+#ifdef __cplusplus
+}
+#endif
+/** @}*/ // end of positioning
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_GPS_API_H_
diff --git a/vehicleservice/positioning/client/include/vehicle_service/POS_sensor_API.h b/vehicleservice/positioning/client/include/vehicle_service/POS_sensor_API.h
new file mode 100755
index 0000000..a7a35c4
--- /dev/null
+++ b/vehicleservice/positioning/client/include/vehicle_service/POS_sensor_API.h
@@ -0,0 +1,716 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_SENSOR_API_H_
+#define POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_SENSOR_API_H_
+/**
+ * @file POS_sensor_API.h
+ * @brief API definition file for Sensor function
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning
+ * @ingroup vehicle_service
+ * @{
+ */
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/POS_define.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* POSITIONING_DID */
+#define POS_DID_SPEED_PULSE 0x80000012 //!< \~english Data ID of speed pulse
+#define POS_DID_SPEED_KMPH 0x80000013 //!< \~english Data ID of KMPH speed
+#define POS_DID_SNS_COUNTER 0x8000001A
+//!< \~english Data ID of sensor counter
+#define POS_DID_GYRO_X 0x80000014 //!< \~english Data ID of X axis gyro
+#define POS_DID_GYRO_Y 0x80000085 //!< \~english Data ID of Y axis gyro
+#define POS_DID_GYRO_Z 0x80000086 //!< \~english Data ID of Z axis gyro
+#define POS_DID_GYRO POS_DID_GYRO_X
+//!< \~english Data ID of POS_DID_GYRO is same as POS_DID_GYRO_X
+#define POS_DID_GSNS_X 0x80000015 //!< \~english Data ID of x axis gsensor
+#define POS_DID_GSNS_Y 0x80000016 //!< \~english Data ID of Y axis gsensor
+#define POS_DID_GSNS_Z 0x80000026 //!< \~english Data ID of Z axis gsensor
+#define POS_DID_REV 0x80000017 //!< \~english Data ID of reverse signal
+#define POS_DID_GPS_ANTENNA 0x80000019
+//!< \~english Data ID of GPS antenna status
+#define POS_DID_SPEED_PULSE_FST 0x80000028
+//!< \~english Data ID of first time speed pulse
+#define POS_DID_GYRO_X_FST 0x80000029 //!< \~english Data ID of first time X axis gyro
+#define POS_DID_GYRO_Y_FST 0x80000043 //!< \~english Data ID of first time Y axis gyro
+#define POS_DID_GYRO_Z_FST 0x80000023 //!< \~english Data ID of first time Z axis gyro
+#define POS_DID_GYRO_FST POS_DID_GYRO_X_FST
+//!< \~~english Data ID of POS_DID_GYRO_FST is same as POS_DID_GYRO_X_FST
+#define POS_DID_REV_FST 0x8000007E
+//!< \~english Data ID of first time reverse signal
+#define POS_DID_GYRO_TEMP 0x80000090 //!< \~english Data ID of gyro temperature
+#define POS_DID_GYRO_TEMP_FST 0x80000091
+//!< \~english Data ID of first time gyro temperature
+#define POS_DID_GSNS_X_FST 0x80000087
+//!< \~english Data ID of first time x axis gsensor
+#define POS_DID_GSNS_Y_FST 0x80000088
+//!< \~english Data ID of first time Y axis gsensor
+#define POS_DID_GSNS_Z_FST 0x80000089
+//!< \~english Data ID of first time Z axis gsensor
+#define POS_DID_PULSE_TIME 0x8000003A //!< \~english Data ID of pulse time
+
+#define POS_DID_GPS__CWORD82__NMEA 0x80000030U
+//!< \~english Data ID of _CWORD82_ GPS NMEA sentence
+#define POS_DID_GPS__CWORD82___CWORD44_GP4 0x80000031U
+//!< \~english Data ID of _CWORD82_ GPS _CWORD44_GP4 data
+#define POS_DID_GPS__CWORD82__FULLBINARY 0x80000032U
+//!< \~english Data ID of _CWORD82_ GPS full binary data
+#define POS_DID_GPS_NMEA 0x8000009AU
+//!< \~english Data ID of GPS NMEA sentence
+#define POS_DID_GPS_CLOCK_DRIFT 0x800000B3U
+//!< \~english Data ID of GPS time drift data
+#define POS_DID_GPS_CLOCK_FREQ 0x800000B4U
+//!< \~english Data ID of GPS time frequency data
+
+/**
+ * \~english @brief Delivery sensor extra package command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_PKG_SENSOR_DATA, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_PKG_SENSOR_DATA 0x0700
+
+/**
+ * \~english @brief Delivery sensor information command ID
+ * \~english @brief If you want to catch above envents, use NSFW like below.
+ * \~english @code
+ * l_eStatus = FrameworkUnifiedAttachCallbackToDispatcher(h_app, POS_NTFY_SEND_THREAD, CID_POSIF_REGISTER_LISTENER_SENSOR_DATA, CBCallbackA);
+ * @endcode
+ */
+#define CID_POSIF_REGISTER_LISTENER_SENSOR_DATA 0x0200
+
+#define SENSOR_MSGBUF_DSIZE 4096
+//!< \~english message body maximum size
+
+#define SENSOR_VSHEAD_DSIZE 36
+//!< \~english vehicle sensor header size(1+3+16*2)
+
+#define SENSOR_VSINFO_DSIZE (SENSOR_MSGBUF_DSIZE - SENSOR_VSHEAD_DSIZE)
+//!< \~english vehicle sensor data size
+
+// Same name/value is defined, but client doesn't include HAL header.
+// It defines SENSOR_MSG_VSINFO_DSIZE if not included HAL.
+#ifndef HAL_API_POSITIONING_HAL_H_
+#define SENSOR_MSG_VSINFO_DSIZE 1904u
+//!< \~english vehicle sensor message body maximum size
+#endif
+
+#define SENSOR_PKG_DELIVERY_MAX 16
+//!< \~english number of data ID per a package
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @struct SENSOR_PKG_MSG_VSINFO
+ * \~english positioning sensor notification message (to User)
+ */
+typedef struct {
+ uint8_t ucDNum; //!< \~english number of data
+ uint8_t ucDataBreak; //!< \~english data lack infomation
+ uint8_t ucDivideCnt; //!< \~english total partition
+ uint8_t ucDivideSendCnt; //!< \~english partition transmit count
+ uint16_t usOffset[SENSOR_PKG_DELIVERY_MAX]; //!< \~english offset
+ uint8_t ucData[SENSOR_VSINFO_DSIZE]; //!< \~english data body
+} SENSOR_PKG_MSG_VSINFO;
+
+/**
+ * @struct SENSOR_MSG_VSINFO
+ * \~english message delivery positioning sensor information
+ */
+typedef struct {
+ DID did; //!< \~english data ID
+ uint16_t size; //!< \~english data size
+ uint8_t rcvFlag; //!< \~english reception flag
+ uint8_t reserve; //!< \~english reserve
+ uint8_t data[SENSOR_MSG_VSINFO_DSIZE]; //!< \~english data body
+} SENSOR_MSG_VSINFO;
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+/* SENSOR_API public API */
+#ifdef __cplusplus
+extern "C" {
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Send the extra package when first delivery.
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ucPkgNum
+/// - uint8_t - data number in package(1 to 16)
+/// \~english @param [in] pulDid
+/// - DID * - buffer pointer of the data ID array in package
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+///
+/// \~english @par
+/// - data number in package(ucPkgNum) \n
+/// The following 8 data ID can be registered. And the register data number range is 1~16.
+/// - buffer pointer of the data ID array in package(pulDid) \n
+/// The data ID set to the first in pulDid is the delivery key. \n
+/// If the data ID not one of the following be set, return SENSOR_RET_ERROR_PARAM.
+/// - POS_DID_SNS_COUNTER - sensor counter
+/// - POS_DID_GYRO_X - gyro output (X axis)
+/// - POS_DID_GYRO_Y - gyro output (Y axis)
+/// - POS_DID_GYRO_Z - gyro output (Z axis)
+/// - POS_DID_SPEED_PULSE - speed pulse
+/// - POS_DID_REV - REV signal(0:forward 1:backward)
+/// - POS_DID_GSNS_X - Gsensor output X axis
+/// - POS_DID_GSNS_Y - Gsensor output Y axis
+/// - POS_DID_GSNS_Z - Gsensor output Z axis
+/// - POS_DID_GYRO_TEMP - gyro temperature
+/// - POS_DID_PULSE_TIME - pulse time\n
+/// \~english @par
+/// - Because positioning is G/W between Navi and HAL, value depends on the design of HAL.
+/// \~english @par
+/// - Note:The Gsensor output is 0 in the environment without Gsensor hardware.\n
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register specified LonLat delivery
+/// - Please note that if the same data delivery has been registered for multiple times, \n
+/// the data will also be deliveried for registered multiple times.
+/// - The specified LonLat will be deliveried at register time no matter what delivery \n
+/// timing has been registered (first delivery).
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change Specified LonLat be deliveried only when it is changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update Specified Lonlat be deliveried as long as \n
+/// it is updated by vehicle sensor.
+///
+///
+/// \~english @retval SENSOR_RET_NORMAL normal end
+/// \~english @retval SENSOR_RET_ERROR_CREATE_EVENT event create failed
+/// \~english @retval SENSOR_RET_ERROR_PARAM parameter error
+/// \~english @retval SENSOR_RET_ERROR_INNER internal error
+/// \~english @retval SENSOR_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval SENSOR_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization \n
+/// (FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the Dispatcher for App are completed.
+/// - Availability of service positioning is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ucDeliveryTiming is neither update(SENSOR_DELIVERY_TIMING_UPDATE) \n
+/// nor change(SENSOR_DELIVERY_TIMING_CHANGE) [SENSOR_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ucPkgNum is 0 or it is larger than 16 [SENSOR_RET_ERROR_PARAM]
+/// - The parameter pulDid is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The data ID in paramter buffer pulDid is not avaliable value [SENSOR_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The event has been registered in event table and created in same process, \n
+/// but the count of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table and created in system, but the \n
+/// count of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, but memory for the thread event table \n
+/// creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, but the thread can not be registered in \n
+/// event table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, but memory for thread table creation \n
+/// allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, and the event flag has already been \n
+/// registered. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, and the event flag register failed. \n
+/// [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - No empty field for registering the event HANDLE into event table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Memory for event HANDLE get failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table and not finished registering \n
+/// [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table, and memory for thread table \n
+/// creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table, and the event flag has already been \n
+/// registered. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table, and the event flag register failed. \n
+/// [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - ProcessNo has not been registered in message control table when message transfered \n
+/// between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered in process. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer failed in process. [SENSOR_RET_ERROR_INNER]
+/// - The destination process name is NULL. [SENSOR_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message transfer \n
+/// between processes. [SENSOR_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer failed between processes. [SENSOR_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during event \n
+/// waiting. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The count of thread is reach to max in event management table during event \n
+/// waiting. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The EV_FLAG_BIT is not set in flagID during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The ID of message event queue has not been created during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The flagID has not been registered during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The interruption happened during event getting [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Whatever error happened during event getting. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Got event is SENSOR_RET_ERROR_INNER. [SENSOR_RET_ERROR_INNER]
+///
+/// \~english @par Detial
+/// - Call this API to register vehicle sensor data delivery. \n
+/// This API return the result of registering. \n
+/// The data from sensor data received to registering will be deliveried. \n
+/// The first delivery data is the sensor data(max 64 number of sensor counter, \n
+/// reverse signal,gyro temperature, max 640 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis), \n
+/// speed pulse,Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis), max 2048 number of pulse time) in 6.4 second. \n
+/// If the data number is more than max number, delivery the data in newest 6.4 second. \n
+/// If the sensor data accumulated more than max number, set VEHICLE_SNS_BREAK to data missing information. \n
+/// If sensor data number is more than the data number send in one time(10 number of \n
+/// sensor counter,reverse signal,gyro temperature, 100 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis), \n
+/// speed pulse, Gsensor output(X axis),Gsensor output(Y axis), Gsensor output(Z axis), 320 number of pulse time), \n
+/// the old data is divided into partitions(every partition with 10 number of sensor counter, \n
+/// reverse signal,gyro temperature, 100 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis), \n
+/// speed pulse,Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis), 320 number of pulse time) to delivery. \n
+/// The last message for first delivery is the message that the partition count equal to partition No. \n
+/// After first delivery, the message data(1 number of sensor counter,reverse signal, \n
+/// gyro temperature, 10 number of gyro output(X axis), gyro output(X axis), gyro output(Z axis),speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis), 32 number of pulse time) deliveried. \n
+/// And because the data missing information, divided partition count, \n
+/// diveided partition No is not used, they will be set to 0 in message.\n
+/// (sample)The sensor data in 6.4 second divided to delivery
+/// - 1st message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided \n
+/// partition count=7, divided partition No=1)
+/// - 2nd message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided \n
+/// partition count=7, divided partition No=2)
+/// - 3rd message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided \n
+/// partition count=7,divided partition No=3)
+/// - 4th message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided \n
+/// partition count=7,divided partition No=4)
+/// - 5th message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided \n
+/// partition count=7,divided partition No=5)
+/// - 6th message(sensor counter, reverse signal, gyro temperature=10 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=100 number, pulse time=320 number), divided \n
+/// partition count=7,divided partition No=6)
+/// - 7th message(sensor counter, reverse signal, gyro temperature=4 number, gyro output(X axis), gyro output(Y axis), gyro output(Z axis), speed pulse, \n
+/// Gsensor output(X axis), Gsensor output(Y axis), Gsensor output(Z axis)=40 number, pulse time=128 number), divided \n
+/// partition count=7,divided partition No=7)
+///
+/// \~english @par
+/// - Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After delivery the sensor data accumulated in 6.4 second(first delivery), the sensor data \n
+/// will not be accumulated any more. So the same data will be deliveried as first \n
+/// delivery when registered again.
+/// - This API is only called by Navi proxy.
+/// - After call this API, if the delivery destination thread name is changed, please call this API again.
+///
+/// \~english @par
+/// message structure
+/// - After success to register, vehicle sensor will send message as system API message with following format.
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_PKG_SENSOR_DATA \n
+/// Definition of structure
+/// \~english @code
+/// #define SENSOR_MSGBUF_DSIZE 4096 /* max size of message body */
+/// #define SENSOR_VSHEAD_DSIZE 36 /* vehicle sensor header size(1+3+16*2) */
+/// #define SENSOR_PKG_DELIVERY_MAX 16 /* max number of Data ID in package */
+/// #define SENSOR_VSINFO_DSIZE (SENSOR_MSGBUF_DSIZE - SENSOR_VSHEAD_DSIZE)
+/// typedef struct {
+/// uint8_t ucDNum; /* number of data */
+/// uint8_t ucDataBreak; /* data missing information */
+/// uint8_t ucDivideCnt; /* divided partition count */
+/// uint8_t ucDivideSendCnt; /* divided partition No. */
+/// uint16_t usOffset[SENSOR_PKG_DELIVERY_MAX]; /* offset */
+/// uint8_t ucData[SENSOR_VSINFO_DSIZE]; /* vehicle sensor data */
+/// } SENSOR_PKG_MSG_VSINFO;
+/// @endcode
+/// - number of data \n
+/// Data number in package
+/// - data missing information \n
+/// VEHICLE_SNS_BREAK:not continuous data \n
+/// VEHICLE_SNS_NORMAL:continuous data
+/// - divided partition count \n
+/// All divided partition count \n
+/// If it is more than 1, data divided to delivery
+/// - divided partition No. \n
+/// The No. of the divided partition. If it equal to the divided partition count, \n
+/// that meanings this message is the last divided partition of the package.
+/// - offset \n
+/// The array of the offset from the head of vehicle sensor data
+/// - vehicle sensor data
+/// - Data ID(4Byte)
+/// - Data size(2Byte)
+/// - reception flag(1Byte)
+/// - If the data get from CAN, direct line, GPS, set to 0x01
+/// - If data has not been received, set to 0x00
+/// - reserve(1Byte)\n
+/// - Data body is cycle fit with the packaged data.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - POS_RegisterListenerSensData, POS_GetSensData
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+SENSOR_RET_API POS_RegisterListenerPkgSensData(HANDLE hApp, PCSTR notifyName, uint8_t ucPkgNum, DID *pulDid,
+ uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Register sensor data delivery.
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] notifyName
+/// - PCSTR - Destination thread name
+/// \~english @param [in] ulDid
+/// - DID - Data ID of vehicle info
+/// \~english @param [in] ucCtrlFlg
+/// - uint8_t - Delivery control flag(register)
+/// \~english @param [in] ucDeliveryTiming
+/// - uint8_t - Delivery timing(change/update)
+///
+/// \~english @par
+/// - Data ID of vehicle info(ulDid) \n
+///
+/// \~english @par
+/// - Note:The Gsensor output is 0 in the environment without Gsensor hardware.
+/// \~english @par
+/// - Delivery control flag(ucCtrlFlg)
+/// - SENSOR_DELIVERY_REGIST - register
+/// - Register specified LonLat delivery
+/// - Please note that if the same data delivery has been registered for multiple times, \n
+/// the data will also be deliveried for registered multiple times.
+/// - The specified LonLat will be deliveried at register time no matter what delivery \n
+/// timing has been registered (first delivery).
+/// - Delivery timing(ucDeliveryTiming)
+/// - SENSOR_DELIVERY_TIMING_CHANGE - change Specified LonLat be deliveried only when it is changed.
+/// - SENSOR_DELIVERY_TIMING_UPDATE - update Specified Lonlat be deliveried \n
+/// as long as it is updated by vehicle sensor.
+///
+/// \~english @retval SENSOR_RET_NORMAL normal end
+/// \~english @retval SENSOR_RET_ERROR_CREATE_EVENT event create failed
+/// \~english @retval SENSOR_RET_ERROR_PARAM parameter error
+/// \~english @retval SENSOR_RET_ERROR_INNER internal error
+/// \~english @retval SENSOR_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval SENSOR_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the Dispatcher for App are completed.
+/// - Availability of service positioning is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter ucDeliveryTiming is neither update \n
+/// (SENSOR_DELIVERY_TIMING_UPDATE) nor change(SENSOR_DELIVERY_TIMING_CHANGE) [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ucCtrlFlg is not register(SENSOR_DELIVERY_REGIST) [SENSOR_RET_ERROR_PARAM]
+/// - The parameter hApp is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter notifyName is NULL [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ulDID is not avaliable value [SENSOR_RET_ERROR_PARAM]
+/// - The parameter ulDID is a value can not specified [SENSOR_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [SENSOR_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to \n
+/// max [SENSOR_RET_ERROR_RESOURCE]
+/// - The event has been registered in event table and created in same process, \n
+/// but the count of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table and created in system, but the count \n
+/// of reference is reach to max [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, but memory for the thread event table \n
+/// creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, but the thread can not be registered \n
+/// in event table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, but memory for thread table creation \n
+/// allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, and the event flag has already been \n
+/// registered. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has been registered in event table, and the event flag register failed. \n
+/// [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - No empty field for registering the event HANDLE into event table. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Memory for event HANDLE get failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table and not finished registering \n
+/// [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table, and memory for thread table \n
+/// creation allocate falied. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table, and the event flag has already \n
+/// been registered. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The event has not been registered in event table, and the event flag register \n
+/// failed. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - ProcessNo has not been registered in message control table when message transfered \n
+/// in process. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed when message transfered in process. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer failed in process. [SENSOR_RET_ERROR_INNER]
+/// - The destination process name is NULL. [SENSOR_RET_ERROR_INNER]
+/// - The destination process name size is larger than 20 characters when message \n
+/// transfer between process. [SENSOR_RET_ERROR_INNER]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between process. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE create failed when message transfered between process. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between process. [SENSOR_RET_ERROR_INNER]
+/// - Message transfer failed between process. [SENSOR_RET_ERROR_INNER]
+/// - Specified event HANDLE has not been registered in event HANDLE table during waiting \n
+/// event. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The count of thread is reach to max in event management table during waiting \n
+/// event. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The EV_FLAG_BIT is not set in flagID during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The ID of message event queue has not been created during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The flagID has not been registered during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - The interruption happened during getting event [SENSOR_RET_ERROR_CREATE_EVENT]
+/// - Whatever error happened during getting event. [SENSOR_RET_ERROR_CREATE_EVENT]
+///
+/// \~english @par Detial
+/// - Call this API to register vehicle sensor data delivery. \n
+/// This API return the result of registering.
+///
+/// \~english @par
+/// Please note the following points when use this API.
+/// - Duplication registering
+/// - The same destination thread name has already been registered
+/// - The registered delivery data updated and normal return.(first delivery)
+/// - To one delivery destination, the same data will not be duplication deliveried at same timing.
+/// - After call this API, if the delivery destination thread name is changed, please call this API again.
+///
+/// \~english @par
+/// message structure
+/// - After success to register, vehicle sensor will send message as system API message with following format.
+/// - If the register successed, certainly delivery first data. And then delivery data according to
+/// the delivery timing. \n
+/// Command ID : @ref CID_POSIF_REGISTER_LISTENER_SENSOR_DATA \n
+///
+/// \~english @code
+/// #define SENSOR_MSG_VSINFO_DSIZE 1904 /* max size of message body */
+/// typedef struct
+/// {
+/// DID did; /* data ID */
+/// uint16_t size; /* data size of vehicle sensor data */
+/// uint8_t rcvFlag; /* reception flag */
+/// uint8_t reserve; /* reserve */
+/// uint8_t data[SENSOR_MSG_VSINFO_DSIZE]; /* vehicle sensor data */
+/// } SENSOR_MSG_VSINFO;
+/// @endcode
+/// - reception flag(1Byte)
+/// - If the data get from CAN or direct line, set to 0x01
+/// - If data has not been received, set to 0x00
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Method
+///
+/// \~english @see
+/// - POS_RegisterListenerPkgSensData, POS_GetSensData
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+SENSOR_RET_API POS_RegisterListenerSensData(HANDLE hApp, PCSTR notifyName, DID ulDid, uint8_t ucCtrlFlg,
+ uint8_t ucDeliveryTiming);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup tag_Positioning
+/// \~english @par Brief
+/// - Get vehicle sensor data.
+///
+/// \~english @param [in] hApp
+/// - HANDLE - App Handle
+/// \~english @param [in] ulDid
+/// - DID - Data ID of vehicle info
+/// \~english @param [out] pDestData
+/// - void* - pointer of buffer for storing vehicle sensor data
+/// \~english @param [in] usDestSize
+/// - uint16_t - vehicle sensor data buffer size
+///
+/// \~english @par
+/// - Data ID of vehicle info(ulDid)
+/// - POS_DID_SPEED_PULSE - speed pulse(count of pulse)
+/// - POS_DID_GYRO_X - gyro output (X axis)
+/// - POS_DID_GYRO_Y - gyro output (Y axis)
+/// - POS_DID_GYRO_Z - gyro output (Z axis)
+/// - POS_DID_GSNS_X - Gsensor output (X axis)
+/// - POS_DID_GSNS_Y - Gsensor output (Y axis)
+/// - POS_DID_GSNS_Z - Gsensor output (Z axis)
+/// - POS_DID_GPS_ANTENNA - GPS antenna connection status
+/// - POS_DID_GPS__CWORD82__NMEA - GPS NMEA(_CWORD82_)
+/// - POS_DID_GPS__CWORD82__FULLBINARY - GPS _CWORD82_ full binary(_CWORD82_)
+/// - POS_DID_GPS_NMEA - GPS NMEA
+/// - POS_DID_GYRO_TEMP - gyro temperature
+/// - POS_DID_GPS_CLOCK_DRIFT - GPS clock drift
+/// - POS_DID_GPS_CLOCK_FREQ - GPS clock frequency
+/// - The avaliable data ID of each hardware type is as following.
+/// \~english @par
+/// - Because positioning is G/W between Navi and HAL, value depends on the design of HAL.
+/// \~english @par
+/// - Note:The Gsensor output is 0 in the environment without Gsensor hardware.
+/// - vehicle sensor data buffer size(usDestSize) \n
+/// Please note it is the size of output buffer, not the size of data.
+///
+/// \~english @retval more than 0 data size
+/// \~english @retval POS_RET_ERROR_CREATE_EVENT event create failed
+/// \~english @retval POS_RET_ERROR_OUTOF_MEMORY share memory guarantee failed
+/// \~english @retval POS_RET_ERROR_PARAM parameter error
+/// \~english @retval POS_RET_ERROR_SIZE buffer size error
+/// \~english @retval POS_RET_ERROR_INNER internal error
+/// \~english @retval POS_RET_ERROR_NOSUPPORT unsupported
+/// \~english @retval POS_RET_ERROR_RESOURCE lack of resource
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) \n
+/// of the Dispatcher for App are completed.
+/// - Availability of service positioning is TRUE.
+///
+/// \~english @par change of internal status
+/// - There is no change of internal status
+///
+/// \~english @par Failure condition
+/// - The parameter hApp is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter pDestData is NULL [POS_RET_ERROR_PARAM]
+/// - The parameter ulDid is not avaliable value in current hardware environment [POS_RET_ERROR_PARAM]
+/// - The count of message in message queue is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of mutex is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The count of item in ProcessName-ProcessNo convert table is reach to max [POS_RET_ERROR_RESOURCE]
+/// - The event is created in same process, but the count of reference is reach to max \n
+/// [POS_RET_ERROR_CREATE_EVENT]
+/// - The event is created in system, but the count of reference is reach to max [POS_RET_ERROR_CREATE_EVENT]
+/// - Memory allocate falied during the event table creation for \n
+/// event registering. [POS_RET_ERROR_CREATE_EVENT]
+/// - The thread can not register in the event table. [POS_RET_ERROR_CREATE_EVENT]
+/// - Memory allocate failed in event table during the thread table creation. [POS_RET_ERROR_CREATE_EVENT]
+/// - After register the thread table in event table, the event flag has already \n
+/// been registered. [POS_RET_ERROR_CREATE_EVENT]
+/// - After register the thread table in event table, the event flag register \n
+/// failed. [POS_RET_ERROR_CREATE_EVENT]
+/// - The event table is full during event creation. [POS_RET_ERROR_CREATE_EVENT]
+/// - The memory for event HANDLE allocate failed during event table creation. [POS_RET_ERROR_CREATE_EVENT]
+/// - The thread can not be registered in event table. [POS_RET_ERROR_CREATE_EVENT]
+/// - In event table, to allocate the memory of the thread table creation, \n
+/// but failed. [POS_RET_ERROR_CREATE_EVENT]
+/// - After register the thread in event table, the event flag has already been \n
+/// registered. [POS_RET_ERROR_CREATE_EVENT]
+/// - After register the thread in event table, the event flag register failed. [POS_RET_ERROR_CREATE_EVENT]
+/// - Specified event ID has not been registered in table. [POS_RET_ERROR_CREATE_EVENT]
+/// - Initialize event object failed. [POS_RET_ERROR_CREATE_EVENT]
+/// - There is no empty field in semaphore table for semaphore creation [POS_RET_ERROR_OUTOF_MEMORY]
+/// - The memory for storing semaphore control data allocate failed. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Specified semaphore ID has not been registered when semaphore lock. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Internal mutex HANDLE is NULL when mutex lock. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Internal mutex HANDLE has not been registered in mutex table when mutex lock. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - The owner of specified mutex is not itself when mutex lock. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Mutex has been multiple locked [POS_RET_ERROR_OUTOF_MEMORY]
+/// - The HANDLE is NULL when getting usable share memory address. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Can not get usable share memory address. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Memory allocate failed for share memory map. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Memory allocate failed for share memory management. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Can not open share memory. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Failed to mapping share memory. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - No empty field in share memory. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - ProcessNo has not been registered in message control table when message \n
+/// transfered between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - Message transfer HANDLE get failed when message transfered between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - Message transfer failed between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - The destination process name size is larger than 20 characters when message \n
+/// transfer between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - The message queue name has not been registered in control table when message \n
+/// transfer between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - Message transfer HANDLE create failed when message transfered between processes. \n
+/// [POS_RET_ERROR_CREATE_EVENT]
+/// - Message transfer HANDLE get failed from internal table when message transfered \n
+/// between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - Message transfer failed between processes. [POS_RET_ERROR_CREATE_EVENT]
+/// - Specified event HANDLE has not been registered in event HANDLE table during \n
+/// event waiting. [POS_RET_ERROR_INNER]
+/// - The count of thread is reach to max in event management table during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during event waiting. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during event waiting. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during event waiting. [POS_RET_ERROR_INNER]
+/// - The interruption happened during event waiting [POS_RET_ERROR_INNER]
+/// - Whatever error happened during event waiting. [POS_RET_ERROR_INNER]
+/// - The EV_FLAG_BIT is not set in flagID during getting event. [POS_RET_ERROR_INNER]
+/// - The ID of message event queue has not been created during getting event. [POS_RET_ERROR_INNER]
+/// - The flagID has not been registered during getting event. [POS_RET_ERROR_INNER]
+/// - The interruption happened during getting event [POS_RET_ERROR_INNER]
+/// - Whatever error happened during getting event. [POS_RET_ERROR_INNER]
+/// - The HANDLE is NULL when getting usable share memory address for accessing \n
+/// received data. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Can not get usable share memory address for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Memory for share memory map allocate failed for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Memory for share memory management allocate failed for accessing received \n
+/// data. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Can not open share memory for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Failed to mapping share memory for accessing received data. [POS_RET_ERROR_OUTOF_MEMORY]
+/// - Can not get share memory normally [POS_RET_ERROR_OUTOF_MEMORY]
+/// - The size of data stored in share memory is larger than the size of received data. [POS_RET_ERROR_SIZE]
+///
+/// \~english @par Detial
+/// - Call this API to get vehicle sensor data. \n
+/// This vehicle sensor data stored in the output buffer of the parameter, this API return.
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+/// \~english @see
+/// - POS_RegisterListenerPkgSensData, POS_RegisterListenerSensData
+///
+
+POS_RET_API POS_GetSensData(HANDLE hApp, DID ulDid, void *pDestData, uint16_t usDestSize);
+
+#ifdef __cplusplus
+}
+#endif
+/** @}*/ // end of positioning
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_CLIENT_INCLUDE_VEHICLE_SERVICE_POS_SENSOR_API_H_
diff --git a/vehicleservice/positioning/client/include/vehicle_service/positioning.h b/vehicleservice/positioning/client/include/vehicle_service/positioning.h
new file mode 100755
index 0000000..a5a1e56
--- /dev/null
+++ b/vehicleservice/positioning/client/include/vehicle_service/positioning.h
@@ -0,0 +1,46 @@
+//
+// @copyright Copyright (c) 2017-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.
+//
+
+
+#ifndef VEHICLESERVICE_POSITIONING_H_ // NOLINT(build/header_guard)
+#define VEHICLESERVICE_POSITIONING_H_ // NOLINT(build/header_guard)
+
+/**
+ * @file positioning.h
+ * @brief Common header of positioning
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning
+ * @ingroup vehicle_service
+ * @{
+ */
+
+#include <vehicle_service/POS_define.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/POS_gps_API.h>
+#include <vehicle_service/POS_common_API.h>
+
+/** @}*/ // end of positioning
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // VEHICLESERVICE_POSITIONING_H_
diff --git a/vehicleservice/positioning/client/src/POS_common_API/Common_API.cpp b/vehicleservice/positioning/client/src/POS_common_API/Common_API.cpp
new file mode 100755
index 0000000..f266dec
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_common_API/Common_API.cpp
@@ -0,0 +1,889 @@
+/*
+ * @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
+ * Common_API.cpp
+ * @brief
+ * Module : POSITIONING
+ * Common I/F service functionality
+ */
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_define.h>
+#include <vehicle_service/POS_common_API.h>
+#include "POS_common_private.h"
+#include "Vehicle_API_private.h"
+#include "POS_private.h"
+
+/**
+ * @brief
+ * Latitude and longitude informationDelivery registration
+ *
+ * Registering Latitude and Longitude Information Delivery
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] notifyName PCSTR - Destination thread name
+ * @param[in] ucCtrlFlg uint8_t - Delivery control(Delivery registration/Delivery stop/Resume delivery)
+ * @param[in] ucDeliveryTiming uint8_t - Delivery timing(Changing/Updating)
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_BUFFULL Buffer-full<br>
+ * POS_RET_ERROR_INNER Internal error<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_RegisterListenerLonLat(HANDLE hApp, // NOLINT(readability/nolint)
+ PCSTR notifyName, // NOLINT(readability/nolint)
+ uint8_t ucCtrlFlg, // NOLINT(readability/nolint)
+ uint8_t ucDeliveryTiming, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ SENSOR_RET_API ret_sens = SENSOR_RET_NORMAL; /* API return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_LOCATION_LONLAT; /* Data ID */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Change delivery timing,Terminate as a parameter error except update */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ucCtrlFlg != SENSOR_DELIVERY_REGIST) {
+ /* Parameters other than delivery registration are terminated abnormally when delivery control is terminated. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (notifyName == NULL) {
+ /* If the thread name is NULL, it terminates with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ if (ucGetMethod == SENSOR_GET_METHOD_GPS) {
+ did = VEHICLE_DID_LOCATION_LONLAT;
+ } else if ((ucGetMethod == SENSOR_GET_METHOD_NAVI) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_LOCATION_LONLAT_NAVI;
+ } else {
+ /* End as a parameter error abnormality except for GPS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Delivery registration */
+ if (ret == POS_RET_NORMAL) {
+ /* Delivery registry SensorAPI calls */
+ ret_sens = PosRegisterListenerProc(notifyName, /* Destination thread name */
+ did, /* Data ID */
+ ucCtrlFlg, /* Delivery control */
+ ucDeliveryTiming); /* Delivery timing */
+
+ /* Decision of delivery registration result */
+ if (ret_sens == SENSOR_RET_NORMAL) {
+ ret = POS_RET_NORMAL;
+ } else if (ret_sens == SENSOR_RET_ERROR_PARAM) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ret_sens == SENSOR_RET_ERROR_BUFFULL) {
+ ret = POS_RET_ERROR_BUFFULL;
+ } else if (ret_sens == SENSOR_RET_ERROR_RESOURCE) {
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Altitude information delivery registration
+ *
+ * Register for the delivery of altitude information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] notifyName PCSTR - Destination thread name
+ * @param[in] ucCtrlFlg uint8_t - Delivery control(Delivery registration/Delivery stop/Resume delivery)
+ * @param[in] ucDeliveryTiming uint8_t - Delivery timing(Changing/Updating)
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_RegisterListenerAltitude(HANDLE hApp, // NOLINT(readability/nolint)
+ PCSTR notifyName, // NOLINT(readability/nolint)
+ uint8_t ucCtrlFlg, // NOLINT(readability/nolint)
+ uint8_t ucDeliveryTiming, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ SENSOR_RET_API ret_sens = SENSOR_RET_NORMAL; /* API return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_LOCATION_ALTITUDE; /* Data ID */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Change delivery timing,Terminate as a parameter error except update */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ucCtrlFlg != SENSOR_DELIVERY_REGIST) {
+ /* Parameters other than delivery registration are terminated abnormally when delivery control is terminated. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (notifyName == NULL) {
+ /* If the thread name is NULL, it terminates with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ if ((ucGetMethod == SENSOR_GET_METHOD_GPS) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_LOCATION_ALTITUDE;
+ } else {
+ /* End as a parameter error abnormality except for GPS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Delivery registration */
+ if (ret == POS_RET_NORMAL) {
+ /* Delivery registry SensorAPI calls */
+ ret_sens = PosRegisterListenerProc(notifyName, /* Destination thread name */
+ did, /* Data ID */
+ ucCtrlFlg, /* Delivery control */
+ ucDeliveryTiming); /* Delivery timing */
+
+ /* Decision of delivery registration result */
+ if (ret_sens == SENSOR_RET_NORMAL) {
+ ret = POS_RET_NORMAL;
+ } else if (ret_sens == SENSOR_RET_ERROR_PARAM) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ret_sens == SENSOR_RET_ERROR_BUFFULL) {
+ ret = POS_RET_ERROR_BUFFULL;
+ } else if (ret_sens == SENSOR_RET_ERROR_RESOURCE) {
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Vehicle Speed Information Transmission Registration
+ *
+ * Register delivery of vehicle speed information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] notifyName PCSTR - Destination thread name
+ * @param[in] ucCtrlFlg uint8_t - Delivery control(Delivery registration/Delivery stop/Resume delivery)
+ * @param[in] ucDeliveryTiming uint8_t - Delivery timing(Changing/Updating)
+ * @param[in] ucGetMethod uint8_t - Acquisition method(POS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_BUFFULL Buffer-full<br>
+ * POS_RET_ERROR_INNER Internal error<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_RegisterListenerSpeed(HANDLE hApp, // NOLINT(readability/nolint)
+ PCSTR notifyName, // NOLINT(readability/nolint)
+ uint8_t ucCtrlFlg, // NOLINT(readability/nolint)
+ uint8_t ucDeliveryTiming, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ SENSOR_RET_API ret_sens = SENSOR_RET_NORMAL; /* API return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did; /* Data ID */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Change delivery timing,Terminate as a parameter error except update */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ucCtrlFlg != SENSOR_DELIVERY_REGIST) {
+ /* Parameters other than delivery registration are terminated abnormally when delivery control is terminated. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (notifyName == NULL) {
+ /* If the thread name is NULL, it terminates with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ if (ucGetMethod == SENSOR_GET_METHOD_POS) {
+ did = VEHICLE_DID_MOTION_SPEED_INTERNAL;
+ } else if ((ucGetMethod == SENSOR_GET_METHOD_NAVI) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_MOTION_SPEED_NAVI;
+ } else {
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Delivery registration */
+ if (ret == POS_RET_NORMAL) {
+ /* Delivery registry SensorAPI calls */
+ ret_sens = PosRegisterListenerProc(notifyName, /* Destination thread name */
+ did, /* Data ID */
+ ucCtrlFlg, /* Delivery control */
+ ucDeliveryTiming); /* Delivery timing */
+
+ /* Decision of delivery registration result */
+ if (ret_sens == SENSOR_RET_NORMAL) {
+ ret = POS_RET_NORMAL;
+ } else if (ret_sens == SENSOR_RET_ERROR_PARAM) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ret_sens == SENSOR_RET_ERROR_BUFFULL) {
+ ret = POS_RET_ERROR_BUFFULL;
+ } else if (ret_sens == SENSOR_RET_ERROR_RESOURCE) {
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Compass Information Transmission Register
+ *
+ * Register the delivery of the vehicle orientation information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] notifyName PCSTR - Destination thread name
+ * @param[in] ucCtrlFlg uint8_t - Delivery control(Delivery registration/Delivery stop/Resume delivery)
+ * @param[in] ucDeliveryTiming uint8_t - Delivery timing(Changing/Updating)
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_RegisterListenerHeading(HANDLE hApp, // NOLINT(readability/nolint)
+ PCSTR notifyName, // NOLINT(readability/nolint)
+ uint8_t ucCtrlFlg, // NOLINT(readability/nolint)
+ uint8_t ucDeliveryTiming, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ SENSOR_RET_API ret_sens = SENSOR_RET_NORMAL; /* API return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_MOTION_HEADING; /* TODO VEHICLE_DID_LOCATION_HEADING Missing */
+ /* Data ID */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Change delivery timing,Terminate as a parameter error except update */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ucCtrlFlg != SENSOR_DELIVERY_REGIST) {
+ /* Parameters other than delivery registration are terminated abnormally when delivery control is terminated. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (notifyName == NULL) {
+ /* If the thread name is NULL, it terminates with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ if (ucGetMethod == SENSOR_GET_METHOD_GPS) {
+ did = VEHICLE_DID_MOTION_HEADING;
+ } else if ((ucGetMethod == SENSOR_GET_METHOD_NAVI) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_MOTION_HEADING_NAVI;
+ } else {
+ /* End as a parameter error abnormality except for GPS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Delivery registration */
+ if (ret == POS_RET_NORMAL) {
+ /* Delivery registry SensorAPI calls */
+ ret_sens = PosRegisterListenerProc(notifyName, /* Destination thread name */
+ did, /* Data ID */
+ ucCtrlFlg, /* Delivery control */
+ ucDeliveryTiming); /* Delivery timing */
+
+ /* Decision of delivery registration result */
+ if (ret_sens == SENSOR_RET_NORMAL) {
+ ret = POS_RET_NORMAL;
+ } else if (ret_sens == SENSOR_RET_ERROR_PARAM) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ret_sens == SENSOR_RET_ERROR_BUFFULL) {
+ ret = POS_RET_ERROR_BUFFULL;
+ } else if (ret_sens == SENSOR_RET_ERROR_RESOURCE) {
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Get Lltitude and longitude information
+ *
+ * Get Lltitude and longitude information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] dat SENSORLOCATION_LONLATINFO_DAT* - Pointer to the acquired latitude/longitude information storage destination
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment<br>
+ * POS_RET_ERROR_INNER Internal error
+ *
+ */
+POS_RET_API POS_GetLonLat(HANDLE hApp, // NOLINT(readability/nolint)
+ SENSORLOCATION_LONLATINFO_DAT *dat, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_LOCATION_LONLAT; /* DID */
+ int32_t ret_get_proc; /* POS_GetProc Return Values */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (dat == NULL) {
+ /* If the longitude/latitude data is NULL, it ends with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ if (ucGetMethod == SENSOR_GET_METHOD_GPS) {
+ did = VEHICLE_DID_LOCATION_LONLAT;
+ } else if ((ucGetMethod == SENSOR_GET_METHOD_NAVI) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_LOCATION_LONLAT_NAVI;
+ } else {
+ /* End as a parameter error abnormality except for GPS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Sensor information acquisition */
+ if (ret == POS_RET_NORMAL) {
+ /* Data acquisition process */
+ ret_get_proc = PosGetProc(did, reinterpret_cast<void *>(dat), sizeof(SENSORLOCATION_LONLATINFO_DAT));
+ if (static_cast<int32_t>(sizeof(SENSORLOCATION_LONLATINFO_DAT)) > ret_get_proc) {
+ /* Failed to acquire */
+ if (ret_get_proc == POS_RET_ERROR_RESOURCE) {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosGetProc ERROR [ret = %d]", ret);
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Altitude information acquisition
+ *
+ * Obtain altitude information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] dat SENSORLOCATION_ALTITUDEINFO_DAT* - Pointer to the acquired altitude information storage destination
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment<br>
+ * POS_RET_ERROR_INNER Internal error
+ *
+ */
+POS_RET_API POS_GetAltitude(HANDLE hApp, // NOLINT(readability/nolint)
+ SENSORLOCATION_ALTITUDEINFO_DAT *dat, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_LOCATION_ALTITUDE; /* DID */
+ int32_t ret_get_proc; /* POS_GetProc Return Values */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (dat == NULL) {
+ /* If the altitude data is NULL, it terminates with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ if ((ucGetMethod == SENSOR_GET_METHOD_GPS) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_LOCATION_ALTITUDE;
+ } else {
+ /* End as a parameter error abnormality except for GPS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+ /* Sensor information acquisition */
+ if (ret == POS_RET_NORMAL) {
+ /* Data acquisition process */
+ ret_get_proc = PosGetProc(did, reinterpret_cast<void *>(dat), sizeof(SENSORLOCATION_ALTITUDEINFO_DAT));
+ if (static_cast<int32_t>(sizeof(SENSORLOCATION_ALTITUDEINFO_DAT)) > ret_get_proc) {
+ /* Failed to acquire */
+ if (ret_get_proc == POS_RET_ERROR_RESOURCE) {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosGetProc ERROR [ret = %d]", ret);
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Vehicle Speed Information Acquisition
+ *
+ * Obtain vehicle speed information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] dat SENSORMOTION_SPEEDINFO_DAT* - Pointer to the acquired car speed information storage destination
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment<br>
+ * POS_RET_ERROR_INNER Internal error
+ *
+ */
+POS_RET_API POS_GetSpeed(HANDLE hApp, // NOLINT(readability/nolint)
+ SENSORMOTION_SPEEDINFO_DAT *dat, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did; /* Data ID */
+ int32_t ret_get_proc; /* POS_GetProc Return Values */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+ if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [hApp = %p]", hApp);
+ } else if (dat == NULL) {
+ /* When the pointer to the vehicle speed data storage destination is NULL, the pointer terminates with an error in the parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [dat = %p]", dat);
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ if (ucGetMethod == SENSOR_GET_METHOD_POS) {
+ did = VEHICLE_DID_MOTION_SPEED_INTERNAL;
+ } else if ((ucGetMethod == SENSOR_GET_METHOD_NAVI) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_MOTION_SPEED_NAVI;
+ } else {
+ /* End as a parameter error abnormality except for POS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "Argument ERROR [type = %d, ucGetMethod = %d]",
+ type, ucGetMethod);
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "GetEnvSupportInfo ERROR [type = %d]", type);
+ }
+ }
+
+ if (ret == POS_RET_NORMAL) {
+ /* Data acquisition process */
+ ret_get_proc = PosGetProc(did, dat, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+ if (static_cast<int32_t>(sizeof(SENSORMOTION_SPEEDINFO_DAT)) > ret_get_proc) {
+ /* Failed to acquire */
+ if (ret_get_proc == POS_RET_ERROR_RESOURCE) {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosGetProc ERROR [ret = %d]", ret);
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Compass information acquisition
+ *
+ * Get Bill Direction Information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] dat SENSORMOTION_HEADINGINFO_DAT* - Pointer to the acquired altitude information storage destination
+ * @param[in] ucGetMethod uint8_t - Acquisition method(GPS/Navigation/Not specified)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment<br>
+ * POS_RET_ERROR_INNER Internal error
+ *
+ */
+POS_RET_API POS_GetHeading(HANDLE hApp, // NOLINT(readability/nolint)
+ SENSORMOTION_HEADINGINFO_DAT *dat, // NOLINT(readability/nolint)
+ uint8_t ucGetMethod) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_MOTION_HEADING; /* Data ID */
+ int32_t ret_get_proc; /* POS_GetProc Return Values */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (dat == NULL) {
+ /* If the longitude/latitude data is NULL, it ends with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ if (ucGetMethod == SENSOR_GET_METHOD_GPS) {
+ did = VEHICLE_DID_MOTION_HEADING;
+ } else if ((ucGetMethod == SENSOR_GET_METHOD_NAVI) ||
+ (ucGetMethod == SENSOR_GET_METHOD_AUTO)) {
+ did = VEHICLE_DID_MOTION_HEADING_NAVI;
+ } else {
+ /* End as a parameter error abnormality except for GPS/unspecified acquisition method */
+ ret = POS_RET_ERROR_PARAM;
+ }
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+ /* Sensor information acquisition */
+ if (ret == POS_RET_NORMAL) {
+ /* Data acquisition process */
+ ret_get_proc = PosGetProc(did, reinterpret_cast<void *>(dat), sizeof(SENSORMOTION_HEADINGINFO_DAT));
+ if (static_cast<int32_t>(sizeof(SENSORMOTION_HEADINGINFO_DAT)) > ret_get_proc) {
+ /** Failed to acquire */
+ if (ret_get_proc == POS_RET_ERROR_RESOURCE) {
+ /** Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosGetProc ERROR [ret = %d]", ret);
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Vehicle speed information setting
+ *
+ * Setting Vehicle Speed Information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] navispped uint16_t - Vehicle speed information[Unit:1.0km/h]
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_SetSpeedInfo(HANDLE hApp, uint16_t navispeed) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ uint16_t speed; /* Vehicle speed */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if (hApp == NULL) {
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == POS_RET_NORMAL) {
+ /* Adjustment by unit [1.0km/h]->[0.01m/sec] */
+ speed = static_cast<uint16_t>(navispeed * 10000 / 360);
+ /* Data setting(After setting,Immediate termination) */
+ ret = PosSetProc(VEHICLE_DID_MOTION_SPEED_NAVI,
+ reinterpret_cast<void *>(&speed), sizeof(uint16_t), FALSE);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Location information setting
+ *
+ * Set location information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] posData POS_POSDATA - Pointer to location information
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_INNER Internal error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_SetLocationInfo(HANDLE hApp, POS_POSDATA* pstPosData) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((pstPosData == NULL) || (hApp == NULL)) {
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == POS_RET_NORMAL) {
+ /* Data status check */
+ if ((0x01 > pstPosData->status) || (0x0F < pstPosData->status)) {
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Parameter range check */
+ /* Latitude */
+ if ((pstPosData->status & POS_LOC_INFO_LAT) == POS_LOC_INFO_LAT) {
+ (void)POS_CHKPARAM32(pstPosData->latitude, -41472000, 41472000);
+ }
+ /* Longitude */
+ if ((pstPosData->status & POS_LOC_INFO_LON) == POS_LOC_INFO_LON) {
+ (void)POS_CHKPARAM32(pstPosData->longitude, -82944000, 82944000);
+ }
+ /* Orientation */
+ if ((pstPosData->status & POS_LOC_INFO_HEAD) == POS_LOC_INFO_HEAD) {
+ (void)POS_CHKPARAM16(pstPosData->heading, -179, 180);
+ }
+
+ /* Data setting(After setting,Immediate termination) */
+ ret = PosSetProc(VEHICLE_DID_GPS_CUSTOMDATA_NAVI, // == POSHAL_DID_GPS_CUSTOMDATA_NAVI
+ reinterpret_cast<void *>(pstPosData), sizeof(POS_POSDATA), FALSE);
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
diff --git a/vehicleservice/positioning/client/src/POS_common_API/Makefile b/vehicleservice/positioning/client/src/POS_common_API/Makefile
new file mode 100755
index 0000000..4d7a90f
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_common_API/Makefile
@@ -0,0 +1,47 @@
+#
+# @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.
+#
+######### installed shared library(*.so) #############
+INST_SHLIBS = libPOS_common_API
+
+######### compiled sources #############
+libPOS_common_API_SRCS += Common_API.cpp
+
+######### add include path #############
+CPPFLAGS += -I../../../server/include/common
+CPPFLAGS += -I../../include
+CPPFLAGS += -I../../../server/include/nsfw
+
+######### add compile option #############
+CPPFLAGS += -DLINUX -fPIC
+
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### linked library (dynamic) #############
+LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
+LDLIBS += -Wl,-Bdynamic -lPOS_base_API
+LDLIBS += -Wl,-Bdynamic -lvp
+
+######### add library path #############
+LDFLAGS += -shared
+
+include ../../../../vehicle_service.mk
diff --git a/vehicleservice/positioning/client/src/POS_common_API/libPOS_common_API.ver b/vehicleservice/positioning/client/src/POS_common_API/libPOS_common_API.ver
new file mode 100755
index 0000000..afc7f3a
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_common_API/libPOS_common_API.ver
@@ -0,0 +1,37 @@
+/*
+ * @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.
+ */
+
+#
+# libPOS_common_API version script
+#
+{
+ global:
+ POS_GetAltitude;
+ POS_GetHeading;
+ POS_GetLonLat;
+ POS_GetSpeed;
+ POS_RegisterListenerAltitude;
+ POS_RegisterListenerHeading;
+ POS_RegisterListenerLonLat;
+ POS_RegisterListenerSpeed;
+ POS_SetLocationInfo;
+ POS_SetSpeedInfo;
+
+ POS_SetLocationInfoNmea;
+ local:
+ *;
+};
+
diff --git a/vehicleservice/positioning/client/src/POS_gps_API/Gps_API.cpp b/vehicleservice/positioning/client/src/POS_gps_API/Gps_API.cpp
new file mode 100755
index 0000000..7395f9d
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_gps_API/Gps_API.cpp
@@ -0,0 +1,456 @@
+/*
+ * @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
+ * Gps_API.cpp
+ * @brief
+ * Module : POSITIONING
+ * GPS I/F service functionality
+ */
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_define.h>
+#include <vehicle_service/POS_gps_API.h>
+#include <vehicle_service/POS_common_API.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include "POS_common_private.h"
+#include "POS_private.h"
+#include "Vehicle_API_private.h"
+#include "Gps_API_private.h"
+
+
+/**
+ * @brief
+ * GPS reset request
+ *
+ * Request a GPS reset
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] ResName PCSTR - Destination thread name
+ * @param[in] mode uint8_t - Reset mode
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_INNER Internal processing error<br>
+ * POS_RET_ERROR_BUSY Busy occurrence<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_ReqGPSReset(HANDLE hApp, PCSTR ResName, uint8_t mode) { // NOLINT(readability/nolint)
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ RET_API ret_api = RET_NORMAL; /* API return value */
+ POS_RESETINFO snd_msg; /* Reset information */
+ EventID event_id; /* Event ID */
+ int32_t event_val; /* Event value */
+ PNO my_pno; /* Caller PNO */
+ PNO rs_pno; /* Destination PNO */
+ uint32_t pid; /* Process ID */
+ uint32_t tid; /* Thread ID */
+ char name[128]; /* Name buffer */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((hApp == NULL) || (ResName == NULL)) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (GPS_RST_COLDSTART != mode) {
+ /* Parameter error except */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+
+ if (ret == POS_RET_NORMAL) {
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+ /* Event Generation */
+ rs_pno = _pb_CnvName2Pno(ResName);
+ pid = (uint32_t)getpid();
+ tid = GetTid();
+
+ snprintf(name, sizeof(name), "PR_p%u_t%u", pid, tid);
+ my_pno = _pb_CnvName2Pno(name);
+ event_id = VehicleCreateEvent(my_pno);
+ if (0 != event_id) {
+ /* Successful event generation */
+ memset(&snd_msg, 0x00, sizeof(POS_RESETINFO));
+
+ /* Message creation */
+ snd_msg.mode = mode; /* Reset mode */
+ snd_msg.snd_pno = my_pno; /* Caller PNo. */
+ snd_msg.res_pno = rs_pno; /* Destination PNo. */
+
+ /* Message transmission request */
+ ret_api = _pb_SndMsg_Ext(POS_THREAD_NAME,
+ CID_GPS_REQRESET,
+ sizeof(POS_RESETINFO),
+ reinterpret_cast<void*>(&snd_msg), 0);
+
+ if (RET_NORMAL == ret_api) {
+ /* If the data setup process is successful,Wait for a completion event */
+ ret_api = _pb_WaitEvent(event_id,
+ SAPI_EVWAIT_VAL,
+ VEHICLE_RET_ERROR_MIN, VEHICLE_RET_NORMAL, &event_val, INFINITE);
+ if (RET_NORMAL != ret_api) {
+ /* When not put in event wait state */
+ /* Event generation failure */
+ ret = POS_RET_ERROR_INNER;
+ } else {
+ /* Return from Event Wait */
+ /* Set event value (processing result) as return value */
+ ret = (POS_RET_API)event_val;
+ }
+ } else {
+ /* Message transmission processing failed */
+ ret = POS_RET_ERROR_INNER;
+ }
+ /* Event deletion */
+ ret_api = VehicleDeleteEvent(event_id);
+ } else {
+ /* Event generation failure */
+ ret = POS_RET_ERROR_INNER;
+ }
+ } else {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * GPS time setting request delivery registration
+ *
+ * Register delivery of GPS time setting request
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] notifyName PCSTR - Destination thread name
+ * @param[in] ucCtrlFlg uint8_t - Delivery control(Delivery registration/Delivery stop/Resume delivery)
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_BUFFULL Buffer-full<br>
+ * POS_RET_ERROR_INNER Internal error<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_RegisterListenerGPSTimeSetReq(HANDLE hApp, // NOLINT(readability/nolint)
+ PCSTR notifyName, // NOLINT(readability/nolint)
+ uint8_t ucCtrlFlg) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ SENSOR_RET_API ret_sens = SENSOR_RET_NORMAL; /* API return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((hApp == NULL) || (notifyName == NULL)) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (SENSOR_DELIVERY_REGIST != ucCtrlFlg) {
+ /* Parameter error other than delivery registration */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Delivery registration */
+ if (POS_RET_NORMAL == ret) {
+ /* Delivery registry SensorAPI calls */
+ ret_sens = PosRegisterListenerProc(notifyName, /* Destination thread name */
+ VEHICLE_DID_SETTINGTIME, /* Data ID */
+ ucCtrlFlg, /* Delivery control */
+ VEHICLE_DELIVERY_TIMING_UPDATE); /* Delivery timing */
+
+ /* Decision of delivery registration result */
+ if (ret_sens == SENSOR_RET_NORMAL) {
+ ret = POS_RET_NORMAL;
+ } else if (ret_sens == SENSOR_RET_ERROR_PARAM) {
+ ret = POS_RET_ERROR_PARAM;
+ } else if (ret_sens == SENSOR_RET_ERROR_BUFFULL) {
+ ret = POS_RET_ERROR_BUFFULL;
+ } else if (ret_sens == SENSOR_RET_ERROR_RESOURCE) {
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * GPS time setting
+ *
+ * Set the GPS time
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] pstDateTime POS_DATETIME - Pointer to GPS time information
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_INNER Internal error<br>
+ * POS_RET_ERROR_TIMEOUT Timeout error<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_SetGPStime(HANDLE hApp, POS_DATETIME* pstDateTime) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value of this function */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if ((pstDateTime == NULL) || (hApp == NULL)) {
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == POS_RET_NORMAL) {
+ /* Parameter range check */
+ /* Month */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(pstDateTime->month, 1, 12)) {
+ return POS_RET_ERROR_PARAM;
+ }
+ /* Day */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(pstDateTime->date, 1, 31)) {
+ return POS_RET_ERROR_PARAM;
+ }
+ /* Hour */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(pstDateTime->hour, 0, 23)) {
+ return POS_RET_ERROR_PARAM;
+ }
+ /* Minutes */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(pstDateTime->minute, 0, 59)) {
+ return POS_RET_ERROR_PARAM;
+ }
+ /* Second */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(pstDateTime->second, 0, 59)) {
+ return POS_RET_ERROR_PARAM;
+ }
+
+ /* Data setting(Immediate recovery)*/
+ ret = PosSetProc(VEHICLE_DID_SETTINGTIME,
+ reinterpret_cast<void*>(pstDateTime), sizeof(POS_DATETIME), FALSE);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * GPS Time Delivery Registration
+ *
+ * Registering GPS time delivery
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] nofifyName PCSTR - Destination thread name
+ * @param[in] ucCtrlFlg uint8_t - Delivery control(Delivery registration/Delivery stop/Resume delivery)
+ * @param[in] ucDeliveryTiming uint8_t - Delivery timing(Changing/Updating)
+ *
+ * @return SENSOR_RET_NORMAL Successful registration<br>
+ * SENSOR_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * SENSOR_RET_ERROR_PARAM Parameter error<br>
+ * SENSOR_RET_ERROR_BUFFULL FULL of delivery registers<br>
+ * SENSOR_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+SENSOR_RET_API POS_RegisterListenerGPStime(HANDLE hApp, // NOLINT(readability/nolint)
+ PCSTR notifyName, // NOLINT(readability/nolint)
+ uint8_t ucCtrlFlg, // NOLINT(readability/nolint)
+ uint8_t ucDeliveryTiming) { // NOLINT(readability/nolint)
+ SENSOR_RET_API ret = SENSOR_RET_NORMAL;
+ UNIT_TYPE type = UNIT_TYPE_NONE;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ if (hApp == NULL) {
+ /* Parameter error */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = SENSOR_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* fail */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (SENSOR_RET_NORMAL == ret) {
+ if (notifyName == NULL) {
+ /* Parameter error */
+ ret = SENSOR_RET_ERROR_PARAM;
+ }
+ if (ucCtrlFlg != SENSOR_DELIVERY_REGIST) {
+ /* Parameter error */
+ ret = SENSOR_RET_ERROR_PARAM;
+ }
+ if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Parameter error */
+ ret = SENSOR_RET_ERROR_PARAM;
+ }
+ }
+
+ if (SENSOR_RET_NORMAL == ret) {
+ /* Delivery registration process */
+ ret = PosRegisterListenerProc(notifyName, VEHICLE_DID_GPS_TIME, ucCtrlFlg, ucDeliveryTiming);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+ return ret;
+}
+
+/**
+ * @brief
+ * Get GPS time
+ *
+ * Get the GPS time
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] *dat SENSOR_GPSTIME - Pointer to GPS time information
+ *
+ * @return POS_RET_NORMAL Normal completion(Include illegal)<br>
+ * POS_RET_ERROR_INNER Internal error<br>
+ * POS_RET_ERROR_PARAM Parameter error<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_GetGPStime(HANDLE hApp, SENSOR_GPSTIME* dat) { // NOLINT(readability/nolint)
+ POS_RET_API ret = POS_RET_NORMAL; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ DID did = VEHICLE_DID_GPS_TIME; /* DID */
+ int32_t ret_get_proc; /* POS_GetProc Return Values */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Arguments & Support Configuration Check */
+ if (hApp == NULL) {
+ /* If the handler is NULL, the process terminates with an error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else if (dat == NULL) {
+ /* If the longitude/latitude data is NULL, it ends with an abnormal parameter. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ ret = POS_RET_NORMAL;
+ } else {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ /* Sensor information acquisition */
+ if (ret == POS_RET_NORMAL) {
+ /* Data acquisition process */
+ ret_get_proc = PosGetProc(did, reinterpret_cast<void*>(dat), sizeof(SENSOR_GPSTIME));
+ if (static_cast<int32_t>(sizeof(SENSOR_GPSTIME)) > ret_get_proc) {
+ /* Failed to acquire */
+ if (ret_get_proc == POS_RET_ERROR_RESOURCE) {
+ /* Insufficient resource */
+ ret = POS_RET_ERROR_RESOURCE;
+ } else {
+ ret = POS_RET_ERROR_INNER;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosGetProc ERROR [ret = %d]", ret);
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret);
+
+ return ret;
+}
diff --git a/vehicleservice/positioning/client/src/POS_gps_API/Makefile b/vehicleservice/positioning/client/src/POS_gps_API/Makefile
new file mode 100755
index 0000000..c6391a9
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_gps_API/Makefile
@@ -0,0 +1,51 @@
+#
+# @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.
+#
+######### installed shared library(*.so) #############
+INST_SHLIBS = libPOS_gps_API
+
+######### compiled sources #############
+libPOS_gps_API_SRCS += Gps_API.cpp
+libPOS_gps_API_SRCS += Naviinfo_API.cpp
+
+######### add include path #############
+CPPFLAGS += -I../../../server/include/common
+CPPFLAGS += -I../../include
+CPPFLAGS += -I../../../server/include/nsfw
+
+CPPFLAGS += -I../Vehicle_API
+CPPFLAGS += -I../Vehicle_API/common
+
+######### add compile option #############
+CPPFLAGS += -DLINUX -fPIC
+
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### linked library (dynamic) #############
+LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
+LDLIBS += -Wl,-Bdynamic -lPOS_base_API
+LDLIBS += -Wl,-Bdynamic -lvp
+
+######### add library path #############
+LDFLAGS += -shared
+
+include ../../../../vehicle_service.mk
diff --git a/vehicleservice/positioning/client/src/POS_gps_API/Naviinfo_API.cpp b/vehicleservice/positioning/client/src/POS_gps_API/Naviinfo_API.cpp
new file mode 100755
index 0000000..cfe04ff
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_gps_API/Naviinfo_API.cpp
@@ -0,0 +1,404 @@
+/*
+ * @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 Naviinfo_API.cpp
+@detail Naviinfo_API Functions
+@lib libNaviinfo_API.so
+******************************************************************************/
+
+/*****************************************************************************
+ * Include *
+ *****************************************************************************/
+#include "Naviinfo_API.h"
+#include <vehicle_service/POS_define.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/POS_gps_API.h>
+#include "Vehicle_API_Dummy.h"
+#include "POS_private.h"
+#include <native_service/frameworkunified_types.h> // NOLINT(build/include_order)
+
+void PosCnvGpsInfo(NAVIINFO_ALL *navi_loc_info);
+
+
+/**
+ * @brief
+ * GPS information setting
+ *
+ * Set GPS information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] navilocinfo NAVIINFO_ALL* - Pointer to GPS information storage area
+ *
+ * @return NAVIINFO_RET_NORMAL Normal completion<br>
+ * NAVIINFO_RET_ERROR_PARAM Parameter error<br>
+ * NAVIINFO_RET_ERROR_INNER Internal error<br>
+ * NAVIINFO_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+NAVIINFO_RET_API POS_SetGPSInfo(HANDLE hApp, NAVIINFO_ALL *navilocinfo)
+{
+ NAVIINFO_RET_API ret = NAVIINFO_RET_NORMAL; /* Return value of this function */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ NAVIINFO_ALL navi_loc_info_tmp; /* Conversion quantity area */
+ RET_API ret_api;
+
+ /** NULL checking */
+ if (navilocinfo == NULL) {
+ /** Parameter error */
+ ret = NAVIINFO_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /** Parameter error */
+ ret = NAVIINFO_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = NAVIINFO_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = NAVIINFO_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = NAVIINFO_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == NAVIINFO_RET_NORMAL) {
+ /* Parameter range check */
+ if (navilocinfo->stNaviGps.tdsts != 0) { /* Other than ""Time not calibrated after receiver reset"" */
+ /* Positioning status information */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stDiagGps.stFix.ucFixSts, 0, 2)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* Latitude */
+ if (POS_RET_ERROR == POS_CHKPARAM32(navilocinfo->stDiagGps.stFix.stWgs84.lLat, -82944000, 82944000)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* Longitude */
+ if (POS_RET_ERROR == POS_CHKPARAM32(navilocinfo->stDiagGps.stFix.stWgs84.lLon, -165888000, 165888000)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* Measurement Azimuth */
+ if (POS_RET_ERROR == POS_CHKPARAMU16(navilocinfo->stNaviGps.heading, 0, 3599)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* UTC(Month) */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stNaviGps.utc.month, 1, 12)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* UTC(Day) */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stNaviGps.utc.date, 1, 31)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* UTC(Hour) */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stNaviGps.utc.hour, 0, 23)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* UTC(Minutes) */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stNaviGps.utc.minute, 0, 59)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ /* UTC(Second) */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stNaviGps.utc.second, 0, 59)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+ }
+ /* Date and Time Status */
+ if (POS_RET_ERROR == POS_CHKPARAMU8(navilocinfo->stNaviGps.tdsts, 0, 2)) {
+ return NAVIINFO_RET_ERROR_PARAM;
+ }
+
+ /* Copy to conversion area */
+ memcpy(&navi_loc_info_tmp, navilocinfo, sizeof(NAVIINFO_ALL));
+ /** Data unit conversion */
+ PosCnvGpsInfo(&navi_loc_info_tmp);
+
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+
+ /** Send navigation information to vehicle sensor */
+ ret_api = _pb_SndMsg_Ext(POS_THREAD_NAME,
+ CID_NAVIINFO_DELIVER,
+ sizeof(NAVIINFO_ALL),
+ reinterpret_cast<void*>(&navi_loc_info_tmp), 0);
+ if (ret_api != RET_NORMAL) {
+ /** Message transmission failure */
+ ret = NAVIINFO_RET_ERROR_INNER;
+ }
+ } else {
+ /* When resource shortage occurs, the system terminates with an insufficient resource error. */
+ ret = NAVIINFO_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * GPS information acquisition
+ *
+ * Access GPS information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] navidiaginfo NAVIINFO_DIAG_GPS* - Pointer to GPS information storage area
+ *
+ * @return NAVIINFO_RET_NORMAL Normal completion<br>
+ * NAVIINFO_RET_ERROR_PARAM Parameter error<br>
+ * NAVIINFO_RET_ERROR_INNER Internal error<br>
+ * NAVIINFO_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+NAVIINFO_RET_API POS_GetGPSInfo(HANDLE hApp, NAVIINFO_DIAG_GPS *navidiaginfo)
+{
+ NAVIINFO_RET_API ret = NAVIINFO_RET_NORMAL; /* Return value of this function */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ int32_t ret_veh; /* VehicleAPI Return Values */
+ NAVIINFO_DIAG_GPS dest_data; /* Data acquisition area */
+
+ /** NULL checking */
+ if (navidiaginfo == NULL) {
+ /** Parameter error */
+ ret = NAVIINFO_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /** Parameter error */
+ ret = NAVIINFO_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = NAVIINFO_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = NAVIINFO_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = NAVIINFO_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == NAVIINFO_RET_NORMAL) {
+ /** Acquisition of navigation data for Diag provide */
+ ret_veh = PosGetProc(
+ (DID)VEHICLE_DID_NAVIINFO_DIAG_GPS,
+ reinterpret_cast<void*>(&dest_data),
+ (u_int16)sizeof(dest_data));
+
+ if (static_cast<int32_t>(sizeof(NAVIINFO_DIAG_GPS)) > ret_veh) {
+ /** Failed to acquire */
+ if (ret_veh == POS_RET_ERROR_RESOURCE) {
+ ret = NAVIINFO_RET_ERROR_RESOURCE;
+ } else {
+ ret = NAVIINFO_RET_ERROR_INNER;
+ }
+ } else {
+ /** Successful acquisition */
+ memcpy( navidiaginfo, &dest_data, sizeof(NAVIINFO_DIAG_GPS));
+ }
+ }
+
+ return ret;
+}
+
+/* ++ GPS _CWORD82_ support */
+/**
+ * @brief
+ * GPS setting transmission request
+ *
+ * Requesting GPS Settings with Complete Return
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] p_data SENSOR_MSG_SEND_DAT* - GPS setting information to be sent
+ *
+ * @return SENSOR_RET_NORMAL Normal completion<br>
+ * SENSOR_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * SENSOR_RET_ERROR_PARAM Parameter error<br>
+ * SENSOR_RET_ERROR_DID Unregistered DID<br>
+ * SENSOR_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+int32 POS_ReqGPSSetting(HANDLE hApp, SENSOR_MSG_SEND_DAT *p_data) { /* Ignore->MISRA-C++:2008 Rule 7-1-2 */
+ SENSOR_RET_API ret = SENSOR_RET_NORMAL; /* Return value */
+ RET_API ret_api; /* System API return value */
+ uint16_t expected_size; /* Message size for the specified DID */
+
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+
+ if (hApp == NULL) {
+ /* Parameter error */
+ ret = SENSOR_RET_ERROR_PARAM;
+ }
+
+ if (ret == SENSOR_RET_NORMAL) {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Argument check (DID) + Size calculation */
+ if (p_data != reinterpret_cast<SENSOR_MSG_SEND_DAT*>(NULL)) {
+ switch (p_data->did) {
+ case VEHICLE_DID_GPS__CWORD82__SETINITIAL:
+ {
+ expected_size = 71;
+ break;
+ }
+ case VEHICLE_DID_GPS__CWORD82__SETRMODE:
+ {
+ expected_size = 50;
+ break;
+ }
+ case VEHICLE_DID_GPS__CWORD82__SETRMODEEX:
+ {
+ expected_size = 63;
+ break;
+ }
+ case VEHICLE_DID_GPS__CWORD82__SELSENT:
+ {
+ expected_size = 21;
+ break;
+ }
+ case VEHICLE_DID_GPS__CWORD82__SETSBAS:
+ {
+ expected_size = 34;
+ break;
+ }
+ case VEHICLE_DID_GPS__CWORD82__SETCONF1:
+ {
+ expected_size = 37;
+ break;
+ }
+ case VEHICLE_DID_GPS__CWORD82__SETCONF2:
+ {
+ expected_size = 45;
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ ret = SENSOR_RET_ERROR_DID;
+ break;
+ }
+ } else {
+ ret = SENSOR_RET_ERROR_PARAM;
+ }
+ }
+
+ /* Supported HW Configuration Check */
+ if (ret == SENSOR_RET_NORMAL) {
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = SENSOR_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == SENSOR_RET_NORMAL) {
+ /* Argument check (Size)*/
+ if (expected_size != p_data->usSize) {
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else {
+ /* Message buffer initialization */
+
+ /* Create message data */
+
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+ /* External Process Transmission and Reception Messages */
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "POSITIONING: POS_ReqGPSSetting() --> cid = %d",
+ CID_SENSORIF__CWORD82__REQUEST);
+ ret_api = _pb_SndMsg_Ext(POS_THREAD_NAME,
+ CID_SENSORIF__CWORD82__REQUEST,
+ sizeof(SENSOR_MSG_SEND_DAT),
+ reinterpret_cast<void *>(p_data), 0);
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, "POSITIONING: POS_ReqGPSSetting() <--");
+
+ if (ret_api != RET_NORMAL) {
+ ret = SENSOR_RET_ERROR_CREATE_EVENT;
+ }
+ } else {
+ /* When resource shortage occurs, the system terminates with an insufficient resource error. */
+ ret = SENSOR_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+ }
+ }
+
+ return ret;
+}
+/* -- GPS _CWORD82_ support */
+
+/**
+ * @brief
+ * GPS information conversion process
+ *
+ * Convert GPS information to a format to be provided to the vehicle sensor
+ *
+ * @param[in] none
+ * @param[in] navi_loc_info NAVIINFO_ALL* - GPS information pointer
+ *
+ * @return none
+ */
+void PosCnvGpsInfo(NAVIINFO_ALL *navi_loc_info) {
+ int32_t altitude;
+ int64_t tmp;
+ uint16_t heading;
+
+ /* Unit conversion of fix altitude[1m]->[0.01m] */
+ tmp = (int64_t)((int64_t)(navi_loc_info->stNaviGps.altitude) * 100);
+ if (tmp > static_cast<int32_t>(0x7FFFFFFF)) {
+ /* +Overflow of digits */
+ altitude = static_cast<int32_t>(0x7FFFFFFF);
+ } else if (tmp < static_cast<int32_t>(0x80000000)) { /* Ignore->MISRA-C:2004 Rule 3.1 */
+ /* -Overflow of digits */
+ altitude = static_cast<int32_t>(0x80000000); /* Ignore->MISRA-C:2004 Rule 3.1 */
+ } else {
+ altitude = static_cast<int32_t>(tmp);
+ }
+ navi_loc_info->stNaviGps.altitude = altitude;
+
+ /* Measurement Azimuth Conversion[0.Once]->[0.01 degree] */
+ heading = navi_loc_info->stNaviGps.heading;
+ heading = static_cast<uint16_t>(heading - ((heading / 3600) * 3600));
+ heading = static_cast<uint16_t>(heading * 10);
+ navi_loc_info->stNaviGps.heading = heading;
+
+ return;
+}
diff --git a/vehicleservice/positioning/client/src/POS_gps_API/libPOS_gps_API.ver b/vehicleservice/positioning/client/src/POS_gps_API/libPOS_gps_API.ver
new file mode 100755
index 0000000..038c99e
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_gps_API/libPOS_gps_API.ver
@@ -0,0 +1,34 @@
+/*
+ * @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.
+ */
+
+#
+# libPOS_gps_API version script
+#
+{
+ global:
+ POS_GetGPSInfo;
+ POS_GetGPSVersion;
+ POS_RegisterListenerGPSTimeSetReq;
+ POS_RegisterListenerGPStime;
+ POS_ReqGPSReset;
+ POS_ReqGPSSetting;
+ POS_SetGPSInfo;
+ POS_SetGPStime;
+ POS_GetGPStime;
+ local:
+ *;
+};
+
diff --git a/vehicleservice/positioning/client/src/POS_sensor_API/Makefile b/vehicleservice/positioning/client/src/POS_sensor_API/Makefile
new file mode 100755
index 0000000..a4f627f
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_sensor_API/Makefile
@@ -0,0 +1,48 @@
+#
+# @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.
+#
+######### installed shared library(*.so) #############
+INST_SHLIBS = libPOS_sensor_API
+
+######### compiled sources #############
+libPOS_sensor_API_SRCS += Sensor_API.cpp
+libPOS_sensor_API_SRCS += Vehicle_API.cpp
+
+######### add include path #############
+CPPFLAGS += -I../../../server/include/common
+CPPFLAGS += -I../../include
+CPPFLAGS += -I../../../server/include/nsfw
+
+######### add compile option #############
+CPPFLAGS += -DLINUX -fPIC
+
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### linked library (dynamic) #############
+LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
+LDLIBS += -Wl,-Bdynamic -lPOS_base_API
+LDLIBS += -Wl,-Bdynamic -lvp
+######### add library path #############
+LDFLAGS += -shared
+
+
+include ../../../../vehicle_service.mk
diff --git a/vehicleservice/positioning/client/src/POS_sensor_API/Sensor_API.cpp b/vehicleservice/positioning/client/src/POS_sensor_API/Sensor_API.cpp
new file mode 100755
index 0000000..179eb92
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_sensor_API/Sensor_API.cpp
@@ -0,0 +1,784 @@
+/*
+ * @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 :Sensor_API.cpp
+ * System name :GPF
+ * Subsystem name :Sensor I/F library
+ * Program name :SensorI/F API
+ ******************************************************************************/
+
+#include <stdio.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/POS_define.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "POS_sensor_private.h"
+#include "Sensor_Common_API.h"
+#include "Sensor_API_private.h"
+#include "Sensor_Common_API.h"
+#include "Vehicle_API_Dummy.h"
+#include "Vehicle_API_private.h"
+#include "Naviinfo_API.h"
+#include "POS_private.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+/********************************************************************************
+ * TAG :TG_GPS_REQ_RESET
+ * ABSTRACT :GPS reset request
+ * NOTE :I/F information between host applications(Reset mode)
+ ********************************************************************************/
+/**
+ * @brief POS_RegisterListenerPkgSensData Return code list
+ */
+static const SENSOR_RET_PKG g_ret_list_reg_lis_pkg_sens_data[SENSOR_PUBLIC_DID_NUM] = {
+ /* GRADE2 GRADE1 DID (Key) */
+ {TRUE, TRUE, POS_DID_SPEED_PULSE },
+ {FALSE, TRUE, POS_DID_SPEED_KMPH },
+ {TRUE, TRUE, POS_DID_GYRO_X },
+ {TRUE, TRUE, POS_DID_GYRO_Y },
+ {TRUE, TRUE, POS_DID_GYRO_Z },
+ {TRUE, TRUE, POS_DID_GSNS_X },
+ {TRUE, TRUE, POS_DID_GSNS_Y },
+ {TRUE, TRUE, POS_DID_GSNS_Z },
+ {FALSE, TRUE, POS_DID_GPS_ANTENNA },
+ {TRUE, TRUE, POS_DID_SNS_COUNTER },
+ {FALSE, TRUE, POS_DID_SPEED_PULSE_FST },
+ {FALSE, TRUE, POS_DID_GYRO_X_FST },
+ {FALSE, TRUE, POS_DID_GYRO_Y_FST },
+ {FALSE, TRUE, POS_DID_GYRO_Z_FST },
+ {FALSE, TRUE, POS_DID_GPS__CWORD82__NMEA },
+ {FALSE, TRUE, POS_DID_GPS__CWORD82___CWORD44_GP4 },
+ {FALSE, TRUE, POS_DID_GPS__CWORD82__FULLBINARY },
+ {FALSE, TRUE, POS_DID_GPS_NMEA },
+ {TRUE, TRUE, POS_DID_REV },
+ {FALSE, TRUE, POS_DID_REV_FST },
+ {TRUE, TRUE, POS_DID_GYRO_TEMP },
+ {FALSE, TRUE, POS_DID_GYRO_TEMP_FST },
+ {FALSE, TRUE, POS_DID_GSNS_X_FST },
+ {FALSE, TRUE, POS_DID_GSNS_Y_FST },
+ {FALSE, TRUE, POS_DID_GSNS_Z_FST },
+ {TRUE, TRUE, POS_DID_PULSE_TIME },
+ {FALSE, TRUE, POS_DID_GPS_CLOCK_DRIFT },
+ {FALSE, TRUE, POS_DID_GPS_CLOCK_FREQ },
+ {FALSE, TRUE, VEHICLE_DID_GPS_TIME }, /* For local use */
+ {FALSE, TRUE, VEHICLE_DID_GPS_TIME_RAW }, /* For local use */
+ {FALSE, TRUE, VEHICLE_DID_GPS_WKNROLLOVER} /* For local use */
+};
+
+/**
+ * @brief POS_RegisterListenerSensData Return code list
+ */
+static const SENSOR_RET_PKG g_ret_list_reg_lis_sens_data[SENSOR_PUBLIC_DID_NUM] = {
+ /* GRADE2 GRADE1 DID (Key) */
+ {TRUE, TRUE, POS_DID_SPEED_PULSE },
+ {FALSE, TRUE, POS_DID_SPEED_KMPH },
+ {TRUE, TRUE, POS_DID_GYRO_X },
+ {TRUE, TRUE, POS_DID_GYRO_Y },
+ {TRUE, TRUE, POS_DID_GYRO_Z },
+ {TRUE, TRUE, POS_DID_GSNS_X },
+ {TRUE, TRUE, POS_DID_GSNS_Y },
+ {TRUE, TRUE, POS_DID_GSNS_Z },
+ {TRUE, TRUE, POS_DID_GPS_ANTENNA },
+ {FALSE, TRUE, POS_DID_SNS_COUNTER },
+ {TRUE, TRUE, POS_DID_SPEED_PULSE_FST },
+ {TRUE, TRUE, POS_DID_GYRO_X_FST },
+ {TRUE, TRUE, POS_DID_GYRO_Y_FST },
+ {TRUE, TRUE, POS_DID_GYRO_Z_FST },
+ {TRUE, TRUE, POS_DID_GPS__CWORD82__NMEA },
+ {FALSE, TRUE, POS_DID_GPS__CWORD82___CWORD44_GP4 },
+ {TRUE, TRUE, POS_DID_GPS__CWORD82__FULLBINARY },
+ {FALSE, TRUE, POS_DID_GPS_NMEA },
+ {FALSE, TRUE, POS_DID_REV },
+ {TRUE, TRUE, POS_DID_REV_FST },
+ {TRUE, TRUE, POS_DID_GYRO_TEMP },
+ {TRUE, TRUE, POS_DID_GYRO_TEMP_FST },
+ {TRUE, TRUE, POS_DID_GSNS_X_FST },
+ {TRUE, TRUE, POS_DID_GSNS_Y_FST },
+ {TRUE, TRUE, POS_DID_GSNS_Z_FST },
+ {FALSE, TRUE, POS_DID_PULSE_TIME },
+ {FALSE, TRUE, POS_DID_GPS_CLOCK_DRIFT },
+ {FALSE, TRUE, POS_DID_GPS_CLOCK_FREQ },
+ {FALSE, TRUE, VEHICLE_DID_GPS_TIME }, /* For local use */
+ {FALSE, TRUE, VEHICLE_DID_GPS_TIME_RAW }, /* For local use */
+ {FALSE, TRUE, VEHICLE_DID_GPS_WKNROLLOVER } /* For local use */
+};
+
+/**
+ * @brief POS_GetSensData Return code list
+ */
+static const SENSOR_RET_PKG g_ret_list_get_sens_data[SENSOR_PUBLIC_DID_NUM] = {
+ /* GRADE2 GRADE1 DID (Key) */
+ {TRUE, TRUE, POS_DID_SPEED_PULSE },
+ {FALSE, TRUE, POS_DID_SPEED_KMPH },
+ {TRUE, TRUE, POS_DID_GYRO_X },
+ {TRUE, TRUE, POS_DID_GYRO_Y },
+ {TRUE, TRUE, POS_DID_GYRO_Z },
+ {TRUE, TRUE, POS_DID_GSNS_X },
+ {TRUE, TRUE, POS_DID_GSNS_Y },
+ {TRUE, TRUE, POS_DID_GSNS_Z },
+ {TRUE, TRUE, POS_DID_GPS_ANTENNA },
+ {FALSE, TRUE, POS_DID_SNS_COUNTER },
+ {FALSE, TRUE, POS_DID_SPEED_PULSE_FST },
+ {FALSE, TRUE, POS_DID_GYRO_X_FST },
+ {FALSE, TRUE, POS_DID_GYRO_Y_FST },
+ {FALSE, TRUE, POS_DID_GYRO_Z_FST },
+ {TRUE, TRUE, POS_DID_GPS__CWORD82__NMEA },
+ {FALSE, TRUE, POS_DID_GPS__CWORD82___CWORD44_GP4 },
+ {TRUE, TRUE, POS_DID_GPS__CWORD82__FULLBINARY },
+ {FALSE, TRUE, POS_DID_GPS_NMEA },
+ {FALSE, TRUE, POS_DID_REV },
+ {FALSE, TRUE, POS_DID_REV_FST },
+ {TRUE, TRUE, POS_DID_GYRO_TEMP },
+ {FALSE, TRUE, POS_DID_GYRO_TEMP_FST },
+ {FALSE, TRUE, POS_DID_GSNS_X_FST },
+ {FALSE, TRUE, POS_DID_GSNS_Y_FST },
+ {FALSE, TRUE, POS_DID_GSNS_Z_FST },
+ {FALSE, TRUE, POS_DID_PULSE_TIME },
+ {FALSE, TRUE, POS_DID_GPS_CLOCK_DRIFT },
+ {FALSE, TRUE, POS_DID_GPS_CLOCK_FREQ },
+ {FALSE, TRUE, VEHICLE_DID_GPS_TIME }, /* For local use */
+ {FALSE, TRUE, VEHICLE_DID_GPS_TIME_RAW }, /* For local use */
+ {FALSE, TRUE, VEHICLE_DID_GPS_WKNROLLOVER } /* For local use */
+};
+
+/**
+ * @brief
+ * DID-decision functions for Sensor API
+ *
+ * Determines whether or not the DID specified by the public API corresponds to the DID.
+ *
+ * @param[in] did Data ID
+ * @param[in] mode Operation mode 1:For Package Delivery Registration API<br>
+ * 2:For Sensor Data Delivery Registration API<br>
+ * 3:For Sensor Data Acquisition API
+ *
+ * @return TRUE Be supported
+ * FALSE Not supported
+ */
+BOOL SensorJudgeDid(DID did, uint8_t mode) {
+ BOOL ret = FALSE;
+ UNIT_TYPE type;
+ const SENSOR_RET_PKG *pkg_list = NULL;
+ int32_t i;
+
+ /* Set Return pakage list */
+ switch (mode) {
+ case MODE_REGISTER_LISTENER_PKG_SENS_DATA: /* POS_RegisterListenerPkgSensData */
+ {
+ pkg_list = g_ret_list_reg_lis_pkg_sens_data;
+ break;
+ }
+ case MODE_REGISTER_LISTENER_SENSDATA: /* POS_RegisterListenerSensData */
+ {
+ pkg_list = g_ret_list_reg_lis_sens_data;
+ break;
+ }
+ case MODE_GET_SENSDATA: /* POS_GetSensData */
+ {
+ pkg_list = g_ret_list_get_sens_data;
+ break;
+ }
+ default:
+ /* Error log */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [mode = %d]", mode);
+ break;
+ }
+
+ if (pkg_list != NULL) {
+ /* Search Return code list for DID */
+ for (i = 0; i < SENSOR_PUBLIC_DID_NUM; i++) {
+ if (did == pkg_list[i].did) {
+ break;
+ }
+ }
+
+ if (i != SENSOR_PUBLIC_DID_NUM) {
+ /* Get Unit type */
+ type = GetEnvSupportInfo();
+ switch (type) {
+ case UNIT_TYPE_GRADE1:
+ {
+ ret = pkg_list[i].GRADE1_ret;
+ break;
+ }
+ case UNIT_TYPE_GRADE2:
+ {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = pkg_list[i].GRADE2_ret;
+ break;
+ }
+ default:
+ /* Error log */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "GetEnvSupportInfo ERROR [type = %d]", type);
+ break;
+ }
+ } else {
+ /* Error log */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [did = %d]", did);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Information Extended Package Delivery Registration
+ * Sensor information is delivered for the first time.,Extension Packaging and Registering for Delivery.
+ *
+ * @param[in] hApp Application handle
+ * @param[in] notifyName Destination thread name
+ * @param[in] ucPkgNum Number of package data(1 to 16)
+ * @param[in] *pulDid Pointer to an array of data IDs for vehicle information
+ * @param[in] ucCtrlFlg Delivery control<br>
+ * Delivery registration: SENSOR_DELIVERY_REGIST<br>
+ * Delivery stop: SENSOR_DELIVERY_STOP (Note: Not mounted)<br>
+ * Resume delivery: SENSOR_DELIVERY_RESTART (Note: Not mounted)
+ * @param[in] ucDeliveryTiming Delivery timing<br>
+ * Updating : SENSOR_DELIVERY_TIMING_UPDATE<br>
+ * Changing : SENSOR_DELIVERY_TIMING_CHANGE
+ *
+ * @return SENSOR_RET_NORMAL Successful registration<br>
+ * SENSOR_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * SENSOR_RET_ERROR_PARAM Parameter error<br>
+ * SENSOR_RET_ERROR_DID Unregistered ID<br>
+ * SENSOR_RET_ERROR_BUFFULL FULL of delivery registers<br>
+ * SENSOR_RET_ERROR_NOSUPPORT Unsupported environment<br>
+ * SENSOR_RET_ERROR_INNER Internal abnormality
+ *
+ */
+SENSOR_RET_API POS_RegisterListenerPkgSensData(HANDLE hApp,
+ PCSTR notifyName,
+ uint8_t ucPkgNum,
+ DID *pulDid, uint8_t ucCtrlFlg, uint8_t ucDeliveryTiming) {
+ SENSOR_RET_API ret; /* Return value */
+ BOOL ret_b;
+ RET_API ret_api; /* System API return value */
+ EventID event_id; /* Event ID */
+ int32_t event_val; /* Event value */
+ SENSOR_MSG_DELIVERY_ENTRY_DAT data; /* Message data */
+ int32_t i; /* Generic counters */
+ PNO ch_pno; /* Converted internal PNO */
+ UNIT_TYPE type; /* Supported HW Configuration Type */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ ret = SENSOR_RET_NORMAL;
+ /* Check Handle */
+ if (hApp == NULL) {
+ /* NULL terminates with an abnormal parameter */
+ ret = SENSOR_RET_ERROR_PARAM;
+ }
+
+ if (ret == SENSOR_RET_NORMAL) {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = SENSOR_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == SENSOR_RET_NORMAL) {
+ /* Check Delivery Control Designation */
+ if (SENSOR_DELIVERY_REGIST != ucCtrlFlg) {
+ /* Parameters other than delivery registration terminated abnormally. */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Check delivery timing */
+ /* Change delivery timing,Terminate as a parameter error except update */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if (notifyName == NULL) {
+ /* Check Thread Name */
+ /* NULL terminates with an abnormal parameter */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if ((0 == ucPkgNum) || (SENSOR_PKG_DELIVERY_MAX < ucPkgNum)) {
+ /* Check Package Data Count */
+ /* Out-of-range is terminated as a parameter error. */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if (pulDid == NULL) {
+ /* Check Data ID */
+ /* NULL terminates with an abnormal parameter */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else {
+ /* Check if data ID is acceptable */
+ for (i = 0; i < ucPkgNum; i++) {
+ /* Judge DID */
+ ret_b = SENSOR_DID_JUDGE_REGLIS_PKG(pulDid[i]);
+ if (ret_b == FALSE) {
+ /* An unacceptable ID terminates with an abnormal parameter. */
+ ret = SENSOR_RET_ERROR_PARAM;
+ break;
+ } else {
+ ret = SENSOR_RET_NORMAL;
+ }
+ }
+ }
+ }
+
+ if (ret == SENSOR_RET_NORMAL) {
+ /* Resource acquisition */
+ if (VehicleGetResource() == TRUE) {
+
+ /* Initialization */
+ event_id = 0;
+ event_val = 0;
+ memset(reinterpret_cast<void *>(&data), 0, sizeof(SENSOR_MSG_DELIVERY_ENTRY_DAT));
+
+ /* Get PNO from Thread Name */
+ ch_pno = _pb_CnvName2Pno(notifyName);
+
+ /* Event Generation */
+ event_id = PosCreateEvent(ch_pno);
+
+ if (0 != event_id) {
+ /* Successful event generation */
+
+ /*--------------------------------------------------------------*
+ * Send Vehicle Sensor Information Delivery Registration Message *
+ *--------------------------------------------------------------*/
+ /* Create Message Data */
+ data.pno = ch_pno;
+ data.pkg_num = ucPkgNum;
+ data.delivery_timing = ucDeliveryTiming;
+ data.ctrl_flg = ucCtrlFlg;
+ data.event_id = event_id;
+ for (i = 0; i < ucPkgNum; i++) {
+ data.did[i] = pulDid[i];
+ }
+
+ /* Messaging */
+ ret_api = PosSndMsg(ch_pno,
+ PNO_VEHICLE_SENSOR,
+ CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT,
+ (uint16_t)sizeof(SENSOR_MSG_DELIVERY_ENTRY_DAT),
+ (const void *)&data);
+
+ if (RET_NORMAL == ret_api) {
+ /* Message transmission processing is successful */
+ /* Wait for completion event from vehicle sensor thread */
+ ret_api = _pb_WaitEvent(event_id,
+ SAPI_EVWAIT_VAL,
+ SENSOR_RET_ERROR_MIN,
+ SENSOR_RET_NORMAL,
+ &event_val,
+ POS_API_TIME_OUT_MS);
+ if (RET_NORMAL != ret_api) {
+ /* Return an internal error */
+ ret = SENSOR_RET_ERROR_INNER;
+ } else {
+ /* Return from Event Wait */
+ /* Set event value (processing result) as return value */
+ ret = (SENSOR_RET_API)event_val;
+ }
+ } else {
+ /* Message transmission processing failed */
+ /* Return an internal error */
+ ret = SENSOR_RET_ERROR_INNER;
+ }
+
+ /* Event deletion */
+ ret_api = PosDeleteEvent(event_id);
+ } else {
+ /* Event generation failure */
+ ret = SENSOR_RET_ERROR_CREATE_EVENT;
+ }
+ } else {
+ /* When resource shortage occurs, the system terminates with an insufficient resource error. */
+ ret = SENSOR_RET_ERROR_RESOURCE;
+ }
+ /* Resource release */
+ VehicleReleaseResource();
+ }
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+
+ return ret;
+}
+
+/*******************************************************************************
+ * MODULE : PosCreateEvent
+ * ABSTRACT : Event creation process
+ * FUNCTION : Generate an event
+ * ARGUMENT : pno : Thread ID
+ * NOTE :
+ * RETURN : Non-zero : Event ID
+ * : Zero : Event generation failure
+ ******************************************************************************/
+EventID PosCreateEvent(PNO pno) {
+ EventID event_id; /* Event ID */
+ char event_name[32]; /* Event name character string buffer */
+ RET_API ret_api; /* System API return value */
+
+ /* Initialization of event name character string buffer */
+ (void)memset(reinterpret_cast<void *>(event_name), 0, sizeof(event_name));
+
+ /* Event name creation */
+ snprintf(event_name, sizeof(event_name), "SENSOR_%X", pno); /* Ignore->MISRA-C++:2008 Rule 5-2-12 */
+
+ /* Event Generation */
+ event_id = _pb_CreateEvent(FALSE , 0, event_name); /* Ignore->MISRA-C++:2008 Rule 5-2-12 */
+
+ if (0 != event_id) {
+ /* For successful event generation */
+
+ /* Initialize the event */
+ ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, SENSOR_EVENT_VAL_INIT);
+ if (RET_NORMAL != ret_api) {
+ /* Event initialization failed */
+
+ /* Delete Event and Return Event Generation Failed */
+ ret_api = PosDeleteEvent(event_id);
+ event_id = 0;
+ }
+ }
+
+ return event_id;
+}
+
+/*******************************************************************************
+ * MODULE : PosDeleteEvent
+ * ABSTRACT : Event deletion processing
+ * FUNCTION : Delete events
+ * ARGUMENT : event_id : Event ID of the event to delete
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_EV_NONE : Specified event does not exist
+ ******************************************************************************/
+RET_API PosDeleteEvent(EventID event_id) {
+ return(_pb_DeleteEvent(event_id));
+}
+
+/*******************************************************************************
+ * MODULE : SensorLinkShareData
+ * ABSTRACT : Link to shared memory
+ * FUNCTION : Link to shared memory
+ * ARGUMENT : **share_top : Storage destination of shared memory top address
+ * : *share_size : Storage destination of shared memory area size
+ * : *offset : Offset storage destination to free shared memory area
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERROR : There is no shared memory area.
+ ******************************************************************************/
+RET_API SensorLinkShareData(void **share_top, uint32_t *share_size, uint16_t *offset) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api; /* System API return value */
+ SemID sem_id; /* Semaphore ID */
+ SENSOR_SHARE *share_top_tmp;
+ int32_t i;
+
+ /* Initialization */
+ ret_api = RET_ERROR;
+
+ /* Create Semaphore */
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(SENSOR_SEMAPHO_NAME));
+ if (0 != sem_id) {
+ /* Semaphore Lock */
+ ret_api = _pb_SemLock(sem_id);
+ if (RET_NORMAL == ret_api) {
+ /* Link to shared memory */
+ ret_api = _pb_LinkShareData(const_cast<char *>(SENSOR_SHARE_NAME), share_top, share_size);
+ if (RET_NORMAL == ret_api) {
+ /* By searching the free shared memory area,Offset is calculated if there is free space. */
+ share_top_tmp = reinterpret_cast<SENSOR_SHARE *>(*share_top);
+
+ /* Because the first block of the shared memory area is the control area,Loop from i = 1 */
+ for (i = 1; i < SENSOR_SHARE_BLOCK_NUM; i++) {
+ if (SENSOR_SHARE_UNLOCK == share_top_tmp->mng.lock_info[i]) {
+ break;
+ }
+ }
+ if (i < SENSOR_SHARE_BLOCK_NUM) {
+ /* Empty space */
+ /* Lock the block */
+ share_top_tmp->mng.lock_info[i] = SENSOR_SHARE_LOCK;
+
+ /* Calculate the offset to the block */
+ *offset = static_cast<uint16_t>(i * SENSOR_SHARE_BLOCK_SIZE);
+
+ /* Normal completion */
+ ret_api = RET_NORMAL;
+ } else {
+ /* No free space */
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* Failed link to shared memory */
+ ret_api = RET_ERROR;
+ }
+ /* Semaphore unlock */
+ _pb_SemUnlock(sem_id);
+ } else {
+ /* Semaphore lock failed */
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* Semaphore creation failed */
+ ret_api = RET_ERROR;
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : SensorUnLinkShareData
+ * ABSTRACT : Unlinking shared memory
+ * FUNCTION : Unlink shared memory
+ * ARGUMENT : *share_top : Start address of shared memory
+ * : offset : Offset to shared memory free area
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERROR : There is no shared memory area./semaphore error
+ ******************************************************************************/
+RET_API SensorUnLinkShareData(SENSOR_SHARE *share_top, uint16_t offset) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api; /* System API return value */
+ SemID sem_id; /* Semaphore ID */
+ int32_t i;
+
+ /* Initialization */
+ ret_api = RET_ERROR;
+
+ /* Create Semaphore */
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(SENSOR_SEMAPHO_NAME));
+ if (0 != sem_id) {
+ /* Semaphore Lock */
+ ret_api = _pb_SemLock(sem_id);
+ if (RET_NORMAL == ret_api) {
+ /* Unlock the block */
+ i = static_cast<int32>(offset) / SENSOR_SHARE_BLOCK_SIZE;
+ share_top->mng.lock_info[i] = SENSOR_SHARE_UNLOCK;
+
+ /* Semaphore unlock */
+ _pb_SemUnlock(sem_id);
+
+ /* Normal completion */
+ ret_api = RET_NORMAL;
+ } else {
+ /* Semaphore lock failed */
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* Semaphore creation failed */
+ ret_api = RET_ERROR;
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : SensorSetShareData
+ * ABSTRACT : Write processing to shared memory
+ * FUNCTION : Write shared memory
+ * ARGUMENT : *share_top : Start address of shared memory
+ * : offset : Offsets to shared memory write destination
+ * : *data_src :
+ : size_src :
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void SensorSetShareData(void *share_top, uint16_t offset, const void *data_src, uint16_t size_src) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SENSOR_SHARE_BLOCK_DAT *share_dat;
+
+ /* Calculate Shared Memory Write Address */
+ share_dat = reinterpret_cast<SENSOR_SHARE_BLOCK_DAT *>(reinterpret_cast<uint8_t *>(share_top) + offset);
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+
+ /* Clear Shared Memory */
+ memset(reinterpret_cast<void *>(share_dat), 0, sizeof(SENSOR_SHARE_BLOCK_DAT));
+
+ /* Set write size to shared memory */
+ share_dat->size = size_src;
+
+ /* Set specified data in shared memory */
+ memcpy(reinterpret_cast<void *>(&share_dat->data), data_src, (size_t)size_src);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : PosSndMsg
+ * ABSTRACT : Message transmission processing
+ * FUNCTION : Send a message to the specified PNO
+ * ARGUMENT : pno_src : Source PNO
+ * : pno_dest : Destination PNO
+ * : cid : Command ID
+ * : msg_len : Message data body length
+ * : *msg_len : Pointer to message data
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERRNOTRDY : Destination process is not wakeup
+ * : RET_ERRMSGFULL : Message queue overflows
+ * : RET_ERRPARAM : Buffer size error
+ ******************************************************************************/
+RET_API PosSndMsg(PNO pno_src, PNO pno_dest, CID cid, uint16_t msg_len, const void *msg_data) {
+ SENSOR_INTERNAL_MSG_BUF msg_buf; /* message buffer */
+ T_APIMSG_MSGBUF_HEADER *msg_hdr; /* Pointer to the message header */
+ RET_API ret_api; /* Return value */
+ PCSTR thread_name; /* Destination thread name */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* _CWORD71_ processing speed(Memset modification) */
+ /* Initializing the header of the message buffer */
+ memset(reinterpret_cast<void *>(&msg_buf.hdr), 0, sizeof(T_APIMSG_MSGBUF_HEADER));
+
+ /* Get pointer to send buffer */
+ msg_hdr = reinterpret_cast<T_APIMSG_MSGBUF_HEADER *>(reinterpret_cast<void *>(&msg_buf));
+
+ /*--------------------------------------------------------------*
+ * Create message headers *
+ *--------------------------------------------------------------*/
+ msg_hdr->hdr.sndpno = pno_src; /* Source PNO */
+ msg_hdr->hdr.cid = cid; /* Command ID */
+ msg_hdr->hdr.msgbodysize = msg_len; /* Message data body length */
+
+ /*--------------------------------------------------------------*
+ * Create message data *
+ *--------------------------------------------------------------*/
+ if ((0 != msg_data) && (0 != msg_len)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Set the message data */
+ memcpy(reinterpret_cast<void *>(msg_buf.data), msg_data, (size_t)msg_len);
+ }
+ /*--------------------------------------------------------------*
+ * Send messages *
+ *--------------------------------------------------------------*/
+ /* Get Thread Name from PNO */
+ if (pno_dest <= SYS_PNO_MAX) {
+ thread_name = POS_THREAD_NAME;
+ } else {
+ thread_name = _pb_CnvPno2Name(pno_dest);
+ }
+
+ if ((pno_dest <= SYS_PNO_MAX) && (pno_src <= SYS_PNO_MAX)) {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "[LOG pno_dest = 0x%x]", pno_dest);
+
+ /* Internal Process Transmission and Reception Messages */
+ ret_api = _pb_SndMsg(pno_dest,
+ (uint16_t)(sizeof(T_APIMSG_MSGBUF_HEADER) + msg_len),/* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ reinterpret_cast<void *>(&msg_buf), 0);
+ } else {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "[LOG thread_name = %s, cid = 0x%x]", thread_name, cid);
+
+ /* External Process Transmission and Reception Messages */
+ ret_api = _pb_SndMsg_Ext(thread_name,
+ cid,
+ (uint16_t)(msg_len), /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ reinterpret_cast<void *>(&(msg_buf.data)), 0);
+ }
+ /* If RET_ERROR,Register a dialog if called from a Vehicle related thread */ /* Task_30332 */
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "[ERROR]");
+ }
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "- [ret = %d]", ret_api);
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Sensor information acquisition
+ *
+ * Obtain sensor information
+ *
+ * @param[in] hApp HANDLE - Application handle
+ * @param[in] did DID - Data ID for vehicle information
+ * @param[in] dest_data void* - Pointer representing the storage destination of vehicle sensor information
+ * @param[in] dest_size uint16_t - Storage destination size of vehicle sensor information(byte)
+ *
+ * @return 0 or more Stored data size(Include illegal)<br>
+ * POS_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * POS_RET_ERROR_OUTOF_MEMORY Shared memory allocation failed<br>
+ * POS_RET_ERROR_SIZE Storage destination size error<br>
+ * POS_RET_ERROR_DID Unregistered ID<br>
+ * POS_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+POS_RET_API POS_GetSensData(HANDLE hApp, DID did, void *dest_data, uint16_t dest_size)
+{
+ POS_RET_API ret; /* Return value */
+ UNIT_TYPE type = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ BOOL ret_b;
+
+ /** NULL checking */
+ if ((hApp == NULL) || (dest_data == NULL)) {
+ /** Parameter error */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = POS_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = POS_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (ret == NAVIINFO_RET_NORMAL) {
+ /* Judge DID*/
+ ret_b = SENSOR_DID_JUDGE_GET(did);
+ if (ret_b == FALSE) {
+ /* An unacceptable ID is regarded as a parameter error. */
+ ret = POS_RET_ERROR_PARAM;
+ } else {
+ /* Data acquisition process */
+ ret = PosGetProc(did, dest_data, dest_size);
+ }
+ }
+
+ return ret;
+}
diff --git a/vehicleservice/positioning/client/src/POS_sensor_API/Vehicle_API.cpp b/vehicleservice/positioning/client/src/POS_sensor_API/Vehicle_API.cpp
new file mode 100755
index 0000000..3cd97f8
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_sensor_API/Vehicle_API.cpp
@@ -0,0 +1,292 @@
+/*
+ * @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 :Vehicle_API.cpp
+ * System name :GPF
+ * Subsystem name :Vehicle I/F library
+ * Program name :Vehicle I/F API
+ * Module configuration :POS_RegisterListenerSensData() Vehicle sensor information delivery registration
+ ******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include <stdio.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include "Sensor_API_private.h"
+#include "Vehicle_API_Dummy.h"
+#include "Vehicle_API_private.h"
+#include "POS_private.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+ * initialize
+******************************************************************************/
+VEHICLE_RET_API VehicleInitialize(u_int32 (*sighand)()) { // LCOV_EXCL_START 8:dead code // NOLINT(readability/nolint)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API _CWORD64_api_ret;
+ VEHICLE_RET_API ret;
+
+ _CWORD64_api_ret = _pb_Setup_CWORD64_API(NULL);
+
+ if (_CWORD64_api_ret == RET_NORMAL) {
+ ret = RET_NORMAL;
+ } else {
+ ret = RET_ERROR;
+ }
+ return ret;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Vehicle sensor information delivery registration
+ * Register delivery of vehicle sensor information
+ *
+ * @param[in] hApp Application handle
+ * @param[in] notifyName Destination thread name
+ * @param[in] ulDid Pointer to an array of data IDs for vehicle information
+ * @param[in] ucCtrlFlg Delivery control<br>
+ * Delivery registration: SENSOR_DELIVERY_REGIST<br>
+ * Delivery stop: SENSOR_DELIVERY_STOP (Note: Not mounted)<br>
+ * Resume delivery: SENSOR_DELIVERY_RESTART (Note: Not mounted)
+ * @param[in] ucDeliveryTiming Delivery timing<br>
+ * Updating : SENSOR_DELIVERY_TIMING_UPDATE<br>
+ * Changing : SENSOR_DELIVERY_TIMING_CHANGE
+ *
+ * @return SENSOR_RET_NORMAL Successful registration<br>
+ * SENSOR_RET_ERROR_CREATE_EVENT Event generation failure<br>
+ * SENSOR_RET_ERROR_PARAM Parameter error<br>
+ * SENSOR_RET_ERROR_DID Unregistered ID<br>
+ * SENSOR_RET_ERROR_BUFFULL FULL of delivery registers<br>
+ * SENSOR_RET_ERROR_NOSUPPORT Unsupported environment
+ *
+ */
+SENSOR_RET_API POS_RegisterListenerSensData(HANDLE hApp,
+ PCSTR notifyName, DID ulDid, u_int8 ucCtrlFlg, u_int8 ucDeliveryTiming) {
+ SENSOR_RET_API ret; /* Return value */
+ UNIT_TYPE type; /* Supported HW Configuration Type */
+ BOOL ret_b;
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Check Delivery Control Designation */
+ ret = SENSOR_RET_NORMAL;
+ /* Arguments & Support Configuration Check */
+ if ((ucDeliveryTiming != SENSOR_DELIVERY_TIMING_CHANGE) &&
+ (ucDeliveryTiming != SENSOR_DELIVERY_TIMING_UPDATE)) {
+ /* Change delivery timing,Terminate as a parameter error except update */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if (SENSOR_DELIVERY_REGIST != ucCtrlFlg) {
+ /* Parameters other than delivery registration terminated abnormally. */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if (hApp == NULL) {
+ /* Check Handle */
+ /* NULL terminates with an abnormal parameter */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else if (notifyName == NULL) {
+ /* Check Thread Name */
+ /* NULL terminates with an abnormal parameter */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else {
+ /* Positioning Base API initialization */
+ _pb_Setup_CWORD64_API(hApp);
+
+ /* Supported HW Configuration Check */
+ type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == type) {
+ /* GRADE1 */
+ ret = SENSOR_RET_NORMAL;
+ } else if (UNIT_TYPE_GRADE2 == type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ } else {
+ /* Environment error */
+ ret = SENSOR_RET_ERROR_NOSUPPORT;
+ }
+ }
+
+ if (SENSOR_RET_NORMAL == ret) {
+ /* Judge DID */
+ ret_b = SENSOR_DID_JUDGE_REGLIS(ulDid);
+ if (ret_b == FALSE) {
+ /* An unacceptable ID is regarded as a parameter error. */
+ ret = SENSOR_RET_ERROR_PARAM;
+ } else {
+ /* Delivery registration process */
+ ret = PosRegisterListenerProc(notifyName, ulDid, ucCtrlFlg, ucDeliveryTiming);
+ }
+ }
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "- [ret = %d]", ret);
+
+ return ret;
+}
+
+/*******************************************************************************
+ * MODULE : PosSetShareData
+ * ABSTRACT : Write processing to shared memory
+ * FUNCTION : Write shared memory
+ * ARGUMENT : *share_top : Start address of shared memory
+ * : offset : Offsets to shared memory write destination
+ * : *data_src : Data
+ * : size_src : Size
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void PosSetShareData(void *share_top, u_int16 offset, const void *data_src, u_int16 size_src) {
+ VEHICLE_SHARE_BLOCK_DAT *share_dat;
+ /* Calculate Shared Memory Write Address */
+ share_dat = reinterpret_cast<VEHICLE_SHARE_BLOCK_DAT *>(reinterpret_cast<u_int8 *>(share_top) + offset);
+
+ /* _CWORD71_ processing speed(Memset modification) */
+ /* Clear Shared Memory(Unused area) */
+ share_dat->reserve[0] = 0;
+ share_dat->reserve[1] = 0;
+
+ /* Set write size to shared memory */
+ share_dat->size = size_src;
+
+ /* Set specified data in shared memory */
+ memcpy(reinterpret_cast<void *>(share_dat->data), data_src, (size_t)size_src);
+}
+
+/*******************************************************************************
+* MODULE : VehicleGetDrData
+* ABSTRACT : DR information acquisition
+* FUNCTION : Retrieves DR information (optional data) by returning to completion.
+* ARGUMENT : pno : Thread ID
+* : did : Data ID for DR information
+* : *dest_data : Pointer to the storage destination of DR information
+* : dest_size : Storage destination size of DR information(byte)
+* NOTE :
+* RETURN : Zero or more : Stored data size
+* : VEHICLE_RET_ERROR_CREATE_EVENT : Event generation failure
+* : VEHICLE_RET_ERROR_OUTOF_MEMORY : Shared memory allocation failed
+* : VEHICLE_RET_ERROR_SIZE : Storage destination size error
+* : VEHICLE_RET_ERROR_DID : Unregistered ID
+******************************************************************************/
+int32 VehicleGetDrData(PNO pno, DID did, void *dest_data, u_int16 dest_size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VEHICLE_RET_API ret; /* Return value */
+ RET_API ret_api; /* System API return value */
+ EventID event_id; /* Event ID */
+ int32 event_val; /* Event value */
+ void *share_top; /* Start address of shared memory */
+ u_int32 share_size; /* Size of shared memory area */
+ u_int16 offset; /* Offset to free shared memory area */
+ VEHICLE_SHARE_BLOCK_DAT *share_dat; /* Address of free shared memory area */
+ VEHICLE_MSG_GET_VEHICLE_DATA_DAT data; /* Message data */
+
+ /* Initialization */
+ event_id = 0;
+ event_val = 0;
+ memset(reinterpret_cast<void *>(&data), 0, sizeof(VEHICLE_MSG_GET_VEHICLE_DATA_DAT));
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(pno);
+
+ if (0 != event_id) {
+ /* Successful event generation */
+ /* Allocate shared memory */
+ ret_api = VehicleLinkShareData(reinterpret_cast<void **>(&share_top), &share_size, &offset);
+ if (RET_NORMAL != ret_api) {
+ /* Failed to allocate shared memory */
+ ret = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ } else {
+ /* When the shared memory is allocated successfully */
+
+ /* Calculate start address of free shared memory area */
+ share_dat = reinterpret_cast<VEHICLE_SHARE_BLOCK_DAT *>(reinterpret_cast<u_int8 *>(share_top) + offset);
+
+ /* Send vehicle sensor information acquisition message */
+ data.did = did;
+ data.pno = pno;
+ data.offset = offset;
+ data.size = VEHICLE_SHARE_BLOCK_DSIZE;
+ data.event_id = event_id;
+ /* Messaging */
+
+ ret_api = VehicleSndMsg(pno,
+ PNO_VEHICLE_SENSOR,
+ CID_VEHICLEIF_GET_DR_DATA,
+ sizeof(VEHICLE_MSG_GET_VEHICLE_DATA_DAT),
+ (const void *)&data);
+
+ if (RET_NORMAL == ret_api) {
+ /* Message transmission processing is successful */
+ /* Wait for completion event from vehicle sensor thread */
+ ret_api = _pb_WaitEvent(event_id,
+ SAPI_EVWAIT_VAL,
+ VEHICLE_RET_ERROR_MIN, VEHICLE_RET_NORMAL, &event_val, INFINITE);
+ if (RET_NORMAL != ret_api) {
+ /* When not put in event wait state */
+ /* Return an event generation failure */
+ ret = VEHICLE_RET_ERROR_CREATE_EVENT;
+ } else {
+ /* Return from Event Wait */
+
+ /* Link to shared memory */
+ ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME), &share_top, &share_size);
+
+ /* Calculate the address of the shared memory storage area. */
+ share_dat = reinterpret_cast<VEHICLE_SHARE_BLOCK_DAT *>(reinterpret_cast<u_int8 *>(share_top)
+ + offset);
+
+ if (event_val < 0) {
+ /* Vehicle sensor information acquisition failure */
+ ret = (VEHICLE_RET_API)event_val;
+ } else if (RET_NORMAL != ret_api) {
+ /* Shared memory error */
+ ret = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ } else if (dest_size < share_dat->size) {
+ /* Storage destination size error */
+ ret = VEHICLE_RET_ERROR_SIZE;
+ } else {
+ /* Vehicle sensor information acquisition success */
+
+ /* Copy from shared memory to user memory */
+ memcpy(dest_data, share_dat->data, (size_t)share_dat->size);
+
+ /* Set Write Size to Return Value */
+ ret = static_cast<int32>(share_dat->size);
+ }
+ }
+ } else {
+ /* Message transmission processing failed */
+ /* Return an event generation failure */
+ ret = VEHICLE_RET_ERROR_CREATE_EVENT;
+ }
+ /* Free shared memory */
+ (void)VehicleUnLinkShareData(reinterpret_cast<VEHICLE_SHARE*>(share_top), offset);
+ }
+
+ /* Event deletion */
+ ret_api = VehicleDeleteEvent(event_id);
+
+ } else {
+ /* Event generation failure */
+ ret = VEHICLE_RET_ERROR_CREATE_EVENT;
+ }
+ return ret;
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/client/src/POS_sensor_API/libPOS_sensor_API.ver b/vehicleservice/positioning/client/src/POS_sensor_API/libPOS_sensor_API.ver
new file mode 100755
index 0000000..10fd95b
--- /dev/null
+++ b/vehicleservice/positioning/client/src/POS_sensor_API/libPOS_sensor_API.ver
@@ -0,0 +1,32 @@
+/*
+ * @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.
+ */
+
+#
+# libPOS_sensor_API version script
+#
+{
+ global:
+ POS_GetSensData;
+ POS_RegisterListenerPkgSensData;
+ POS_RegisterListenerSensData;
+ *PosSndMsg*;
+ *PosCreateEvent*;
+ *PosDeleteEvent*;
+ *PosSetShareData*;
+ local:
+ *;
+};
+
diff --git a/vehicleservice/positioning/server/Makefile b/vehicleservice/positioning/server/Makefile
new file mode 100755
index 0000000..6ef1082
--- /dev/null
+++ b/vehicleservice/positioning/server/Makefile
@@ -0,0 +1,22 @@
+#
+# @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.
+#
+
+######### subdirectories #########
+SUBDIRS += src/Sensor
+SUBDIRS += src/ServiceInterface
+SUBDIRS += src/nsfw
+
+include ../../vehicle_service.mk
diff --git a/vehicleservice/positioning/server/include/Sensor/ClockDataMng.h b/vehicleservice/positioning/server/include/Sensor/ClockDataMng.h
new file mode 100755
index 0000000..69a96c2
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/ClockDataMng.h
@@ -0,0 +1,100 @@
+/*
+ * @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 : ClockDataMng.h
+ * System name : PastModel002
+ * Subsystem name : Time-related processing
+ ******************************************************************************/
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKDATAMNG_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKDATAMNG_H_
+
+#include <vehicle_service/positioning_base_library.h>
+
+
+#include "positioning_hal.h"
+#include "CanInput_API.h"
+#include "Sensor_API.h"
+
+/********************************************************************************
+* Macro definitions *
+*********************************************************************************/
+#define CLOCKDATAMNG_SECONDS_PAR_WEEK (7 * 24 * 60 * 60)
+#define CLOCKDATAMNG_CNV_WEEK2SEC(WEEK) ((WEEK)* CLOCKDATAMNG_SECONDS_PAR_WEEK)
+
+/* [PastModel002 Specifications]Time difference tolerance(plus or minus 512 week or less,GPS TIME range from 0 to 1023 week) */
+#define CLOCKDATAMNG_TIME_DIFF_LIMIT_UPPER (512 * CLOCKDATAMNG_SECONDS_PAR_WEEK)
+#define CLOCKDATAMNG_TIME_DIFF_LIMIT_LOWER (-512 * CLOCKDATAMNG_SECONDS_PAR_WEEK)
+
+/* [PastModel002 Specifications]Time difference addition value(+1024week,GPS TIME range from 0 to 1023 week) */
+#define CLOCKDATAMNG_TIME_DIFF_ADD_VALUE (CLOCKDATAMNG_TIME_DIFF_LIMIT_UPPER * 2)
+
+/* [PastModel002 Specifications]GPS TIME weekNo scope */
+#define CLOCKDATAMNG_GPS_TIME_WEEKNO_LIMIT 1024
+
+/* [PastModel002 Specifications]Initial value of time difference information at the previous shutdown */
+#define CLOCKDATAMNG_TIME_DIFF_INIT_VALUE 0x7FFFFFFFL
+
+/* [PastModel002 Specifications]AID-INI lifetime(+4Time) */
+#define CLOCKDATAMNG_AID_INI_EFFECTIVE_TIME (4 * 60 * 60)
+
+/* [PastModel002 Specifications]AID-EPH lifetime(plus or minus 2 hours) */
+#define CLOCKDATAMNG_AID_EPH_EFFECTIVE_TIME (2 * 60 * 60)
+
+#define MUTEX_CLOCKDATAMNG __TEXT("MUTEX_VEHICLE_CLOCKDATAMNG")
+
+/********************************************************************************
+* Struct definitions *
+*********************************************************************************/
+/********************************************************************************
+ * TAG :CLOCKDATAMNG_GPS_TIME
+ * ABSTRACT :GPS time structure
+ * NOTE :
+ ********************************************************************************/
+typedef struct {
+ u_int32 tow; /* Time of week (msec) */
+ int16 week_no; /* GPS Week No. */
+ u_int8 reserve[2]; /* reserve */
+ BOOL validity_flag; /* Enabled/DisabledFlagging */
+} CLOCKDATAMNG_GPS_TIME;
+
+/********************************************************************************
+* Function prototype *
+*********************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ BOOL ClockDataMngInitialize(void);
+ void ClockDataMngSetLastTimeDiff(int32 time_diff);
+
+ void ClockDataMngSetGpsTime(const SENSOR_MSG_GPSDATA_DAT *gps_time_data);
+ void ClockDataMngGetGpsTime(CLOCKDATAMNG_GPS_TIME *gps_time_data);
+
+ BOOL ClockDataMngGetLocalTime(const CANINPUT_MSG_LOCALTIMEINFO_DAT *can_local_time, LOCALTIME *vehicle_local_time);
+ BOOL ClockDataMngGetTimeDiff(LOCALTIME *local_time, int32 *time_diff);
+
+ void ClockDataMngGetStartupTime(CLOCKDATAMNG_GPS_TIME *start_up_time);
+ int32 ClockDataMngCalculateTimeDiff(int32 munuend, int32 subtrahend);
+
+ BOOL ClockDataMngCheckLocalTime(LOCALTIME *local_time);
+ int32 ClockDataMngConversionLocalTime2GpsTime(LOCALTIME *local_time, BOOL calc_second_available);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKDATAMNG_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/ClockGPS_Process_Proto.h b/vehicleservice/positioning/server/include/Sensor/ClockGPS_Process_Proto.h
new file mode 100755
index 0000000..5f20c33
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/ClockGPS_Process_Proto.h
@@ -0,0 +1,37 @@
+/*
+ * @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 : ClockGPS_Process_Proto.h
+ * SYSTEM : _CWORD107_
+ * SUBSYSTEM: ClockGPS thread
+ * TITLE : Header for publication in a process (EXL)
+ ******************************************************************************/
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKGPS_PROCESS_PROTO_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKGPS_PROCESS_PROTO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+EFrameworkunifiedStatus ClockGPSThread(HANDLE h_app);
+int TimerSramInit(int); /* Baackup data check/initialization function */ /* Ignore->MISRA-C++:2008 Rule 3-9-2 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKGPS_PROCESS_PROTO_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/ClockUtility.h b/vehicleservice/positioning/server/include/Sensor/ClockUtility.h
new file mode 100755
index 0000000..8924975
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/ClockUtility.h
@@ -0,0 +1,46 @@
+/*
+ * @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 ClockUtility.h
+@detail Common processing function header file concerning clock
+*****************************************************************************/
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKUTILITY_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKUTILITY_H_
+
+#include <vehicle_service/positioning_base_library.h>
+#include "Clock_API.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ Function prototype declaration
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+ RET_API ClockUtilityConvertDateToSecond(const LPSYSTEMTIME lp_st, u_int32* uli_sec);
+ RET_API ClockUtilityConvertSecondToDate(const u_int32* uli_sec, LPSYSTEMTIME lp_st);
+
+ /* Converting TimeData Types to SYSTEMTIME Types Functions */
+ CLOCK_RETURN ClockApiConvertTimeDataToSYSTEMTIME(const TimeData* base_time,
+ SYSTEMTIME* result_time);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKUTILITY_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/ClockUtility_private.h b/vehicleservice/positioning/server/include/Sensor/ClockUtility_private.h
new file mode 100755
index 0000000..8c322ae
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/ClockUtility_private.h
@@ -0,0 +1,49 @@
+/*
+ * @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 ClockUtility_private.h
+@detail Common processing function private header file concerning clock
+*****************************************************************************/
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKUTILITY_PRIVATE_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKUTILITY_PRIVATE_H_
+
+#include "CommonDefine.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ Macro definitions
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define MONTH_MAX (12U) /* Maximum value of month */
+
+ /*
+ Data typing
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ /* Time parameter */
+ typedef struct ClockDayCnvTblTag {
+ YearCntTbl st_tbl[CNV_YEAR_MAX + 1 ]; /* Have +1 data for end determination */
+ } ClockDayCntTbl;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_CLOCKUTILITY_PRIVATE_H_
+
diff --git a/vehicleservice/positioning/server/include/Sensor/DeadReckoning_Common.h b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_Common.h
new file mode 100755
index 0000000..1c6e060
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_Common.h
@@ -0,0 +1,84 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_COMMON_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_COMMON_H_
+/****************************************************************************
+ * File name :DeadReckoning_Common.h
+ * System name :PastModel002
+ * Subsystem name :
+ ****************************************************************************/
+
+#include "Dead_Reckoning_Local_Api.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#define DEADRECKONING_ZERO 0
+#define DEADRECKONING_BIT0 0x00000001
+#define DEADRECKONING_BIT1 0x00000002
+#define DEADRECKONING_BIT2 0x00000004
+#define DEADRECKONING_BIT3 0x00000008
+#define DEADRECKONING_BIT4 0x00000010
+#define DEADRECKONING_BIT5 0x00000020
+#define DEADRECKONING_BIT6 0x00000040
+#define DEADRECKONING_BIT7 0x00000080
+#define DEADRECKONING_BIT29 0x20000000
+#define DEADRECKONING_BIT30 0x40000000
+#define DEADRECKONING_BIT31 0x80000000
+#define DEADRECKONING_NEQ 1
+#define DEADRECKONING_EQ 0
+#define DEADRECKONING_INVALID 0
+#define DEADRECKONING_EFFECTIVE 1
+#define DEADRECKONING_CHGTYPE_NCHG DEADRECKONING_EQ
+#define DEADRECKONING_CHGTYPE_CHG DEADRECKONING_NEQ
+#define DEADRECKONING_GETMETHOD_DR 4 /* Data collection way: DR */
+
+/* Offset value of normal data of vehicle sensor */
+#define DEADRECKONING_OFFSET_NORMAL 4
+
+/************************************************************************
+* Typedef definitions *
+************************************************************************/
+
+/* Data Master Set Notification Function */
+typedef void (*PFUNC_DR_DMASTER_SET_N) (DID, u_int8, u_int8);
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+/*********************************************************************
+* TAG : DEADRECKONING_DID_OFFSET_TBL
+* ABSTRACT : Vehicle sensor data ID,Structure of each data in the offset table
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_offset; /* Offset value */
+ u_int8 uc_reserve[2]; /* Reserved */
+} DEADRECKONING_DID_OFFSET_TBL;
+
+/*********************************************************************
+* TAG :
+* ABSTRACT :
+***********************************************************************/
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+u_int8 DeadReckoningMemcmp(const void *, const void *, size_t);
+int32 DeadReckoningCheckDid(DID);
+u_int16 DeadReckoningGetDataMasterOffset(DID);
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_COMMON_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/DeadReckoning_DataMaster.h b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_DataMaster.h
new file mode 100755
index 0000000..00c056a
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_DataMaster.h
@@ -0,0 +1,127 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DATAMASTER_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DATAMASTER_H_
+/****************************************************************************
+ * File name :DeadReckoning_DataMaster.h
+ * System name :PastModel002
+ * Subsystem name :DeadReckoning processes
+ ****************************************************************************/
+
+#include "DeadReckoning_Common.h"
+#include "Dead_Reckoning_Local_Api.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+/* Initial value */
+#define VEHICLE_DINIT_LONGITUDE 0x00
+#define VEHICLE_DINIT_LATITUDE 0x00
+#define VEHICLE_DINIT_ALTITUDE 0x00
+#define VEHICLE_DINIT_SPEED 0x00
+#define VEHICLE_DINIT_HEADING 0x00
+#define VEHICLE_DINIT_DR_SNS_COUNTER 0x00
+#define VEHICLE_DINIT_GYRO_OFFSET 0x0000
+#define VEHICLE_DINIT_GYRO_SCALE_FACTOR 0x00
+#define VEHICLE_DINIT_GYRO_SCALE_FACTOR_LEVEL 0x00
+#define VEHICLE_DINIT_SPEED_PULSE_SCALE_FACTOR 0x0000
+#define VEHICLE_DINIT_SPEED_PULSE_SCALE_FACTOR_LEVEL 0x00
+
+#define VEHICLE_DSIZE_LONGITUDE 0x04
+#define VEHICLE_DSIZE_LATITUDE 0x04
+#define VEHICLE_DSIZE_ALTITUDE 0x04
+#define VEHICLE_DSIZE_SPEED 0x02
+#define VEHICLE_DSIZE_HEADING 0x02
+#define VEHICLE_DSIZE_DR_SNS_COUNTER 0x01
+#define VEHICLE_DSIZE_GYRO_OFFSET 0x02
+#define VEHICLE_DSIZE_GYRO_SCALE_FACTOR 0x01
+#define VEHICLE_DSIZE_GYRO_SCALE_FACTOR_LEVEL 0x01
+#define VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR 0x02
+#define VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR_LEVEL 0x01
+
+/* Data received*/
+#define DEADRECKONING_RCVFLAG_ON 0x01
+#define DEADRECKONING_RCVFLAG_OFF 0x00
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/*********************************************************************
+* TAG : DEADRECKONING_DATA_MASTER
+* ABSTRACT : Vehicle SW Data Master Structure
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcv_flag; /* Receive flag */
+ u_int8 dr_status; /* DR status */
+ u_int8 uc_data[4]; /* Vehicle DR data */
+} DEADRECKONING_DATA_MASTER;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+void DeadReckoningInitDataMaster(void);
+void DeadReckoningSetDataMaster(const DEADRECKONING_DATA_MASTER *, PFUNC_DR_DMASTER_SET_N);
+void DeadReckoningGetDataMaster(DID ul_did, DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitLongitudeDr(void);
+u_int8 DeadReckoningSetLongitudeDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetLongitudeDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitLatitudeDr(void);
+u_int8 DeadReckoningSetLatitudeDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetLatitudeDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitAltitudeDr(void);
+u_int8 DeadReckoningSetAltitudeDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetAltitudeDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitSpeedDr(void);
+u_int8 DeadReckoningSetSpeedDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetSpeedDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitHeadingDr(void);
+u_int8 DeadReckoningSetHeadingDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetHeadingDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitSnsCounterDr(void);
+u_int8 DeadReckoningSetSnsCounterDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetSnsCounterDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitGyroOffsetDr(void);
+u_int8 DeadReckoningSetGyroOffsetDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetGyroOffsetDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitGyroScaleFactorDr(void);
+u_int8 DeadReckoningSetGyroScaleFactorDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetGyroScaleFactorDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitGyroScaleFactorLevelDr(void);
+u_int8 DeadReckoningSetGyroScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetGyroScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitSpeedPulseScaleFactorDr(void);
+u_int8 DeadReckoningSetSpeedPulseScaleFactorDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetSpeedPulseScaleFactorDr(DEADRECKONING_DATA_MASTER *);
+
+void DeadReckoningInitSpeedPulseScaleFactorLevelDr(void);
+u_int8 DeadReckoningSetSpeedPulseScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *);
+void DeadReckoningGetSpeedPulseScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DATAMASTER_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/DeadReckoning_DeliveryCtrl.h b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_DeliveryCtrl.h
new file mode 100755
index 0000000..a555a47
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_DeliveryCtrl.h
@@ -0,0 +1,137 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DELIVERYCTRL_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DELIVERYCTRL_H_
+/******************************************************************************
+ * File name :DeadReckoning_DeliveryCtrl.h
+ * System name :PastModel002
+ * Subsystem name :
+ ******************************************************************************/
+
+#include "DeadReckoning_DataMaster.h"
+#include "Dead_Reckoning_Local_Api.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#define DEADRECKONING_SIGNAL 6 /* Number of vehicle signals */
+#define DEADRECKONING_DELIVERY 10 /* Number of delivery destinations */
+/* Vehicle sensor information */
+#define DEADRECKONING_DELIVERY_INFO (DEADRECKONING_SIGNAL)
+/* Maximum number of vehicle sensor information */
+#define DEADRECKONING_DELIVERY_INFO_MAX (DEADRECKONING_DELIVERY_INFO * DEADRECKONING_DELIVERY)
+/* Vehicle Sensor Information Valid Number */
+#define DEADRECKONING_DID_EFFECTIVE (DEADRECKONING_SIGNAL)
+#define DEADRECKONING_ACTION_TYPE_ADD 0 /* Vehicle sensor addition processing */
+#define DEADRECKONING_ACTION_TYPE_UPDATE 1 /* Vehicle sensor update processing */
+
+#define DEADRECKONING_LINK_INDEX_END 0xFFFF /* End of the link index */
+
+#define DEADRECKONING_DELIVERY_METHOD_NORMAL 0 /* Delivery system normal delivery */
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/*********************************************************************
+* TAG :DEADRECKONING_DELIVERY_CTRL_TBL_DATA
+* ABSTRACT : Structure of each data of the vehicle sensor delivery destination management table
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ PNO us_pno; /* Shipping PID */
+ u_int8 uc_chg_type; /* Delivery timing */
+ u_int8 uc_ctrl_flg; /* Delivery operation */
+ u_int16 us_link_idx; /* Link index */
+ u_int8 uc_method; /* Delivery system */
+ u_int8 uc_reserve; /* reserve */
+} DEADRECKONING_DELIVERY_CTRL_TBL_DATA;
+
+/*********************************************************************
+* TAG : DEADRECKONING_DELIVERY_CTRL_TBL
+* ABSTRACT : Vehicle Sensor Delivery Destination Management Table Structure
+***********************************************************************/
+typedef struct {
+ u_int16 us_num; /* Number of delivery destination management data items */
+ u_int8 uc_reserve[2]; /* Reserved */
+ /* Array of each data */
+ DEADRECKONING_DELIVERY_CTRL_TBL_DATA st_ctrl_data[DEADRECKONING_DELIVERY_INFO_MAX];
+} DEADRECKONING_DELIVERY_CTRL_TBL;
+
+/*********************************************************************
+* TAG : DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA
+* ABSTRACT : Structure of each data of Vehicle Sensor Destination Management Table Management
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_start_idx; /* Start index */
+ u_int16 us_end_idx; /* End index */
+ u_int16 us_dlvry_entry_num; /* Number of registered shipping addresses */
+ u_int8 uc_reserve[2]; /* Reserved */
+} DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA;
+
+/*********************************************************************
+* TAG : DEADRECKONING_DELIVERY_CTRL_TBL_MNG
+* ABSTRACT : Structure of Vehicle Sensor Delivery Destination Management Table Management
+***********************************************************************/
+typedef struct {
+ u_int16 us_num; /* Number of data items */
+ u_int8 uc_reserve[2]; /* Reserved */
+ /* Array of each data */
+ DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA st_ctrl_tbl_mng_data[DEADRECKONING_DELIVERY_INFO];
+} DEADRECKONING_DELIVERY_CTRL_TBL_MNG;
+
+/*********************************************************************
+* TAG : DEADRECKONING_DELIVERY_PNO_TBL
+* ABSTRACT : Vehicle Sensor Destination PNO Table
+***********************************************************************/
+typedef struct {
+ PNO us_pno; /* Thread ID */
+ u_int16 us_index; /* Appropriate INDEX in the delivery control table */
+ u_int8 uc_method; /* Delivery system */
+ u_int8 uc_reserve[3]; /* reserve */
+} DEADRECKONING_DELIVERY_PNO_TBL_DAT;
+
+typedef struct {
+ u_int16 us_num; /* Number of data items */
+ u_int8 uc_reserve[2]; /* reserve */
+ DEADRECKONING_DELIVERY_PNO_TBL_DAT st_pno_data[DEADRECKONING_DELIVERY_INFO_MAX];
+} DEADRECKONING_DELIVERY_PNO_TBL;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+
+DEADRECKONING_DELIVERY_PNO_TBL* DeadReckoningMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type);
+
+DEAD_RECKONING_RET_API DeadReckoningEntryDeliveryCtrl(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
+
+void DeadReckoningInitDeliveryCtrlTbl(void);
+void DeadReckoningInitDeliveryCtrlTblMng(void);
+
+void DeadReckoningAddDeliveryCtrlTbl(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
+void DeadReckoningUpdateDeliveryCtrlTbl(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *);
+void DeadReckoningAddDeliveryCtrlTblMng(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
+void DeadReckoningUpdateDeliveryCtrlTblMng(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *);
+
+void DeadReckoningAddPnoTbl(u_int16);
+void DeadReckoningDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method);
+void DeadReckoningFirstDelivery(PNO us_pno, DID ul_did);
+
+RET_API DRManagerSndMsg(PNO us_pno_src, PNO us_pno_dest, CID us_cid, u_int16 us_msg_len, const void *p_msg_data);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_DELIVERYCTRL_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/DeadReckoning_main.h b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_main.h
new file mode 100755
index 0000000..3e2e9d4
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/DeadReckoning_main.h
@@ -0,0 +1,146 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_MAIN_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_MAIN_H_
+/****************************************************************************
+ * File name :DeadReckoning_main.h
+ * System name :PastModel002
+ * Subsystem name :
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+
+#include "Sensor_Common_API.h"
+
+#include "Dead_Reckoning_API.h"
+#include "Dead_Reckoning_Local_Api.h"
+#include "DeadReckoning_Common.h"
+#include "DeadReckoning_DataMaster.h"
+#include "DeadReckoning_DeliveryCtrl.h"
+
+#include "Sensor_API.h"
+#include "VehicleSens_DeliveryCtrl.h"
+#include "VehicleDebug_API.h"
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+/* Return value */
+#define RET_SWMNG_SUCCESS RET_NORMAL /* Success of API processing */
+#define RET_SWMNG_ERROR RET_ERROR /* API processing failed */
+
+/*** Rcv Message Relationships ***************************************************/
+/* Size of data section */
+#define DEAD_RECKONING_RCVMSG_MSGBUF 512 /* RcvMSG Byte count in data section */
+#define DEAD_RECKONING_RCVDATA_SENSOR_MSGBUF 40 /* RcvMSG Byte count of Sensor data section */
+#define DEAD_RECKONING_RCVDATA_SENSOR_FIRST_MSGBUF 1000 /* RcvMSG Initial Byte count of sensor data section */
+#define DEAD_RECKONING_SENSOR_FIRST_NUM 175 /* Initial number of saved sensor data */
+
+/* Event initial value */
+/* DR_API_private. Synchronize with DR_EVENT_VAL_INIT in h */
+#define DR_EVENT_VAL_INIT (-101)
+
+/* Event initial value */
+/* DeadReckoning_main. Synchronize with h's VEHICELEDEBUG_EVENT_VAL_INIT */
+#define VEHICLEDEBUG_EVENT_VAL_INIT (-101)
+
+/* PastModel002 sleep time[ms] for CPU load balancing in the first sensor data processing */
+#define DR_FST_SENS_CALC_SLEEP_TIME 15
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/*********************************************************************
+* TAG : DEAD_RECKONING_RCVDATA
+* ABSTRACT : Message receive buffer structure
+***********************************************************************/
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER hdr;
+ u_int8 data[DEAD_RECKONING_RCVMSG_MSGBUF]; /* Data portion */
+} DEAD_RECKONING_RCVDATA;
+
+/*********************************************************************
+* TAG : DEAD_RECKONING_RCVDATA_SENSOR
+* ABSTRACT : LineSensor Vehicle Signal Notification Message Structure
+***********************************************************************/
+typedef struct {
+ u_int32 did; /* Data ID */
+ u_int8 size; /* Size of the data */
+ u_int8 reserve[3]; /* Reserved */
+ u_int8 data[DEAD_RECKONING_RCVDATA_SENSOR_MSGBUF]; /* Data content */
+} DEAD_RECKONING_RCVDATA_SENSOR;
+
+/*********************************************************************
+* TAG : DEAD_RECKONING_RCVDATA_SENSOR_FIRST
+* ABSTRACT : LineSensor Vehicle Signal Notification Message Structure
+***********************************************************************/
+typedef struct {
+ u_int32 did; /* Data ID */
+ u_int16 size; /* Size of the data */
+ u_int8 reserve[1]; /* Reserved */
+ u_int8 num; /* Number of data */
+ u_int8 data[DEAD_RECKONING_RCVDATA_SENSOR_FIRST_MSGBUF]; /* Data content */
+} DEAD_RECKONING_RCVDATA_SENSOR_FIRST;
+
+/*********************************************************************
+* TAG : DEAD_RECKONING_SAVEDATA_SENSOR_FIRST
+* ABSTRACT : LineSensor Vehicle Signal-Storage Message Structures
+***********************************************************************/
+typedef struct {
+ u_int16 gyro_x_data[DEAD_RECKONING_SENSOR_FIRST_NUM * NUM_OF_100msData]; /* Data content */
+ u_int16 gyro_y_data[DEAD_RECKONING_SENSOR_FIRST_NUM * NUM_OF_100msData]; /* Data content */
+ u_int16 gyro_z_data[DEAD_RECKONING_SENSOR_FIRST_NUM * NUM_OF_100msData]; /* Data content */
+ u_int16 spd_pulse_data[DEAD_RECKONING_SENSOR_FIRST_NUM]; /* Data content */
+ u_int8 spd_pulse_check_data[DEAD_RECKONING_SENSOR_FIRST_NUM]; /* Data content */
+ u_int8 rev_data[DEAD_RECKONING_SENSOR_FIRST_NUM]; /* Data content */
+ u_int8 data_num; /* Number of data */
+ u_int8 reserve[3]; /* reserve */
+ u_int16 gyro_x_rcv_size; /* Receiving Size */
+ u_int16 gyro_y_rcv_size; /* Receiving Size */
+ u_int16 gyro_z_rcv_size; /* Receiving Size */
+ u_int16 spd_pulse_rcv_size; /* Receiving Size */
+ u_int16 spd_pulse_check_rcv_size; /* Receiving Size */
+ u_int16 rev_rcv_size; /* Receiving Size */
+} DEAD_RECKONING_SAVEDATA_SENSOR_FIRST;
+
+/*********************************************************************
+* TAG : DEAD_RECKONING_LONLAT_INFO
+* ABSTRACT : Get Position Information Structure
+***********************************************************************/
+typedef struct {
+ u_int8 calc_called; /* Whether Calculate_DeadReckoningData was called */
+ u_int8 available;
+ u_int8 reserve[2];
+ LONLAT lonlat;
+} DEAD_RECKONING_LONLAT_INFO;
+
+/************************************************************************
+* DeadReckoning_main function prototype *
+************************************************************************/
+
+void DeadReckoningRcvMsg(const DEAD_RECKONING_RCVDATA *msg, DEAD_RECKONING_LONLAT_INFO *location_info);
+void DeadReckoningRcvMsgFstSens(const DEAD_RECKONING_RCVDATA *msg, DEAD_RECKONING_LONLAT_INFO *location_info,
+ const SENSOR_MSG_GPSDATA_DAT *rcv_gps_msg, Struct_GpsData* send_gps_msg,
+ Struct_SensData* send_sensor_msg);
+int32 DeadReckoningInit(void);
+void DeadReckoningGetDRData(const DEADRECKONING_MSG_GET_DR_DATA *msg);
+void DeadReckoningSetMapMatchingData(const DR_MSG_MAP_MATCHING_DATA *msg);
+void DeadReckoningClearBackupData(const DR_MSG_CLEAR_BACKUP_DATA *msg);
+void DeadReckoningGetLocationLogStatus(PNO pno);
+void DeadReckoningSetLocationLogStatus(BOOL log_sw, u_int8 severity);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_DEADRECKONING_MAIN_H_ */
diff --git a/vehicleservice/positioning/server/include/Sensor/GpsInt.h b/vehicleservice/positioning/server/include/Sensor/GpsInt.h
new file mode 100755
index 0000000..fbb69de
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/GpsInt.h
@@ -0,0 +1,68 @@
+/*
+ * @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 :GpsInt.h
+* System name :PastModel002
+* Process name :Vehicle
+* Overview :GPS interrupt thread header
+******************************************************************************************/
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_GPSINT_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_GPSINT_H_
+
+/*******************************************************************************
+* Include File
+*******************************************************************************/
+
+/*******************************************************************************
+* Define
+*******************************************************************************/
+#define GPS_IRQ_ADR 0x00000306UL /* GPS IRQ addresses */
+#define GPS_MASK_6BIT 0x00000040UL /* GPS IRQ bit-mask position */
+
+#define GPS_GPIO0_IRQSTATUS_0_OFFSET 0x0000002CUL /* IRQSTATUS_0 offset */
+#define GPS_GPIO0_IRQSTATUS_SET_0_OFFSET 0x00000034UL /* IRQSTATUS_SET_0 offset */
+#define GPS_GPIO0_RISINGDETECT_OFFSET 0x00000148UL /* RISINGDETECT offsets */
+
+/* IRQSTATUS_0 address */
+#define GPS_GPIO0_IRQSTATUS_0_ADDR (DM816X_GPIO0_BASE + GPS_GPIO0_IRQSTATUS_0_OFFSET)
+
+/* IRQSTATUS_SET_0 address */
+#define GPS_GPIO0_IRQSTATUS_SET_0_ADDR (DM816X_GPIO0_BASE + GPS_GPIO0_IRQSTATUS_SET_0_OFFSET)
+
+/* RISINGDETECT addresses */
+#define GPS_GPIO0_RISINGDETECT_ADDR (DM816X_GPIO0_BASE + GPS_GPIO0_RISINGDETECT_OFFSET)
+
+/*******************************************************************************
+* Struct
+*******************************************************************************/
+typedef struct {
+ DWORD irq_status_reg; /* Interrupt Source Clear Register */
+ DWORD irq_status_set_reg; /* Interrupt enable register */
+ DWORD rising_detect_reg; /* Rising edge detection setting register */
+} GPS_INT_DATA;
+
+/***************************
+* Function prototype declaration
+***************************/
+RET_API DEVGpsIntInitial(void);
+BOOL DEVGpsIntMapDevice(void);
+void DEVGpsIntUnMapDevice(void);
+void DEVGpsIntSetInterupt(void);
+void DEVGpsIntIntRegClear(void);
+RET_API DEVGpsIntSndMsg(void);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_GPSINT_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/SensorLog.h b/vehicleservice/positioning/server/include/Sensor/SensorLog.h
new file mode 100755
index 0000000..9b6a49a
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/SensorLog.h
@@ -0,0 +1,114 @@
+/*
+ * @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
+ * SensorLog.h
+ * @brief
+ * Definition for Sensor Logging I/F Liblary
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_SENSORLOG_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_SENSORLOG_H_
+
+#include <stdint.h>
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_define.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* NAV-SVINFO sizes(chnum=20) */
+#define SENSLOG_GPS_SIZE_NAVSVINFO 248
+
+/* Sensor log data type */
+typedef enum {
+ SENSLOG_DATA_I_UNSPECIFIED = 0, /* Input:Not specified */
+
+ SENSLOG_DATA_I_SYS, /* Input:Sensor */
+ SENSLOG_DATA_I_SYS_STS, /* Input:External terminal status */
+ SENSLOG_DATA_I_GPS, /* Input:GPS(_CWORD82_/u-blox) */
+ SENSLOG_DATA_I_LOC, /* Input:Location information */
+ SENSLOG_DATA_I_SPEED, /* Input:Vehicle speed */
+ SENSLOG_DATA_I_TIME, /* Input:Request to set GPS time */
+ SENSLOG_DATA_I_GPSINF, /* Input:GPS information setting request */
+ SENSLOG_DATA_I_GPSRST, /* Input:GPS reset request */
+ SENSLOG_DATA_I_GPSSET, /* Input:GPS setting request */
+ SENSLOG_DATA_I_NAVSVINFO, /* Input:NAV-SVINFO(u-blox)*/
+ SENSLOG_DATA_I_SYS_ABNORMAL, /* Input:Sensor(When an error occurs) */
+ SENSLOG_DATA_I_COUNT /* Classified number */
+} SENSLOG_DATA_I;
+
+typedef enum {
+ SENSLOG_DATA_O_UNSPECIFIED = 0, /* Output:Not specified */
+
+ SENSLOG_DATA_O_SYS, /* Output:Sensor */
+ SENSLOG_DATA_O_SYS_PKG, /* Output:Sensor(PKG) */
+ SENSLOG_DATA_O_GPS, /* Output:GPS(_CWORD82_/u-blox) */
+ SENSLOG_DATA_O_LONLAT_N, /* Output:Latitude and longitude(NAVI) */
+ SENSLOG_DATA_O_LONLAT_G, /* Output:Latitude and longitude(GPS) */
+ SENSLOG_DATA_O_ALT, /* Output:Altitude */
+ SENSLOG_DATA_O_SPEED_N, /* Output:Vehicle speed(NAVI) */
+ SENSLOG_DATA_O_SPEED_P, /* Output:Vehicle speed(POS) */
+ SENSLOG_DATA_O_HEAD_N, /* Output:Orientation(NAVI) */
+ SENSLOG_DATA_O_HEAD_G, /* Output:Orientation(GPS) */
+ SENSLOG_DATA_O_TIME_SETREQ, /* Output:GPS time delivery request */
+ SENSLOG_DATA_O_TIME, /* Output:GPS time */
+ SENSLOG_DATA_O_GPSINF, /* Output:GPS information */
+ SENSLOG_DATA_O_TIME_CS, /* Output:GPS time(For the ClockService) */
+ SENSLOG_DATA_O_GPSRST, /* Output:GPS reset response */
+
+ SENSLOG_DATA_O_COUNT /* Classified number */
+} SENSLOG_DATA_O;
+
+/* Send/Receive result */
+#define SENSLOG_RES_SUCCESS 0 /* Send/Receive Success */
+#define SENSLOG_RES_FAIL 1 /* Send/Receive Abnormality */
+
+/* Destination name(Internal use) */
+#define SENSLOG_PNAME_CLOCK "*Clock" /* Clock Service */
+#define SENSLOG_PNAME_COMMUSB "*CommUSB" /* CommUSB */
+
+#define SENSLOG_ON 1
+#define SENSLOG_OFF 0
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+/* SensorLog public API */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void SensLogInitialize(uint8_t *p_mount_path);
+ uint8_t SensLogGetNavSvinfoFlag(void);
+ void SensLogWriteInputData(uint16_t us_data_type, DID ul_did, PNO us_pno, uint8_t *p_data, \
+ uint16_t us_size, uint8_t uc_result, uint8_t u_write_flag, uint8_t u_write_abnormal_flag);
+ void SensLogWriteOutputData(uint16_t us_data_type, DID ul_did, PNO us_pno, uint8_t *p_data, \
+ uint16_t us_size, uint8_t uc_result);
+ void SensLogTerminate(void);
+ void SensLogStore(void);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_SENSORLOG_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_Common.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_Common.h
new file mode 100755
index 0000000..7b47268
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_Common.h
@@ -0,0 +1,131 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_COMMON_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_COMMON_H_
+/****************************************************************************
+ * File name :VehicleSens_Common.h
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ ****************************************************************************/
+
+#include "Vehicle_API_Dummy.h"
+#include "Vehicle_API_private.h"
+
+#include "positioning_hal.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#define VEHICLESENS_ZERO 0
+#define VEHICLESENS_BIT0 0x00000001
+#define VEHICLESENS_BIT1 0x00000002
+#define VEHICLESENS_BIT2 0x00000004
+#define VEHICLESENS_BIT3 0x00000008
+#define VEHICLESENS_BIT4 0x00000010
+#define VEHICLESENS_BIT5 0x00000020
+#define VEHICLESENS_BIT6 0x00000040
+#define VEHICLESENS_BIT7 0x00000080
+#define VEHICLESENS_BIT29 0x20000000
+#define VEHICLESENS_BIT30 0x40000000
+#define VEHICLESENS_BIT31 0x80000000
+#define VEHICLESENS_NEQ 1
+#define VEHICLESENS_EQ 0
+#define VEHICLESENS_INVALID 0
+#define VEHICLESENS_EFFECTIVE 1
+#define VEHICLESENS_CHGTYPE_NCHG VEHICLESENS_EQ
+#define VEHICLESENS_CHGTYPE_CHG VEHICLESENS_NEQ
+#define VEHICLESENS_GETMETHOD_CAN 0 /* Data collection way: CAN communication */
+#define VEHICLESENS_GETMETHOD_LINE 1 /* Data collection way: LineSensor drivers */
+#define VEHICLESENS_GETMETHOD_NO_DETECTION 2 /* Data collection way: Not downloaded */
+#define VEHICLESENS_GETMETHOD_GPS 3 /* Data collection way: GPS */
+#define VEHICLESENS_GETMETHOD_NAVI 4 /* Data collection way: NAVI */
+#define VEHICLESENS_GETMETHOD_CLOCK 5 /* Data collection way: Clock Information */
+#define VEHICLESENS_GETMETHOD_INTERNAL 6 /* Data collection way: Internal calculation */
+#define VEHICLESENS_GETMETHOD_OTHER 7 /* Data collection way: Others */
+
+/* Offset value of normal data of vehicle sensor */
+#define VEHICLESENS_OFFSET_NORMAL 32
+/* Offset value of normal data of vehicle sensor */
+#define VEHICLESENS_OFFSET_GPS_FORMAT 268 /* 8 + 260 */
+/* Offset value of normal data of vehicle sensor */
+#define VEHICLESENS_OFFSET_GPS_BINARY 368 /* 8 + 360 */
+/* ++ GPS _CWORD82_ support */
+#define VEHICLESENS_OFFSET_GPS_NMEA 460 /* 8 + 452 Packaged delivery offset */
+/* -- GPS _CWORD82_ support */
+
+/* ++ PastModel002 support */
+/* U-Blox GPS offsets */
+#define VEHICLESENS_OFFSET_GPS_UBLOX 220 /* 220 */
+/* -- PastModel002 support */
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+#define VEHICLESENS_OFFSET_10WORD_PKG_EXT 208 /* Offset value of 10 initial deliveries(WORD) 8 + (20 * 10) */
+#define VEHICLESENS_OFFSET_WORD_PKG_EXT 28 /* Offset value of 10 initial deliveries(WORD) 8 + 20 */
+#define VEHICLESENS_OFFSET_BYTE_PKG_EXT 18 /* Offset value of 10 initial deliveries(BYTE) 8 + 10 */
+#define VEHICLESENS_OFFSET_32LONG_PKG_EXT 1328 /* Offset value of 10 initial deliveries(LONG) 8 + (132 * 10) */
+#define VEHICLESENS_OFFSET_20WORD 48 /* Offset value of 20 sensor data(WORD) 8 + 40 */
+#define VEHICLESENS_OFFSET_20WORD_FST 408 /* Offset value of 20 initial sensor data(WORD) 8 + 400 */
+#define VEHICLESENS_DNUM_4 4 /* Number of sensor data */
+#define VEHICLESENS_DNUM_5 5 /* Number of sensor data */
+#define VEHICLESENS_DNUM_7 7 /* Number of sensor data */
+#endif
+#define VEHICLESENS_EXT_OFF 0 /* Normal delivery */
+#define VEHICLESENS_EXT_ON 1 /* Extended delivery */
+
+#if CONFIG_HW_PORTSET_TYPE_C
+#define VEHICLESENS_OFFSET_GPS_NMEA 248 /* 8 + 240 */
+#endif
+
+/************************************************************************
+* Typedef definitions *
+************************************************************************/
+/* typedef u_int32 DID; */ /* Data ID */
+
+/* Data Master Set Notification Function */
+typedef void (*PFUNC_DMASTER_SET_N) (DID, u_int8, u_int8);
+typedef void (*PFUNC_DMASTER_SET_SHARED_MEMORY) (DID, u_int8);
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+/*********************************************************************
+* TAG : VEHICLESENS_DID_OFFSET_TBL
+* ABSTRACT : Vehicle sensor data ID,Structure of each data in the offset table
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_offset; /* Offset value */
+ u_int8 uc_reserve[2]; /* Reserved */
+} VEHICLESENS_DID_OFFSET_TBL;
+
+/*********************************************************************
+* TAG :
+* ABSTRACT :
+***********************************************************************/
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+u_int8 VehicleSensmemcmp(const void *, const void *, size_t);
+int32 VehicleSensCheckDid(DID);
+u_int16 VehicleSensGetDataMasterOffset(DID);
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+u_int16 VehicleSensGetDataMasterExtOffset(DID);
+#endif
+void VehicleSensSetGpsVersion(const SENSOR_MSG_GPSDATA_DAT *pstData);
+void VehicleSensGetDebugPosDate(void* pBuf, u_int8 uc_get_method);
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_COMMON_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_DataMaster.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_DataMaster.h
new file mode 100755
index 0000000..a180764
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_DataMaster.h
@@ -0,0 +1,1091 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_DATAMASTER_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_DATAMASTER_H_
+/****************************************************************************
+ * File name :VehicleSens_DataMaster.h
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ ****************************************************************************/
+
+#include "Vehicle_API_Dummy.h"
+#include "Vehicle_API_private.h"
+
+#include "positioning_hal.h"
+#include "VehicleSens_Common.h"
+#include "VehicleSens_SelectionItemList.h"
+#include "CommonDefine.h"
+#include <vehicle_service/POS_common_API.h>
+#include <vehicle_service/POS_gps_API.h>
+#include "Naviinfo_API.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+/* Initial value */
+#define VEHICLE_DINIT_SP1P 0x0000
+#define VEHICLE_DINIT_SP1S 0x00
+#define VEHICLE_DINIT_SP1 0x0000
+#define VEHICLE_DINIT_ECOMODE 0x00
+#define VEHICLE_DINIT_NE1 0x0000
+#define VEHICLE_DINIT_R_ACCALL 0x00
+#define VEHICLE_DINIT_R_AC_WNG 0x00
+#define VEHICLE_DINIT_R_SW_CON 0x00
+#define VEHICLE_DINIT_R_BEEP 0x00
+#define VEHICLE_DINIT_I_RA_AUT 0x00
+#define VEHICLE_DINIT_I_RA_AC 0x00
+#define VEHICLE_DINIT_I_RA_LO 0x00
+#define VEHICLE_DINIT_I_RA_HI 0x00
+#define VEHICLE_DINIT_I_AUTO_D 0x00
+#define VEHICLE_DINIT_I_AUTO_P 0x00
+#define VEHICLE_DINIT_I_DEF 0x00
+#define VEHICLE_DINIT_I_RRDEF 0x00
+#define VEHICLE_DINIT_I_RFAUT 0x00
+#define VEHICLE_DINIT_I_REC 0x00
+#define VEHICLE_DINIT_I_FRS 0x00
+#define VEHICLE_DINIT_I_AC 0x00
+#define VEHICLE_DINIT_I_MHTR 0x00
+#define VEHICLE_DINIT_I_WIPD 0x00
+#define VEHICLE_DINIT_I_DUSY 0x00
+#define VEHICLE_DINIT_I_SWNG 0x00
+#define VEHICLE_DINIT_I_BLW_F 0x00
+#define VEHICLE_DINIT_I_OAUT_D 0x00
+#define VEHICLE_DINIT_I_OLET_D 0x00
+#define VEHICLE_DINIT_I_OAUT_P 0x00
+#define VEHICLE_DINIT_I_OLET_P 0x00
+#define VEHICLE_DINIT_ST_BMN_F 0x00
+#define VEHICLE_DINIT_I_AIRPR 0x00
+#define VEHICLE_DINIT_I_O2 0x00
+#define VEHICLE_DINIT_I_PLSM 0x00
+#define VEHICLE_DINIT_I_KAFUN 0x00
+#define VEHICLE_DINIT_I_SAFS 0x00
+#define VEHICLE_DINIT_R_ONSCRN 0x00
+#define VEHICLE_DINIT_I_HUM 0x00
+#define VEHICLE_DINIT_I_TMP_D 0x00
+#define VEHICLE_DINIT_I_TMP_P 0x00
+#define VEHICLE_DINIT_SL_ACDSP 0x00
+#define VEHICLE_DINIT_SL_DUSY 0x00
+#define VEHICLE_DINIT_SL_CIF 0x00
+#define VEHICLE_DINIT_SL_BLW_F 0x00
+#define VEHICLE_DINIT_SL_SRLVL 0x00
+#define VEHICLE_DINIT_SL_RR_IH 0x00
+#define VEHICLE_DINIT_SL_RAUTO 0x00
+#define VEHICLE_DINIT_SL_BLW_R 0x00
+#define VEHICLE_DINIT_SL_DST 0x00
+#define VEHICLE_DINIT_SL_WIPD 0x00
+#define VEHICLE_DINIT_SL_MRHT 0x00
+#define VEHICLE_DINIT_SL_AIRP 0x00
+#define VEHICLE_DINIT_SL_O2 0x00
+#define VEHICLE_DINIT_SL_PLSM 0x00
+#define VEHICLE_DINIT_SL_KAFUN 0x00
+#define VEHICLE_DINIT_SL_SWNG 0x00
+#define VEHICLE_DINIT_ST_CN_OK 0x00
+#define VEHICLE_DINIT_SL_RBLW 0x00
+#define VEHICLE_DINIT_SL_HUM 0x00
+#define VEHICLE_DINIT_R_INLVL 0x00
+#define VEHICLE_DINIT_I_INLVL 0x00
+#define VEHICLE_DINIT_I_AUT_RR 0x00
+#define VEHICLE_DINIT_I_AUT_RL 0x00
+#define VEHICLE_DINIT_I_CNT_IH 0x00
+#define VEHICLE_DINIT_I_RAUTO 0x00
+#define VEHICLE_DINIT_ST_BMN_R 0x00
+#define VEHICLE_DINIT_I_BLW_R 0x00
+#define VEHICLE_DINIT_R_RONSCR 0x00
+#define VEHICLE_DINIT_I_OLT_RR 0x00
+#define VEHICLE_DINIT_I_OLT_RL 0x00
+#define VEHICLE_DINIT_I_TMP_RR 0x00
+#define VEHICLE_DINIT_I_TMP_RL 0x00
+#define VEHICLE_DINIT_ACN_AMB 0x00
+#define VEHICLE_DINIT_AC_AMB05 0x00
+#define VEHICLE_DINIT_SOC_MON 0x00
+#define VEHICLE_DINIT_RDYIND 0x00
+#define VEHICLE_DINIT_HV_M2B 0x00
+#define VEHICLE_DINIT_HV_EP 0x00
+#define VEHICLE_DINIT_HV_EM 0x00
+#define VEHICLE_DINIT_RNRG 0x00
+#define VEHICLE_DINIT_HV_MP 0x00
+#define VEHICLE_DINIT_HV_MB 0x00
+#define VEHICLE_DINIT_HV_RG 0x00
+#define VEHICLE_DINIT_B_P 0x00
+#define VEHICLE_DINIT_B_R 0x00
+#define VEHICLE_DINIT_B_N 0x00
+#define VEHICLE_DINIT_B_D 0x00
+#define VEHICLE_DINIT_B_FC 0x0000
+#define VEHICLE_DINIT_R_DISP 0x00
+#define VEHICLE_DINIT_HVFLAG 0x00
+#define VEHICLE_DINIT_DVINF 0x00
+#define VEHICLE_DINIT_IN_FC 0x0000
+#define VEHICLE_DINIT_UNIT_0 0x00
+#define VEHICLE_DINIT_AS_SP 0x0000
+#define VEHICLE_DINIT_UNIT_1 0x00
+#define VEHICLE_DINIT_FC_SCL 0x00
+#define VEHICLE_DINIT_RANGE 0x0000
+#define VEHICLE_DINIT_UNIT_4 0x00
+#define VEHICLE_DINIT_TO_FC 0x0000
+#define VEHICLE_DINIT_UNIT_6 0x00
+#define VEHICLE_DINIT_AS_TM 0x0000
+#define VEHICLE_DINIT_ADIM_C 0x00
+#define VEHICLE_DINIT_LGCY 0x00
+#define VEHICLE_DINIT_BCTY 0x00
+#define VEHICLE_DINIT_RTRRQ 0x00
+#define VEHICLE_DINIT_DEST_BDB 0x00
+#define VEHICLE_DINIT_DS_PACK1 0x00
+#define VEHICLE_DINIT_DS_PACK2 0x00
+#define VEHICLE_DINIT_STRG_WHL 0x00
+#define VEHICLE_DINIT_TRIP_CNT 0x0000
+#define VEHICLE_DINIT_TIME_CNT 0x00000000
+#define VEHICLE_DINIT_TPM_VAR 0x00
+#define VEHICLE_DINIT_TPM_WA1 0x00
+#define VEHICLE_DINIT_TPM_TNUM 0x00
+#define VEHICLE_DINIT_TPM_REQ0 0x00
+#define VEHICLE_DINIT_TPM_TAN0 0x00
+#define VEHICLE_DINIT_TPM_FLPR 0x00
+#define VEHICLE_DINIT_TPM_FL0 0x00
+#define VEHICLE_DINIT_TPM_FRPR 0x00
+#define VEHICLE_DINIT_TPM_FR0 0x00
+#define VEHICLE_DINIT_TPM_RLPR 0x00
+#define VEHICLE_DINIT_TPM_RL0 0x00
+#define VEHICLE_DINIT_TPM_RRPR 0x00
+#define VEHICLE_DINIT_TPM_RR0 0x00
+#define VEHICLE_DINIT_TPM_SPPR 0x00
+#define VEHICLE_DINIT_TPM_SP0 0x00
+#define VEHICLE_DINIT_B_R2 0x00
+#define VEHICLE_DINIT_VSP0B 0x00
+#define VEHICLE_DINIT_EPBLOCK 0x00
+
+#define VEHICLE_DINIT_DESTINATION_DEST_BDB 0x00
+#define VEHICLE_DINIT_DESTINATION_DS_PACK1 0x00
+#define VEHICLE_DINIT_DESTINATION_DS_PACK2 0x00
+#define VEHICLE_DINIT_HV 0x00
+#define VEHICLE_DINIT_2WD4WD 0x00
+#define VEHICLE_DINIT_STEERING_WHEEL 0x00
+#define VEHICLE_DINIT_VB 0x00
+#define VEHICLE_DINIT_IG 0x00
+#define VEHICLE_DINIT_MIC 0x00
+#define VEHICLE_DINIT_TEST 0x00
+#define VEHICLE_DINIT_VTRADAPTER 0x00
+#define VEHICLE_DINIT_AUXADAPTER 0x00
+#define VEHICLE_DINIT_BACKDOOR 0x00
+#define VEHICLE_DINIT_PKB 0x00
+#define VEHICLE_DINIT_PKB_CAN 0x00
+#define VEHICLE_DINIT_ADIM 0x00
+#define VEHICLE_DINIT_ILL 0x00
+#define VEHICLE_DINIT_RHEOSTAT 0x00
+#define VEHICLE_DINIT_PANELTEMP 0x00
+#define VEHICLE_DINIT_SYSTEMP 0x0000
+#define VEHICLE_DINIT_SPEED_PULSE 0x0000
+#define VEHICLE_DINIT_SPEED_KMPH 0x0000
+#define VEHICLE_DINIT_GYRO_X 0x0000
+#define VEHICLE_DINIT_GYRO_Y 0x0000
+#define VEHICLE_DINIT_GYRO_Z 0x0000
+#define VEHICLE_DINIT_GYRO VEHICLE_DINIT_GYRO_X
+#define VEHICLE_DINIT_GSNS_X 0x0000
+#define VEHICLE_DINIT_GSNS_Y 0x0000
+#define VEHICLE_DINIT_GSNS_Z 0x0000
+#define VEHICLE_DINIT_REV 0x00
+#define VEHICLE_DINIT_VSC1S03_4 0x00
+#define VEHICLE_DINIT_VSC1S03_5 0x00
+#define VEHICLE_DINIT_VSC1S03_6 0x00
+#define VEHICLE_DINIT_VSC1S03_7 0x00
+#define VEHICLE_DINIT_ECO1S01_2 0x00
+#define VEHICLE_DINIT_ENG1F07_0 0x00
+#define VEHICLE_DINIT_ENG1F07_1 0x00
+#define VEHICLE_DINIT_ENG1S03_0 0x00
+#define VEHICLE_DINIT_ENG1S03_1 0x00
+#define VEHICLE_DINIT_ACN1S04_0 0x00
+#define VEHICLE_DINIT_ACN1S04_1 0x00
+#define VEHICLE_DINIT_ACN1S04_2 0x00
+#define VEHICLE_DINIT_ACN1S04_3 0x00
+#define VEHICLE_DINIT_ACN1S04_4 0x00
+#define VEHICLE_DINIT_ACN1S04_5 0x00
+#define VEHICLE_DINIT_ACN1S04_7 0x00
+#define VEHICLE_DINIT_ACN1S05_0 0x00
+#define VEHICLE_DINIT_ACN1S05_1 0x00
+#define VEHICLE_DINIT_ACN1S06_0 0x00
+#define VEHICLE_DINIT_ACN1S06_1 0x00
+#define VEHICLE_DINIT_ACN1S06_2 0x00
+#define VEHICLE_DINIT_ACN1S06_4 0x00
+#define VEHICLE_DINIT_ACN1S06_7 0x00
+#define VEHICLE_DINIT_ACN1S08_0 0x00
+#define VEHICLE_DINIT_ACN1S08_1 0x00
+#define VEHICLE_DINIT_ACN1S08_2 0x00
+#define VEHICLE_DINIT_ACN1S08_6 0x00
+#define VEHICLE_DINIT_ACN1S08_7 0x00
+#define VEHICLE_DINIT_ACN1S07_3 0x00
+#define VEHICLE_DINIT_ACN1S07_5 0x00
+#define VEHICLE_DINIT_EHV1S90_2 0x00
+#define VEHICLE_DINIT_EHV1S90_3 0x00
+#define VEHICLE_DINIT_EHV1S90_4 0x00
+#define VEHICLE_DINIT_EHV1S90_5 0x00
+#define VEHICLE_DINIT_EHV1S90_6 0x00
+#define VEHICLE_DINIT_EHV1S90_7 0x00
+#define VEHICLE_DINIT_ECT1S92_1 0x00
+#define VEHICLE_DINIT_ECT1S92_5 0x00
+#define VEHICLE_DINIT_ENG1S28_0 0x00
+#define VEHICLE_DINIT_ENG1S28_1 0x00
+#define VEHICLE_DINIT_BGM1S01_0 0x00
+#define VEHICLE_DINIT_ENG1F03_1 0x00
+#define VEHICLE_DINIT_ENG1F03_3 0x00
+#define VEHICLE_DINIT_MET1S01_5 0x00
+#define VEHICLE_DINIT_MET1S01_6 0x00
+#define VEHICLE_DINIT_MET1S01_7 0x00
+#define VEHICLE_DINIT_MET1S03_2 0x00
+#define VEHICLE_DINIT_MET1S03_3 0x00
+#define VEHICLE_DINIT_MET1S03_4 0x00
+#define VEHICLE_DINIT_MET1S04_4 0x00
+#define VEHICLE_DINIT_MET1S04_5 0x00
+#define VEHICLE_DINIT_MET1S04_6 0x00
+#define VEHICLE_DINIT_MET1S04_7 0x00
+#define VEHICLE_DINIT_MET1S05_5 0x00
+#define VEHICLE_DINIT_MET1S05_6 0x00
+#define VEHICLE_DINIT_MET1S05_7 0x00
+#define VEHICLE_DINIT_MET1S07_6 0x00
+#define VEHICLE_DINIT_MET1S07_7 0x00
+#define VEHICLE_DINIT_BDB1S01_4 0x00
+#define VEHICLE_DINIT_BDB1S01_5 0x00
+#define VEHICLE_DINIT_BDB1S03_4 0x00
+#define VEHICLE_DINIT_BDB1S08_2 0x00
+#define VEHICLE_DINIT_BDB1S08_3 0x00
+#define VEHICLE_DINIT_BDB1S08_4 0x00
+#define VEHICLE_DINIT_BDB1S08_5 0x00
+#define VEHICLE_DINIT_BDB1F03_2 0x00
+#define VEHICLE_DINIT_BDB1F03_3 0x00
+#define VEHICLE_DINIT_BDB1F03_4 0x00
+#define VEHICLE_DINIT_BDB1F03_5 0x00
+#define VEHICLE_DINIT_BDB1F03_6 0x00
+#define VEHICLE_DINIT_BDB1F03_7 0x00
+#define VEHICLE_DINIT_TPM1S02_2 0x00
+#define VEHICLE_DINIT_TPM1S02_5 0x00
+#define VEHICLE_DINIT_TPM1S03_2 0x00
+#define VEHICLE_DINIT_TPM1S03_3 0x00
+#define VEHICLE_DINIT_TPM1S03_4 0x00
+#define VEHICLE_DINIT_TPM1S03_5 0x00
+#define VEHICLE_DINIT_TPM1S03_6 0x00
+#define VEHICLE_DINIT_TPM1S03_7 0x00
+#define VEHICLE_DINIT_ENG1S92_3 0x00
+#define VEHICLE_DINIT_MMT1S52_0 0x00
+#define VEHICLE_DINIT_EPB1S01_0 0x00
+#define VEHICLE_DINIT_MINIJACK 0x00
+#define VEHICLE_DINIT_GPS_ANTENNA 0x00
+#define VEHICLE_DINIT_SNS_COUNTER 0x00
+#define VEHICLE_DINIT_GPS_COUNTER 0x00
+
+/* ++ PastModel002 support */
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_POSLLH 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_STATUS 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_TIMEUTC 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_VELNED 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_DOP 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_TIMEGPS 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_SVINFO 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_NAV_CLOCK 0x00
+#define VEHICLE_DINIT_GPS_UBLOX_MON_HW 0x00
+
+#define VEHICLE_DINIT_SPEED_PULSE_FLAG 0x00
+#define VEHICLE_DINIT_GPS_INTERRUPT_FLAG 0x00
+
+#define VEHICLE_DINIT_GYRO_TROUBLE 0x00 /* Gyro failure status undefined(GYRO_UNFIXED) */
+#define VEHICLE_DINIT_MAIN_GPS_INTERRUPT_SIGNAL 0x00
+#define VEHICLE_DINIT_SYS_GPS_INTERRUPT_SIGNAL 0x00
+#define VEHICLE_DINIT_GYRO_CONNECT_STATUS 0x00
+/* -- PastModel002 support */
+
+/* Size of the data(byte) */
+#define VEHICLE_DSIZE_DESTINATION 0x03
+#define VEHICLE_DSIZE_HV 0x01
+#define VEHICLE_DSIZE_2WD4WD 0x01
+#define VEHICLE_DSIZE_STEERING_WHEEL 0x01
+#define VEHICLE_DSIZE_VB 0x01
+#define VEHICLE_DSIZE_IG 0x01
+#define VEHICLE_DSIZE_MIC 0x01
+#define VEHICLE_DSIZE_TEST 0x01
+#define VEHICLE_DSIZE_VTRADAPTER 0x01
+#define VEHICLE_DSIZE_AUXADAPTER 0x01
+#define VEHICLE_DSIZE_BACKDOOR 0x01
+#define VEHICLE_DSIZE_PKB 0x01
+#define VEHICLE_DSIZE_ADIM 0x01
+#define VEHICLE_DSIZE_ILL 0x01
+#define VEHICLE_DSIZE_RHEOSTAT 0x01
+#define VEHICLE_DSIZE_PANELTEMP 0x01
+#define VEHICLE_DSIZE_SYSTEMP 0x02
+#define VEHICLE_DSIZE_SPEED_PULSE 0x14
+#define VEHICLE_DSIZE_SPEED_KMPH 0x02
+#define VEHICLE_DSIZE_GYRO_X 0x14
+#define VEHICLE_DSIZE_GYRO_Y 0x14
+#define VEHICLE_DSIZE_GYRO_Z 0x14
+#define VEHICLE_DSIZE_GYRO VEHICLE_DSIZE_GYRO_X
+#define VEHICLE_DSIZE_GYRO_TEMP 0x02
+#define VEHICLE_DSIZE_PULSE_TIME 0x84
+#define VEHICLE_DSIZE_GSNS_X 0x06
+#define VEHICLE_DSIZE_GSNS_Y 0x06
+#define VEHICLE_DSIZE_GSNS_Z 0x06
+#define VEHICLE_DSIZE_REV 0x01
+#define VEHICLE_DSIZE_VSC1S03 0x09 /* Internal extensions */
+#define VEHICLE_DSIZE_ECO1S01 0x05
+#define VEHICLE_DSIZE_ENG1F07 0x08
+#define VEHICLE_DSIZE_ENG1S03 0x08
+#define VEHICLE_DSIZE_ACN1S04 0x08
+#define VEHICLE_DSIZE_ACN1S05 0x02
+#define VEHICLE_DSIZE_ACN1S06 0x08
+#define VEHICLE_DSIZE_ACN1S08 0x08
+#define VEHICLE_DSIZE_ACN1S07 0x06
+#define VEHICLE_DSIZE_EHV1S90 0x08
+#define VEHICLE_DSIZE_ECT1S92 0x08
+#define VEHICLE_DSIZE_ENG1S28 0x02
+#define VEHICLE_DSIZE_BGM1S01 0x01
+#define VEHICLE_DSIZE_ENG1F03 0x08
+#define VEHICLE_DSIZE_CAA1N01 0x08
+#define VEHICLE_DSIZE_MET1S01 0x08
+#define VEHICLE_DSIZE_MET1S03 0x08
+#define VEHICLE_DSIZE_MET1S04 0x08
+#define VEHICLE_DSIZE_MET1S05 0x08
+#define VEHICLE_DSIZE_MET1S07 0x08
+#define VEHICLE_DSIZE_BDB1S01 0x08
+#define VEHICLE_DSIZE_BDB1S03 0x08
+#define VEHICLE_DSIZE_BDB1S08 0x08
+#define VEHICLE_DSIZE_BDB1F03 0x08
+#define VEHICLE_DSIZE_TPM1S02 0x08
+#define VEHICLE_DSIZE_TPM1S03 0x08
+#define VEHICLE_DSIZE_ENG1S92 0x08
+#define VEHICLE_DSIZE_MMT1S52 0x08
+#define VEHICLE_DSIZE_EPB1S01 0x03
+#define VEHICLE_DSIZE_MINIJACK 0x01
+#define VEHICLE_DSIZE_GPS_ANTENNA 0x01
+#define VEHICLE_DSIZE_SNS_COUNTER 0x01
+#define VEHICLE_DSIZE_GPS_COUNTER 0x01
+#define VEHICLE_DSIZE_SIRF_BINARY 360
+#define VEHICLE_DSIZE_RTC VEHICLE_DSIZE_GPS_FORMAT
+#define VEHICLE_DSIZE_GPS_VERSION VEHICLE_DSIZE_GPS_FORMAT
+#define VEHICLE_DSIZE_SATELLITE_STATUS VEHICLE_DSIZE_GPS_FORMAT
+#define VEHICLE_DSIZE_LOCATION VEHICLE_DSIZE_GPS_FORMAT
+/* ++ GPS _CWORD82_ support */
+#define VEHICLE_DSIZE_GPS__CWORD82___CWORD44_GP4 VEHICLE_DSIZE_GPS_FORMAT
+#define VEHICLE_DSIZE_GPS__CWORD82__NMEA 424
+#define VEHICLE_DSIZE_GPS__CWORD82__FULLBINARY VEHICLE_DSIZE_GPS_FORMAT
+/* -- GPS _CWORD82_ support */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+#define VEHICLE_DSIZE_DATA_MASTER_FST 0x1200
+
+#define VEHICLE_DSIZE_GYRO_X_FST LSDRV_FSTSNS_DSIZE_GYRO_X
+#define VEHICLE_DSIZE_GYRO_Y_FST LSDRV_FSTSNS_DSIZE_GYRO_Y
+#define VEHICLE_DSIZE_GYRO_Z_FST LSDRV_FSTSNS_DSIZE_GYRO_Z
+#define VEHICLE_DSIZE_SPEED_PULSE_FST LSDRV_FSTSNS_DSIZE_SPEED
+#define VEHICLE_DSIZE_GSNSX_FST LSDRV_FSTSNS_DSIZE_GSENSOR_X
+#define VEHICLE_DSIZE_GSNSY_FST LSDRV_FSTSNS_DSIZE_GSENSOR_Y
+#define VEHICLE_DSIZE_GSNSZ_FST LSDRV_FSTSNS_DSIZE_GSENSOR_Z
+#define VEHICLE_DSIZE_GYROTEMP_FST LSDRV_FSTSNS_DSIZE_GYRO_TEMP
+#define VEHICLE_DSIZE_SPEED_PULSE_FLAG_FST LSDRV_FSTSNS_DSIZE_SPEED_FLG
+#define VEHICLE_DSIZE_REV_FST LSDRV_FSTSNS_DSIZE_REV
+
+#define VEHICLE_DSIZE_GYRO_EXT 0x500
+#define VEHICLE_DSIZE_SPEED_PULSE_EXT 0x500
+#define VEHICLE_DSIZE_GSNS_X_EXT 0x500
+#define VEHICLE_DSIZE_GSNS_Y_EXT 0x500
+#define VEHICLE_DSIZE_GSNS_Z_EXT 0x500
+#define VEHICLE_DSIZE_SNS_COUNTER_EXT 0x40
+#define VEHICLE_DSIZE_GYRO_TEMP_EXT 0x80
+#define VEHICLE_DSIZE_REV_EXT 0x40
+#define VEHICLE_DSIZE_PULSE_TIME_EXT 0x2100
+
+#define VEHICLE_DSIZE_GYRO_EXT_INIT 0x00 /* Gyro output extended data master registration number initial value */
+#define VEHICLE_DSIZE_SPEED_PULSE_EXT_INIT 0x00 /* Vehicle speed expansion data master registration number initial value */
+#define VEHICLE_DSIZE_GSNS_X_EXT_INIT 0x00 /* Initial value of G sensor (X-axis) extended data master registration number */
+#define VEHICLE_DSIZE_GSNS_Y_EXT_INIT 0x00 /* Initial value of G sensor (Y-axis) expansion data master registration number */
+#define VEHICLE_DSIZE_GSNS_Z_EXT_INIT 0x00 /* Initial value of G sensor (Z-axis) expansion data master registration number */
+#define VEHICLE_DSIZE_SNS_COUNTER_EXT_INIT 0x00 /* Initial value of register number of sensor counter extended data master */
+#define VEHICLE_DSIZE_REV_EXT_INIT 0x00 /* REV extended data master registration number initial value */
+#define VEHICLE_DSIZE_GYRO_TEMP_EXT_INIT 0x00 /* Gyro Temperature Extended Data Master Registration Number Initial Value */
+#define VEHICLE_DSIZE_PULSE_TIME_EXT_INIT 0x00 /* Extended data master registration number initial value between pulse time */
+
+#define VEHICLE_DSIZE_GYRO_TROUBLE 0x01
+#define VEHICLE_DSIZE_MAIN_GPS_INTERRUPT_SIGNAL 0x01
+#define VEHICLE_DSIZE_SYS_GPS_INTERRUPT_SIGNAL 0x01
+#define VEHICLE_DSIZE_GYRO_CONNECT_STATUS 0x01
+
+#define VEHICLE_DKEEP_MAX 64 /* Internal data retention count */
+
+/* Data storage location */
+#define VEHICLE_DATA_POS_00 0x00 /* Data storage position 0 */
+#define VEHICLE_DATA_POS_01 0x01 /* Data storage position 1 */
+#endif
+
+#define VEHICLE_DSIZE_GPS_FORMAT 1904
+
+/* ++ PastModel002 support */
+/* GPS_u-blox data size(Up to 208 bytes + 1 byte of sensor counter) */
+#define VEHICLE_DSIZE_GPS_UBLOX_FORMAT 212
+/* ++ PastModel002 support */
+
+/* NMEA data size */
+#define VEHICLE_DSIZE_GPS_NMEA_GGA 71 /* Positioning information(Fixed-length sentence 71 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_DGGA 75 /* Double precision GGA - Positioning information(Fixed-length sentence 75 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_VTG 37 /* Progress Direction,Velocity information(Fixed-length sentence 37 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_RMC 61 /* RMC - Minimal information(Fixed-length sentence 61 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_DRMC 67 /* Double RMC - Minimal information(Fixed-length sentence 67 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_GLL 44 /* GLL - Geographical locality information(Fixed-length sentence 44 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_DGLL 50 /* Double-precision GLL - Geographical locality information(Fixed-length sentence 50 Byte) */
+/* GSA - DOP information and positioning satellite information(Fixed-length sentence 66 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_GSA 66
+#define VEHICLE_DSIZE_GPS_NMEA_GSV_1 70 /* GSV - Visual satellite information(Fixed-length sentence 70 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_GSV_2 70 /* GSV - Visual satellite information(Fixed-length sentence 70 Byte) */
+#define VEHICLE_DSIZE_GPS_NMEA_GSV_3 70 /* GSV - Visual satellite information(Fixed-length sentence 70 Byte) */
+/* _CWORD44_,GP,3 - Visual satellite reception information */
+#define VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_3 78
+/* _CWORD44_,GP,4 - Receiver-specific information */
+#define VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4 25
+
+/* FULLBINARY data size */
+/* Fully customized output */
+#define VEHICLE_DSIZE_GPS_FULLBINARY GPS_CMD_FULLBIN_SZ
+
+#if CONFIG_HW_PORTSET_TYPE_C
+#define VEHICLE_DSIZE_NMEA 0
+#define VEHICLE_DSIZE_GGA 0x00
+#define VEHICLE_DSIZE_GLL 0x00
+#define VEHICLE_DSIZE_GSA 0x00
+#define VEHICLE_DSIZE_GSV 0x00
+#define VEHICLE_DSIZE_RMC 0x00
+#define VEHICLE_DSIZE_VTG 0x00
+#endif
+
+/* ++ PastModel002 support */
+#define VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE 0 /* UBX common header size */
+
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_CLOCK 0
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_DOP 0
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_POSLLH 0
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_STATUS 0
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO 0 /* 8 + 12*numCh(For variable,Define only the fixed part) */
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_TIMEGPS 0
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_TIMEUTC 0
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_VELNED 0
+#define VEHICLE_DSIZE_GPS_UBLOX_MON_HW 0
+
+#define VEHICLE_DSIZE_SPEED_PULSE_FLAG 0x00
+#define VEHICLE_DSIZE_GPS_INTERRUPT_FLAG 0x00
+
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO_CH_MAX 0 /* Maximum number of NAV_SVINFO channels */
+#define VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO_ALONE_MAX 0 /* NAV_SVINFO channel:Maximum Single Data Size */
+/* -- PastModel002 support */
+
+/* Data received*/
+#define VEHICLE_RCVFLAG_ON 0x00
+#define VEHICLE_RCVFLAG_OFF 0x00
+
+/* Upper limit of number of data items stored between pulses */
+#define VEHICLE_SNS_INFO_PULSE_NUM 0
+
+/*------------------------------------------------------------------------------*
+ * NMEA reception flag *
+ -------------------------------------------------------------------------------*/
+/* Not supported by UBX_Protocol */
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/*********************************************************************
+* TAG : VEHICLESENS_DATA_MASTER
+* ABSTRACT : Vehicle sensor data master structure
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_snscnt; /* Sensor Counter */
+ u_int8 uc_data[132]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER;
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data[8448]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_EXT;
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 partition_flg; /* Fragmented Transmission Flag */
+ u_int8 uc_data[VEHICLE_DSIZE_DATA_MASTER_FST]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_FST;
+
+#endif
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data[VEHICLE_DSIZE_GPS_FORMAT]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GPS_FORMAT;
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data[VEHICLE_DSIZE_SIRF_BINARY]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GPS_BINARY;
+
+/* ++ GPS _CWORD82_ support */
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data[VEHICLE_DSIZE_GPS__CWORD82__NMEA]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GPS_NMEA_FORMAT;
+
+/* -- GPS _CWORD82_ support */
+#if CONFIG_HW_PORTSET_TYPE_C
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data[VEHICLE_DSIZE_NMEA]; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GPS_NMEA;
+#endif
+
+/* ++ PastModel002 support */
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_sensor_cnt; /* Sensor Counter */
+ u_int8 uc_gpscnt_flag; /* GPS counter flag */
+ u_int8 reserve[3]; /* reserve */
+ u_int8 uc_data[VEHICLE_DSIZE_GPS_UBLOX_FORMAT]; /* UBLOX_GPS data */
+} VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT;
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GYRO_TROUBLE;
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL;
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_reserve; /* Reserved */
+ u_int8 uc_data; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS;
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_size; /* Size of the data */
+ u_int8 uc_rcvflag; /* Receive flag */
+ u_int8 uc_sensor_cnt; /* Sensor Counter */
+ u_int8 uc_data; /* Vehicle sensor data */
+} VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS;
+
+/* ++ PastModel002 support */
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*********************************************************************
+* TAG : VEHICLESENS_PKG_DELIVERY_TEMP_EXT
+* ABSTRACT : Structure of Vehicle Sensor Initial Delivery Management Table
+***********************************************************************/
+typedef struct {
+ u_int16 us_gyro[10]; /* Gyro output */
+ u_int16 us_sp_pls[10]; /* Vehicle speed pulse */
+ u_int8 uc_sens_cnt; /* Sensor Counter */
+ u_int8 uc_reserve[3]; /* reserve */
+} VEHICLESENS_PKG_DELIVERY_TEMP_TBL;
+
+// for VEHICLESENS_PKG_DELIVERY_TEMP_EXT.start_point index
+enum VEHICLESENS_PKG_INDEX {
+ SNSCounter = 0,
+ SpeedPulse,
+ GyroExt,
+ GsnsX,
+ GsnsY,
+ Rev,
+ GyroTemp,
+ PulseTime,
+ GyroY,
+ GyroZ,
+ GsnsZ,
+ MAX
+};
+
+typedef struct {
+ uint16_t start_point[8]; /* Sequence reference start position */
+ uint16_t end_point; /* Array registration completion position */
+ uint16_t data_break; /* All data undelivered flag */
+} VEHICLESENS_PKG_DELIVERY_TEMP_EXT;
+
+/************************************************************************
+* External variable *
+************************************************************************/
+extern VEHICLESENS_PKG_DELIVERY_TEMP_EXT gstPkgTempExt; // NOLINT(readability/nolint)
+#endif
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+void VehicleSensInitDataMaster(void);
+void VehicleSensSetDataMasterLineSens(const LSDRV_LSDATA *, PFUNC_DMASTER_SET_N func, BOOL);
+void VehicleSensSetDataMasterLineSensG(const LSDRV_LSDATA_G *, PFUNC_DMASTER_SET_N func, BOOL);
+void VehicleSensSetDataMasterGps(SENSOR_MSG_GPSDATA_DAT *, PFUNC_DMASTER_SET_N func);
+void VehicleSensGetDataMaster(DID ul_did, u_int8, VEHICLESENS_DATA_MASTER *);
+void VehicleSensGetGpsDataMaster(DID ul_did, u_int8, SENSOR_MSG_GPSDATA_DAT *);
+void VehicleSensSetDataMasterData(const POS_MSGINFO *, PFUNC_DMASTER_SET_N func);
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+void VehicleSensSetDataMasterLineSensFst(const LSDRV_LSDATA_FST *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n);
+void VehicleSensSetDataMasterLineSensFstG(const LSDRV_MSG_LSDATA_DAT_FST *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n);
+void VehicleSensGetDataMasterFst(DID ul_did, u_int8, VEHICLESENS_DATA_MASTER_FST *);
+void VehicleSensGetDataMasterExt(DID ul_did, u_int8, VEHICLESENS_DATA_MASTER_EXT *);
+#endif
+
+void VehicleSensSetDataMasterGyroTrouble(const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n);
+void VehicleSensSetDataMasterSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory);
+void VehicleSensSetDataMasterMainGpsInterruptSignal(const SENSOR_MSG_GPSDATA_DAT *pst_data,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory);
+void VehicleSensSetDataMasterGyroConnectStatus(const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *pst_data,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory);
+void VehicleSensSetDataMasterGpsAntennaStatus(const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n);
+
+void VehicleSensGetDataMasterGyroTrouble(DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_data);
+void VehicleSensGetDataMasterSysGpsInterruptSignal(DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data);
+void VehicleSensGetDataMasterMainGpsInterruptSignal(DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data);
+void VehicleSensGetDataMasterGyroConnectStatus(DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_data);
+void VehicleSensGetDataMasterGpsAntennaStatus(DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_data);
+
+void VehicleSensGetGsnsX(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGsnsXl(void);
+u_int8 VehicleSensSetGsnsXl(const LSDRV_LSDATA *);
+void VehicleSensGetGsnsXl(VEHICLESENS_DATA_MASTER *);
+u_int8 VehicleSensSetGsnsXlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGsnsXFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitGsnsXFstl(void);
+u_int8 VehicleSensSetGsnsXFstG(const LSDRV_LSDATA_FST_GSENSOR_X *pst_data);
+void VehicleSensGetGsnsXFstl(VEHICLESENS_DATA_MASTER_FST *pst_data);
+
+void VehicleSensGetGsnsY(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGsnsYl(void);
+u_int8 VehicleSensSetGsnsYl(const LSDRV_LSDATA *);
+void VehicleSensGetGsnsYl(VEHICLESENS_DATA_MASTER *);
+u_int8 VehicleSensSetGsnsYlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGsnsYFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitGsnsYFstl(void);
+u_int8 VehicleSensSetGsnsYFstG(const LSDRV_LSDATA_FST_GSENSOR_Y *pst_data);
+void VehicleSensGetGsnsYFstl(VEHICLESENS_DATA_MASTER_FST *pst_data);
+
+void VehicleSensGetGsnsZ(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGsnsZl(void);
+u_int8 VehicleSensSetGsnsZl(const LSDRV_LSDATA *);
+void VehicleSensGetGsnsZl(VEHICLESENS_DATA_MASTER *);
+u_int8 VehicleSensSetGsnsZlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGsnsZFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitGsnsZFstl(void);
+u_int8 VehicleSensSetGsnsZFstG(const LSDRV_LSDATA_FST_GSENSOR_Z *pst_data);
+void VehicleSensGetGsnsZFstl(VEHICLESENS_DATA_MASTER_FST *pst_data);
+
+void VehicleSensGetGyroX(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGyroXl(void);
+u_int8 VehicleSensSetGyroXl(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetGyroXlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroXl(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetGyroY(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGyroYl(void);
+u_int8 VehicleSensSetGyroYl(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetGyroYlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroYl(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetGyroZ(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGyroZl(void);
+u_int8 VehicleSensSetGyroZl(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetGyroZlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroZl(VEHICLESENS_DATA_MASTER *);
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+void VehicleSensGetSpeedPulseFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitSpeedPulseFstl(void);
+u_int8 VehicleSensSetSpeedPulseFstl(const LSDRV_LSDATA_FST *);
+u_int8 VehicleSensSetSpeedPulseFstG(const LSDRV_LSDATA_FST_SPEED *);
+void VehicleSensGetSpeedPulseFstl(VEHICLESENS_DATA_MASTER_FST *);
+
+void VehicleSensGetGyroXFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitGyroXFstl(void);
+u_int8 VehicleSensSetGyroXFstl(const LSDRV_LSDATA_FST *);
+u_int8 VehicleSensSetGyroXFstG(const LSDRV_LSDATA_FST_GYRO_X *);
+void VehicleSensGetGyroXFstl(VEHICLESENS_DATA_MASTER_FST *);
+
+void VehicleSensGetGyroYFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitGyroYFstl(void);
+u_int8 VehicleSensSetGyroYFstl(const LSDRV_LSDATA_FST *);
+u_int8 VehicleSensSetGyroYFstG(const LSDRV_LSDATA_FST_GYRO_Y *);
+void VehicleSensGetGyroYFstl(VEHICLESENS_DATA_MASTER_FST *);
+
+void VehicleSensGetGyroYExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitGyroYExtl(void);
+void VehicleSensSetGyroYExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroYExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetGyroZFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitGyroZFstl(void);
+u_int8 VehicleSensSetGyroZFstl(const LSDRV_LSDATA_FST *);
+u_int8 VehicleSensSetGyroZFstG(const LSDRV_LSDATA_FST_GYRO_Z *);
+void VehicleSensGetGyroZFstl(VEHICLESENS_DATA_MASTER_FST *);
+
+void VehicleSensGetGyroZExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitGyroZExtl(void);
+void VehicleSensSetGyroZExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroZExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetSpeedPulseFlagFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitSpeedPulseFlagFstl(void);
+u_int8 VehicleSensSetSpeedPulseFlagFstl(const LSDRV_LSDATA_FST *);
+u_int8 VehicleSensSetSpeedPulseFlagFstG(const LSDRV_LSDATA_FST_SPEED_PULSE_FLAG *);
+void VehicleSensGetSpeedPulseFlagFstl(VEHICLESENS_DATA_MASTER_FST *);
+
+void VehicleSensGetRevFst(VEHICLESENS_DATA_MASTER_FST *, u_int8);
+void VehicleSensInitRevFstl(void);
+u_int8 VehicleSensSetRevFstl(const LSDRV_LSDATA_FST *);
+u_int8 VehicleSensSetRevFstG(const LSDRV_LSDATA_FST_REV *);
+void VehicleSensGetRevFstl(VEHICLESENS_DATA_MASTER_FST *);
+
+void VehicleSensGetGsnsXExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitGsnsXExtl(void);
+void VehicleSensSetGsnsXExtl(const LSDRV_LSDATA *);
+void VehicleSensSetGsnsXExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGsnsXExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetGsnsYExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitGsnsYExtl(void);
+void VehicleSensSetGsnsYExtl(const LSDRV_LSDATA *);
+void VehicleSensSetGsnsYExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGsnsYExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetGsnsZExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitGsnsZExtl(void);
+void VehicleSensSetGsnsZExtl(const LSDRV_LSDATA *);
+void VehicleSensSetGsnsZExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGsnsZExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetGyroExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitGyroExtl(void);
+void VehicleSensSetGyroExtl(const LSDRV_LSDATA *);
+void VehicleSensSetGyroExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetGyroRev(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGyroRevl(void);
+u_int8 VehicleSensSetGyroRevl(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetGyroRevlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetGyroRevl(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetSpeedPulseExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitSpeedPulseExtl(void);
+void VehicleSensSetSpeedPulseExtl(const LSDRV_LSDATA *);
+void VehicleSensSetSpeedPulseExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetSpeedPulseExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetSnsCounterExt(VEHICLESENS_DATA_MASTER_EXT *, u_int8);
+void VehicleSensInitSnsCounterExtl(void);
+void VehicleSensSetSnsCounterExtl(const LSDRV_LSDATA *);
+void VehicleSensSetSnsCounterExtlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetSnsCounterExtl(VEHICLESENS_DATA_MASTER_EXT *);
+
+void VehicleSensGetRevExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method);
+void VehicleSensGetRevExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data);
+void VehicleSensInitRevExtl(void);
+void VehicleSensSetRevExtlG(const LSDRV_LSDATA_G *pst_data);
+
+#endif
+
+void VehicleSensGetSpeedKmph(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitSpeedKmphl(void);
+u_int8 VehicleSensSetSpeedKmphl(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetSpeedKmphlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetSpeedKmphl(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetGyroTemp(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method);
+void VehicleSensInitGyroTempl(void);
+u_int8 VehicleSensSetGyroTemplG(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetGyroTempl(VEHICLESENS_DATA_MASTER *pst_data);
+
+void VehicleSensGetGyroTempFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method);
+void VehicleSensInitGyroTempFstl(void);
+u_int8 VehicleSensSetGyroTempFstG(const LSDRV_LSDATA_FST_GYRO_TEMP *pst_data);
+void VehicleSensGetGyroTempFstl(VEHICLESENS_DATA_MASTER_FST *pst_data);
+
+void VehicleSensGetGyroTempExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method);
+void VehicleSensInitGyroTempExtl(void);
+void VehicleSensSetGyroTempExtlG(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetGyroTempExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data);
+
+void VehicleSensGetPulseTime(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method);
+void VehicleSensInitPulseTimel(void);
+u_int8 VehicleSensSetPulseTimelG(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetPulseTimel(VEHICLESENS_DATA_MASTER *pst_data);
+
+void VehicleSensGetPulseTimeExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method);
+void VehicleSensInitPulseTimeExtl(void);
+void VehicleSensSetPulseTimeExtlG(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetPulseTimeExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data);
+
+void VehicleSensGetRev(VEHICLESENS_DATA_MASTER *, u_int8);
+
+void VehicleSensInitRevl(void);
+u_int8 VehicleSensSetRevl(const LSDRV_LSDATA *);
+void VehicleSensGetRevl(VEHICLESENS_DATA_MASTER *);
+u_int8 VehicleSensSetRevlG(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetRevline(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetSpeedPulse(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitSpeedPulsel(void);
+u_int8 VehicleSensSetSpeedPulsel(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetSpeedPulselG(const LSDRV_LSDATA_G *);
+void VehicleSensGetSpeedPulsel(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetGpsAntenna(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitGpsAntennal(void);
+u_int8 VehicleSensSetGpsAntennal(const LSDRV_LSDATA *);
+void VehicleSensGetGpsAntennal(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensGetSnsCounter(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitSnsCounterl(void);
+u_int8 VehicleSensSetSnsCounterl(const LSDRV_LSDATA *);
+u_int8 VehicleSensSetSnsCounterlG(const LSDRV_LSDATA_G *);
+void VehicleSensGetSnsCounterl(VEHICLESENS_DATA_MASTER *);
+
+void VehicleSensInitGpsCounterg(void);
+u_int8 VehicleSensSetGpsCounterg(const SENSOR_MSG_GPSDATA_DAT *);
+void VehicleSensGetGpsCounterg(SENSOR_MSG_GPSDATA_DAT *);
+
+/* ++ PastModel002 support */
+/* U-BLOX_GPS MON-HW */
+void VehicleSensInitMonHwG(void);
+u_int8 VehicleSensSetMonHwG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetMonHwG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-CLOCK */
+void VehicleSensInitNavClockG(void);
+u_int8 VehicleSensSetNavClockG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavClockG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-DOP */
+void VehicleSensInitNavDopG(void);
+u_int8 VehicleSensSetNavDopG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavDopG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-POSLLH */
+void VehicleSensInitNavPosllhG(void);
+u_int8 VehicleSensSetNavPosllhG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavPosllhG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-STATUS */
+void VehicleSensInitNavStatusG(void);
+u_int8 VehicleSensSetNavStatusG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavStatusG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-SVINFO */
+void VehicleSensInitNavSvInfoG(void);
+u_int8 VehicleSensSetNavSvInfoG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavSvInfoG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-TIMEGPS */
+void VehicleSensInitNavTimeGpsG(void);
+u_int8 VehicleSensSetNavTimeGpsG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavTimeGpsG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-TIMEUTC */
+void VehicleSensInitNavTimeUtcG(void);
+u_int8 VehicleSensSetNavTimeUtcG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavTimeUtcG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* U-BLOX_GPS NAV-VELNED */
+void VehicleSensInitNavVelnedG(void);
+u_int8 VehicleSensSetNavVelnedG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetNavVelnedG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* DR SPEED_PULSE_FLAG */
+void VehicleSensInitSpeedPulseFlag(void);
+u_int8 VehicleSensSetSpeedPulseFlag(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetSpeedPulseFlag(VEHICLESENS_DATA_MASTER *);
+
+/* DR GPS_INTERRUPT_FLAG */
+void VehicleSensInitGpsInterruptFlag(void);
+u_int8 VehicleSensSetGpsInterruptFlag(const LSDRV_LSDATA_G *pst_data);
+void VehicleSensGetGpsInterruptFlag(VEHICLESENS_DATA_MASTER *);
+
+/* GYRO_TROUBLE */
+void VehicleSensInitGyroTrouble(void);
+u_int8 VehicleSensSetGyroTrouble(const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *pst_data);
+void VehicleSensGetGyroTrouble(VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_data);
+
+/* MAIN_GPS_INTERRUPT_SIGNAL */
+void VehicleSensInitMainGpsInterruptSignal(void);
+u_int8 VehicleSensSetMainGpsInterruptSignal(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetMainGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data);
+
+/* SYS_GPS_INTERRUPT_SIGNAL */
+void VehicleSensInitSysGpsInterruptSignal(void);
+u_int8 VehicleSensSetSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data);
+void VehicleSensGetSysGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data);
+
+/* GYRO_CONNECT_STATUS */
+void VehicleSensInitGyroConnectStatus(void);
+u_int8 VehicleSensSetGyroConnectStatus(const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *pst_data);
+void VehicleSensGetGyroConnectStatus(VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_data);
+
+/* GPS_ANTENNA_STATUS */
+void VehicleSensInitGpsAntennaStatus(void);
+u_int8 VehicleSensSetGpsAntennaStatus(const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *pst_data);
+void VehicleSensGetGpsAntennaStatus(VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_data);
+
+/* -- PastModel002 support */
+
+/* GPS__CWORD82__FULLBINARY */
+void VehicleSensInitGps_CWORD82_FullBinaryG(void);
+u_int8 VehicleSensSetGps_CWORD82_FullBinaryG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetGps_CWORD82_FullBinaryG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* GPS__CWORD82__FULLBINARY */
+void VehicleSensInitGps_CWORD82__CWORD44_Gp4G(void);
+u_int8 VehicleSensSetGps_CWORD82__CWORD44_Gp4G(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetGps_CWORD82__CWORD44_Gp4G(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* GPS__CWORD82__NMEA */
+void VehicleSensInitGps_CWORD82_NmeaG(void);
+u_int8 VehicleSensSetGps_CWORD82_NmeaG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetGps_CWORD82_NmeaG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* GPS_NMEA */
+void VehicleSensInitGpsNmeaG(void);
+u_int8 VehicleSensSetGpsNmeaG(const SENSOR_MSG_GPSDATA_DAT *pst_data);
+void VehicleSensGetGpsNmeaG(SENSOR_MSG_GPSDATA_DAT *pst_data);
+
+/* LOCATION_LONLAT */
+void VehicleSensGetLocationLonLat(VEHICLESENS_DATA_MASTER *pst_data, u_int8);
+void VehicleSensInitLocationLonLatG(void);
+u_int8 VehicleSensSetLocationLonLatG(const SENSORLOCATION_LONLATINFO_DAT*);
+void VehicleSensGetLocationLonLatG(VEHICLESENS_DATA_MASTER*);
+void VehicleSensInitLocationLonLatN(void);
+u_int8 VehicleSensSetLocationLonLatN(const SENSORLOCATION_LONLATINFO_DAT*);
+void VehicleSensGetLocationLonLatN(VEHICLESENS_DATA_MASTER*);
+void VehicleSensGetLocationLonLatnUnitCnv(VEHICLESENS_DATA_MASTER*);
+
+/* LOCATION_ALTITUDE */
+void VehicleSensGetLocationAltitude(VEHICLESENS_DATA_MASTER *pst_data, u_int8);
+void VehicleSensInitLocationAltitudeG(void);
+u_int8 VehicleSensSetLocationAltitudeG(const SENSORLOCATION_ALTITUDEINFO_DAT*);
+void VehicleSensGetLocationAltitudeG(VEHICLESENS_DATA_MASTER*);
+void VehicleSensInitLocationAltitudeN(void);
+u_int8 VehicleSensSetLocationAltitudeN(const SENSORLOCATION_ALTITUDEINFO_DAT*);
+void VehicleSensGetLocationAltitudeN(VEHICLESENS_DATA_MASTER*);
+
+/* MOTION_SPEED */
+void VehicleSensGetMotionSpeed(VEHICLESENS_DATA_MASTER *pst_data, u_int8);
+void VehicleSensInitMotionSpeedG(void);
+u_int8 VehicleSensSetMotionSpeedG(const SENSORMOTION_SPEEDINFO_DAT*);
+void VehicleSensGetMotionSpeedG(VEHICLESENS_DATA_MASTER*);
+void VehicleSensInitMotionSpeedN(void);
+u_int8 VehicleSensSetMotionSpeedN(const SENSORMOTION_SPEEDINFO_DAT*);
+void VehicleSensGetMotionSpeedN(VEHICLESENS_DATA_MASTER*);
+void VehicleSensInitMotionSpeedI(void);
+u_int8 VehicleSensSetMotionSpeedI(const SENSORMOTION_SPEEDINFO_DAT*);
+void VehicleSensGetMotionSpeedI(VEHICLESENS_DATA_MASTER*);
+
+/* MOTION_HEADING */
+void VehicleSensGetMotionHeading(VEHICLESENS_DATA_MASTER *pst_data, u_int8);
+void VehicleSensInitMotionHeadingG(void);
+u_int8 VehicleSensSetMotionHeadingG(const SENSORMOTION_HEADINGINFO_DAT*);
+void VehicleSensGetMotionHeadingG(VEHICLESENS_DATA_MASTER*);
+void VehicleSensInitMotionHeadingN(void);
+u_int8 VehicleSensSetMotionHeadingN(const SENSORMOTION_HEADINGINFO_DAT*);
+void VehicleSensGetMotionHeadingN(VEHICLESENS_DATA_MASTER*);
+void VehicleSensGetMotionHeadingnCnvData(VEHICLESENS_DATA_MASTER*);
+
+/* GPS_TIME */
+void VehicleSensGetGpsTime(SENSOR_MSG_GPSDATA_DAT*, u_int8);
+void VehicleSensInitGpsTimeG(void);
+u_int8 VehicleSensSetGpsTimeG(const SENSOR_MSG_GPSTIME*);
+void VehicleSensGetGpsTimeG(SENSOR_MSG_GPSDATA_DAT*);
+
+/* GPS_TIME_RAW */
+void VehicleSensGetGpsTimeRaw(SENSOR_MSG_GPSDATA_DAT*, u_int8);
+void VehicleSensInitGpsTimeRawG(void);
+u_int8 VehicleSensSetGpsTimeRawG(const SENSOR_GPSTIME_RAW*);
+void VehicleSensGetGpsTimeRawG(SENSOR_MSG_GPSDATA_DAT*);
+
+/* GPS_WKNROLLOVER */
+void VehicleSensGetWknRollover(VEHICLESENS_DATA_MASTER*, u_int8);
+void VehicleSensInitWknRolloverG(void);
+u_int8 VehicleSensSetWknRolloverG(const SENSOR_WKNROLLOVER*);
+void VehicleSensGetWknRolloverG(SENSOR_MSG_GPSDATA_DAT*);
+
+/* DIAG_GPS */
+void VehicleSensInitNaviinfoDiagGPSg(void);
+u_int8 VehicleSensSetNaviinfoDiagGPSg(const NAVIINFO_DIAG_GPS*);
+void VehicleSensGetNaviinfoDiagGPSg(SENSOR_MSG_GPSDATA_DAT*);
+
+/* SETTINGTIME */
+void VehicleSensGetSettingTime(VEHICLESENS_DATA_MASTER *, u_int8);
+void VehicleSensInitSettingTimeclock(void);
+u_int8 VehicleSensSetSettingTimeclock(const POS_DATETIME*);
+void VehicleSensGetSettingTimeclock(VEHICLESENS_DATA_MASTER*);
+
+/* GPS_CLOCK_DRIFT */
+void VehicleSensGetGpsClockDrift(SENSOR_MSG_GPSDATA_DAT *, u_int8);
+void VehicleSensInitGpsClockDriftG(void);
+u_int8 VehicleSensSetGpsClockDriftG(const int32_t*);
+void VehicleSensGetGpsClockDriftG(SENSOR_MSG_GPSDATA_DAT*);
+
+/* GPS_CLOCK_FREQ */
+void VehicleSensGetGpsClockFreq(SENSOR_MSG_GPSDATA_DAT *, u_int8);
+void VehicleSensInitGpsClockFreqG(void);
+u_int8 VehicleSensSetGpsClockFreqG(const uint32_t*);
+void VehicleSensGetGpsClockFreqG(SENSOR_MSG_GPSDATA_DAT*);
+
+/* LOCATION INFORMATION (NMEA) */
+void VehicleSens_GetLocationInfoNmea(VEHICLESENS_DATA_MASTER_GPS_FORMAT *, u_int8 );
+void VehicleSens_InitLocationInfoNmea_n(void);
+u_int8 VehicleSens_SetLocationInfoNmea_n( const POS_LOCATIONINFO_NMEA * );
+void VehicleSens_GetLocationInfoNmea_n(VEHICLESENS_DATA_MASTER_GPS_FORMAT * );
+
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_DATAMASTER_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_DeliveryCtrl.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_DeliveryCtrl.h
new file mode 100755
index 0000000..3fb7056
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_DeliveryCtrl.h
@@ -0,0 +1,253 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_DELIVERYCTRL_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_DELIVERYCTRL_H_
+/******************************************************************************
+ * File name :VehicleSens_DeliveryCtrl.h
+ * System name :_CWORD107_
+ * Subsystem name :
+ ******************************************************************************/
+
+#include "Vehicle_API_Dummy.h"
+#include "Sensor_API.h"
+#include "Vehicle_API_private.h"
+#include "Sensor_API_private.h"
+#include "VehicleSens_SelectionItemList.h"
+#include "VehicleSens_DataMaster.h"
+#include "Dead_Reckoning_Local_Api.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#define VEHICLESENS_CANID_EFFECTIVE 29 /* CAN ID Effective number */
+#define VEHICLESENS_CANID_RESERVE 11 /* CAN ID Reserved number */
+#define VEHICLESENS_SIGNAL VEHICLESENS_SELECTION_ITEM_LIST_LEN /* Number of vehicle signals */
+#define VEHICLESENS_DELIVERY 10 /* Number of delivery destinations */
+/* CAN ID Maximum number */
+#define VEHICLESENS_CANID_MAX (VEHICLESENS_CANID_EFFECTIVE + VEHICLESENS_CANID_RESERVE)
+/* Vehicle sensor information */
+#define VEHICLESENS_DELIVERY_INFO (VEHICLESENS_CANID_MAX + VEHICLESENS_SIGNAL)
+/* Maximum number of vehicle sensor information */
+#define VEHICLESENS_DELIVERY_INFO_MAX (VEHICLESENS_DELIVERY_INFO * VEHICLESENS_DELIVERY)
+/* Vehicle Sensor Information Valid Number */
+#define VEHICLESENS_DID_EFFECTIVE (VEHICLESENS_CANID_EFFECTIVE + VEHICLESENS_SIGNAL)
+#define VEHICLESENS_ACTION_TYPE_ADD 0 /* Vehicle sensor addition processing */
+#define VEHICLESENS_ACTION_TYPE_UPDATE 1 /* Vehicle sensor update processing */
+#define VEHICLESENS_LINK_INDEX_END 0xFFFF /* End of the link index */
+
+
+#define VEHICLESENS_PKG_DELIVERY_INFO_MAX 2560 /* Maximum number of vehicle sensor information */
+#define VEHICLESENS_DELIVERY_METHOD_NORMAL 0 /* Delivery system normal delivery */
+#define VEHICLESENS_DELIVERY_METHOD_PACKAGE 1 /* Delivery system package delivery */
+#define VEHICLESENS_PKG_EXT_SEND_MAX 10 /* Number of data master transmissions/onece */
+#define VEHICLESENS_PKG_EXT_SEND_MAX_10DATA 100 /* Number of data masters transmitted (GYRO),SPEED)/once */
+
+#define VEHICLESENS_DELIVERY_MAX_SIZE SENSOR_MSG_VSINFO_DSIZE /* Maximum Size of Delivery */
+#define VEHICLESENS_DELIVERY_FSTSNS_HDR_SIZE 8 /* Initial Sensor Data Delivery Data Header Size */
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_LIST_CANID
+* ABSTRACT : CAN data delivery registration request information
+***********************************************************************/
+typedef struct {
+ u_int8 uc_can_num; /* CANID delivery registrations */
+ u_int8 uc_reserve[3];
+ u_int32 ul_can_id[VEHICLESENS_CANID_MAX]; /* Delivery registrationCANID */ /* CANIF_API deletion */
+} VEHICLESENS_DELIVERY_LIST_CANID;
+
+/*********************************************************************
+* TAG :VEHICLESENS_DELIVERY_CTRL_TBL_DATA
+* ABSTRACT : Structure of each data of the vehicle sensor delivery destination management table
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ PNO us_pno; /* Shipping PID */
+ u_int8 uc_chg_type; /* Delivery timing */
+ u_int8 uc_ctrl_flg; /* Delivery operation */
+ u_int16 us_link_idx; /* Link index */
+ u_int16 us_pkg_start_idx; /* Package Delivery Start Index */
+ u_int16 us_pkg_end_idx; /* Package delivery end index */
+ u_int8 uc_method; /* Delivery system */
+ u_int8 uc_reserve; /* reserve */
+ /* Modify to store the destination service name TODO */
+ /* Add handles as needed TODO */
+} VEHICLESENS_DELIVERY_CTRL_TBL_DATA;
+
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_CTRL_TBL
+* ABSTRACT : Vehicle Sensor Delivery Destination Management Table Structure
+***********************************************************************/
+typedef struct {
+ u_int16 us_dnum; /* Number of delivery destination management data items */
+ u_int8 uc_reserve[2]; /* Reserved */
+ /* Array of each data */
+ VEHICLESENS_DELIVERY_CTRL_TBL_DATA st_ctrl_data[VEHICLESENS_DELIVERY_INFO_MAX];
+} VEHICLESENS_DELIVERY_CTRL_TBL;
+
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA
+* ABSTRACT : Structure of each data of Vehicle Sensor Destination Management Table Management
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 us_start_idx; /* Start index */
+ u_int16 us_end_idx; /* End index */
+ u_int16 usdlvry_entry_num; /* Number of registered shipping addresses */
+ u_int8 uc_reserve[2]; /* Reserved */
+} VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA;
+
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_CTRL_TBL_MNG
+* ABSTRACT : Structure of Vehicle Sensor Delivery Destination Management Table Management
+***********************************************************************/
+typedef struct {
+ u_int16 us_dnum; /* Number of data items */
+ u_int8 uc_reserve[2]; /* Reserved */
+ /* Array of each data */
+ VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA st_ctrl_tbl_mng_data[VEHICLESENS_DELIVERY_INFO];
+} VEHICLESENS_DELIVERY_CTRL_TBL_MNG;
+
+/*********************************************************************
+* TAG : VEHICLESENS_PKG_DELIVERY_TBL_MNG_DATA
+* ABSTRACT : Structure of each data of the vehicle sensor package delivery management table
+***********************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int16 usdlvry_idx; /* Delivery data index */
+ u_int8 uc_reserve[2]; /* Reserved */
+} VEHICLESENS_PKG_DELIVERY_TBL_MNG_DATA;
+
+
+/*********************************************************************
+* TAG : VEHICLESENS_PKG_DELIVERY_TBL_MNG
+* ABSTRACT : Structure of Vehicle Sensor Package Delivery Management Table
+***********************************************************************/
+typedef struct {
+ u_int16 us_dnum; /* Number of data items */
+ u_int8 uc_reserve[2]; /* Reserved */
+ /* Array of each data */
+ VEHICLESENS_PKG_DELIVERY_TBL_MNG_DATA st_pkg_data[VEHICLESENS_PKG_DELIVERY_INFO_MAX];
+} VEHICLESENS_PKG_DELIVERY_TBL_MNG;
+
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_PNO_TBL
+* ABSTRACT : Vehicle Sensor Destination PNO Table
+***********************************************************************/
+typedef struct {
+ PNO us_pno; /* Thread ID */
+ u_int16 us_pkg_start_idx; /* Package Delivery Start Index */
+ u_int16 us_pkg_end_idx; /* Package delivery end index */
+ u_int8 uc_method; /* Delivery system */
+ u_int8 uc_reserve; /* reserve */
+} VEHICLESENS_DELIVERY_PNO_TBL_DAT;
+
+typedef struct {
+ u_int16 us_dnum; /* Number of data items */
+ u_int8 uc_reserve[2]; /* reserve */
+ VEHICLESENS_DELIVERY_PNO_TBL_DAT st_pno_data[VEHICLESENS_DELIVERY_INFO_MAX];
+} VEHICLESENS_DELIVERY_PNO_TBL;
+
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_HEADER
+* ABSTRACT : Delivery data header
+***********************************************************************/
+typedef struct {
+ DID did; /* Data ID */
+ u_int16 size; /* Size of the data */
+ u_int8 rcv_flag; /* Receive flag */
+ u_int8 sensor_cnt; /* Sensor Counter */
+} VEHICLESENS_DELIVERY_HEADER;
+
+/*********************************************************************
+* TAG : VEHICLESENS_DELIVERY_FORMAT
+* ABSTRACT : Delivery data format
+***********************************************************************/
+typedef struct {
+ VEHICLESENS_DELIVERY_HEADER header; /* Header */
+ u_int8 data[VEHICLESENS_DELIVERY_MAX_SIZE]; /* Data */
+} VEHICLESENS_DELIVERY_FORMAT;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+void VehicleSensInitDeliveryCtrlTbl(void);
+void VehicleSensInitDeliveryCtrlTblMng(void);
+void VehicleSensInitPkgDeliveryTblMng(void);
+VEHICLE_RET_API VehicleSensEntryDeliveryCtrl(const VEHICLE_MSG_DELIVERY_ENTRY *);
+void VehicleSensAddDeliveryCtrlTbl(const VEHICLE_MSG_DELIVERY_ENTRY *);
+void VehicleSensUpdateDeliveryCtrlTbl(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *);
+void VehicleSensUpdatePkgDeliveryCtrlTbl(u_int16, u_int16);
+void VehicleSensAddDeliveryCtrlTblMng(const VEHICLE_MSG_DELIVERY_ENTRY *);
+void VehicleSensUpdateDeliveryCtrlTblMng(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *);
+void VehicleSensAddPkgDeliveryTblMng(const SENSOR_MSG_DELIVERY_ENTRY *);
+VEHICLE_RET_API VehicleSensEntryPkgDeliveryCtrl(const SENSOR_MSG_DELIVERY_ENTRY *, u_int8 uc_ext_chk);
+VEHICLESENS_DELIVERY_PNO_TBL* VehicleSensMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type);
+void VehicleSensAddPnoTbl(u_int16);
+u_int8 VehicleSensDeliveryGPS(DID ul_did, u_int8 uc_get_method, u_int8 uc_current_get_method, int32 pno_index,
+ u_int32* cid, VEHICLESENS_DATA_MASTER* stmaster,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl);
+u_int8 VehicleSensDeliveryFst(DID ul_did, u_int8 uc_get_method, int32 pno_index,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl);
+u_int8 VehicleSensDeliveryGyro(DID ul_did, u_int8 uc_current_get_method, int32 pno_index,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl);
+void VehicleSensDeliveryAntenna(DID ul_did, u_int8 uc_current_get_method, int32 pno_index,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl);
+u_int8 VehicleSensDeliveryOther(DID ul_did, u_int8 uc_current_get_method, int32 pno_index,
+ u_int32* cid,
+ VEHICLESENS_DATA_MASTER* stmaster,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl);
+void VehicleSensDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method);
+u_int8 VehicleSensFirstDeliverySens(PNO us_pno, DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_FST* stmaster_fst,
+ VEHICLESENS_DATA_MASTER_FST* stmaster_fst_temp);
+u_int8 VehicleSensFirstDeliveryOther(PNO us_pno, DID ul_did, u_int8 uc_get_method,
+ u_int32* cid,
+ VEHICLESENS_DATA_MASTER* stmaster);
+void VehicleSensFirstDelivery(PNO us_pno, DID ul_did);
+void VehicleSensFirstPkgDelivery(const SENSOR_MSG_DELIVERY_ENTRY_DAT *);
+RET_API VehicleSensCanDeliveryEntry(void);
+void VehicleSensFirstPkgDelivery(const SENSOR_MSG_DELIVERY_ENTRY_DAT *);
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+void VehicleSensFirstPkgDeliveryExt(const SENSOR_MSG_DELIVERY_ENTRY_DAT *pst_data);
+#endif
+
+#if CONFIG_HW_PORTSET_TYPE_C
+void VehicleSensInitSeqNum(void);
+void VehicleSensDivideDeliveryProc(PNO, const void *);
+#endif
+
+/* ++ PastModel002 support DR */
+void VehicleSensInitDeliveryCtrlTblDR(void);
+void VehicleSensInitDeliveryCtrlTblMngDR(void);
+VEHICLE_RET_API VehicleSensEntryDeliveryCtrlDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
+void VehicleSensAddDeliveryCtrlTblDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
+void VehicleSensAddDeliveryCtrlTblMngDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *);
+void VehicleSensUpdateDeliveryCtrlTblDR(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *);
+void VehicleSensUpdateDeliveryCtrlTblMngDR(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *);
+void VehicleSensDeliveryProcDR(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method);
+VEHICLESENS_DELIVERY_PNO_TBL* VehicleSensMakeDeliveryPnoTblDR(DID ul_did, u_int8 change_type);
+void VehicleSensAddPnoTblDR(u_int16 us_index);
+void VehicleSensGetDebugDeliveryCtrlTbl(void* pbuf);
+void VehicleSensGetDebugDeliveryCtrlTblMng(void* pbuf);
+void VehicleSensGetDebugPkgDeliveryTblMng(void* pbuf);
+void VehicleSensGetDebugDeliveryPnoTbl(void* pbuf);
+/* -- PastModel002 supprt DR */
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_DELIVERYCTRL_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_FromAccess.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_FromAccess.h
new file mode 100755
index 0000000..e58b059
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_FromAccess.h
@@ -0,0 +1,69 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_FROMACCESS_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_FROMACCESS_H_
+/******************************************************************************
+ * File name :VehicleSens_FromAccess.h
+ * System name :PastModel002
+ * Subsystem name :
+ ******************************************************************************/
+
+#include <stdio.h>
+#include <stdint.h>
+#include "Sensor_API.h"
+#include "SensorLocation_API.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#define NV_FILE_VEHICLESENS "/fs/tmpfs/VehicleSens_nv_data.bin"
+#define NV_FILE_VEHICLESENS_TEMP "/fs/tmpfs/VehicleSens_nv_data_temp.bin"
+#define NV_FILE_VEHICLESENS2 "/fs/tmpfs/VehicleSens_nv_data_2nd.bin"
+#define NV_FILE_VEHICLESENS2_TEMP "/fs/tmpfs/VehicleSens_nv_data_2nd_temp.bin"
+#define NV_LOAD_WAIT_TIME_VEHICLESENS 100U
+#define NV_UPDATE_CYCLE_LONLAT 100U
+#define NV_UPDATE_CYCLE_LOCALTIME 10U
+
+/************************************************************************
+* Typedef definitions *
+************************************************************************/
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+typedef struct {
+ LOCALTIME localtime;
+ LONLAT lonlat;
+ int32 timediff;
+ u_int32 update_counter;
+ u_int8 reserve[2];
+ u_int8 cka;
+ u_int8 ckb;
+} NV_DATA_VEHICLESENS;
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+void VehicleSensFromAccessInitialize(void);
+RET_API VehicleSensRegistNvTag(void);
+RET_API VehicleSensReadNVLocalTime(LOCALTIME * local_time);
+RET_API VehicleSensReadNVLonLat(LONLAT * lonlat);
+RET_API VehicleSensReadNVTimeDiff(int32 * time_diff);
+void VehicleSensStoreLonlat(LONLAT * plonlat);
+RET_API VehicleSensWriteNVLocaltime(LOCALTIME * local_time, int32 * time_diff);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_FROMACCESS_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_SelectionItemList.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_SelectionItemList.h
new file mode 100755
index 0000000..15004e8
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_SelectionItemList.h
@@ -0,0 +1,116 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_SELECTIONITEMLIST_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_SELECTIONITEMLIST_H_
+/****************************************************************************
+ * File name :VehicleSens_SelectionItemList.h
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ ****************************************************************************/
+
+#include "Vehicle_API_Dummy.h"
+#include "Vehicle_API_private.h"
+#include "VehicleSens_Common.h"
+#include "VehicleIf.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/* ++ Addition of DID9 related to PastModel002 supported_UBX commands */
+/* ++ GPS _CWORD82_ support (To add the target DID 3) */
+#define VEHICLESENS_SELECTION_ITEM_LIST_LEN (87) /* Number of data in Vehicle Sensor Selection Item List */
+/* -- GPS _CWORD82_ support */
+#else
+#define VEHICLESENS_SELECTION_ITEM_LIST_LEN (63) /* Number of data in Vehicle Sensor Selection Item List */
+/* -- PastModel002 support */
+#endif
+/* Sum of bits 29 through 31*/
+#define VEHICLESENS_BIT31_29 (VEHICLESENS_BIT31 | VEHICLESENS_BIT30 | VEHICLESENS_BIT29)
+
+#define VEHICLESENS_ITEMLIST_APPLICATION 0x00 /* Application of electronic PF */
+#define VEHICLESENS_ITEMLIST_NON_APPLICATION 0x01 /* Electronic PF not applicable */
+#define VEHICLESENS_ITEMLIST_INVALID 0x02 /* Disabled */
+
+#define VEHICLE_COMM_WATCHTBL_DAT_NUM 64 /* Number of data held for communication discontinuation registration */
+#define VEHICLE_COMM_WATCHTBL_DID_NUM 2 /* Number of Disruption Monitoring Data Management */
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/*********************************************************************
+* TAG : VEHICLESENS_SELECTION_ITEM_LIST
+* ABSTRACT : Managing a list of vehicle information choices
+***********************************************************************/
+
+typedef struct {
+ DID ul_did; /* Data ID */
+ u_int32 ul_canid; /* CAN ID */ /* CANIF_API deletion */
+ u_int8 uc_get_method; /* Data acquisition source category */
+ u_int8 reserve[3]; /* reserve */
+} VEHICLESENS_SELECTION_ITEM_LIST;
+
+/************************************************************************
+* TAG : VEHICLE_COMM_WATCH_TBL
+* ABSTRACT : Managing Vehicle Sensor Disruption Monitoring Data
+************************************************************************/
+typedef struct {
+ PNO us_pno; /* Destination PNO */
+ u_int16 us_watch_time; /* Interruption monitoring time(Units of 100 ms) */
+} VEHICLE_COMM_WATCH_DAT;
+
+typedef struct {
+ DID ul_did; /* Data ID corresponding to vehicle sensor information */
+ u_int8 uc_effective_flg; /* CANID Valid Flag */
+ u_int8 uc_vehicle_comm_watch_cnt; /* Vehicle Sensor Information Disruption Monitoring Request Count */
+ VEHICLE_COMM_WATCH_DAT st_comm_watch_dat[VEHICLE_COMM_WATCHTBL_DAT_NUM]; /* Communication disruption registration data */
+} VEHICLE_COMM_WATCH_TBL;
+
+/* ++ PastModel002 support */
+/************************************************************************
+* TAG : VEHICLE_MSG_WATCH_STOPPAGE
+* ABSTRACT : Vehicle Sensor Disruption Monitoring Message(-> Vehicle sensor)
+************************************************************************/
+typedef struct {
+ DID ul_did; /* Data ID corresponding to vehicle sensor information */
+ PNO us_pno; /* Destination PNO */
+ u_int16 us_watch_time; /* Interruption monitoring time(Units of 100 ms) */
+ u_int16 us_offset; /* Offset to shared memory storage area */
+ u_int16 us_size; /* Size of shared memory storage area */
+ EventID ul_eventid; /* Event ID */
+} VEHICLE_MSG_WATCH_STOPPAGE_DAT;
+
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER st_hdr; /* Message header */
+ VEHICLE_MSG_WATCH_STOPPAGE_DAT st_data; /* Message data */
+} VEHICLE_MSG_WATCH_STOPPAGE;
+
+/* -- PastModel002 support */
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+void VehicleSensInitSelectionItemList(void);
+u_int8 VehicleSensGetSelectionItemList(DID);
+u_int32 VehicleSensGetSelectionItemListCanId(DID);
+BOOL VehicleSensSetSelectionItemListCanId(DID did, u_int32); /* CANIF_API deletion */
+void VehicleSensCommWatchTblInit(void);
+BOOL VehicleSensCommWatchTblSave(const VEHICLE_MSG_WATCH_STOPPAGE*);
+BOOL VehicleSensCommWatchTblRun(DID);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_SELECTIONITEMLIST_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_SharedMemory.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_SharedMemory.h
new file mode 100755
index 0000000..54878ec
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_SharedMemory.h
@@ -0,0 +1,48 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_SHAREDMEMORY_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_SHAREDMEMORY_H_
+/******************************************************************************
+ * File name :VehicleSens_SharedMemory.h
+ * System name :PastModel002
+ * Subsystem name :
+ ******************************************************************************/
+
+#include "Vehicle_API.h"
+#include "Sensor_Common_API.h"
+#include "VehicleSens_FromAccess.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+
+/************************************************************************
+* Typedef definitions *
+************************************************************************/
+
+/************************************************************************
+* Struct definitions *
+************************************************************************/
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+RET_API VehicleSensInitSharedMemory(void);
+void VehicleSensWriteSharedMemory(DID ul_did);
+RET_API VehicleSensWriteDataValidEphemerisNum(u_int8 valid_ephemer_isnum);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_SHAREDMEMORY_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSens_Thread.h b/vehicleservice/positioning/server/include/Sensor/VehicleSens_Thread.h
new file mode 100755
index 0000000..17a342d
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSens_Thread.h
@@ -0,0 +1,185 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_THREAD_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_THREAD_H_
+/******************************************************************************
+ * File name :VehicleSens_Thread.h
+ * System name :_CWORD107_
+ * Subsystem name :
+ ******************************************************************************/
+
+#include "Vehicle_API_Dummy.h"
+#include "Sensor_API.h"
+#include "Vehicle_API_private.h"
+#include "Sensor_API_private.h"
+#include "VehicleSens_Common.h"
+#include "VehicleSens_SelectionItemList.h"
+#include "VehicleSens_DataMaster.h"
+#include "VehicleSens_DeliveryCtrl.h"
+#include "VehicleSens_SharedMemory.h"
+#include "CanInput_API.h"
+#include "CanInput_API_private.h"
+#include "VehicleDebug_API.h"
+#include "VehicleSens_FromAccess.h"
+#include "ClockDataMng.h"
+#include "gps_hal.h"
+#include "positioning_hal.h"
+#include "CommonDefine.h"
+
+/* ++ DR support */
+#include "DeadReckoning_main.h"
+#include "Dead_Reckoning_Local_Api.h"
+/* -- DR support */
+
+#include "POS_common_private.h"
+
+/************************************************************************
+* Macro definitions *
+************************************************************************/
+
+/* ++ Porting from PastModel002 enabled APIs */
+#define CID_VEHICLEIF_GET_VEHICLE_DATA 0x0102 /* Vehicle sensor information acquisition CID */
+#define CID_VEHICLEIF_COMM_WATCH 0x0103 /* Vehicle Sensor Information Disruption Monitoring CID */
+#define CID_SENSORIF__CWORD82__REQUEST 0x0800 /* Vehicle sensor information setting CID */
+
+#define VEHICLE_RET_ERROR_OUTOF_MEMORY (-8) /* Shared memory allocation failure */
+#define VEHICLE_RET_ERROR_INVALID (-10) /* CANID undetermined */
+
+/* -- Porting from PastModel002 enabled APIs */
+
+
+/* NMEA */
+#define VEHICLESENS_NMEA_LF "\n"
+#define VEHICLESENS_NMEA_CR "\r"
+#define VEHICLESENS_NMEA_FIELDDELIMITER ","
+#define VEHICLESENS_NMEA_DECIMALPOINT "."
+#define VEHICLESENS_NMEA_ASTARISK "*"
+
+#define VEHICLESENS_NMEA_PASCD_LEN_MAX 256
+
+#define VEHICLESENS_NMEA_PASCD_ID "$PASCD"
+
+#define VEHICLESENS_NMEA_PASCD_TS_MAX 86400
+#define VEHICLESENS_NMEA_PASCD_TS_INT_LEN_MAX 6 /* max length of integer part of timestamp */
+#define VEHICLESENS_NMEA_PASCD_TS_FRA_LEN_MAX 3 /* max length of fractional part of timestamp */
+
+#define VEHICLESENS_NMEA_PASCD_SENSORTYPE_C "C" /* Combined left and right wheel speed sensors */
+
+#define VEHICLESENS_NMEA_PASCD_TMS_U "U" /* Unkonwn */
+#define VEHICLESENS_NMEA_PASCD_TMS_P "P" /* Park */
+#define VEHICLESENS_NMEA_PASCD_TMS_R "R" /* Reverse */
+#define VEHICLESENS_NMEA_PASCD_TMS_D "D" /* Driving forword */
+#define VEHICLESENS_NMEA_PASCD_TMS_N "N" /* Neutral */
+
+#define VEHICLESNES_NMEA_PASCD_SLIP "1" /* 1 = a wheel speed slippage was detected */
+#define VEHICLESNES_NMEA_PASCD_NOSLIP "0" /* 0 = no slip was detected */
+
+#define VEHICLESENS_NMEA_PASCD_TO_FRA_LEN_MAX 2 /* max length of fractional part of timeoffset */
+
+#define VEHICLESENS_NMEA_PASCD_SPD_FRA_LEN_MAX 3 /* max length of fractional part of speed */
+
+#define VEHICLESENS_NMEA_PASCD_SAMPLECOUNT_MAX 50
+
+/************************************************************************
+ * Struct definitions *
+ ************************************************************************/
+
+/*!
+ @brief Structure of Vehicle Speed and TimeSpec
+ */
+typedef struct {
+ timespec ts;
+ uint16_t speed; /* [0.01m/s] */
+} VEHICLESENS_VEHICLE_SPEED_DAT;
+
+/*!
+ @brief Structure of Vehilce Speeds and TimeSpecs
+ */
+typedef struct {
+ VEHICLESENS_VEHICLE_SPEED_DAT listSpd[VEHICLESENS_NMEA_PASCD_SAMPLECOUNT_MAX];
+ uint8_t sampleCount;
+} VEHICLESENS_VEHICLE_SPEED_INFO;
+
+/*!
+ @brief Structure for LUT to Derive Transmission State
+ */
+typedef struct {
+ uint8_t type; /* Transmission Type */
+ uint8_t shift; /* Shift Position from Vehicle */
+
+ uint8_t pkb; /* Parking Brake from Vehicle */
+ char state[8]; /* Transmission State for _CWORD27_ */
+} VEHICLESENS_TRANSMISSION_PKG;
+
+/************************************************************************
+ * TAG : VEHICLE_MSG_SEND_DAT
+ * ABSTRACT : Vehicle sensor information setting message(-> Vehicle sensor)
+ ************************************************************************/
+
+
+
+/************************************************************************
+* Function prototype *
+************************************************************************/
+EFrameworkunifiedStatus VehicleSensThread(HANDLE h_app);
+RET_API VehicleSensThreadInit(void);
+void VehicleSensDeliveryEntry(const VEHICLE_MSG_DELIVERY_ENTRY *);
+void VehicleSensGetVehicleData(const VEHICLE_MSG_GET_VEHICLE_DATA *);
+void VehicleSensWatchStopPage(const VEHICLE_MSG_WATCH_STOPPAGE *);
+void VehicleSensPkgDeliveryEntry(const SENSOR_MSG_DELIVERY_ENTRY *);
+void VehicleSensGetVehiclePkgData(const SENSOR_MSG_GET_SENSOR_DATA *);
+void VehicleSensLineSensDataDelivery(const LSDRV_MSG_LSDATA *, PFUNC_DMASTER_SET_N);
+void VehicleSensLineSensDataDeliveryG(const LSDRV_MSG_LSDATA_G *, PFUNC_DMASTER_SET_N);
+void VehicleSensLineSensDataDeliveryGyroTrouble(const LSDRV_MSG_LSDATA_GYRO_TROUBLE *msg,
+ PFUNC_DMASTER_SET_N p_datamaster_set_n);
+void VehicleSensLineSensDataDeliverySysGpsInterruptSignal(const LSDRV_MSG_LSDATA_GPS_INTERRUPT_SIGNAL *msg,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory);
+void VehicleSensLineSensDataDeliveryGyroConnectStatus(const LSDRV_MSG_LSDATA_GYRO_CONNECT_STATUS *msg,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory);
+void VehicleSensLineSensDataDeliveryGpsAntennaStatus(const LSDRV_MSG_LSDATA_GPS_ANTENNA_STATUS *msg,
+ PFUNC_DMASTER_SET_N p_datamaster_set_n);
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+void VehicleSensPkgDeliveryEntryExt(const SENSOR_MSG_DELIVERY_ENTRY *msg);
+void VehicleSensLineSensDataDeliveryFst(const LSDRV_MSG_LSDATA_FST *, PFUNC_DMASTER_SET_N);
+void VehicleSensLineSensDataDeliveryFstG(const LSDRV_MSG_LSDATA_FST *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n);
+#else
+void VehicleSensPkgDeliveryEntryError(const SENSOR_MSG_DELIVERY_ENTRY *msg);
+#endif
+void VehicleSensGpsDataDelivery(SENSOR_MSG_GPSDATA *msg,
+ PFUNC_DMASTER_SET_N p_datamaster_set_n,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory);
+
+void VehicleSensDataMasterSetN(DID did, u_int8 chg_type, u_int8 get_method);
+void VehicleSensDataMasterSetSharedMemory(DID did, u_int8 chg_type);
+/* ++ GPS _CWORD82_ support */
+void VehicleSensSetVehicleData(const VEHICLE_MSG_SEND *);
+/* -- GPS _CWORD82_ support */
+
+void VehicleSensDrDeliveryEntry(const VEHICLE_MSG_DELIVERY_ENTRY *);
+void VehicleSensGetLog(const VEHICLEDEBUG_MSG_BUF* msg);
+void VehicleSensSetLog(const VEHICLEDEBUG_MSG_BUF* msg);
+void VehicleSensWriteLocalTime(const CANINPUT_MSG_INFO *msg);
+void VehicleSensSetEphNumSharedMemory(const SENSOR_MSG_GPSDATA *msg);
+void VehicleSensDrRcvMsg(const DEAD_RECKONING_RCVDATA *msg);
+
+void VehicleSensCommonDataDelivery(const VEHICLE_MSG_BUF *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n);
+void VehicleSensGpsTimeSndMsg(const POS_MSGINFO *pos_msg);
+void VehicleSensGpsTimeDelivery(const VEHICLE_MSG_BUF *msg);
+RET_API VehicleSensSendEvent(uint16_t snd_pno, int32_t event_val);
+void VehicleSensThreadStopProcess(void);
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENS_THREAD_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleSensor_Thread.h b/vehicleservice/positioning/server/include/Sensor/VehicleSensor_Thread.h
new file mode 100755
index 0000000..f40f2a7
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleSensor_Thread.h
@@ -0,0 +1,33 @@
+/*
+ * @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 :vehiclesensor_thread.h
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Title :Prototype Declaration of Thread Entry Function of Vehicle Sensor Process
+ ****************************************************************************/
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENSOR_THREAD_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENSOR_THREAD_H_
+
+#include <vehicle_service/positioning_base_library.h>
+
+/***********************************************************************
+* Thread entry function prototype *
+************************************************************************/
+EFrameworkunifiedStatus VehicleSensThread(HANDLE h_app);
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLESENSOR_THREAD_H_
diff --git a/vehicleservice/positioning/server/include/Sensor/VehicleUtility.h b/vehicleservice/positioning/server/include/Sensor/VehicleUtility.h
new file mode 100755
index 0000000..e7ebef0
--- /dev/null
+++ b/vehicleservice/positioning/server/include/Sensor/VehicleUtility.h
@@ -0,0 +1,128 @@
+/*
+ * @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 VehicleUtility.h
+@detail Common processing function header file of Vehicle<BR>
+ Vehicle Common Functions Header Files
+*****************************************************************************/
+#ifndef POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLEUTILITY_H_
+#define POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLEUTILITY_H_
+
+#include <stdint.h>
+#include <vehicle_service/positioning_base_library.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*------------------------------------------------------------------------------*
+ * Definition *
+ *------------------------------------------------------------------------------*/
+/* GPS-related timer value */
+#define TIMVAL_GPS_STARTUP 500 /* 5Sec Start confirmation monitoring timer */
+#define TIMVAL_GPS_RCVCYCLDAT 500 /* 5Sec Periodic reception data monitoring timer */
+#define TIMVAL_GPS_RCVACK 500 /* 5Sec ACK reception monitoring timer */
+#define TIMVAL_GPS_RCVDAT 500 /* 5Sec Data reception monitoring timer(Not used) */
+#define TIMVAL_GPS_NAVIFST 3000 /* 30sec Initial Navigation Monitoring Timer */
+#define TIMVAL_GPS_NAVICYCLE 300 /* 3sec Navi monitoring timer */
+#define TIMVAL_GPS_NAVIDISRPT 1000 /* 10Sec Navigation Monitoring Disruption Log Output Timer */
+#define TIMVAL_GPS_DIAGCLKGUARD 1000 /* 10sec Diag provision time guard monitoring timer */
+#define TIMVAL_GPS_NMEADATAGUARD 1000 /* 10sec NMEA data-providing guard monitoring timer */
+#define TIMVAL_GPS_RECOVERY 60000 /* 600sec GPS recovery timer */
+#define TIMVAL_GPS_RECEIVERERR 60000 /* 600sec GPS receiver anomaly detection timer */
+
+/* Sensor-related timer value */
+#define TIMVAL_SNS_RCVFSTDAT 3000 /* 30Sec Initial sensor data reception monitoring timer */
+#define TIMVAL_SNS_RCVCYCLDAT 300 /* 3Sec Cyclic sensor data reception monitoring timer */
+#define TIMVAL_SNS_RCVDISRPT 1000 /* 10Sec Cyclic sensor data interruption log output timer */
+
+/* Timer management table */
+#define TIM_NON 0x00 /* Timer counter initial value */
+#define TIM_CNTMIN 0x01 /* Timer counter minimum value */
+#define TIM_CNTMAX 0xff /* Maximum value of timer counter */
+#define TIMER_OFF 0 /* Timer enable flag OFF */
+#define TIMER_ON 1 /* Timer enable flag ON */
+
+/*------------------------------------------------------------------------------*
+ * Structure *
+ *------------------------------------------------------------------------------*/
+/*!
+ @brief Timer type
+ */
+typedef enum _VEHICLEUTILITY_TIM_KIND {
+ GPS_STARTUP_TIMER = 0, /* 0 Start confirmation monitoring timer */
+ GPS_CYCL_TIMER, /* 1 Cyclic GPS data reception monitoring timer */
+ GPS_RECV_ACK_TIMER, /* 2 ACK reception monitoring timer */
+ GPS_NAVIFST_TIMER, /* 3 Initial Navigation Monitoring Timer */
+ GPS_NAVICYCLE_TIMER, /* 4 Navi monitoring timer */
+ GPS_NAVIDISRPT_TIMER, /* 5 Navigation Monitoring Disruption Log Output Timer */
+ GPS_DIAGCLK_GUARDTIMER, /* 6 Diag provision time guard monitoring timer */
+ GPS_NMEADATA_GUARDTIMER, /* 7 NMEA data-providing guard monitoring timer */
+ GPS_RECOVERY_TIMER, /* 8 GPS recovery timer */
+ GPS_RECEIVERERR_TIMER, /* 9 GPS receiver anomaly detection timer */
+ SNS_FST_TIMER, /* 10 Initial sensor data reception monitoring timer */
+ SNS_CYCLE_TIMER, /* 11 Cyclic sensor data reception monitoring timer */
+ SNS_DISRPT_TIMER, /* 12 Cyclic sensor data interruption log output timer */
+ TIM_NUM /* 13 Number of timer types */
+} VEHICLEUTILITY_TIM_KIND;
+
+/*!
+ @brief Master status
+*/
+typedef struct {
+ u_int8 flag; /**< Timer flag OFF:Stop,ON:Start */
+ u_int8 cnt; /**< Start counter */
+ int8 rsv[2]; /**< Reserved */
+} VEHICLEUTILITY_TIM_STS;
+
+/*!
+ @brief Master status management table
+ */
+typedef struct {
+ VEHICLEUTILITY_TIM_STS sts[TIM_NUM]; /**< Master status */
+} VEHICLEUTILITY_TIM_MNG;
+
+/*!
+ @brief Timer setting information table
+*/
+typedef struct {
+ uint32_t timer_val; /**< Timer value */
+ PNO pno; /**< Event notification destination process number */
+} VEHICLEUTILITY_TIM_INFO;
+
+/*
+ Function prototype declaration
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API VehicleUtilitySndMsg(PNO pno, u_int16 size, void *msgbuf, u_int16 mode);
+RET_API VehicleUtilityRcvMsg(PNO pno, u_int16 size, void **msgbuf, u_int16 mode);
+void VehicleUtilityDiagCodePut(u_int32 err_id, u_int16 positioning_code);
+void VehicleUtilityInitTimer(void);
+BOOL VehicleUtilitySetTimer(VEHICLEUTILITY_TIM_KIND tim_kind);
+BOOL VehicleUtilityStopTimer(VEHICLEUTILITY_TIM_KIND tim_kind);
+BOOL VehicleUtilityTimeJdgKnd(uint16_t seqno);
+
+void LineSensDrvExtTermStsReq(void);
+RET_API DEVGpsSndBackupDataLoadReq(void);
+void DEVGpsGetDebugGpsFormatFailCnt(void* p_buf);
+u_int8 LineSensDrvGetSysRecvFlag(void);
+uint16_t DEVGpsGetWknRollover(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SENSOR_VEHICLEUTILITY_H_ */
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/BackupMgrIf.h b/vehicleservice/positioning/server/include/ServiceInterface/BackupMgrIf.h
new file mode 100755
index 0000000..3e2e5e5
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/BackupMgrIf.h
@@ -0,0 +1,65 @@
+/*
+ * @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
+ * BackupMgrIf.h
+ * @brief
+ * BackupMgr service-to-service interface
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_BACKUPMGRIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_BACKUPMGRIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <native_service/frameworkunified_framework_if.h>
+#include <native_service/ns_backup.h>
+#include <native_service/ns_backup_id.h>
+
+#include <vehicle_service/positioning_base_library.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+EFrameworkunifiedStatus BackupMgrIfNotifyOnBackupMgrAvailability(CbFuncPtr fp_on_cmd);
+void BackupMgrIfSetAvailability(BOOL b_is_available);
+BOOL BackupMgrIf_GetAvailability(void);
+EFrameworkunifiedStatus BackupMgrIfBackupDataRd(PCSTR tag_id, uint32_t ui_offset, \
+ void *pv_buf, uint32_t ui_size, BOOL* pb_is_available);
+EFrameworkunifiedStatus BackupMgrIfBackupDataWt(PCSTR tag_id, void *pv_buf, \
+ uint32_t ui_offset, uint32_t ui_size, BOOL* pb_is_available);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_BACKUPMGRIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/ClockIf.h b/vehicleservice/positioning/server/include/ServiceInterface/ClockIf.h
new file mode 100755
index 0000000..5a2e976
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/ClockIf.h
@@ -0,0 +1,61 @@
+/*
+ * @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
+ * ClockIf.h
+ * @brief
+ * Clock service-to-service interface
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_CLOCKIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_CLOCKIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <native_service/frameworkunified_framework_if.h>
+
+#include <stub/DTime_Api.h>
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_gps_API.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+EFrameworkunifiedStatus ClockIfNotifyOnClockAvailability(CbFuncPtr fp_on_cmd);
+void ClockIfSetAvailability(BOOL b_is_available);
+EFrameworkunifiedStatus ClockIfDtimeSetGpsTime(const SENSOR_MSG_GPSTIME *pst_gps_time, BOOL* pb_is_available);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_CLOCKIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/CommUsbIf.h b/vehicleservice/positioning/server/include/ServiceInterface/CommUsbIf.h
new file mode 100755
index 0000000..cbc947c
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/CommUsbIf.h
@@ -0,0 +1,64 @@
+/*
+ * @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
+ * CommUsbIf.h
+ * @brief
+ * CommUSB service-to-service interface
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_COMMUSBIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_COMMUSBIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <native_service/frameworkunified_framework_if.h>
+#include <stub/commusb_api.h>
+#include <stub/commusb_notifications.h>
+
+#include <vehicle_service/positioning_base_library.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+EFrameworkunifiedStatus CommUsbIfAttachCallbacksToDispatcher( // NOLINT(readability/nolint)
+ _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler,
+ unsigned int ui_handler_count);
+EFrameworkunifiedStatus CommUsbIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count);
+EFrameworkunifiedStatus CommUsbIfNotifyOnCommUSBAvailability(CbFuncPtr fp_on_cmd);
+void CommUsbIfSetAvailability(BOOL b_is_available);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_COMMUSBIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/DevDetectSrvIf.h b/vehicleservice/positioning/server/include/ServiceInterface/DevDetectSrvIf.h
new file mode 100755
index 0000000..8829123
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/DevDetectSrvIf.h
@@ -0,0 +1,69 @@
+/*
+ * @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
+ * DevDetectSrvIf.h
+ * @brief
+ * DevDetectSrv service-to-service interface
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_DEVDETECTSRVIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_DEVDETECTSRVIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <system_service/ss_devicedetection_service_ifc.h>
+#include <system_service/ss_devicedetection_service_protocol.h>
+
+#include <vehicle_service/positioning_base_library.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+void DevDetectSrvIfSetAvailability(BOOL b_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfInitialize(void);
+EFrameworkunifiedStatus DevDetectSrvIfNotifyOnDeviceDetectionAvailability(CbFuncPtr fp_call_back_fn);
+EFrameworkunifiedStatus DevDetectSrvIfNotifyOnOpenSessionAck(CbFuncPtr fp_call_back_fn, BOOL* pb_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfNotifyOnCloseSessionAck(CbFuncPtr fp_call_back_fn, BOOL* pb_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfOpenSessionRequest(BOOL* pb_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfDecodeOpenSessionResponse(BOOL* pb_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfRegisterForDeviceDetectionEvent(SS_DeviceDetectionServerEvents fe_dev_detect_event, \
+ CbFuncPtr fp_call_back_fn, PCSTR p_file_path, BOOL* pb_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfUnRegisterForDeviceDetectionEvent(SS_DeviceDetectionServerEvents fe_dev_detect_event, \
+ BOOL* pb_is_available);
+EFrameworkunifiedStatus DevDetectSrvIfCloseSessionRequest(BOOL* pb_is_available);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_DEVDETECTSRVIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/DiagSrvIf.h b/vehicleservice/positioning/server/include/ServiceInterface/DiagSrvIf.h
new file mode 100755
index 0000000..a6bcd77
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/DiagSrvIf.h
@@ -0,0 +1,55 @@
+/*
+ * @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
+ * DiagSrvIf.h
+ * @brief
+ * DiagSrv service-to-service interface
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_DIAGSRVIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_DIAGSRVIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <vehicle_service/positioning_base_library.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+void DiagSrvIfSetRegistrationPermission(BOOL b_is_true);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_DIAGSRVIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/PSMShadowIf.h b/vehicleservice/positioning/server/include/ServiceInterface/PSMShadowIf.h
new file mode 100755
index 0000000..8cdb1f8
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/PSMShadowIf.h
@@ -0,0 +1,58 @@
+/*
+ * @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
+ * PSMShadow.h
+ * @brief
+ * PSMShadow service-to-service interface
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_PSMSHADOWIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_PSMSHADOWIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <native_service/frameworkunified_framework_if.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "ps_psmshadow_notifications.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+EFrameworkunifiedStatus PSMShadowIfNotifyOnPSMShadowAvailability(CbFuncPtr fp_on_cmd);
+EFrameworkunifiedStatus PSMShadowIfNotifyOnPSMShadowInitComp(CbFuncPtr fp_on_cmd);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_PSMSHADOWIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/VehicleIf.h b/vehicleservice/positioning/server/include/ServiceInterface/VehicleIf.h
new file mode 100755
index 0000000..28c05fb
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/VehicleIf.h
@@ -0,0 +1,82 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_VEHICLEIF_H_
+#define POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_VEHICLEIF_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <native_service/frameworkunified_framework_if.h>
+
+#include <vehicle_service/positioning_base_library.h>
+#include <stub/vehicle_notifications.h>
+#include <stub/Vehicle_Sensor_Common_API.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* Transmission Type */
+#define VEHICLEIF_TRANSMISSION_TYPE_MT 0
+#define VEHICLEIF_TRANSMISSION_TYPE_AT 1
+#define VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN 2
+#define VEHICLEIF_TRANSMISSION_TYPE_NUM 3 /* Number of Transmission Types */
+
+/* Shift Position (CAUTION: These values depend on Vehicle I/F) */
+#define VEHICLEIF_SHIFT_POSITION_U 0
+#define VEHICLEIF_SHIFT_POSITION_R 1
+#define VEHICLEIF_SHIFT_POSITION_P 2
+#define VEHICLEIF_SHIFT_POSITION_N 4
+#define VEHICLEIF_SHIFT_POSITION_D 8
+#define VEHICLEIF_SHIFT_POSITION_NUM 5 /* Number of Shift Position Types */
+
+/* Parking Brake (CAUTION: These values depend on Vehicle I/F) */
+#define VEHICLEIF_PKB_OFF 0
+#define VEHICLEIF_PKB_ON 1
+#define VEHICLEIF_PKB_UNKNOWN 2
+#define VEHICLEIF_PKB_NUM 3
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+void VehicleIf_SetAvailability(BOOL bIsAvailable);
+
+//EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, BOOL* pbIsAvailable);
+EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, uint8_t* pPkb, BOOL* pbIsAvailable);
+EFrameworkunifiedStatus VehicleIf_GetShiftPosition(uint8_t* pShift, BOOL* pbIsAvailable);
+EFrameworkunifiedStatus VehicleIfAttachCallbacksToDispatcher( // NOLINT(readability/nolint)
+ _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler,
+ unsigned int ui_handlercount);
+EFrameworkunifiedStatus VehicleIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count);
+EFrameworkunifiedStatus VehicleIfNotifyOnVehicleAvailability(CbFuncPtr fp_on_cmd);
+EFrameworkunifiedStatus VehicleIfDeliveryEntry(uint32_t ul_did);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_SERVER_INCLUDE_SERVICEINTERFACE_VEHICLEIF_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/ps_psmshadow_notifications.h b/vehicleservice/positioning/server/include/ServiceInterface/ps_psmshadow_notifications.h
new file mode 100755
index 0000000..24a513a
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/ps_psmshadow_notifications.h
@@ -0,0 +1,62 @@
+/*
+ * @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 ps_psmshadow_notifications.h
+ */
+
+#ifndef PS_PSM_SHADOW_NOTIFICATIONS_H_ // NOLINT(build/header_guard)
+
+#include "agl_thread.h"
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup peripheralservice
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup PS_PSMShadow
+ * @ingroup peripheralservice
+ * @{
+ */
+
+/**
+ * \~english PS_PSMShadow service availability notify.
+ */
+#define NTFY_PSMShadowService_Availability MN_PS_PSMSHADOW"/Availability"
+
+/**
+ * \~english init complete notify.
+ */
+#define NTFY_PSM_INITCOMP MN_PS_PSMSHADOW"/InitComp"
+
+/**
+ * \~english init complete2 notify.
+ */
+#define NTFY_PSM_INITCOMP2 MN_PS_PSMSHADOW"/InitComp2"
+
+// to be delete code.
+// Voltage, temperature and fan data to DIAG / HMI.
+#define NTFY_PSM_VTG_TEMP_FAN_DATA MN_PS_PSMSHADOW"/VolTempFanInfo"
+// Audio High Temp notification to Audio service.
+#define NTFY_PSM_AUDIO_HIGH_TEMP MN_PS_PSMSHADOW"/AudioHighTemp"
+
+/** @}*/ // end of PS_PSMShadow
+/** @}*/ // end of peripheralservice
+/** @}*/ // end of BaseSystem
+
+#endif // PS_PSM_SHADOW_NOTIFICATIONS_H_
diff --git a/vehicleservice/positioning/server/include/ServiceInterface/ps_version.h b/vehicleservice/positioning/server/include/ServiceInterface/ps_version.h
new file mode 100755
index 0000000..f28982f
--- /dev/null
+++ b/vehicleservice/positioning/server/include/ServiceInterface/ps_version.h
@@ -0,0 +1,45 @@
+/*
+ * @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.
+ */
+
+/// \session
+/// \internal
+//////////////////////////////////////////////////////////////////////////////////////////////////
+/// \file ps_services.h
+/// \ingroup tag_PeripheralServices
+/// \brief Peripheral Services Version Information Support.
+///
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// File name : ps_version.h
+// Module : PeripheralServices
+// Description : Peripheral Services Version Information Support.
+// Scope : PeripheralServices
+// Platform : Global Platform Framework (GPF)
+//
+// Customer : General
+// System : PosixBasedOS001
+// Reference : PeripheralServices
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef PS_VERSION_H_ // NOLINT(build/header_guard)
+
+#define PS_VERSION_MAJOR (1u)
+#define PS_VERSION_MINOR (0u)
+#define PS_VERSION_REV (0u)
+
+#endif /* PS_VERSION_H_ */
+
diff --git a/vehicleservice/positioning/server/include/nsfw/positioning_common.h b/vehicleservice/positioning/server/include/nsfw/positioning_common.h
new file mode 100755
index 0000000..538630d
--- /dev/null
+++ b/vehicleservice/positioning/server/include/nsfw/positioning_common.h
@@ -0,0 +1,90 @@
+/*
+ * @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
+ * positioning_common.h
+ * @brief
+ * Positioing NSFW Dependency Section Common Headers
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_NSFW_POSITIONING_COMMON_H_
+#define POSITIONING_SERVER_INCLUDE_NSFW_POSITIONING_COMMON_H_
+
+#include <positioning_hal.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* Thread control command ID */
+#define CID_EXTTERM_REQ (0x0011) /* External pin status request */
+
+/* Internal thread activation status determination */
+#define THREAD_STS_MSK_POS_MAIN (0x01)
+#define THREAD_STS_MSK_POS_SENS (0x02)
+#define THREAD_STS_MSK_POS_GPS (0x04)
+#define THREAD_STS_MSK_POS_GPS_RECV (0x08)
+#define THREAD_STS_MSK_POS_GPS_ROLLOVER (0x10)
+
+
+/*---------------------------------------------------------------------------------*
+ * ENUMERATION *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Positioning operating status definitions
+*/
+typedef enum {
+ EPOS_EXE_STS_STOP = 0, /* Stopped */
+ EPOS_EXE_STS_RUNNING, /* Running (From FrameworkunifiedOnStart to FrameworkunifiedOnStop) */
+ EPOS_EXE_STS_RUNNING_COLDSTART /* Running after cold start */
+} EnumExeSts_POS;
+
+/*!
+ @brief Positioning Thread Startup Modes
+*/
+typedef enum {
+ EPOS_SETUP_MODE_NORMAL = 0, /* Normal start */
+ EPOS_SETUP_MODE_DATA_RESET /* Data reset start */ /* QAC 930 */
+} EnumSetupMode_POS;
+
+/*---------------------------------------------------------------------------------*
+ * STRUCTURE *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Thread activation information
+*/
+typedef struct {
+ EnumSetupMode_POS e_mode; /* Thread activation mode */
+} ST_THREAD_SETUP_INFO;
+
+/*---------------------------------------------------------------------------------*
+ * Prototype *
+ *---------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+ EnumSetupMode_POS PosSetupThread(HANDLE h_app, EnumTID_POS e_tid);
+ void PosTeardownThread(EnumTID_POS e_tid);
+#ifdef __cplusplus
+}
+#endif
+
+/*---------------------------------------------------------------------------------*
+ * Extern *
+ *---------------------------------------------------------------------------------*/
+extern BOOL g_thread_stop_req; /* Pos_Gps_Recv Thread Stop Flag */
+
+
+#endif // POSITIONING_SERVER_INCLUDE_NSFW_POSITIONING_COMMON_H_
diff --git a/vehicleservice/positioning/server/include/nsfw/vehicle_version.h b/vehicleservice/positioning/server/include/nsfw/vehicle_version.h
new file mode 100755
index 0000000..b397b68
--- /dev/null
+++ b/vehicleservice/positioning/server/include/nsfw/vehicle_version.h
@@ -0,0 +1,29 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_SERVER_INCLUDE_NSFW_VEHICLE_VERSION_H_
+#define POSITIONING_SERVER_INCLUDE_NSFW_VEHICLE_VERSION_H_
+
+#define MAJORNO 0x01
+#define MINORNO 0x00
+#define REVISION 0x00
+
+/*
+ * ChangeLog : This section describes all the changes done to the project.
+ *
+ * - Initial
+ */
+
+#endif // POSITIONING_SERVER_INCLUDE_NSFW_VEHICLE_VERSION_H_
diff --git a/vehicleservice/positioning/server/src/Sensor/ClockUtility.cpp b/vehicleservice/positioning/server/src/Sensor/ClockUtility.cpp
new file mode 100755
index 0000000..2e9639a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/ClockUtility.cpp
@@ -0,0 +1,414 @@
+/*
+ * @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 ClockUtility.cpp
+@detail Common processing function concerning clock
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "ClockUtility.h"
+#include "ClockUtility_private.h"
+
+/*
+ Global Constant Definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static const u_int16 kUsMonth[3][12] = { /* Mnumonic For Remembering The Months With Fewer Than 31 Days Table(Leap year version) Task_31499 */
+ {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, /* Number of days per month(If it is not a leap year) */
+ {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, /* Number of days per month(For leap years) */
+ {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334} /* Cumulative number of days per month(If it is not a leap year) */
+};
+
+static const ClockDayCntTbl kUlDayCntTbl = {
+ /* 1970 Year */ {{0x000007B2U, 0x00000000U, {0x00000000U, 0x0028DE80U, 0x004DC880U, 0x0076A700U, 0x009E3400U, 0x00C71280U, 0x00EE9F80U, 0x01177E00U, 0x01405C80U, 0x0167E980U, 0x0190C800U, 0x01B85500U}}, // NOLINT(whitespace/line_length)
+ /* 1971 Year */ {0x000007B3U, 0x01E13380U, {0x01E13380U, 0x020A1200U, 0x022EFC00U, 0x0257DA80U, 0x027F6780U, 0x02A84600U, 0x02CFD300U, 0x02F8B180U, 0x03219000U, 0x03491D00U, 0x0371FB80U, 0x03998880U}}, // NOLINT(whitespace/line_length)
+ /* 1972 Year */ {0x000007B4U, 0x03C26700U, {0x03C26700U, 0x03EB4580U, 0x04118100U, 0x043A5F80U, 0x0461EC80U, 0x048ACB00U, 0x04B25800U, 0x04DB3680U, 0x05041500U, 0x052BA200U, 0x05548080U, 0x057C0D80U}}, // NOLINT(whitespace/line_length)
+ /* 1973 Year */ {0x000007B5U, 0x05A4EC00U, {0x05A4EC00U, 0x05CDCA80U, 0x05F2B480U, 0x061B9300U, 0x06432000U, 0x066BFE80U, 0x06938B80U, 0x06BC6A00U, 0x06E54880U, 0x070CD580U, 0x0735B400U, 0x075D4100U}}, // NOLINT(whitespace/line_length)
+ /* 1974 Year */ {0x000007B6U, 0x07861F80U, {0x07861F80U, 0x07AEFE00U, 0x07D3E800U, 0x07FCC680U, 0x08245380U, 0x084D3200U, 0x0874BF00U, 0x089D9D80U, 0x08C67C00U, 0x08EE0900U, 0x0916E780U, 0x093E7480U}}, // NOLINT(whitespace/line_length)
+ /* 1975 Year */ {0x000007B7U, 0x09675300U, {0x09675300U, 0x09903180U, 0x09B51B80U, 0x09DDFA00U, 0x0A058700U, 0x0A2E6580U, 0x0A55F280U, 0x0A7ED100U, 0x0AA7AF80U, 0x0ACF3C80U, 0x0AF81B00U, 0x0B1FA800U}}, // NOLINT(whitespace/line_length)
+ /* 1976 Year */ {0x000007B8U, 0x0B488680U, {0x0B488680U, 0x0B716500U, 0x0B97A080U, 0x0BC07F00U, 0x0BE80C00U, 0x0C10EA80U, 0x0C387780U, 0x0C615600U, 0x0C8A3480U, 0x0CB1C180U, 0x0CDAA000U, 0x0D022D00U}}, // NOLINT(whitespace/line_length)
+ /* 1977 Year */ {0x000007B9U, 0x0D2B0B80U, {0x0D2B0B80U, 0x0D53EA00U, 0x0D78D400U, 0x0DA1B280U, 0x0DC93F80U, 0x0DF21E00U, 0x0E19AB00U, 0x0E428980U, 0x0E6B6800U, 0x0E92F500U, 0x0EBBD380U, 0x0EE36080U}}, // NOLINT(whitespace/line_length)
+ /* 1978 Year */ {0x000007BAU, 0x0F0C3F00U, {0x0F0C3F00U, 0x0F351D80U, 0x0F5A0780U, 0x0F82E600U, 0x0FAA7300U, 0x0FD35180U, 0x0FFADE80U, 0x1023BD00U, 0x104C9B80U, 0x10742880U, 0x109D0700U, 0x10C49400U}}, // NOLINT(whitespace/line_length)
+ /* 1979 Year */ {0x000007BBU, 0x10ED7280U, {0x10ED7280U, 0x11165100U, 0x113B3B00U, 0x11641980U, 0x118BA680U, 0x11B48500U, 0x11DC1200U, 0x1204F080U, 0x122DCF00U, 0x12555C00U, 0x127E3A80U, 0x12A5C780U}}, // NOLINT(whitespace/line_length)
+ /* 1980 Year */ {0x000007BCU, 0x12CEA600U, {0x12CEA600U, 0x12F78480U, 0x131DC000U, 0x13469E80U, 0x136E2B80U, 0x13970A00U, 0x13BE9700U, 0x13E77580U, 0x14105400U, 0x1437E100U, 0x1460BF80U, 0x14884C80U}}, // NOLINT(whitespace/line_length)
+ /* 1981 Year */ {0x000007BDU, 0x14B12B00U, {0x14B12B00U, 0x14DA0980U, 0x14FEF380U, 0x1527D200U, 0x154F5F00U, 0x15783D80U, 0x159FCA80U, 0x15C8A900U, 0x15F18780U, 0x16191480U, 0x1641F300U, 0x16698000U}}, // NOLINT(whitespace/line_length)
+ /* 1982 Year */ {0x000007BEU, 0x16925E80U, {0x16925E80U, 0x16BB3D00U, 0x16E02700U, 0x17090580U, 0x17309280U, 0x17597100U, 0x1780FE00U, 0x17A9DC80U, 0x17D2BB00U, 0x17FA4800U, 0x18232680U, 0x184AB380U}}, // NOLINT(whitespace/line_length)
+ /* 1983 Year */ {0x000007BFU, 0x18739200U, {0x18739200U, 0x189C7080U, 0x18C15A80U, 0x18EA3900U, 0x1911C600U, 0x193AA480U, 0x19623180U, 0x198B1000U, 0x19B3EE80U, 0x19DB7B80U, 0x1A045A00U, 0x1A2BE700U}}, // NOLINT(whitespace/line_length)
+ /* 1984 Year */ {0x000007C0U, 0x1A54C580U, {0x1A54C580U, 0x1A7DA400U, 0x1AA3DF80U, 0x1ACCBE00U, 0x1AF44B00U, 0x1B1D2980U, 0x1B44B680U, 0x1B6D9500U, 0x1B967380U, 0x1BBE0080U, 0x1BE6DF00U, 0x1C0E6C00U}}, // NOLINT(whitespace/line_length)
+ /* 1985 Year */ {0x000007C1U, 0x1C374A80U, {0x1C374A80U, 0x1C602900U, 0x1C851300U, 0x1CADF180U, 0x1CD57E80U, 0x1CFE5D00U, 0x1D25EA00U, 0x1D4EC880U, 0x1D77A700U, 0x1D9F3400U, 0x1DC81280U, 0x1DEF9F80U}}, // NOLINT(whitespace/line_length)
+ /* 1986 Year */ {0x000007C2U, 0x1E187E00U, {0x1E187E00U, 0x1E415C80U, 0x1E664680U, 0x1E8F2500U, 0x1EB6B200U, 0x1EDF9080U, 0x1F071D80U, 0x1F2FFC00U, 0x1F58DA80U, 0x1F806780U, 0x1FA94600U, 0x1FD0D300U}}, // NOLINT(whitespace/line_length)
+ /* 1987 Year */ {0x000007C3U, 0x1FF9B180U, {0x1FF9B180U, 0x20229000U, 0x20477A00U, 0x20705880U, 0x2097E580U, 0x20C0C400U, 0x20E85100U, 0x21112F80U, 0x213A0E00U, 0x21619B00U, 0x218A7980U, 0x21B20680U}}, // NOLINT(whitespace/line_length)
+ /* 1988 Year */ {0x000007C4U, 0x21DAE500U, {0x21DAE500U, 0x2203C380U, 0x2229FF00U, 0x2252DD80U, 0x227A6A80U, 0x22A34900U, 0x22CAD600U, 0x22F3B480U, 0x231C9300U, 0x23442000U, 0x236CFE80U, 0x23948B80U}}, // NOLINT(whitespace/line_length)
+ /* 1989 Year */ {0x000007C5U, 0x23BD6A00U, {0x23BD6A00U, 0x23E64880U, 0x240B3280U, 0x24341100U, 0x245B9E00U, 0x24847C80U, 0x24AC0980U, 0x24D4E800U, 0x24FDC680U, 0x25255380U, 0x254E3200U, 0x2575BF00U}}, // NOLINT(whitespace/line_length)
+ /* 1990 Year */ {0x000007C6U, 0x259E9D80U, {0x259E9D80U, 0x25C77C00U, 0x25EC6600U, 0x26154480U, 0x263CD180U, 0x2665B000U, 0x268D3D00U, 0x26B61B80U, 0x26DEFA00U, 0x27068700U, 0x272F6580U, 0x2756F280U}}, // NOLINT(whitespace/line_length)
+ /* 1991 Year */ {0x000007C7U, 0x277FD100U, {0x277FD100U, 0x27A8AF80U, 0x27CD9980U, 0x27F67800U, 0x281E0500U, 0x2846E380U, 0x286E7080U, 0x28974F00U, 0x28C02D80U, 0x28E7BA80U, 0x29109900U, 0x29382600U}}, // NOLINT(whitespace/line_length)
+ /* 1992 Year */ {0x000007C8U, 0x29610480U, {0x29610480U, 0x2989E300U, 0x29B01E80U, 0x29D8FD00U, 0x2A008A00U, 0x2A296880U, 0x2A50F580U, 0x2A79D400U, 0x2AA2B280U, 0x2ACA3F80U, 0x2AF31E00U, 0x2B1AAB00U}}, // NOLINT(whitespace/line_length)
+ /* 1993 Year */ {0x000007C9U, 0x2B438980U, {0x2B438980U, 0x2B6C6800U, 0x2B915200U, 0x2BBA3080U, 0x2BE1BD80U, 0x2C0A9C00U, 0x2C322900U, 0x2C5B0780U, 0x2C83E600U, 0x2CAB7300U, 0x2CD45180U, 0x2CFBDE80U}}, // NOLINT(whitespace/line_length)
+ /* 1994 Year */ {0x000007CAU, 0x2D24BD00U, {0x2D24BD00U, 0x2D4D9B80U, 0x2D728580U, 0x2D9B6400U, 0x2DC2F100U, 0x2DEBCF80U, 0x2E135C80U, 0x2E3C3B00U, 0x2E651980U, 0x2E8CA680U, 0x2EB58500U, 0x2EDD1200U}}, // NOLINT(whitespace/line_length)
+ /* 1995 Year */ {0x000007CBU, 0x2F05F080U, {0x2F05F080U, 0x2F2ECF00U, 0x2F53B900U, 0x2F7C9780U, 0x2FA42480U, 0x2FCD0300U, 0x2FF49000U, 0x301D6E80U, 0x30464D00U, 0x306DDA00U, 0x3096B880U, 0x30BE4580U}}, // NOLINT(whitespace/line_length)
+ /* 1996 Year */ {0x000007CCU, 0x30E72400U, {0x30E72400U, 0x31100280U, 0x31363E00U, 0x315F1C80U, 0x3186A980U, 0x31AF8800U, 0x31D71500U, 0x31FFF380U, 0x3228D200U, 0x32505F00U, 0x32793D80U, 0x32A0CA80U}}, // NOLINT(whitespace/line_length)
+ /* 1997 Year */ {0x000007CDU, 0x32C9A900U, {0x32C9A900U, 0x32F28780U, 0x33177180U, 0x33405000U, 0x3367DD00U, 0x3390BB80U, 0x33B84880U, 0x33E12700U, 0x340A0580U, 0x34319280U, 0x345A7100U, 0x3481FE00U}}, // NOLINT(whitespace/line_length)
+ /* 1998 Year */ {0x000007CEU, 0x34AADC80U, {0x34AADC80U, 0x34D3BB00U, 0x34F8A500U, 0x35218380U, 0x35491080U, 0x3571EF00U, 0x35997C00U, 0x35C25A80U, 0x35EB3900U, 0x3612C600U, 0x363BA480U, 0x36633180U}}, // NOLINT(whitespace/line_length)
+ /* 1999 Year */ {0x000007CFU, 0x368C1000U, {0x368C1000U, 0x36B4EE80U, 0x36D9D880U, 0x3702B700U, 0x372A4400U, 0x37532280U, 0x377AAF80U, 0x37A38E00U, 0x37CC6C80U, 0x37F3F980U, 0x381CD800U, 0x38446500U}}, // NOLINT(whitespace/line_length)
+ /* 2000 Year */ {0x000007D0U, 0x386D4380U, {0x386D4380U, 0x38962200U, 0x38BC5D80U, 0x38E53C00U, 0x390CC900U, 0x3935A780U, 0x395D3480U, 0x39861300U, 0x39AEF180U, 0x39D67E80U, 0x39FF5D00U, 0x3A26EA00U}}, // NOLINT(whitespace/line_length)
+ /* 2001 Year */ {0x000007D1U, 0x3A4FC880U, {0x3A4FC880U, 0x3A78A700U, 0x3A9D9100U, 0x3AC66F80U, 0x3AEDFC80U, 0x3B16DB00U, 0x3B3E6800U, 0x3B674680U, 0x3B902500U, 0x3BB7B200U, 0x3BE09080U, 0x3C081D80U}}, // NOLINT(whitespace/line_length)
+ /* 2002 Year */ {0x000007D2U, 0x3C30FC00U, {0x3C30FC00U, 0x3C59DA80U, 0x3C7EC480U, 0x3CA7A300U, 0x3CCF3000U, 0x3CF80E80U, 0x3D1F9B80U, 0x3D487A00U, 0x3D715880U, 0x3D98E580U, 0x3DC1C400U, 0x3DE95100U}}, // NOLINT(whitespace/line_length)
+ /* 2003 Year */ {0x000007D3U, 0x3E122F80U, {0x3E122F80U, 0x3E3B0E00U, 0x3E5FF800U, 0x3E88D680U, 0x3EB06380U, 0x3ED94200U, 0x3F00CF00U, 0x3F29AD80U, 0x3F528C00U, 0x3F7A1900U, 0x3FA2F780U, 0x3FCA8480U}}, // NOLINT(whitespace/line_length)
+ /* 2004 Year */ {0x000007D4U, 0x3FF36300U, {0x3FF36300U, 0x401C4180U, 0x40427D00U, 0x406B5B80U, 0x4092E880U, 0x40BBC700U, 0x40E35400U, 0x410C3280U, 0x41351100U, 0x415C9E00U, 0x41857C80U, 0x41AD0980U}}, // NOLINT(whitespace/line_length)
+ /* 2005 Year */ {0x000007D5U, 0x41D5E800U, {0x41D5E800U, 0x41FEC680U, 0x4223B080U, 0x424C8F00U, 0x42741C00U, 0x429CFA80U, 0x42C48780U, 0x42ED6600U, 0x43164480U, 0x433DD180U, 0x4366B000U, 0x438E3D00U}}, // NOLINT(whitespace/line_length)
+ /* 2006 Year */ {0x000007D6U, 0x43B71B80U, {0x43B71B80U, 0x43DFFA00U, 0x4404E400U, 0x442DC280U, 0x44554F80U, 0x447E2E00U, 0x44A5BB00U, 0x44CE9980U, 0x44F77800U, 0x451F0500U, 0x4547E380U, 0x456F7080U}}, // NOLINT(whitespace/line_length)
+ /* 2007 Year */ {0x000007D7U, 0x45984F00U, {0x45984F00U, 0x45C12D80U, 0x45E61780U, 0x460EF600U, 0x46368300U, 0x465F6180U, 0x4686EE80U, 0x46AFCD00U, 0x46D8AB80U, 0x47003880U, 0x47291700U, 0x4750A400U}}, // NOLINT(whitespace/line_length)
+ /* 2008 Year */ {0x000007D8U, 0x47798280U, {0x47798280U, 0x47A26100U, 0x47C89C80U, 0x47F17B00U, 0x48190800U, 0x4841E680U, 0x48697380U, 0x48925200U, 0x48BB3080U, 0x48E2BD80U, 0x490B9C00U, 0x49332900U}}, // NOLINT(whitespace/line_length)
+ /* 2009 Year */ {0x000007D9U, 0x495C0780U, {0x495C0780U, 0x4984E600U, 0x49A9D000U, 0x49D2AE80U, 0x49FA3B80U, 0x4A231A00U, 0x4A4AA700U, 0x4A738580U, 0x4A9C6400U, 0x4AC3F100U, 0x4AECCF80U, 0x4B145C80U}}, // NOLINT(whitespace/line_length)
+ /* 2010 Year */ {0x000007DAU, 0x4B3D3B00U, {0x4B3D3B00U, 0x4B661980U, 0x4B8B0380U, 0x4BB3E200U, 0x4BDB6F00U, 0x4C044D80U, 0x4C2BDA80U, 0x4C54B900U, 0x4C7D9780U, 0x4CA52480U, 0x4CCE0300U, 0x4CF59000U}}, // NOLINT(whitespace/line_length)
+ /* 2011 Year */ {0x000007DBU, 0x4D1E6E80U, {0x4D1E6E80U, 0x4D474D00U, 0x4D6C3700U, 0x4D951580U, 0x4DBCA280U, 0x4DE58100U, 0x4E0D0E00U, 0x4E35EC80U, 0x4E5ECB00U, 0x4E865800U, 0x4EAF3680U, 0x4ED6C380U}}, // NOLINT(whitespace/line_length)
+ /* 2012 Year */ {0x000007DCU, 0x4EFFA200U, {0x4EFFA200U, 0x4F288080U, 0x4F4EBC00U, 0x4F779A80U, 0x4F9F2780U, 0x4FC80600U, 0x4FEF9300U, 0x50187180U, 0x50415000U, 0x5068DD00U, 0x5091BB80U, 0x50B94880U}}, // NOLINT(whitespace/line_length)
+ /* 2013 Year */ {0x000007DDU, 0x50E22700U, {0x50E22700U, 0x510B0580U, 0x512FEF80U, 0x5158CE00U, 0x51805B00U, 0x51A93980U, 0x51D0C680U, 0x51F9A500U, 0x52228380U, 0x524A1080U, 0x5272EF00U, 0x529A7C00U}}, // NOLINT(whitespace/line_length)
+ /* 2014 Year */ {0x000007DEU, 0x52C35A80U, {0x52C35A80U, 0x52EC3900U, 0x53112300U, 0x533A0180U, 0x53618E80U, 0x538A6D00U, 0x53B1FA00U, 0x53DAD880U, 0x5403B700U, 0x542B4400U, 0x54542280U, 0x547BAF80U}}, // NOLINT(whitespace/line_length)
+ /* 2015 Year */ {0x000007DFU, 0x54A48E00U, {0x54A48E00U, 0x54CD6C80U, 0x54F25680U, 0x551B3500U, 0x5542C200U, 0x556BA080U, 0x55932D80U, 0x55BC0C00U, 0x55E4EA80U, 0x560C7780U, 0x56355600U, 0x565CE300U}}, // NOLINT(whitespace/line_length)
+ /* 2016 Year */ {0x000007E0U, 0x5685C180U, {0x5685C180U, 0x56AEA000U, 0x56D4DB80U, 0x56FDBA00U, 0x57254700U, 0x574E2580U, 0x5775B280U, 0x579E9100U, 0x57C76F80U, 0x57EEFC80U, 0x5817DB00U, 0x583F6800U}}, // NOLINT(whitespace/line_length)
+ /* 2017 Year */ {0x000007E1U, 0x58684680U, {0x58684680U, 0x58912500U, 0x58B60F00U, 0x58DEED80U, 0x59067A80U, 0x592F5900U, 0x5956E600U, 0x597FC480U, 0x59A8A300U, 0x59D03000U, 0x59F90E80U, 0x5A209B80U}}, // NOLINT(whitespace/line_length)
+ /* 2018 Year */ {0x000007E2U, 0x5A497A00U, {0x5A497A00U, 0x5A725880U, 0x5A974280U, 0x5AC02100U, 0x5AE7AE00U, 0x5B108C80U, 0x5B381980U, 0x5B60F800U, 0x5B89D680U, 0x5BB16380U, 0x5BDA4200U, 0x5C01CF00U}}, // NOLINT(whitespace/line_length)
+ /* 2019 Year */ {0x000007E3U, 0x5C2AAD80U, {0x5C2AAD80U, 0x5C538C00U, 0x5C787600U, 0x5CA15480U, 0x5CC8E180U, 0x5CF1C000U, 0x5D194D00U, 0x5D422B80U, 0x5D6B0A00U, 0x5D929700U, 0x5DBB7580U, 0x5DE30280U}}, // NOLINT(whitespace/line_length)
+ /* 2020 Year */ {0x000007E4U, 0x5E0BE100U, {0x5E0BE100U, 0x5E34BF80U, 0x5E5AFB00U, 0x5E83D980U, 0x5EAB6680U, 0x5ED44500U, 0x5EFBD200U, 0x5F24B080U, 0x5F4D8F00U, 0x5F751C00U, 0x5F9DFA80U, 0x5FC58780U}}, // NOLINT(whitespace/line_length)
+ /* 2021 Year */ {0x000007E5U, 0x5FEE6600U, {0x5FEE6600U, 0x60174480U, 0x603C2E80U, 0x60650D00U, 0x608C9A00U, 0x60B57880U, 0x60DD0580U, 0x6105E400U, 0x612EC280U, 0x61564F80U, 0x617F2E00U, 0x61A6BB00U}}, // NOLINT(whitespace/line_length)
+ /* 2022 Year */ {0x000007E6U, 0x61CF9980U, {0x61CF9980U, 0x61F87800U, 0x621D6200U, 0x62464080U, 0x626DCD80U, 0x6296AC00U, 0x62BE3900U, 0x62E71780U, 0x630FF600U, 0x63378300U, 0x63606180U, 0x6387EE80U}}, // NOLINT(whitespace/line_length)
+ /* 2023 Year */ {0x000007E7U, 0x63B0CD00U, {0x63B0CD00U, 0x63D9AB80U, 0x63FE9580U, 0x64277400U, 0x644F0100U, 0x6477DF80U, 0x649F6C80U, 0x64C84B00U, 0x64F12980U, 0x6518B680U, 0x65419500U, 0x65692200U}}, // NOLINT(whitespace/line_length)
+ /* 2024 Year */ {0x000007E8U, 0x65920080U, {0x65920080U, 0x65BADF00U, 0x65E11A80U, 0x6609F900U, 0x66318600U, 0x665A6480U, 0x6681F180U, 0x66AAD000U, 0x66D3AE80U, 0x66FB3B80U, 0x67241A00U, 0x674BA700U}}, // NOLINT(whitespace/line_length)
+ /* 2025 Year */ {0x000007E9U, 0x67748580U, {0x67748580U, 0x679D6400U, 0x67C24E00U, 0x67EB2C80U, 0x6812B980U, 0x683B9800U, 0x68632500U, 0x688C0380U, 0x68B4E200U, 0x68DC6F00U, 0x69054D80U, 0x692CDA80U}}, // NOLINT(whitespace/line_length)
+ /* 2026 Year */ {0x000007EAU, 0x6955B900U, {0x6955B900U, 0x697E9780U, 0x69A38180U, 0x69CC6000U, 0x69F3ED00U, 0x6A1CCB80U, 0x6A445880U, 0x6A6D3700U, 0x6A961580U, 0x6ABDA280U, 0x6AE68100U, 0x6B0E0E00U}}, // NOLINT(whitespace/line_length)
+ /* 2027 Year */ {0x000007EBU, 0x6B36EC80U, {0x6B36EC80U, 0x6B5FCB00U, 0x6B84B500U, 0x6BAD9380U, 0x6BD52080U, 0x6BFDFF00U, 0x6C258C00U, 0x6C4E6A80U, 0x6C774900U, 0x6C9ED600U, 0x6CC7B480U, 0x6CEF4180U}}, // NOLINT(whitespace/line_length)
+ /* 2028 Year */ {0x000007ECU, 0x6D182000U, {0x6D182000U, 0x6D40FE80U, 0x6D673A00U, 0x6D901880U, 0x6DB7A580U, 0x6DE08400U, 0x6E081100U, 0x6E30EF80U, 0x6E59CE00U, 0x6E815B00U, 0x6EAA3980U, 0x6ED1C680U}}, // NOLINT(whitespace/line_length)
+ /* 2029 Year */ {0x000007EDU, 0x6EFAA500U, {0x6EFAA500U, 0x6F238380U, 0x6F486D80U, 0x6F714C00U, 0x6F98D900U, 0x6FC1B780U, 0x6FE94480U, 0x70122300U, 0x703B0180U, 0x70628E80U, 0x708B6D00U, 0x70B2FA00U}}, // NOLINT(whitespace/line_length)
+ /* 2030 Year */ {0x000007EEU, 0x70DBD880U, {0x70DBD880U, 0x7104B700U, 0x7129A100U, 0x71527F80U, 0x717A0C80U, 0x71A2EB00U, 0x71CA7800U, 0x71F35680U, 0x721C3500U, 0x7243C200U, 0x726CA080U, 0x72942D80U}}, // NOLINT(whitespace/line_length)
+ /* 2031 Year */ {0x000007EFU, 0x72BD0C00U, {0x72BD0C00U, 0x72E5EA80U, 0x730AD480U, 0x7333B300U, 0x735B4000U, 0x73841E80U, 0x73ABAB80U, 0x73D48A00U, 0x73FD6880U, 0x7424F580U, 0x744DD400U, 0x74756100U}}, // NOLINT(whitespace/line_length)
+ /* 2032 Year */ {0x000007F0U, 0x749E3F80U, {0x749E3F80U, 0x74C71E00U, 0x74ED5980U, 0x75163800U, 0x753DC500U, 0x7566A380U, 0x758E3080U, 0x75B70F00U, 0x75DFED80U, 0x76077A80U, 0x76305900U, 0x7657E600U}}, // NOLINT(whitespace/line_length)
+ /* 2033 Year */ {0x000007F1U, 0x7680C480U, {0x7680C480U, 0x76A9A300U, 0x76CE8D00U, 0x76F76B80U, 0x771EF880U, 0x7747D700U, 0x776F6400U, 0x77984280U, 0x77C12100U, 0x77E8AE00U, 0x78118C80U, 0x78391980U}}, // NOLINT(whitespace/line_length)
+ /* 2034 Year */ {0x000007F2U, 0x7861F800U, {0x7861F800U, 0x788AD680U, 0x78AFC080U, 0x78D89F00U, 0x79002C00U, 0x79290A80U, 0x79509780U, 0x79797600U, 0x79A25480U, 0x79C9E180U, 0x79F2C000U, 0x7A1A4D00U}}, // NOLINT(whitespace/line_length)
+ /* 2035 Year */ {0x000007F3U, 0x7A432B80U, {0x7A432B80U, 0x7A6C0A00U, 0x7A90F400U, 0x7AB9D280U, 0x7AE15F80U, 0x7B0A3E00U, 0x7B31CB00U, 0x7B5AA980U, 0x7B838800U, 0x7BAB1500U, 0x7BD3F380U, 0x7BFB8080U}}, // NOLINT(whitespace/line_length)
+ /* 2036 Year */ {0x000007F4U, 0x7C245F00U, {0x7C245F00U, 0x7C4D3D80U, 0x7C737900U, 0x7C9C5780U, 0x7CC3E480U, 0x7CECC300U, 0x7D145000U, 0x7D3D2E80U, 0x7D660D00U, 0x7D8D9A00U, 0x7DB67880U, 0x7DDE0580U}}, // NOLINT(whitespace/line_length)
+ /* 2037 Year */ {0x000007F5U, 0x7E06E400U, {0x7E06E400U, 0x7E2FC280U, 0x7E54AC80U, 0x7E7D8B00U, 0x7EA51800U, 0x7ECDF680U, 0x7EF58380U, 0x7F1E6200U, 0x7F474080U, 0x7F6ECD80U, 0x7F97AC00U, 0x7FBF3900U}}, // NOLINT(whitespace/line_length)
+ /* 2038 Year */ {0x000007F6U, 0x7FE81780U, {0x7FE81780U, 0x8010F600U, 0x8035E000U, 0x805EBE80U, 0x80864B80U, 0x80AF2A00U, 0x80D6B700U, 0x80FF9580U, 0x81287400U, 0x81500100U, 0x8178DF80U, 0x81A06C80U}}, // NOLINT(whitespace/line_length)
+ /* 2039 Year */ {0x000007F7U, 0x81C94B00U, {0x81C94B00U, 0x81F22980U, 0x82171380U, 0x823FF200U, 0x82677F00U, 0x82905D80U, 0x82B7EA80U, 0x82E0C900U, 0x8309A780U, 0x83313480U, 0x835A1300U, 0x8381A000U}}, // NOLINT(whitespace/line_length)
+ /* 2040 Year */ {0x000007F8U, 0x83AA7E80U, {0x83AA7E80U, 0x83D35D00U, 0x83F99880U, 0x84227700U, 0x844A0400U, 0x8472E280U, 0x849A6F80U, 0x84C34E00U, 0x84EC2C80U, 0x8513B980U, 0x853C9800U, 0x85642500U}}, // NOLINT(whitespace/line_length)
+ /* 2041 Year */ {0x000007F9U, 0x858D0380U, {0x858D0380U, 0x85B5E200U, 0x85DACC00U, 0x8603AA80U, 0x862B3780U, 0x86541600U, 0x867BA300U, 0x86A48180U, 0x86CD6000U, 0x86F4ED00U, 0x871DCB80U, 0x87455880U}}, // NOLINT(whitespace/line_length)
+ /* 2042 Year */ {0x000007FAU, 0x876E3700U, {0x876E3700U, 0x87971580U, 0x87BBFF80U, 0x87E4DE00U, 0x880C6B00U, 0x88354980U, 0x885CD680U, 0x8885B500U, 0x88AE9380U, 0x88D62080U, 0x88FEFF00U, 0x89268C00U}}, // NOLINT(whitespace/line_length)
+ /* 2043 Year */ {0x000007FBU, 0x894F6A80U, {0x894F6A80U, 0x89784900U, 0x899D3300U, 0x89C61180U, 0x89ED9E80U, 0x8A167D00U, 0x8A3E0A00U, 0x8A66E880U, 0x8A8FC700U, 0x8AB75400U, 0x8AE03280U, 0x8B07BF80U}}, // NOLINT(whitespace/line_length)
+ /* 2044 Year */ {0x000007FCU, 0x8B309E00U, {0x8B309E00U, 0x8B597C80U, 0x8B7FB800U, 0x8BA89680U, 0x8BD02380U, 0x8BF90200U, 0x8C208F00U, 0x8C496D80U, 0x8C724C00U, 0x8C99D900U, 0x8CC2B780U, 0x8CEA4480U}}, // NOLINT(whitespace/line_length)
+ /* 2045 Year */ {0x000007FDU, 0x8D132300U, {0x8D132300U, 0x8D3C0180U, 0x8D60EB80U, 0x8D89CA00U, 0x8DB15700U, 0x8DDA3580U, 0x8E01C280U, 0x8E2AA100U, 0x8E537F80U, 0x8E7B0C80U, 0x8EA3EB00U, 0x8ECB7800U}}, // NOLINT(whitespace/line_length)
+ /* 2046 Year */ {0x000007FEU, 0x8EF45680U, {0x8EF45680U, 0x8F1D3500U, 0x8F421F00U, 0x8F6AFD80U, 0x8F928A80U, 0x8FBB6900U, 0x8FE2F600U, 0x900BD480U, 0x9034B300U, 0x905C4000U, 0x90851E80U, 0x90ACAB80U}}, // NOLINT(whitespace/line_length)
+ /* 2047 Year */ {0x000007FFU, 0x90D58A00U, {0x90D58A00U, 0x90FE6880U, 0x91235280U, 0x914C3100U, 0x9173BE00U, 0x919C9C80U, 0x91C42980U, 0x91ED0800U, 0x9215E680U, 0x923D7380U, 0x92665200U, 0x928DDF00U}}, // NOLINT(whitespace/line_length)
+ /* 2048 Year */ {0x00000800U, 0x92B6BD80U, {0x92B6BD80U, 0x92DF9C00U, 0x9305D780U, 0x932EB600U, 0x93564300U, 0x937F2180U, 0x93A6AE80U, 0x93CF8D00U, 0x93F86B80U, 0x941FF880U, 0x9448D700U, 0x94706400U}}, // NOLINT(whitespace/line_length)
+ /* 2049 Year */ {0x00000801U, 0x94994280U, {0x94994280U, 0x94C22100U, 0x94E70B00U, 0x950FE980U, 0x95377680U, 0x95605500U, 0x9587E200U, 0x95B0C080U, 0x95D99F00U, 0x96012C00U, 0x962A0A80U, 0x96519780U}}, // NOLINT(whitespace/line_length)
+ /* 2050 Year */ {0x00000802U, 0x967A7600U, {0x967A7600U, 0x96A35480U, 0x96C83E80U, 0x96F11D00U, 0x9718AA00U, 0x97418880U, 0x97691580U, 0x9791F400U, 0x97BAD280U, 0x97E25F80U, 0x980B3E00U, 0x9832CB00U}}, // NOLINT(whitespace/line_length)
+ /* 2051 Year */ {0x00000803U, 0x985BA980U, {0x985BA980U, 0x98848800U, 0x98A97200U, 0x98D25080U, 0x98F9DD80U, 0x9922BC00U, 0x994A4900U, 0x99732780U, 0x999C0600U, 0x99C39300U, 0x99EC7180U, 0x9A13FE80U}}, // NOLINT(whitespace/line_length)
+ /* 2052 Year */ {0x00000804U, 0x9A3CDD00U, {0x9A3CDD00U, 0x9A65BB80U, 0x9A8BF700U, 0x9AB4D580U, 0x9ADC6280U, 0x9B054100U, 0x9B2CCE00U, 0x9B55AC80U, 0x9B7E8B00U, 0x9BA61800U, 0x9BCEF680U, 0x9BF68380U}}, // NOLINT(whitespace/line_length)
+ /* 2053 Year */ {0x00000805U, 0x9C1F6200U, {0x9C1F6200U, 0x9C484080U, 0x9C6D2A80U, 0x9C960900U, 0x9CBD9600U, 0x9CE67480U, 0x9D0E0180U, 0x9D36E000U, 0x9D5FBE80U, 0x9D874B80U, 0x9DB02A00U, 0x9DD7B700U}}, // NOLINT(whitespace/line_length)
+ /* 2054 Year */ {0x00000806U, 0x9E009580U, {0x9E009580U, 0x9E297400U, 0x9E4E5E00U, 0x9E773C80U, 0x9E9EC980U, 0x9EC7A800U, 0x9EEF3500U, 0x9F181380U, 0x9F40F200U, 0x9F687F00U, 0x9F915D80U, 0x9FB8EA80U}}, // NOLINT(whitespace/line_length)
+ /* 2055 Year */ {0x00000807U, 0x9FE1C900U, {0x9FE1C900U, 0xA00AA780U, 0xA02F9180U, 0xA0587000U, 0xA07FFD00U, 0xA0A8DB80U, 0xA0D06880U, 0xA0F94700U, 0xA1222580U, 0xA149B280U, 0xA1729100U, 0xA19A1E00U}}, // NOLINT(whitespace/line_length)
+ /* 2056 Year */ {0x00000808U, 0xA1C2FC80U, {0xA1C2FC80U, 0xA1EBDB00U, 0xA2121680U, 0xA23AF500U, 0xA2628200U, 0xA28B6080U, 0xA2B2ED80U, 0xA2DBCC00U, 0xA304AA80U, 0xA32C3780U, 0xA3551600U, 0xA37CA300U}}, // NOLINT(whitespace/line_length)
+ /* 2057 Year */ {0x00000809U, 0xA3A58180U, {0xA3A58180U, 0xA3CE6000U, 0xA3F34A00U, 0xA41C2880U, 0xA443B580U, 0xA46C9400U, 0xA4942100U, 0xA4BCFF80U, 0xA4E5DE00U, 0xA50D6B00U, 0xA5364980U, 0xA55DD680U}}, // NOLINT(whitespace/line_length)
+ /* 2058 Year */ {0x0000080AU, 0xA586B500U, {0xA586B500U, 0xA5AF9380U, 0xA5D47D80U, 0xA5FD5C00U, 0xA624E900U, 0xA64DC780U, 0xA6755480U, 0xA69E3300U, 0xA6C71180U, 0xA6EE9E80U, 0xA7177D00U, 0xA73F0A00U}}, // NOLINT(whitespace/line_length)
+ /* 2059 Year */ {0x0000080BU, 0xA767E880U, {0xA767E880U, 0xA790C700U, 0xA7B5B100U, 0xA7DE8F80U, 0xA8061C80U, 0xA82EFB00U, 0xA8568800U, 0xA87F6680U, 0xA8A84500U, 0xA8CFD200U, 0xA8F8B080U, 0xA9203D80U}}, // NOLINT(whitespace/line_length)
+ /* 2060 Year */ {0x0000080CU, 0xA9491C00U, {0xA9491C00U, 0xA971FA80U, 0xA9983600U, 0xA9C11480U, 0xA9E8A180U, 0xAA118000U, 0xAA390D00U, 0xAA61EB80U, 0xAA8ACA00U, 0xAAB25700U, 0xAADB3580U, 0xAB02C280U}}, // NOLINT(whitespace/line_length)
+ /* 2061 Year */ {0x0000080DU, 0xAB2BA100U, {0xAB2BA100U, 0xAB547F80U, 0xAB796980U, 0xABA24800U, 0xABC9D500U, 0xABF2B380U, 0xAC1A4080U, 0xAC431F00U, 0xAC6BFD80U, 0xAC938A80U, 0xACBC6900U, 0xACE3F600U}}, // NOLINT(whitespace/line_length)
+ /* 2062 Year */ {0x0000080EU, 0xAD0CD480U, {0xAD0CD480U, 0xAD35B300U, 0xAD5A9D00U, 0xAD837B80U, 0xADAB0880U, 0xADD3E700U, 0xADFB7400U, 0xAE245280U, 0xAE4D3100U, 0xAE74BE00U, 0xAE9D9C80U, 0xAEC52980U}}, // NOLINT(whitespace/line_length)
+ /* 2063 Year */ {0x0000080FU, 0xAEEE0800U, {0xAEEE0800U, 0xAF16E680U, 0xAF3BD080U, 0xAF64AF00U, 0xAF8C3C00U, 0xAFB51A80U, 0xAFDCA780U, 0xB0058600U, 0xB02E6480U, 0xB055F180U, 0xB07ED000U, 0xB0A65D00U}}, // NOLINT(whitespace/line_length)
+ /* 2064 Year */ {0x00000810U, 0xB0CF3B80U, {0xB0CF3B80U, 0xB0F81A00U, 0xB11E5580U, 0xB1473400U, 0xB16EC100U, 0xB1979F80U, 0xB1BF2C80U, 0xB1E80B00U, 0xB210E980U, 0xB2387680U, 0xB2615500U, 0xB288E200U}}, // NOLINT(whitespace/line_length)
+ /* 2065 Year */ {0x00000811U, 0xB2B1C080U, {0xB2B1C080U, 0xB2DA9F00U, 0xB2FF8900U, 0xB3286780U, 0xB34FF480U, 0xB378D300U, 0xB3A06000U, 0xB3C93E80U, 0xB3F21D00U, 0xB419AA00U, 0xB4428880U, 0xB46A1580U}}, // NOLINT(whitespace/line_length)
+ /* 2066 Year */ {0x00000812U, 0xB492F400U, {0xB492F400U, 0xB4BBD280U, 0xB4E0BC80U, 0xB5099B00U, 0xB5312800U, 0xB55A0680U, 0xB5819380U, 0xB5AA7200U, 0xB5D35080U, 0xB5FADD80U, 0xB623BC00U, 0xB64B4900U}}, // NOLINT(whitespace/line_length)
+ /* 2067 Year */ {0x00000813U, 0xB6742780U, {0xB6742780U, 0xB69D0600U, 0xB6C1F000U, 0xB6EACE80U, 0xB7125B80U, 0xB73B3A00U, 0xB762C700U, 0xB78BA580U, 0xB7B48400U, 0xB7DC1100U, 0xB804EF80U, 0xB82C7C80U}}, // NOLINT(whitespace/line_length)
+ /* 2068 Year */ {0x00000814U, 0xB8555B00U, {0xB8555B00U, 0xB87E3980U, 0xB8A47500U, 0xB8CD5380U, 0xB8F4E080U, 0xB91DBF00U, 0xB9454C00U, 0xB96E2A80U, 0xB9970900U, 0xB9BE9600U, 0xB9E77480U, 0xBA0F0180U}}, // NOLINT(whitespace/line_length)
+ /* 2069 Year */ {0x00000815U, 0xBA37E000U, {0xBA37E000U, 0xBA60BE80U, 0xBA85A880U, 0xBAAE8700U, 0xBAD61400U, 0xBAFEF280U, 0xBB267F80U, 0xBB4F5E00U, 0xBB783C80U, 0xBB9FC980U, 0xBBC8A800U, 0xBBF03500U}}, // NOLINT(whitespace/line_length)
+ /* 2070 Year */ {0x00000816U, 0xBC191380U, {0xBC191380U, 0xBC41F200U, 0xBC66DC00U, 0xBC8FBA80U, 0xBCB74780U, 0xBCE02600U, 0xBD07B300U, 0xBD309180U, 0xBD597000U, 0xBD80FD00U, 0xBDA9DB80U, 0xBDD16880U}}, // NOLINT(whitespace/line_length)
+ /* 2071 Year */ {0x00000817U, 0xBDFA4700U, {0xBDFA4700U, 0xBE232580U, 0xBE480F80U, 0xBE70EE00U, 0xBE987B00U, 0xBEC15980U, 0xBEE8E680U, 0xBF11C500U, 0xBF3AA380U, 0xBF623080U, 0xBF8B0F00U, 0xBFB29C00U}}, // NOLINT(whitespace/line_length)
+ /* 2072 Year */ {0x00000818U, 0xBFDB7A80U, {0xBFDB7A80U, 0xC0045900U, 0xC02A9480U, 0xC0537300U, 0xC07B0000U, 0xC0A3DE80U, 0xC0CB6B80U, 0xC0F44A00U, 0xC11D2880U, 0xC144B580U, 0xC16D9400U, 0xC1952100U}}, // NOLINT(whitespace/line_length)
+ /* 2073 Year */ {0x00000819U, 0xC1BDFF80U, {0xC1BDFF80U, 0xC1E6DE00U, 0xC20BC800U, 0xC234A680U, 0xC25C3380U, 0xC2851200U, 0xC2AC9F00U, 0xC2D57D80U, 0xC2FE5C00U, 0xC325E900U, 0xC34EC780U, 0xC3765480U}}, // NOLINT(whitespace/line_length)
+ /* 2074 Year */ {0x0000081AU, 0xC39F3300U, {0xC39F3300U, 0xC3C81180U, 0xC3ECFB80U, 0xC415DA00U, 0xC43D6700U, 0xC4664580U, 0xC48DD280U, 0xC4B6B100U, 0xC4DF8F80U, 0xC5071C80U, 0xC52FFB00U, 0xC5578800U}}, // NOLINT(whitespace/line_length)
+ /* 2075 Year */ {0x0000081BU, 0xC5806680U, {0xC5806680U, 0xC5A94500U, 0xC5CE2F00U, 0xC5F70D80U, 0xC61E9A80U, 0xC6477900U, 0xC66F0600U, 0xC697E480U, 0xC6C0C300U, 0xC6E85000U, 0xC7112E80U, 0xC738BB80U}}, // NOLINT(whitespace/line_length)
+ /* 2076 Year */ {0x0000081CU, 0xC7619A00U, {0xC7619A00U, 0xC78A7880U, 0xC7B0B400U, 0xC7D99280U, 0xC8011F80U, 0xC829FE00U, 0xC8518B00U, 0xC87A6980U, 0xC8A34800U, 0xC8CAD500U, 0xC8F3B380U, 0xC91B4080U}}, // NOLINT(whitespace/line_length)
+ /* 2077 Year */ {0x0000081DU, 0xC9441F00U, {0xC9441F00U, 0xC96CFD80U, 0xC991E780U, 0xC9BAC600U, 0xC9E25300U, 0xCA0B3180U, 0xCA32BE80U, 0xCA5B9D00U, 0xCA847B80U, 0xCAAC0880U, 0xCAD4E700U, 0xCAFC7400U}}, // NOLINT(whitespace/line_length)
+ /* 2078 Year */ {0x0000081EU, 0xCB255280U, {0xCB255280U, 0xCB4E3100U, 0xCB731B00U, 0xCB9BF980U, 0xCBC38680U, 0xCBEC6500U, 0xCC13F200U, 0xCC3CD080U, 0xCC65AF00U, 0xCC8D3C00U, 0xCCB61A80U, 0xCCDDA780U}}, // NOLINT(whitespace/line_length)
+ /* 2079 Year */ {0x0000081FU, 0xCD068600U, {0xCD068600U, 0xCD2F6480U, 0xCD544E80U, 0xCD7D2D00U, 0xCDA4BA00U, 0xCDCD9880U, 0xCDF52580U, 0xCE1E0400U, 0xCE46E280U, 0xCE6E6F80U, 0xCE974E00U, 0xCEBEDB00U}}, // NOLINT(whitespace/line_length)
+ /* 2080 Year */ {0x00000820U, 0xCEE7B980U, {0xCEE7B980U, 0xCF109800U, 0xCF36D380U, 0xCF5FB200U, 0xCF873F00U, 0xCFB01D80U, 0xCFD7AA80U, 0xD0008900U, 0xD0296780U, 0xD050F480U, 0xD079D300U, 0xD0A16000U}}, // NOLINT(whitespace/line_length)
+ /* 2081 Year */ {0x00000821U, 0xD0CA3E80U, {0xD0CA3E80U, 0xD0F31D00U, 0xD1180700U, 0xD140E580U, 0xD1687280U, 0xD1915100U, 0xD1B8DE00U, 0xD1E1BC80U, 0xD20A9B00U, 0xD2322800U, 0xD25B0680U, 0xD2829380U}}, // NOLINT(whitespace/line_length)
+ /* 2082 Year */ {0x00000822U, 0xD2AB7200U, {0xD2AB7200U, 0xD2D45080U, 0xD2F93A80U, 0xD3221900U, 0xD349A600U, 0xD3728480U, 0xD39A1180U, 0xD3C2F000U, 0xD3EBCE80U, 0xD4135B80U, 0xD43C3A00U, 0xD463C700U}}, // NOLINT(whitespace/line_length)
+ /* 2083 Year */ {0x00000823U, 0xD48CA580U, {0xD48CA580U, 0xD4B58400U, 0xD4DA6E00U, 0xD5034C80U, 0xD52AD980U, 0xD553B800U, 0xD57B4500U, 0xD5A42380U, 0xD5CD0200U, 0xD5F48F00U, 0xD61D6D80U, 0xD644FA80U}}, // NOLINT(whitespace/line_length)
+ /* 2084 Year */ {0x00000824U, 0xD66DD900U, {0xD66DD900U, 0xD696B780U, 0xD6BCF300U, 0xD6E5D180U, 0xD70D5E80U, 0xD7363D00U, 0xD75DCA00U, 0xD786A880U, 0xD7AF8700U, 0xD7D71400U, 0xD7FFF280U, 0xD8277F80U}}, // NOLINT(whitespace/line_length)
+ /* 2085 Year */ {0x00000825U, 0xD8505E00U, {0xD8505E00U, 0xD8793C80U, 0xD89E2680U, 0xD8C70500U, 0xD8EE9200U, 0xD9177080U, 0xD93EFD80U, 0xD967DC00U, 0xD990BA80U, 0xD9B84780U, 0xD9E12600U, 0xDA08B300U}}, // NOLINT(whitespace/line_length)
+ /* 2086 Year */ {0x00000826U, 0xDA319180U, {0xDA319180U, 0xDA5A7000U, 0xDA7F5A00U, 0xDAA83880U, 0xDACFC580U, 0xDAF8A400U, 0xDB203100U, 0xDB490F80U, 0xDB71EE00U, 0xDB997B00U, 0xDBC25980U, 0xDBE9E680U}}, // NOLINT(whitespace/line_length)
+ /* 2087 Year */ {0x00000827U, 0xDC12C500U, {0xDC12C500U, 0xDC3BA380U, 0xDC608D80U, 0xDC896C00U, 0xDCB0F900U, 0xDCD9D780U, 0xDD016480U, 0xDD2A4300U, 0xDD532180U, 0xDD7AAE80U, 0xDDA38D00U, 0xDDCB1A00U}}, // NOLINT(whitespace/line_length)
+ /* 2088 Year */ {0x00000828U, 0xDDF3F880U, {0xDDF3F880U, 0xDE1CD700U, 0xDE431280U, 0xDE6BF100U, 0xDE937E00U, 0xDEBC5C80U, 0xDEE3E980U, 0xDF0CC800U, 0xDF35A680U, 0xDF5D3380U, 0xDF861200U, 0xDFAD9F00U}}, // NOLINT(whitespace/line_length)
+ /* 2089 Year */ {0x00000829U, 0xDFD67D80U, {0xDFD67D80U, 0xDFFF5C00U, 0xE0244600U, 0xE04D2480U, 0xE074B180U, 0xE09D9000U, 0xE0C51D00U, 0xE0EDFB80U, 0xE116DA00U, 0xE13E6700U, 0xE1674580U, 0xE18ED280U}}, // NOLINT(whitespace/line_length)
+ /* 2090 Year */ {0x0000082AU, 0xE1B7B100U, {0xE1B7B100U, 0xE1E08F80U, 0xE2057980U, 0xE22E5800U, 0xE255E500U, 0xE27EC380U, 0xE2A65080U, 0xE2CF2F00U, 0xE2F80D80U, 0xE31F9A80U, 0xE3487900U, 0xE3700600U}}, // NOLINT(whitespace/line_length)
+ /* 2091 Year */ {0x0000082BU, 0xE398E480U, {0xE398E480U, 0xE3C1C300U, 0xE3E6AD00U, 0xE40F8B80U, 0xE4371880U, 0xE45FF700U, 0xE4878400U, 0xE4B06280U, 0xE4D94100U, 0xE500CE00U, 0xE529AC80U, 0xE5513980U}}, // NOLINT(whitespace/line_length)
+ /* 2092 Year */ {0x0000082CU, 0xE57A1800U, {0xE57A1800U, 0xE5A2F680U, 0xE5C93200U, 0xE5F21080U, 0xE6199D80U, 0xE6427C00U, 0xE66A0900U, 0xE692E780U, 0xE6BBC600U, 0xE6E35300U, 0xE70C3180U, 0xE733BE80U}}, // NOLINT(whitespace/line_length)
+ /* 2093 Year */ {0x0000082DU, 0xE75C9D00U, {0xE75C9D00U, 0xE7857B80U, 0xE7AA6580U, 0xE7D34400U, 0xE7FAD100U, 0xE823AF80U, 0xE84B3C80U, 0xE8741B00U, 0xE89CF980U, 0xE8C48680U, 0xE8ED6500U, 0xE914F200U}}, // NOLINT(whitespace/line_length)
+ /* 2094 Year */ {0x0000082EU, 0xE93DD080U, {0xE93DD080U, 0xE966AF00U, 0xE98B9900U, 0xE9B47780U, 0xE9DC0480U, 0xEA04E300U, 0xEA2C7000U, 0xEA554E80U, 0xEA7E2D00U, 0xEAA5BA00U, 0xEACE9880U, 0xEAF62580U}}, // NOLINT(whitespace/line_length)
+ /* 2095 Year */ {0x0000082FU, 0xEB1F0400U, {0xEB1F0400U, 0xEB47E280U, 0xEB6CCC80U, 0xEB95AB00U, 0xEBBD3800U, 0xEBE61680U, 0xEC0DA380U, 0xEC368200U, 0xEC5F6080U, 0xEC86ED80U, 0xECAFCC00U, 0xECD75900U}}, // NOLINT(whitespace/line_length)
+ /* 2096 Year */ {0x00000830U, 0xED003780U, {0xED003780U, 0xED291600U, 0xED4F5180U, 0xED783000U, 0xED9FBD00U, 0xEDC89B80U, 0xEDF02880U, 0xEE190700U, 0xEE41E580U, 0xEE697280U, 0xEE925100U, 0xEEB9DE00U}}, // NOLINT(whitespace/line_length)
+ /* 2097 Year */ {0x00000831U, 0xEEE2BC80U, {0xEEE2BC80U, 0xEF0B9B00U, 0xEF308500U, 0xEF596380U, 0xEF80F080U, 0xEFA9CF00U, 0xEFD15C00U, 0xEFFA3A80U, 0xF0231900U, 0xF04AA600U, 0xF0738480U, 0xF09B1180U}}, // NOLINT(whitespace/line_length)
+ /* 2098 Year */ {0x00000832U, 0xF0C3F000U, {0xF0C3F000U, 0xF0ECCE80U, 0xF111B880U, 0xF13A9700U, 0xF1622400U, 0xF18B0280U, 0xF1B28F80U, 0xF1DB6E00U, 0xF2044C80U, 0xF22BD980U, 0xF254B800U, 0xF27C4500U}}, // NOLINT(whitespace/line_length)
+ /* 2099 Year */ {0x00000833U, 0xF2A52380U, {0xF2A52380U, 0xF2CE0200U, 0xF2F2EC00U, 0xF31BCA80U, 0xF3435780U, 0xF36C3600U, 0xF393C300U, 0xF3BCA180U, 0xF3E58000U, 0xF40D0D00U, 0xF435EB80U, 0xF45D7880U}}, // NOLINT(whitespace/line_length)
+ /* 2100 Year */ {0x00000834U, 0xF4865700U, {0xF4865700U, 0xF4AF3580U, 0xF4D41F80U, 0xF4FCFE00U, 0xF5248B00U, 0xF54D6980U, 0xF574F680U, 0xF59DD500U, 0xF5C6B380U, 0xF5EE4080U, 0xF6171F00U, 0xF63EAC00U}}, // NOLINT(whitespace/line_length)
+ /* 2101 Year */ {0x00000835U, 0xF6678A80U, {0xF6678A80U, 0xF6906900U, 0xF6B55300U, 0xF6DE3180U, 0xF705BE80U, 0xF72E9D00U, 0xF7562A00U, 0xF77F0880U, 0xF7A7E700U, 0xF7CF7400U, 0xF7F85280U, 0xF81FDF80U}}, // NOLINT(whitespace/line_length)
+ /* 2102 Year */ {0x00000836U, 0xF848BE00U, {0xF848BE00U, 0xF8719C80U, 0xF8968680U, 0xF8BF6500U, 0xF8E6F200U, 0xF90FD080U, 0xF9375D80U, 0xF9603C00U, 0xF9891A80U, 0xF9B0A780U, 0xF9D98600U, 0xFA011300U}}, // NOLINT(whitespace/line_length)
+ /* 2103 Year */ {0x00000837U, 0xFA29F180U, {0xFA29F180U, 0xFA52D000U, 0xFA77BA00U, 0xFAA09880U, 0xFAC82580U, 0xFAF10400U, 0xFB189100U, 0xFB416F80U, 0xFB6A4E00U, 0xFB91DB00U, 0xFBBAB980U, 0xFBE24680U}}, // NOLINT(whitespace/line_length)
+ /* 2104 Year */ {0x00000838U, 0xFC0B2500U, {0xFC0B2500U, 0xFC340380U, 0xFC5A3F00U, 0xFC831D80U, 0xFCAAAA80U, 0xFCD38900U, 0xFCFB1600U, 0xFD23F480U, 0xFD4CD300U, 0xFD746000U, 0xFD9D3E80U, 0xFDC4CB80U}}, // NOLINT(whitespace/line_length)
+ /* 2105 Year */ {0x00000839U, 0xFDEDAA00U, {0xFDEDAA00U, 0xFE168880U, 0xFE3B7280U, 0xFE645100U, 0xFE8BDE00U, 0xFEB4BC80U, 0xFEDC4980U, 0xFF052800U, 0xFF2E0680U, 0xFF559380U, 0xFF7E7200U, 0xFFA5FF00U}}, // NOLINT(whitespace/line_length)
+ /* 2106 Year */ {0x0000083AU, 0xFFCEDD80U, {0xFFCEDD80U, 0xFFF7BC00U, 0x001CA600U, 0x00458480U, 0x006D1180U, 0x0095F000U, 0x00BD7D00U, 0x00E65B80U, 0x010F3A00U, 0x0136C700U, 0x015FA580U, 0x01873280U}} // NOLINT(whitespace/line_length)
+ }
+};
+
+/*************************************************************************
+@brief The date is converted at the multiplication second.
+@outline The specified time and date is converted at the multiplication second
+ from epoch time(0:0:0 January 1, 1970. )
+@type Completion return type<BR>
+@param[in] const LPSYSTEMTIME lp_st : Converted time and date
+@param[out] u_int32* uli_sec : Multiplication second from epoch time
+@threshold lp_st != NULL, uli_sec != NULL <BR>
+ 1970 <= lp_st.wYear <= 2105 <BR>
+ 1 <= lp_st.wMonth <= 12 <BR>
+ 1 <= lp_st.wDay <= 31 <BR>
+ 0 <= lp_st.wHour <= 23 <BR>
+ 0 <= lp_st.wMinute <= 59 <BR>
+ 0 <= lp_st.wSecond <= 59 <BR>
+@return RET_API
+@retval RET_NORMAL : Normal end
+@retval RET_ERROR : Abnormal end
+*****************************************************************************/
+RET_API ClockUtilityConvertDateToSecond(const LPSYSTEMTIME lp_st, u_int32* uli_sec) {
+ u_int8 imflg; /* Leap year determination flag 0:Not a leap year 1:Leap year */
+ u_int32 ui_day;
+ int32 century;
+ RET_API ret = RET_NORMAL;
+
+ /* Checking the NULL of Pointer Arguments */
+ if ((lp_st == NULL) || (uli_sec == NULL)) {
+ ret = RET_ERROR;
+ } else {
+ *uli_sec = 0; /* Reset accumulated seconds to 0 */
+
+ /* Parameter check */
+ if (((lp_st->wYear < 1970) || (2105 < lp_st->wYear)) || /* Check Year to Convert */
+ ((lp_st->wMonth < 1) || (12 < lp_st->wMonth))) { /* Check month to convert */
+ ret = RET_ERROR;
+ } else {
+ /* Determine the leap year and select the "Mnumonic For Remembering The Months With Fewer Than 31 Days" table. */
+ imflg = 0; /* Set the default to a non-leap year */
+ if ((lp_st->wYear % 4) == 0) { /* If the year is divisible by 4, */
+ imflg = 1; /* Be a leap year */
+ }
+ if ((lp_st->wYear % 100) == 0) { /* However,If the year is divisible by 100 */
+ imflg = 0; /* Not leap years */
+ }
+ if ((lp_st->wYear % 400) == 0) { /* However,If the year is divisible by 400 */
+ imflg = 1; /* Be a leap year */
+ }
+
+ /* Parameter check again */
+ if (((lp_st->wDay < 1) || (kUsMonth[imflg][lp_st->wMonth - 1] < lp_st->wDay)) || /* Check date to convert */
+ (23 < lp_st->wHour) || /* Check when converting */
+ (59 < lp_st->wMinute) || /* Check the minutes to convert */
+ (59 < lp_st->wSecond) ) { /* Check the seconds to convert */
+ ret = RET_ERROR;
+ } else {
+ /* Converting Hours, Minutes, and Seconds to Seconds */
+ *uli_sec = lp_st->wSecond; /* The specified seconds are stored as is. */
+ *uli_sec += lp_st->wMinute * SEC_PER_MIN; /* Convert specified minutes to seconds and add */
+ *uli_sec += lp_st->wHour * SEC_PER_HOUR; /* Convert specified hour to second and add */
+
+ /* Convert a date to the number of days since January 1, 1970 */ /* Task_31499 */
+ ui_day = 0;
+ ui_day += (lp_st->wYear - 1970) * 365;
+
+ /* Because years divisible by 100 are not counted as leap years,Calculate the number of times */
+ century = lp_st->wYear / 100;
+ /* Add the number of days added for the leap year up to the previous year */
+ /* Shift year to right by 2 bits until last year(Divide by 4) -
+ Exclude years divisible by 100(century) + Shift century right by 2 bits(Divide by 4
+ -> If it is divisible by 4, it is counted as a leap year */
+ ui_day += ((lp_st->wYear - 1) >> 2) - century + (century >> 2) - 477; /* 477 -> Number of leap years up to 1970 */
+ /* Add the number of days up to the previous month of the current year */
+ ui_day += kUsMonth[2][lp_st->wMonth - 1] + ((lp_st->wMonth > 2) ? imflg : 0);
+
+ ui_day += (lp_st->wDay - 1); /* Add the number of elapsed days */
+
+ *uli_sec += (ui_day * SEC_PER_DAY); /* Convert the number of days to seconds and add */
+ }
+ }
+ }
+
+ return ret;
+}
+
+/*************************************************************************
+@brief The multiplication second is converted at the date.
+@outline The specified multiplication second is converted as a multiplication second from epoch time(0:0:0 January 1, 1970.) at time and date.
+@type Completion return type
+@param[in] const u_int32*uli_sec : Converted multiplication second from epoch time
+@param[out] LPSYSTEMTIME lp_st : Time after it converts it of date
+@threshold lp_st != NULL, uli_sec != NULL <BR>
+ uli_sec < 0xFFCEDD80
+@return RET_API
+@retval RET_NORMAL : Normal end
+@retval RET_ERROR : Abnormal end
+*****************************************************************************/
+
+RET_API ClockUtilityConvertSecondToDate(const u_int32* uli_sec, LPSYSTEMTIME lp_st) {
+ u_int32 i; /* Loop control */
+ u_int32 j; /* Loop control */
+ u_int32 uli_sec_wk; /* Total value save */
+ RET_API ret = RET_NORMAL; /* return value */
+ u_int8 complete_cnv = FALSE; /* Conversion completion flag */
+ u_int8 valid_date; /* Date Valid Value Flag */
+
+ /* Checking the NULL of Pointer Arguments */
+ if ((uli_sec == NULL) || (lp_st == NULL)) {
+ ret = RET_ERROR;
+ } else {
+ /* Back up the accumulated seconds to the work. */
+ uli_sec_wk = static_cast<u_int32>(*uli_sec);
+
+ /* Parameter check processing */
+ if (uli_sec_wk >= kUlDayCntTbl.st_tbl[CNV_YEAR_MAX].ulCount) {
+ ret = RET_ERROR;
+ } else {
+ /* Initialize */
+ lp_st->wYear = (WORD)(kUlDayCntTbl.st_tbl[0].ulYear);
+ lp_st->wMonth = (WORD)(1); /* Month Settings */
+ lp_st->wDay = (WORD)(1); /* Day Settings */
+ lp_st->wDayOfWeek = (WORD)(4); /* Setting the day of the week(Note : Corrected in cases other than 1970) */
+ lp_st->wHour = (WORD)(0); /* Time setting */
+ lp_st->wMinute = (WORD)(0); /* Minute setting */
+ lp_st->wSecond = (WORD)(0); /* Set Seconds */
+ lp_st->wMilliseconds = (WORD)(0); /* Set msec. */
+
+ /* Search time accumulated seconds conversion table */
+ for (i = 0; i < CNV_YEAR_MAX; i++) {
+ /* Set the year(Maximum value) */
+ if ((kUlDayCntTbl.st_tbl[i + 1].ulCount > uli_sec_wk) || (i == (CNV_YEAR_MAX - 1))) {
+ lp_st->wYear = (WORD)kUlDayCntTbl.st_tbl[i].ulYear;
+
+ /* Set the month(Maximum value) */
+ j = 0;
+ while ((j < 12) && (complete_cnv == FALSE)) {
+ /* Prevent 12Month(j=11)ulMonth[12] access */
+ valid_date = FALSE;
+ if (j == (MONTH_MAX - 1)) {
+ valid_date = TRUE;
+ } else {
+ if (kUlDayCntTbl.st_tbl[i].ulMonth[j + 1] > uli_sec_wk) {
+ valid_date = TRUE;
+ }
+ }
+
+ if (valid_date == TRUE) {
+ lp_st->wMonth = (WORD)(j + 1);
+
+ /* Day-of-week,Set Date Hour Minute Second */
+ lp_st->wDayOfWeek = (WORD)((lp_st->wDayOfWeek +
+ (WORD)((uli_sec_wk / SEC_PER_DAY) % 7)) % 7); /* Setting the day of the week */
+ uli_sec_wk = uli_sec_wk - (u_int32)(kUlDayCntTbl.st_tbl[i].ulMonth[j]);
+ lp_st->wDay = (WORD)((uli_sec_wk / SEC_PER_DAY) + 1); /* Day Settings */
+ lp_st->wSecond = (WORD)(uli_sec_wk % SEC_PER_MIN); /* Set Seconds */
+ lp_st->wMinute = (WORD)((uli_sec_wk % SEC_PER_HOUR) / SEC_PER_MIN); /* Minute setting */
+ lp_st->wHour = (WORD)((uli_sec_wk % SEC_PER_DAY) / SEC_PER_HOUR); /* Time setting */
+
+ complete_cnv = TRUE; /* Completion */
+ }
+ j++;
+ }
+ }
+
+ if (complete_cnv != FALSE) {
+ break;
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
+/*************************************************************************
+@brief Type conversion is done.
+@outline It converts it from the TimeData type to the SYSTEMTIME type.
+@type Completion return type
+@param[in] const TimeData* base_time : Time of conversion origin
+@param[out] const SYSTEMTIME* result_time : Time after it converts it
+@threshold base_time != NULL<BR>
+@threshold result_time != NULL
+@return CLOCK_RETURN
+@retval CLOCK_OK : Normal end
+@retval CLOCK_ERROR : Abnormal end
+@retval CLOCK_ERROR_ARGUMENTS : The argument is wrong
+@trace
+*****************************************************************************/
+CLOCK_RETURN ClockApiConvertTimeDataToSYSTEMTIME(const TimeData* base_time, SYSTEMTIME* result_time) {
+ CLOCK_RETURN ret = CLOCK_ERROR;
+ RET_API ret_cnv = RET_ERROR;
+ u_int32 total_sec = 0;
+
+ if ((base_time != NULL) && (result_time != NULL)) {
+ /* Converting TimeData Types to SYSTEMTIME Types */
+ result_time->wYear = static_cast<WORD>(base_time->year);
+ result_time->wMonth = static_cast<WORD>(base_time->month);
+ result_time->wDay = static_cast<WORD>(base_time->day);
+ result_time->wHour = static_cast<WORD>(base_time->hour);
+ result_time->wMinute = static_cast<WORD>(base_time->minute);
+ result_time->wSecond = static_cast<WORD>(base_time->second);
+ result_time->wMilliseconds = 0; /* 0 because there is no corresponding parameter */
+ result_time->wDayOfWeek = CLKMNG_SUN; /* 0 because there is no corresponding parameter */
+
+ ret_cnv = ClockUtilityConvertDateToSecond(result_time, &total_sec);
+ if (ret_cnv == RET_NORMAL) {
+ /* Calculate the day of the week from the cumulative second. */
+ ret_cnv = ClockUtilityConvertSecondToDate(&total_sec, result_time);
+ if (ret_cnv == RET_NORMAL) {
+ ret = CLOCK_OK;
+ } else {
+ ret = CLOCK_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ClockUtility.lib:%s:LINE:%d\r\nClockApiConvertTimeDataToSYSTEMTIME"\
+ "ClockUtilityConvertSecondToDate ERROR!![%d]\r\n",
+ LTEXT(__FILE__),
+ __LINE__,
+ ret);
+ }
+ } else {
+ ret = CLOCK_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ClockUtility.lib:%s:LINE:%d\r\nClockApiConvertTimeDataToSYSTEMTIME"\
+ "ClockUtilityConvertDateToSecond ERROR!![%d]\r\n",
+ LTEXT(__FILE__),
+ __LINE__,
+ ret);
+ }
+
+ } else {
+ /* Invalid argument */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ClockUtility.lib:%s:LINE:%d\r\nClockApiConvertTimeDataToSYSTEMTIME"\
+ "Arguments ERROR!![%d]\r\n",
+ LTEXT(__FILE__),
+ __LINE__,
+ ret);
+ ret = CLOCK_ERROR_ARGUMENTS;
+ }
+ return ret;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp
new file mode 100755
index 0000000..9503b34
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp
@@ -0,0 +1,127 @@
+/*
+ * @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 :DeadReckoning_Common.cpp
+ * System name :PastModel002
+ * Subsystem name :DeadReckoning processes
+ * Program name :DeadReckoning shared process(DEADRECKONING_COMMON)
+ * Module configuration DeadReckoningMemcmp() Functions for Common Processing Memory Block Comparisons
+ * DeadReckoningCheckDid() Common Processing Data ID Check Function
+ * DeadReckoningGetDataMasterOffset() Get function for common processing data master offset value
+ ******************************************************************************/
+#include "DeadReckoning_Common.h"
+#include <vehicle_service/positioning_base_library.h>
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static const DEADRECKONING_DID_OFFSET_TBL kGstDidListS[] = {
+ /* Data ID Offset size Reserved */
+ { VEHICLE_DID_DR_LONGITUDE, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_LATITUDE, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_ALTITUDE, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_SPEED, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_HEADING, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_GYRO_OFFSET, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_GYRO_SCALE_FACTOR, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL, DEADRECKONING_OFFSET_NORMAL, {0, 0} },
+ { 0, 0, {0, 0} } /* Termination code */
+};
+
+/*******************************************************************************
+* MODULE : DeadReckoningMemcmp
+* ABSTRACT : Functions for Common Processing Memory Block Comparisons
+* FUNCTION : Memory block comparison processing
+* ARGUMENT : *vp_data1 : Comparison target address 1
+* : *vp_data2 : Comparison target address 2
+* : uc_size : Comparison Size
+* NOTE :
+* RETURN : DEADRECKONING_EQ : No data change
+* : DEADRECKONING_NEQ : Data change
+******************************************************************************/
+u_int8 DeadReckoningMemcmp(const void *vp_data1, const void *vp_data2, size_t uc_size) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 l_ret = DEADRECKONING_EQ;
+ const u_int8 *p_data1 = (const u_int8 *)vp_data1;
+ const u_int8 *p_data2 = (const u_int8 *)vp_data1;
+
+ /* Loop by data size */
+ while (uc_size > 0) {
+ if (*p_data1 != *p_data2) {
+ /* Data mismatch */
+ l_ret = DEADRECKONING_NEQ;
+ break;
+ }
+ p_data1++;
+ p_data2++;
+ uc_size--;
+ }
+ return(l_ret);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningCheckDid
+* ABSTRACT : Common Processing Data ID Check Function
+* FUNCTION : Check if the specified DID corresponds to the vehicle sensor information
+* ARGUMENT : ul_did : Data ID
+* NOTE :
+* RETURN : DEADRECKONING_INVALID :Disabled
+* : DEADRECKONING_EFFECTIVE :Enabled
+******************************************************************************/
+int32 DeadReckoningCheckDid(DID ul_did) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i = 0;
+ int32 l_ret = DEADRECKONING_INVALID;
+
+ while (0 != kGstDidListS[i].ul_did) {
+ if (kGstDidListS[i].ul_did == ul_did) {
+ /* DID enabled */
+ l_ret = DEADRECKONING_EFFECTIVE;
+ break;
+ }
+ i++;
+ }
+ return(l_ret);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningGetDataMasterOffset
+* ABSTRACT : Get function for common processing data master offset value
+* FUNCTION : Get the fixed offset value for a given DID
+* ARGUMENT : ul_did : Data ID
+* NOTE :
+* RETURN : Offset value(Returns 0 if DID is invalid)
+* :
+******************************************************************************/
+u_int16 DeadReckoningGetDataMasterOffset(DID ul_did) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i = 0; /* Generic counters */
+ u_int16 us_ret = 0; /* Return value of this function */
+
+ while (0 != kGstDidListS[i].ul_did) {
+ if (kGstDidListS[i].ul_did == ul_did) {
+ /* DID enabled */
+ us_ret = kGstDidListS[i].us_offset;
+ break;
+ }
+ i++;
+ }
+ return(us_ret);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp
new file mode 100755
index 0000000..93adda0
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp
@@ -0,0 +1,298 @@
+/*
+ * @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 :DeadReckoning_DataMasterMain.cpp
+ * System name :GPF
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle SW Data Master
+ * Module configuration :DeadReckoningInitDataMaster() Guess Navigation Data Master Initialization Function
+ * :DeadReckoningSetDataMaster() Estimated Navigational Data Master SW Data Set Processing
+ * :DeadReckoningGetDataMaster() Estimated Navigational Data Master Get Processing
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+#define DR_DEBUG 0
+
+/*******************************************************************************
+* MODULE : DeadReckoningInitDataMaster
+* ABSTRACT : Initialization of Guess Navigation Data Master
+* FUNCTION : Initialize the estimated navigation data master
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningInitDataMaster(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Vehicle sensor data master initialization */
+ DeadReckoningInitLongitudeDr();
+ DeadReckoningInitLatitudeDr();
+ DeadReckoningInitAltitudeDr();
+ DeadReckoningInitSpeedDr();
+ DeadReckoningInitHeadingDr();
+ DeadReckoningInitSnsCounterDr();
+ DeadReckoningInitGyroOffsetDr();
+ DeadReckoningInitGyroScaleFactorDr();
+ DeadReckoningInitGyroScaleFactorLevelDr();
+ DeadReckoningInitSpeedPulseScaleFactorDr();
+ DeadReckoningInitSpeedPulseScaleFactorLevelDr();
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoning_SetDataMaster_Sub
+* ABSTRACT : Estimated Navigational Data Master SW Data Set Processing
+* FUNCTION : Set estimated navigation data
+* ARGUMENT : *p_data : SW vehicle signal notification data
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningSetDataMaster(const DEADRECKONING_DATA_MASTER *p_data,
+ PFUNC_DR_DMASTER_SET_N p_datamaster_set_n) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 chg_type;
+
+ static u_int8 gyro_parameter_chg_type = 0;
+ static u_int8 speedpulse_parameter_chg_type = 0;
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (p_data->ul_did) {
+ case VEHICLE_DID_DR_LONGITUDE:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetLongitudeDr(p_data);
+ /* Implementation of delivery process at LATITUDE updating timings */
+ /* Since the order of transmission (updating) at the main receiver is fixed, there is no problem. */
+ break;
+ }
+ case VEHICLE_DID_DR_LATITUDE:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetLatitudeDr(p_data);
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ case VEHICLE_DID_DR_ALTITUDE:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetAltitudeDr(p_data);
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetSpeedDr(p_data);
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ case VEHICLE_DID_DR_HEADING:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetHeadingDr(p_data);
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ case VEHICLE_DID_DR_SNS_COUNTER:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetSnsCounterDr(p_data);
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_OFFSET:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetGyroOffsetDr(p_data);
+ /* Distribution processing not performed in this DID */
+ /* Delivery processing is executed when VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL is updated. */
+ /* The GyroParameter order is defined by DeadReckoning_RcvMsg(). */
+ if (chg_type == DEADRECKONING_NEQ) {
+ gyro_parameter_chg_type = DEADRECKONING_NEQ;
+ }
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetGyroScaleFactorDr(p_data);
+ /* Distribution processing not performed in this DID */
+ /* Delivery processing is executed when VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL is updated. */
+ /* The GyroParameter order is defined by DeadReckoning_RcvMsg(). */
+ if (chg_type == DEADRECKONING_NEQ) {
+ gyro_parameter_chg_type = DEADRECKONING_NEQ;
+ }
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetGyroScaleFactorLevelDr(p_data);
+ if (gyro_parameter_chg_type == DEADRECKONING_NEQ) {
+ chg_type = DEADRECKONING_NEQ;
+ gyro_parameter_chg_type = DEADRECKONING_EQ;
+ }
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetSpeedPulseScaleFactorDr(p_data);
+ /* Distribution processing not performed in this DID */
+ /* Delivery processing is executed when VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL is updated. */
+ /* The SpeedPulseParameter order is defined by DeadReckoning_RcvMsg(). */
+ if (chg_type == DEADRECKONING_NEQ) {
+ speedpulse_parameter_chg_type = DEADRECKONING_NEQ;
+ }
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n",
+ p_data->ul_did, p_data->us_size);
+#endif
+ chg_type = DeadReckoningSetSpeedPulseScaleFactorLevelDr(p_data);
+ if (speedpulse_parameter_chg_type == DEADRECKONING_NEQ) {
+ chg_type = DEADRECKONING_NEQ;
+ speedpulse_parameter_chg_type = DEADRECKONING_EQ;
+ }
+ (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningGetDataMaster
+* ABSTRACT : Estimated Navigational Data Master Get Processing
+* FUNCTION : Provide an estimated navigation data master
+* ARGUMENT : ul_did : Data ID corresponding to the vehicle information
+* : *p_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningGetDataMaster(DID ul_did, DEADRECKONING_DATA_MASTER *p_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /*------------------------------------------------------*/
+ /* Call the data Get processing associated with the DID */
+ /*------------------------------------------------------*/
+ switch (ul_did) {
+ /*------------------------------------------------------*/
+ /* Vehicle sensor data group */
+ /*------------------------------------------------------*/
+ case VEHICLE_DID_DR_LONGITUDE:
+ {
+ DeadReckoningGetLongitudeDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_LATITUDE:
+ {
+ DeadReckoningGetLatitudeDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_ALTITUDE:
+ {
+ DeadReckoningGetAltitudeDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED:
+ {
+ DeadReckoningGetSpeedDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_HEADING:
+ {
+ DeadReckoningGetHeadingDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_SNS_COUNTER:
+ {
+ DeadReckoningGetSnsCounterDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_OFFSET:
+ {
+ DeadReckoningGetGyroOffsetDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR:
+ {
+ DeadReckoningGetGyroScaleFactorDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL:
+ {
+ DeadReckoningGetGyroScaleFactorLevelDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR:
+ {
+ DeadReckoningGetSpeedPulseScaleFactorDr(p_data);
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL:
+ {
+ DeadReckoningGetSpeedPulseScaleFactorLevelDr(p_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp
new file mode 100755
index 0000000..0a08f5f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp
@@ -0,0 +1,835 @@
+/*
+ * @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 :DeadReckoning_DeliveryCtrl.cpp
+ * System name :GPF
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle Sensor Destination Management(
+ * Module configuration DeadReckoningInitDeliveryCtrlTbl() Vehicle sensor delivery destination management table initialization function
+ * DeadReckoningInitDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management area initialization function
+ * DeadReckoningEntryDeliveryCtrl() Vehicle sensor delivery destination management registration function
+ * :DeadReckoningAddDeliveryCtrlTbl() Vehicle sensor delivery destination management table addition function
+ * :DeadReckoningUpdateDeliveryCtrlTbl() Vehicle sensor delivery destination management table update function
+ * :DeadReckoning_DeliveryEntry_Delete() Vehicle sensor delivery destination management table deletion function
+ * :DeadReckoningAddDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management addition function
+ * :DeadReckoningUpdateDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management update function
+ * :DeadReckoning_DeleteDeliveryCtrlTblMng_Touch() Vehicle sensor delivery destination management table management deletion (touch panel) function
+ * DeadReckoningMakeDeliveryPnoTbl() Vehicle Sensor Destination PNO Table Creation Function
+ * :DeadReckoningAddPnoTbl() Vehicle Sensor Destination PNO Table Addition Function
+ * :DeadReckoningDeliveryProc() Vehicle Sensor Data Delivery Process
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DeliveryCtrl.h"
+#include "Vehicle_API.h"
+#include "Vehicle_API_Dummy.h"
+#include "Dead_Reckoning_Local_Api.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DELIVERY_CTRL_TBL g_delivery_dr_ctrltbl;
+static DEADRECKONING_DELIVERY_CTRL_TBL_MNG g_delivery_dr_ctrltbl_mng;
+static DEADRECKONING_DELIVERY_PNO_TBL g_delivery_dr_pnotbl;
+
+/* Stored data count */
+int32 g_delivery_dr_ctrl_num = 0;
+
+/* PastModel002 support DR */
+/*******************************************************************************
+* MODULE : DeadReckoningInitDeliveryCtrlTbl
+* ABSTRACT : Vehicle sensor delivery destination management table initialization function
+* FUNCTION : Delivery destination management table initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningInitDeliveryCtrlTbl(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&g_delivery_dr_ctrltbl, 0x00, sizeof(DEADRECKONING_DELIVERY_CTRL_TBL));
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningInitDeliveryCtrlTblMng
+* ABSTRACT : Vehicle sensor delivery destination management table management area initialization function
+* FUNCTION : Delivery destination management table management area initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningInitDeliveryCtrlTblMng(void) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&g_delivery_dr_ctrltbl_mng, 0x00, sizeof(DEADRECKONING_DELIVERY_CTRL_TBL_MNG));
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningEntryDeliveryCtrl
+* ABSTRACT : Vehicle sensor delivery destination management registration function
+* FUNCTION : Shipping management table,Update the shipping management table management.
+* ARGUMENT : p_st_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : VEHICLE_RET_NORMAL :Successful registration
+******************************************************************************/
+DEAD_RECKONING_RET_API DeadReckoningEntryDeliveryCtrl(const DEADRECKONING_MSG_DELIVERY_ENTRY *p_st_delivery_entry) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i;
+ u_int8 uc_action_type = DEADRECKONING_ACTION_TYPE_ADD;
+ int32 uc_did_flag;
+ DID ul_entry_did = p_st_delivery_entry->data.did;
+ DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_existing_mng_data = NULL;
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ DEAD_RECKONING_RET_API ret = DEAD_RECKONING_RET_NORMAL;
+
+ /* Check if the data ID exists. */
+ uc_did_flag = DeadReckoningCheckDid(ul_entry_did);
+ if (uc_did_flag == 0) {
+ ret = DEADRECKONING_RET_ERROR_DID; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Check the number of registered shipments. */
+ if ((ret == DEAD_RECKONING_RET_NORMAL) &&/* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (g_delivery_dr_ctrltbl.us_num >= DEADRECKONING_DELIVERY_INFO_MAX)) {
+ /* Return the FULL of delivery registrations*/
+ ret = DEADRECKONING_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ if (ret == DEAD_RECKONING_RET_NORMAL) {
+ /* By searching for the delivery registration of the relevant DID,Hold the address. */
+ for (i = 0; i < g_delivery_dr_ctrltbl_mng.us_num; i++) {
+ if (g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ul_entry_did) {
+ uc_action_type = DEADRECKONING_ACTION_TYPE_UPDATE;
+ p_st_existing_mng_data = &g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i];
+ }
+ }
+
+ /* Add to the shipping management table.*/
+ DeadReckoningAddDeliveryCtrlTbl(p_st_delivery_entry);
+
+ /* Processing when updating existing data*/
+ if (uc_action_type == DEADRECKONING_ACTION_TYPE_UPDATE) {
+ /* Update the shipping management table.*/
+ DeadReckoningUpdateDeliveryCtrlTbl(p_st_existing_mng_data);
+
+ /* Update the shipping destination management table management information.*/
+ DeadReckoningUpdateDeliveryCtrlTblMng(p_st_existing_mng_data);
+ } else { /* Newly added processing*/
+ /* Add to the shipping management table management information.*/
+ DeadReckoningAddDeliveryCtrlTblMng(p_st_delivery_entry);
+ }
+ }
+ return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningAddDeliveryCtrlTbl
+* ABSTRACT : Vehicle sensor delivery destination management table addition function
+* FUNCTION : Add to the shipping management table.
+* ARGUMENT : *p_st_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningAddDeliveryCtrlTbl(const DEADRECKONING_MSG_DELIVERY_ENTRY *p_st_delivery_entry) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DEADRECKONING_DELIVERY_CTRL_TBL_DATA *p_st_ctrl_data;
+
+ p_st_ctrl_data = &g_delivery_dr_ctrltbl.st_ctrl_data[g_delivery_dr_ctrltbl.us_num];
+ p_st_ctrl_data->ul_did = p_st_delivery_entry->data.did;
+ p_st_ctrl_data->us_pno = p_st_delivery_entry->data.pno;
+ p_st_ctrl_data->uc_chg_type = p_st_delivery_entry->data.delivery_timing;
+ p_st_ctrl_data->uc_ctrl_flg = p_st_delivery_entry->data.ctrl_flg;
+ p_st_ctrl_data->us_link_idx = DEADRECKONING_LINK_INDEX_END;
+ p_st_ctrl_data->uc_method = DEADRECKONING_DELIVERY_METHOD_NORMAL;
+
+ g_delivery_dr_ctrltbl.us_num = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num + 1);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningUpdateDeliveryCtrlTbl
+* ABSTRACT : Vehicle sensor delivery destination management table update function
+* FUNCTION : Update the shipping management table.
+* ARGUMENT : *p_st_existing_mng_data : Pointer to the previous data information with the same data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningUpdateDeliveryCtrlTbl(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_existing_mng_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Update Link Index Only.
+ For the index of the value of us_end_idx that matches the data ID of the distribution target management table management information
+ Make us_link_idx a registered index */
+ g_delivery_dr_ctrltbl.st_ctrl_data[p_st_existing_mng_data->us_end_idx].us_link_idx =
+ static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningAddDeliveryCtrlTblMng
+* ABSTRACT : Vehicle sensor delivery destination management table management addition function
+* FUNCTION : Add to the shipping management table management.
+* ARGUMENT : *p_st_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningAddDeliveryCtrlTblMng(const DEADRECKONING_MSG_DELIVERY_ENTRY *p_st_delivery_entry) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_ctr_mng_data;
+
+ p_st_ctr_mng_data = &g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[g_delivery_dr_ctrltbl_mng.us_num];
+ p_st_ctr_mng_data->ul_did = p_st_delivery_entry->data.did;
+ p_st_ctr_mng_data->us_start_idx = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1);
+ p_st_ctr_mng_data->us_end_idx = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1);
+ p_st_ctr_mng_data->us_dlvry_entry_num++;
+ g_delivery_dr_ctrltbl_mng.us_num++;
+ g_delivery_dr_ctrl_num++;
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningUpdateDeliveryCtrlTblMng
+* ABSTRACT : Vehicle sensor delivery destination management table management update function
+* FUNCTION : Update the shipping management table management.
+* ARGUMENT : *p_st_existing_mng_data : Pointer to the previous data information with the same data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningUpdateDeliveryCtrlTblMng(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_existing_mng_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Update only the end index and the number of registered shipping destinations. */
+ p_st_existing_mng_data->us_end_idx = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1);
+ p_st_existing_mng_data->us_dlvry_entry_num++;
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningMakeDeliveryPnoTbl
+* ABSTRACT : Vehicle sensor delivery destination PNO table creation function
+* FUNCTION : Create the shipping destination PNO table
+* ARGUMENT : ul_did Data ID
+* Change_type Delivery Trigger
+* NOTE :
+* RETURN : DEADRECKONING_DELIVERY_PNO_TBL* Pointer to the shipping PNO table
+******************************************************************************/
+DEADRECKONING_DELIVERY_PNO_TBL* DeadReckoningMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i;
+ u_int16 us_index = 0;
+ u_int16 us_num = 0;
+
+ /* Get the start index and count of the corresponding data ID. */
+ for (i = 0; i < g_delivery_dr_ctrl_num; i++) {
+ /* Stores the information of the corresponding DID.. */
+ if (g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ul_did) {
+ us_index = g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].us_start_idx;
+ us_num = g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].us_dlvry_entry_num;
+ break;
+ }
+ }
+
+ /* Create a PNO list */
+ g_delivery_dr_pnotbl.us_num = 0;
+ if (change_type == DEADRECKONING_CHGTYPE_CHG) {
+ /* Processing when delivery timing is changed*/
+ for (i = 0; i < us_num; i++) {
+ /* Functionalization by Increasing Structure Members */
+ DeadReckoningAddPnoTbl(us_index);
+
+ us_index = g_delivery_dr_ctrltbl.st_ctrl_data[us_index].us_link_idx;
+ }
+ } else {
+ /* Processing when delivery timing is update */
+ for (i = 0; i < us_num; i++) {
+ if (DEADRECKONING_DELIVERY_TIMING_UPDATE == g_delivery_dr_ctrltbl.st_ctrl_data[us_index].uc_chg_type) {
+ /* Functionalization by Increasing Structure Members */
+ DeadReckoningAddPnoTbl(us_index);
+ }
+ us_index = g_delivery_dr_ctrltbl.st_ctrl_data[us_index].us_link_idx;
+ }
+ }
+ return (&g_delivery_dr_pnotbl);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningAddPnoTbl
+* ABSTRACT : Vehicle Sensor Destination PNO Table Addition Function
+* FUNCTION : Add to the shipping PNO table.
+* ARGUMENT : us_index : Index of the referenced destination management table
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningAddPnoTbl(u_int16 us_index) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int16 us_pno_tbl_idx;
+
+ us_pno_tbl_idx = g_delivery_dr_pnotbl.us_num;
+ g_delivery_dr_pnotbl.st_pno_data[us_pno_tbl_idx].us_pno = g_delivery_dr_ctrltbl.st_ctrl_data[us_index].us_pno;
+ /* Save the relevant INDEX in the delivery control table */
+ g_delivery_dr_pnotbl.st_pno_data[us_pno_tbl_idx].us_index = us_index;
+ g_delivery_dr_pnotbl.st_pno_data[us_pno_tbl_idx].uc_method =
+ g_delivery_dr_ctrltbl.st_ctrl_data[us_index].uc_method;
+ g_delivery_dr_pnotbl.us_num++;
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningDeliveryProc
+* ABSTRACT : Vehicle Sensor Data Delivery Process
+* FUNCTION : Deliver data to a destination.
+* ARGUMENT : ul_did :Data ID
+* uc_chg_type :Delivery timing
+* uc_get_method :Acquisition method
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i; /* Generic counters */
+ DEADRECKONING_DATA_MASTER st_master; /* Data master of normal data */
+
+
+ /* Defines the data master for each API. */
+ SENSORLOCATION_MSG_LONLATINFO_DAT st_msg_lonlat_info;
+ SENSORLOCATION_MSG_ALTITUDEINFO_DAT st_msg_altitude_info;
+ SENSORMOTION_MSG_SPEEDINFO_DAT st_msg_speed_info;
+ SENSORMOTION_MSG_HEADINGINFO_DAT st_msg_heading_info;
+
+
+ const DEADRECKONING_DELIVERY_PNO_TBL *p_st_pno_tbl; /* Vehicle Sensor Destination PNO Table Pointer */
+
+ /* Initialization */
+ st_msg_lonlat_info.reserve[0] = 0;
+ st_msg_lonlat_info.reserve[1] = 0;
+ st_msg_lonlat_info.reserve[2] = 0;
+ st_msg_altitude_info.reserve[0] = 0;
+ st_msg_altitude_info.reserve[1] = 0;
+ st_msg_altitude_info.reserve[2] = 0;
+ st_msg_speed_info.reserve = 0;
+ st_msg_heading_info.reserve = 0;
+
+ /* Obtain the shipping destination PNO */
+ p_st_pno_tbl =
+ reinterpret_cast<DEADRECKONING_DELIVERY_PNO_TBL*>(DeadReckoningMakeDeliveryPnoTbl(ul_did, uc_chg_type));
+
+ if ((p_st_pno_tbl->us_num) > 0) {
+ /* When there is a shipping destination PNO registration */
+ /* Vehicle sensor information notification transmission process */
+ for (i = 0; i < (p_st_pno_tbl->us_num); i++) {
+ /* Acquire the applicable data information from the data master..*/
+ DeadReckoningGetDataMaster(ul_did, &st_master);
+
+ /* Align data from the data master for API I/F */
+ switch (ul_did) {
+ /* Describes the process for each DID. */
+ case VEHICLE_DID_DR_LATITUDE:
+ {
+ /* Size storage(LONLAT) */
+ st_msg_lonlat_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT);
+
+ /* DR status setting */
+ st_msg_lonlat_info.dr_status = st_master.dr_status;
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_lonlat_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR;
+
+ /* Set the Latitude */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_lonlat_info.latitude)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ /* Obtain the data master Longitude */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_LONGITUDE, &st_master);
+
+ /* Set the Longitude */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_lonlat_info.longitude)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+
+ /* Set the SensorCnt */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_lonlat_info.sensor_cnt)),
+ (const void *)(&( st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ p_st_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLE_SENSORLOCATION_LONLAT,
+ sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT),
+ (const void *)&st_msg_lonlat_info);
+ break;
+ }
+ case VEHICLE_DID_DR_ALTITUDE:
+ {
+ /* Size storage(ALTITUDE) */
+ st_msg_altitude_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT);
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_altitude_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR;
+
+ /* DR status setting */
+ st_msg_altitude_info.dr_status = st_master.dr_status;
+
+
+ /* Set the Altitude */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_altitude_info.altitude)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+
+ /* Set the SensorCnt */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_altitude_info.sensor_cnt)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ p_st_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLE_SENSORLOCATION_ALTITUDE,
+ sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT),
+ (const void *)&st_msg_altitude_info);
+
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED:
+ {
+ /* Size storage(SPEED) */
+ st_msg_speed_info.size = (u_int16)sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT);
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_speed_info.is_exist_dr = SENSORMOTION_EXISTDR_DR;
+
+ /* DR status setting */
+ st_msg_speed_info.dr_status = st_master.dr_status;
+
+
+ /* Set the Speed */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_speed_info.speed)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+ /* Set the SensorCnt */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_speed_info.sensor_cnt)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ p_st_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLE_SENSORMOTION_SPEED,
+ sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT),
+ (const void *)&st_msg_speed_info);
+ break;
+ }
+ case VEHICLE_DID_DR_HEADING:
+ {
+ /* Size storage(HEADING) */
+ st_msg_heading_info.size = (u_int16)sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT);
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_heading_info.is_exist_dr = SENSORMOTION_EXISTDR_DR;
+
+ /* DR status setting */
+ st_msg_heading_info.dr_status = st_master.dr_status;
+
+ /* Set the Heading */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.heading)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+ /* Set the SensorCnt */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.sensor_cnt)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ p_st_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLE_SENSORMOTION_HEADING,
+ sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT),
+ (const void *)&st_msg_heading_info);
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL:
+ {
+ SENSORMOTION_MSG_GYROPARAMETERINFO_DAT stMsgGyroParameterInfo;
+ /* Initialization */
+ stMsgGyroParameterInfo.reserve[0] = 0;
+ stMsgGyroParameterInfo.reserve[1] = 0;
+
+ /* GyroOffset/GyroScaleFactor/GyroScaleFactorLevel data master */
+ /* setup must be completed before data delivery of this DID */
+ /* The order of processing is defined by DeadReckoning_RcvMsg().,Be careful when changing */
+
+ /* Size storage(GYROPARAMETER) */
+ stMsgGyroParameterInfo.size = (u_int16)sizeof(stMsgGyroParameterInfo);
+
+ /* GyroOffset acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_OFFSET, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_offset)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgGyroParameterInfo.gyro_offset));
+
+ /* GyroScaleFactor acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgGyroParameterInfo.gyro_scale_factor));
+
+ /* GyroScaleFactorLevel acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor_level)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgGyroParameterInfo.gyro_scale_factor_level));
+
+ /* Data transmission */
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ p_st_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLE_SENSORMOTION_GYROPARAMETER,
+ sizeof(stMsgGyroParameterInfo),
+ (const void *)&stMsgGyroParameterInfo);
+ }
+ break;
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL:
+ {
+ SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT stMsgSpeedPulseParameterInfo;
+
+ /* Initialization */
+ stMsgSpeedPulseParameterInfo.reserve[0] = 0;
+ stMsgSpeedPulseParameterInfo.reserve[1] = 0;
+ stMsgSpeedPulseParameterInfo.reserve[2] = 0;
+
+ /* GyroOffset/GyroScaleFactor/GyroScaleFactorLevel data master */
+ /* setup must be completed before data delivery of this DID */
+ /* The order of processing is defined by DeadReckoning_RcvMsg().,Be careful when changing */
+
+ /* Size storage(SPEEDPULSEPARAMETER) */
+ stMsgSpeedPulseParameterInfo.size = (u_int16)sizeof(stMsgSpeedPulseParameterInfo);
+
+ /* SpeedPulseScaleFactor acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor));
+
+ /* SpeedPulseScaleFactorLevel acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level));
+
+ /* Data transmission */
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ p_st_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER,
+ sizeof(stMsgSpeedPulseParameterInfo),
+ (const void *)&stMsgSpeedPulseParameterInfo);
+ }
+ break;
+ /* Other than the above */
+ default:
+ /* Do not edit. */
+ break;
+ }
+ }
+ }
+}
+
+/*******************************************************************************
+ * MODULE : DRManagerSndMsg
+ * ABSTRACT : Message transmission processing
+ * FUNCTION : Send a message to the specified PNO
+ * ARGUMENT : us_pno_src : Source PNO
+ * : us_pno_dest : Destination PNO
+ * : us_cid : Command ID
+ * : us_msg_len : Message data body length
+ * : *p_msg_data : Pointer to message data
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : RET_ERRNOTRDY : Destination process is not wakeup
+ * : RET_ERRMSGFULL : Message queue overflows
+ * : RET_ERRPARAM : Buffer size error
+ ******************************************************************************/
+RET_API DRManagerSndMsg(PNO us_pno_src, PNO us_pno_dest, CID us_cid, u_int16 us_msg_len, const void *p_msg_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DEADRECKONING_MSG_BUF st_msg_buf; /* message buffer */
+ T_APIMSG_MSGBUF_HEADER *p_st_msg_hdr; /* Pointer to the message header */
+ RET_API l_ret_api; /* Return value */
+
+ /* Message buffer initialization */
+ memset(reinterpret_cast<void *>(&st_msg_buf), 0, sizeof(DEADRECKONING_MSG_BUF));
+
+ /* Get pointer to send buffer */
+ p_st_msg_hdr = reinterpret_cast<T_APIMSG_MSGBUF_HEADER *>(reinterpret_cast<void *>(&st_msg_buf));
+
+ /*--------------------------------------------------------------*
+ * Create message headers *
+ *--------------------------------------------------------------*/
+ p_st_msg_hdr->hdr.sndpno = us_pno_src; /* Source PNO */
+ p_st_msg_hdr->hdr.cid = us_cid; /* Command ID */
+ p_st_msg_hdr->hdr.msgbodysize = us_msg_len; /* Message data body length */
+
+ /*--------------------------------------------------------------*
+ * Create message data *
+ *--------------------------------------------------------------*/
+ if ((0 != p_msg_data) && (0 != us_msg_len)) {
+ /* Set the message data */
+ memcpy(reinterpret_cast<void *>(st_msg_buf.data), p_msg_data, (size_t)us_msg_len);
+ }
+ /*--------------------------------------------------------------*
+ * Send messages *
+ *--------------------------------------------------------------*/
+ l_ret_api = _pb_SndMsg(us_pno_dest,
+ (u_int16)(sizeof(T_APIMSG_MSGBUF_HEADER) + us_msg_len),
+ reinterpret_cast<void *>(&st_msg_buf),
+ 0);
+ return (l_ret_api);
+}
+
+
+/*******************************************************************************
+* MODULE : DeadReckoningFirstDelivery
+* ABSTRACT : Vehicle Sensor Initial Data Delivery Process
+* FUNCTION : Deliver the initial data to the destination.
+* ARGUMENT : us_pno :Addresses for delivery NO
+* ul_did :Data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningFirstDelivery(PNO us_pno, DID ul_did) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DEADRECKONING_DATA_MASTER st_master; /* Data master of normal data */
+
+ /* Defines the data master for each API. */
+ SENSORLOCATION_MSG_LONLATINFO_DAT st_msg_lonlat_info;
+ SENSORLOCATION_MSG_ALTITUDEINFO_DAT st_msg_altitude_info;
+ SENSORMOTION_MSG_SPEEDINFO_DAT st_msg_speed_info;
+ SENSORMOTION_MSG_HEADINGINFO_DAT st_msg_heading_info;
+
+ /* Initialization */
+ st_msg_lonlat_info.reserve[0] = 0;
+ st_msg_lonlat_info.reserve[1] = 0;
+ st_msg_lonlat_info.reserve[2] = 0;
+ st_msg_altitude_info.reserve[0] = 0;
+ st_msg_altitude_info.reserve[1] = 0;
+ st_msg_altitude_info.reserve[2] = 0;
+ st_msg_speed_info.reserve = 0;
+ st_msg_heading_info.reserve = 0;
+
+ /* Align data from the data master for API I/F */
+ switch (ul_did) {
+ /* Describes the process for each DID. */
+ case VEHICLE_DID_DR_LATITUDE:
+ {
+ DeadReckoningGetDataMaster(ul_did, &st_master);
+
+ /* Size storage(LONLAT) */
+ st_msg_lonlat_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT);
+
+ /* DR status setting */
+ st_msg_lonlat_info.dr_status = st_master.dr_status;
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_lonlat_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR;
+
+ /* Set the Latitude */
+ memcpy(&(st_msg_lonlat_info.latitude), &(st_master.uc_data[0]), st_master.us_size);
+
+ /* Obtain the data master Longitude */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_LONGITUDE, &st_master);
+
+ /* Set the Longitude */
+ memcpy(&(st_msg_lonlat_info.longitude), &(st_master.uc_data[0]), st_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+
+ /* Set the SensorCnt */
+ memcpy(&(st_msg_lonlat_info.sensor_cnt), &(st_master.uc_data[0]), st_master.us_size);
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORLOCATION_LONLAT,
+ sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT),
+ (const void *)&st_msg_lonlat_info);
+ break;
+ }
+ case VEHICLE_DID_DR_ALTITUDE:
+ {
+ DeadReckoningGetDataMaster(ul_did, &st_master);
+
+ /* Size storage(ALTITUDE) */
+ st_msg_altitude_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT);
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_altitude_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR;
+
+ /* DR status setting */
+ st_msg_altitude_info.dr_status = st_master.dr_status;
+
+
+ /* Set the Altitude */
+ memcpy(&(st_msg_altitude_info.altitude), &(st_master.uc_data[0]), st_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+
+ /* Set the SensorCnt */
+ memcpy(&(st_msg_altitude_info.sensor_cnt), &(st_master.uc_data[0]), st_master.us_size);
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORLOCATION_ALTITUDE,
+ sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT),
+ (const void *)&st_msg_altitude_info);
+
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED:
+ {
+ DeadReckoningGetDataMaster(ul_did, &st_master);
+
+ /* Size storage(SPEED) */
+ st_msg_speed_info.size = (u_int16)sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT);
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_speed_info.is_exist_dr = SENSORMOTION_EXISTDR_DR;
+
+ /* DR status setting */
+ st_msg_speed_info.dr_status = st_master.dr_status;
+
+
+ /* Set the Speed */
+ memcpy(&(st_msg_speed_info.speed), &(st_master.uc_data[0]), st_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+ /* Set the SensorCnt */
+ memcpy(&(st_msg_speed_info.sensor_cnt), &(st_master.uc_data[0]), st_master.us_size);
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORMOTION_SPEED,
+ sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT),
+ (const void *)&st_msg_speed_info);
+ break;
+ }
+ case VEHICLE_DID_DR_HEADING:
+ {
+ DeadReckoningGetDataMaster(ul_did, &st_master);
+
+ /* Size storage(HEADING) */
+ st_msg_heading_info.size = (u_int16)sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT);
+
+ /* The DR enable flag is set to enabled. */
+ st_msg_heading_info.is_exist_dr = SENSORMOTION_EXISTDR_DR;
+
+ /* DR status setting */
+ st_msg_heading_info.dr_status = st_master.dr_status;
+
+
+ /* Set the Heading */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.heading)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ /* Acquire data master SensorCnt */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master);
+ /* Set the SensorCnt */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.sensor_cnt)),
+ (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size));
+
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORMOTION_HEADING,
+ sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT),
+ (const void *)&st_msg_heading_info);
+ break;
+ }
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL:
+ {
+ SENSORMOTION_MSG_GYROPARAMETERINFO_DAT stMsgGyroParameterInfo;
+
+ /* Initialization */
+ stMsgGyroParameterInfo.reserve[0] = 0;
+ stMsgGyroParameterInfo.reserve[1] = 0;
+
+ /* Size storage(GYROPARAMETER) */
+ stMsgGyroParameterInfo.size = (u_int16)sizeof(stMsgGyroParameterInfo);
+
+ /* GyroOffset acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_OFFSET, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_offset)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof( stMsgGyroParameterInfo.gyro_offset));
+
+ /* GyroScaleFactor acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgGyroParameterInfo.gyro_scale_factor));
+
+ /* GyroScaleFactorLevel acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor_level)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgGyroParameterInfo.gyro_scale_factor_level));
+
+ /* Data transmission */
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORMOTION_GYROPARAMETER,
+ sizeof(stMsgGyroParameterInfo),
+ (const void *)&stMsgGyroParameterInfo);
+ }
+ break;
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL:
+ {
+ SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT stMsgSpeedPulseParameterInfo;
+
+ /* Initialization */
+ stMsgSpeedPulseParameterInfo.reserve[0] = 0;
+ stMsgSpeedPulseParameterInfo.reserve[1] = 0;
+ stMsgSpeedPulseParameterInfo.reserve[2] = 0;
+
+ /* Size storage(SPEEDPULSEPARAMETER) */
+ stMsgSpeedPulseParameterInfo.size = (u_int16)sizeof(stMsgSpeedPulseParameterInfo);
+
+ /* SpeedPulseScaleFactor acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor));
+
+ /* SpeedPulseScaleFactorLevel acuisition/setting */
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL, &st_master);
+
+ (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level)),
+ reinterpret_cast<void *>(&(st_master.uc_data[0])),
+ sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level));
+
+ /* Data transmission */
+ (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER,
+ sizeof(stMsgSpeedPulseParameterInfo),
+ (const void *)&stMsgSpeedPulseParameterInfo);
+ }
+ break;
+ /* Other than the above */
+ default:
+ /* Do not edit. */
+ break;
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp
new file mode 100755
index 0000000..acd5f6d
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp
@@ -0,0 +1,106 @@
+/*
+ * @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 DeadReckoning_Did_Altitude.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_ALTITUDE)<BR>
+ DeadReckoning data master(VEHICLE_DID_DR_ALTITUDE)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_altitude; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief Altitude Dead Reckoning initialization function
+@outline Altitude initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitAltitudeDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&(gst_altitude), 0x00, sizeof(DEADRECKONING_DATA_MASTER));
+ gst_altitude.ul_did = VEHICLE_DID_DR_ALTITUDE;
+ gst_altitude.us_size = VEHICLE_DSIZE_ALTITUDE;
+ gst_altitude.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_altitude.dr_status = SENSORLOCATION_DRSTATUS_INVALID;
+ gst_altitude.uc_data[0] = VEHICLE_DINIT_ALTITUDE;
+}
+
+/***********************************************************************
+@brief Altitude Dead Reckoning SET function
+@outline To update the master data Altitude.
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetAltitudeDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_altitude;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = p_st_data->dr_status;
+
+ memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief Altitude Dead Reckoning GET function
+@outline Master Data provides the Altitude
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetAltitudeDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_altitude;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status;
+ memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp
new file mode 100755
index 0000000..f295f8d
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp
@@ -0,0 +1,115 @@
+/*
+ * @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 DeadReckoning_Did_GyroScaleFactor_dr.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_OFFSET)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_gyrooffset; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief GyroOffset initialization function
+@outline GyroOffset initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitGyroOffsetDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ (void)memset(reinterpret_cast<void *>(&gst_gyrooffset), 0x00, sizeof(gst_gyrooffset));
+ gst_gyrooffset.ul_did = VEHICLE_DID_DR_GYRO_OFFSET;
+ gst_gyrooffset.us_size = VEHICLE_DSIZE_GYRO_OFFSET;
+ gst_gyrooffset.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_gyrooffset.dr_status = 0U; /* Not used */
+}
+
+/************************************************************************
+@brief GyroOffset SET function
+@outline To update the master data GyroOffset
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetGyroOffsetDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = DEADRECKONING_EQ;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_gyrooffset;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data)), (size_t)(p_st_data->us_size));
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = 0U; /* Not used */
+
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data) ), sizeof(p_st_master->uc_data));
+ }
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief GyroOffset GET function
+@outline Master Data provides the GyroOffset
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetGyroOffsetDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_gyrooffset;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)),
+ (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size);
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp
new file mode 100755
index 0000000..dff0913
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp
@@ -0,0 +1,115 @@
+/*
+ * @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 DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_gyroscalefactor_level; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief GyroScaleFactorLevel initialization function
+@outline GyroScaleFactorLevel initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitGyroScaleFactorLevelDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ (void)memset(reinterpret_cast<void *>(&gst_gyroscalefactor_level), 0x00, sizeof(gst_gyroscalefactor_level));
+ gst_gyroscalefactor_level.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL;
+ gst_gyroscalefactor_level.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR_LEVEL;
+ gst_gyroscalefactor_level.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_gyroscalefactor_level.dr_status = 0U; /* Not used */
+}
+
+/*************************************************************************
+@brief GyroScaleFactorLevel SET function
+@outline To update the master data GyroScaleFactorLevel
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes<BR>
+@retval DEADRECKONING_NEQ : With data changes<BR>
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetGyroScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = DEADRECKONING_EQ;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_gyroscalefactor_level;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)( &(p_st_data->uc_data)), (size_t)(p_st_data->us_size));
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = 0U; /* Not used */
+
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data));
+ }
+
+ return (uc_ret);
+}
+
+/*************************************************************************
+@brief GyroScaleFactorLevel GET function
+@outline Master Data provides the GyroScaleFactorLevel
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetGyroScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_gyroscalefactor_level;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)),
+ (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size);
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp
new file mode 100755
index 0000000..d05ef5c
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp
@@ -0,0 +1,115 @@
+/*
+ * @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 DeadReckoning_Did_GyroScaleFactor_dr.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_SCALE_FACTOR)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_gyroscalefactor; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief GyroScaleFactor initialization function
+@outline GyroScaleFactor initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitGyroScaleFactorDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ (void)memset(reinterpret_cast<void *>(&gst_gyroscalefactor), 0x00, sizeof(gst_gyroscalefactor));
+ gst_gyroscalefactor.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR;
+ gst_gyroscalefactor.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR;
+ gst_gyroscalefactor.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_gyroscalefactor.dr_status = 0U; /* Not used */
+}
+
+/************************************************************************
+@brief GyroScaleFactor SET function
+@outline To update the master data GyroScaleFactor
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetGyroScaleFactorDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = DEADRECKONING_EQ;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_gyroscalefactor;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data)), (size_t)(p_st_data->us_size));
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = 0U; /* Not used */
+
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data) ), sizeof(p_st_master->uc_data));
+ }
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief GyroScaleFactor GET function
+@outline Master Data provides the GyroScaleFactor
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetGyroScaleFactorDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_gyroscalefactor;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)),
+ (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size);
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp
new file mode 100755
index 0000000..451b133
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp
@@ -0,0 +1,106 @@
+/*
+ * @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 DeadReckoning_Did_Heading.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_HEADING)<BR>
+ DeadReckoning data master(VEHICLE_DID_DR_HEADING)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_heading; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief Heading Dead Reckoning initialization function
+@outline Heading initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitHeadingDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&(gst_heading), 0x00, sizeof(DEADRECKONING_DATA_MASTER));
+ gst_heading.ul_did = VEHICLE_DID_DR_HEADING;
+ gst_heading.us_size = VEHICLE_DSIZE_HEADING;
+ gst_heading.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_heading.dr_status = SENSORMOTION_DRSTATUS_INVALID;
+ gst_heading.uc_data[0] = VEHICLE_DINIT_HEADING;
+}
+
+/*************************************************************************
+@brief Heading Dead Reckoning SET function
+@outline To update the master data Heading.
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetHeadingDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_heading;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = p_st_data->dr_status;
+
+ memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief Heading Dead Reckoning GET function
+@outline Master Data provides the Heading
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetHeadingDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_heading;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status;
+ memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp
new file mode 100755
index 0000000..9d06e7a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp
@@ -0,0 +1,105 @@
+/*
+ * @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 DeadReckoning_Did_Latitude.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_LATITUDE)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_latitude; // NOLINT(readability/nolint)
+
+/***********************************************************************
+@brief Latitude Dead Reckoning initialization function
+@outline Latitude initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitLatitudeDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&(gst_latitude), 0x00, sizeof(DEADRECKONING_DATA_MASTER));
+ gst_latitude.ul_did = VEHICLE_DID_DR_LATITUDE;
+ gst_latitude.us_size = VEHICLE_DSIZE_LATITUDE;
+ gst_latitude.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_latitude.dr_status = SENSORLOCATION_DRSTATUS_INVALID;
+ gst_latitude.uc_data[0] = VEHICLE_DINIT_LATITUDE;
+}
+
+/************************************************************************
+@brief Latitude Dead Reckoning SET function
+@outline To update the master data Latitude.
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetLatitudeDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_latitude;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = p_st_data->dr_status;
+
+ memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief Latitude Dead Reckoning GET function
+@outline Master Data provides the Latitude
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetLatitudeDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_latitude;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status;
+ memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp
new file mode 100755
index 0000000..38a6351
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp
@@ -0,0 +1,105 @@
+/*
+ * @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 DeadReckoning_Did_Longitude.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_LONGITUDE)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_longitude; // NOLINT(readability/nolint)
+
+/***********************************************************************
+@brief Longitude Dead Reckoning initialization function
+@outline Longitude initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitLongitudeDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&(gst_longitude), 0x00, sizeof(DEADRECKONING_DATA_MASTER));
+ gst_longitude.ul_did = VEHICLE_DID_DR_LONGITUDE;
+ gst_longitude.us_size = VEHICLE_DSIZE_LONGITUDE;
+ gst_longitude.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_longitude.dr_status = SENSORLOCATION_DRSTATUS_INVALID;
+ gst_longitude.uc_data[0] = VEHICLE_DINIT_LONGITUDE;
+}
+
+/************************************************************************
+@brief Longitude Dead Reckoning SET function
+@outline To update the master data Longitude.
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetLongitudeDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_longitude;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = p_st_data->dr_status;
+
+ memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief Longitude Dead Reckoning GET function
+@outline Master Data provides the Longitude
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetLongitudeDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_longitude;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status;
+ memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp
new file mode 100755
index 0000000..6bf3ed7
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp
@@ -0,0 +1,103 @@
+/*
+ * @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 :DeadReckoning_Did_SnsCounter.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_SNS_COUNTER)
+ * Module configuration :DeadReckoningInitSnsCounterDr() Vehicle sensor SNS_COUNTER initialization function
+ * :DeadReckoningSetSnsCounterDr() Vehicle sensor SNS_COUNTER SET function
+ * :DeadReckoningGetSnsCounterDr() Vehicle sensor SNS_COUNTER GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_snscounter_dr; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : DeadReckoningInitSnsCounterDr
+* ABSTRACT : Vehicle sensor SNS_COUNTER initialization function
+* FUNCTION : SNS_COUNTER data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningInitSnsCounterDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&(gst_snscounter_dr), 0x00, sizeof(DEADRECKONING_DATA_MASTER));
+ gst_snscounter_dr.ul_did = VEHICLE_DID_DR_SNS_COUNTER;
+ gst_snscounter_dr.us_size = VEHICLE_DSIZE_DR_SNS_COUNTER;
+ gst_snscounter_dr.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_snscounter_dr.dr_status = SENSORLOCATION_DRSTATUS_INVALID;
+ gst_snscounter_dr.uc_data[0] = VEHICLE_DINIT_DR_SNS_COUNTER;
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningSetSnsCounterDr
+* ABSTRACT : Vehicle sensor SNS_COUNTER SET function
+* FUNCTION : Update the SNS_COUNTER data master
+* ARGUMENT : *p_st_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 DeadReckoningSetSnsCounterDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_snscounter_dr;
+
+ /* Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ /* Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = p_st_data->dr_status;
+ memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ return (uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningGetSnsCounterDr
+* ABSTRACT : Vehicle sensor SNS_COUNTER GET function
+* FUNCTION : Provide the SNS_COUNTER data master
+* ARGUMENT : *p_st_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningGetSnsCounterDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_snscounter_dr;
+
+ /* Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status;
+ memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp
new file mode 100755
index 0000000..dc7022f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp
@@ -0,0 +1,116 @@
+/*
+ * @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 DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_speedpulsescalefactor_level; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief SpeedPulseScaleFactorLevel initialization function
+@outline SpeedPulseScaleFactorLevel initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitSpeedPulseScaleFactorLevelDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ (void)memset(reinterpret_cast<void *>(&gst_speedpulsescalefactor_level), 0x00,
+ sizeof(gst_speedpulsescalefactor_level));
+ gst_speedpulsescalefactor_level.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL;
+ gst_speedpulsescalefactor_level.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR_LEVEL;
+ gst_speedpulsescalefactor_level.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_speedpulsescalefactor_level.dr_status = 0U; /* Not used */
+}
+
+/************************************************************************
+@brief SpeedPulseScaleFactorLevel SET function
+@outline To update the master data SpeedPulseScaleFactorLevel
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetSpeedPulseScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = DEADRECKONING_EQ;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_speedpulsescalefactor_level;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data)), (size_t)(p_st_data->us_size));
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = 0U; /* Not used */
+
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data));
+ }
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief SpeedPulseScaleFactorLevel GET function
+@outline Master Data provides the SpeedPulseScaleFactorLevel
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetSpeedPulseScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_speedpulsescalefactor_level;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)),
+ (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size);
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp
new file mode 100755
index 0000000..cd27141
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp
@@ -0,0 +1,115 @@
+/*
+ * @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 DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_speedpulsescalefactor; // NOLINT(readability/nolint)
+
+/***********************************************************************
+@brief SpeedPulseScaleFactor initialization function
+@outline SpeedPulseScaleFactor initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitSpeedPulseScaleFactorDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ (void)memset(reinterpret_cast<void *>(&gst_speedpulsescalefactor), 0x00, sizeof(gst_speedpulsescalefactor));
+ gst_speedpulsescalefactor.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR;
+ gst_speedpulsescalefactor.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR;
+ gst_speedpulsescalefactor.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_speedpulsescalefactor.dr_status = 0U; /* Not used */
+}
+
+/*************************************************************************
+@brief SpeedPulseScaleFactor SET function
+@outline To update the master data SpeedPulseScaleFactor
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetSpeedPulseScaleFactorDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = DEADRECKONING_EQ;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_speedpulsescalefactor;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data) ), (size_t)(p_st_data->us_size));
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = 0U; /* Not used */
+
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)),
+ (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data));
+ }
+
+ return (uc_ret);
+}
+
+/************************************************************************
+@brief SpeedPulseScaleFactor GET function
+@outline Master Data provides the SpeedPulseScaleFactor
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetSpeedPulseScaleFactorDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ if (p_st_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n");
+ } else {
+ p_st_master = &gst_speedpulsescalefactor;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */
+ (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)),
+ (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size);
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp
new file mode 100755
index 0000000..b2b1f88
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp
@@ -0,0 +1,105 @@
+/*
+ * @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 DeadReckoning_Did_Speed.cpp
+@detail DeadReckoning data Master(VEHICLE_DID_DR_SPEED)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DeadReckoning_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static DEADRECKONING_DATA_MASTER gst_speed; // NOLINT(readability/nolint)
+
+/************************************************************************
+@brief Speed Dead Reckoning initialization function
+@outline Speed initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+**************************************************************************** */
+void DeadReckoningInitSpeedDr(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&(gst_speed), 0x00, sizeof(DEADRECKONING_DATA_MASTER));
+ gst_speed.ul_did = VEHICLE_DID_DR_SPEED;
+ gst_speed.us_size = VEHICLE_DSIZE_SPEED;
+ gst_speed.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF;
+ gst_speed.dr_status = SENSORMOTION_DRSTATUS_INVALID;
+ gst_speed.uc_data[0] = VEHICLE_DINIT_SPEED;
+}
+
+/************************************************************************
+@brief Speed Dead Reckoning SET function
+@outline To update the master data Speed.
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval DEADRECKONING_EQ : No data changes
+@retval DEADRECKONING_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 DeadReckoningSetSpeedDr(const DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_speed;
+
+ /** Compare data master and received data */
+ uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ /** Received data is set in the data master. */
+ p_st_master->ul_did = p_st_data->ul_did;
+ p_st_master->us_size = p_st_data->us_size;
+ p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ p_st_master->dr_status = p_st_data->dr_status;
+
+ memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size);
+
+ return (uc_ret);
+}
+
+/*************************************************************************
+@brief Speed Dead Reckoning GET function
+@outline Master Data provides the Speed
+@type Completion return type
+@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void DeadReckoningGetSpeedDr(DEADRECKONING_DATA_MASTER *p_st_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const DEADRECKONING_DATA_MASTER *p_st_master;
+
+ p_st_master = &gst_speed;
+
+ /** Store the data master in the specified destination. */
+ p_st_data->ul_did = p_st_master->ul_did;
+ p_st_data->us_size = p_st_master->us_size;
+ p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag;
+ p_st_data->dr_status = p_st_master->dr_status;
+ memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp
new file mode 100755
index 0000000..1d956b7
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp
@@ -0,0 +1,1086 @@
+/*
+ * @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 :DeadReckoning_Main.cpp
+ * System name :_CWORD107_
+ * Subsystem name :DeadReckoning Mains
+ * Program name :DeadReckoning Mains
+ * Module configuration :DeadReckoningInit() Guessed navigation initialization processing
+ * :DeadReckoningRcvMsg() DR Component MSG Receive Processing
+ ******************************************************************************/
+
+#include <positioning_hal.h>
+
+#include "DeadReckoning_main.h"
+
+#include "Sensor_Common_API.h"
+#include "DeadReckoning_DataMaster.h"
+#include "Dead_Reckoning_Local_Api.h"
+
+#include "DeadReckoning_DbgLogSim.h"
+
+#include "POS_private.h"
+
+static RET_API DeadReckoningWriteSharedMemory(VEHICLEDEBUG_MSG_LOGINFO_DAT* loginfo);
+static void DeadReckoningSetEvent(PNO pno, RET_API ret);
+static void DeadReckoningLinkSharedMemory(char *shared_memory_name, void **share_addr);
+
+#define DEAD_RECKONING_MAIN_DEBUG 0
+#define DR_DEBUG 0
+#define DR_DEBUG_ENG_MODE 0
+
+/*************************************************/
+/* Constant */
+/*************************************************/
+
+#define DEAD_RECKONING_BUF_SIZE 7
+#define DR_MASK_WORD_L 0x00FF
+#define DR_MASK_WORD_U 0xFF00
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/* Data receive confirmation flag */
+BOOL g_gps_data_get_flg = FALSE;
+BOOL g_sens_data_get_flg = FALSE;
+BOOL g_fst_sens_data_get_flg = FALSE;
+
+/* Reception flag for each data */
+BOOL g_sens_data_get_sns_cnt_flg = FALSE;
+BOOL g_sens_data_get_gyro_x_flg = FALSE;
+BOOL g_sens_data_get_gyro_y_flg = FALSE;
+BOOL g_sens_data_get_gyro_z_flg = FALSE;
+BOOL g_sens_data_get_rev_flg = FALSE;
+BOOL g_sens_data_get_spdpulse_flg = FALSE;
+BOOL g_sens_data_get_spdpulse_chk_flg = FALSE;
+
+BOOL g_sens_data_get_gyro_x_fst_flg = FALSE;
+BOOL g_sens_data_get_gyro_y_fst_flg = FALSE;
+BOOL g_sens_data_get_gyro_z_fst_flg = FALSE;
+BOOL g_sens_data_get_rev_fst_flg = FALSE;
+BOOL g_sens_data_get_spdpulse_fst_flg = FALSE;
+BOOL g_sens_data_get_spdpulse_chk_fst_flg = FALSE;
+
+/* Receive data storage buffer */
+/* [0]:SNS_COUNTER [1]:REV [2]:SPEED_PULSE_FLAG [3]:SPEED_PULSE [4]:GYRO_X [5]:GYRO_Y [6]:GYRO_Z */
+DEAD_RECKONING_RCVDATA_SENSOR g_sns_buf[DEAD_RECKONING_BUF_SIZE];
+DEAD_RECKONING_SAVEDATA_SENSOR_FIRST g_fst_sns_buf;
+
+/*******************************************************************************
+ * MODULE : DeadReckoningInit
+ * ABSTRACT : Guessed navigation initialization processing
+ * FUNCTION : Initialize inferred navigation processing
+ * ARGUMENT : None
+ * NOTE :
+ * RETURN : RET_NORMAL :Success in initialization
+ * RET_ERROR :Master Clear failed
+ ******************************************************************************/
+int32 DeadReckoningInit(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL;
+}
+
+/*******************************************************************************
+ * MODULE : DeadReckoningRcvMsg
+ * ABSTRACT : DR Component MSG Receive Processing
+ * FUNCTION : Receive the DR component MSG
+ * ARGUMENT : *msg : message buffer
+ * NOTE :
+ * RETURN : None
+ ******************************************************************************/
+void DeadReckoningRcvMsg(const DEAD_RECKONING_RCVDATA *msg, DEAD_RECKONING_LONLAT_INFO *location_info) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if ((msg == NULL) || (location_info == NULL)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "msg == NULL\r\n");
+ } else {
+ const SENSOR_MSG_GPSDATA_DAT *rcv_gps_msg = NULL;
+ const VEHICLESENS_DATA_MASTER *rcv_sensor_msg = NULL;
+ const VEHICLESENS_DATA_MASTER_FST *rcv_sensor_msg_fst = NULL;
+
+ Struct_GpsData send_gps_msg;
+ Struct_SensData send_sensor_msg;
+
+ /* Initialization */
+ (void)memset(reinterpret_cast<void *>(&send_gps_msg), 0, sizeof(Struct_GpsData));
+ (void)memset(reinterpret_cast<void *>(&send_sensor_msg), 0, sizeof(Struct_SensData));
+
+ /* Flag is set to FALSE */
+ location_info->calc_called = static_cast<u_int8>(FALSE);
+ location_info->available = static_cast<u_int8>(FALSE);
+
+ if (CID_DEAD_RECKONING_GPS_DATA == msg->hdr.hdr.cid) {
+ rcv_gps_msg = (const SENSOR_MSG_GPSDATA_DAT *)(&(msg->data[0]));
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+
+ /* Receiving GPS Data for DR */
+ switch (rcv_gps_msg->ul_did) {
+ case VEHICLE_DID_GPS_UBLOX_NAV_POSLLH :
+ case VEHICLE_DID_GPS_UBLOX_NAV_STATUS :
+ case VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC :
+ case VEHICLE_DID_GPS_UBLOX_NAV_VELNED :
+ case VEHICLE_DID_GPS_UBLOX_NAV_DOP :
+ case VEHICLE_DID_GPS_UBLOX_NAV_SVINFO :
+ case VEHICLE_DID_GPS_UBLOX_NAV_CLOCK :
+ {
+ g_gps_data_get_flg = TRUE;
+ break;
+ }
+ default:
+ break;
+ }
+ } else if (CID_DEAD_RECKONING_SENS_DATA == msg->hdr.hdr.cid) {
+ rcv_sensor_msg = (const VEHICLESENS_DATA_MASTER *)(&(msg->data[0]));
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+
+ /* Sensor data reception for DR */
+ switch (rcv_sensor_msg->ul_did) {
+ case POSHAL_DID_SNS_COUNTER :
+ {
+ g_sns_buf[0].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[0].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ g_sns_buf[0].data[0] = rcv_sensor_msg->uc_data[0];
+ g_sens_data_get_sns_cnt_flg = TRUE;
+ break;
+ }
+ case POSHAL_DID_REV :
+ {
+ g_sns_buf[1].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[1].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[1].data[0])),
+ (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size);
+ g_sens_data_get_rev_flg = TRUE;
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FLAG :
+ {
+ g_sns_buf[2].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[2].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[2].data[0])),
+ (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size);
+ g_sens_data_get_spdpulse_chk_flg = TRUE;
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE :
+ {
+ g_sns_buf[3].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[3].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[3].data[0])),
+ (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size);
+ g_sens_data_get_spdpulse_flg = TRUE;
+ break;
+ }
+ case POSHAL_DID_GYRO_X :
+ {
+ g_sns_buf[4].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[4].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[4].data[0])),
+ (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size);
+ g_sens_data_get_gyro_x_flg = TRUE;
+ break;
+ }
+ case POSHAL_DID_GYRO_Y :
+ {
+ g_sns_buf[5].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[5].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[5].data[0])),
+ (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size);
+ g_sens_data_get_gyro_y_flg = TRUE;
+ break;
+ }
+ case POSHAL_DID_GYRO_Z :
+ {
+ g_sns_buf[6].did = rcv_sensor_msg->ul_did;
+ g_sns_buf[6].size = static_cast<u_int8>(rcv_sensor_msg->us_size);
+ (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[6].data[0])),
+ (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size);
+ g_sens_data_get_gyro_z_flg = TRUE;
+ break;
+ }
+ default:
+ break;
+ }
+ } else if (CID_DEAD_RECKONING_SENS_FST_DATA == msg->hdr.hdr.cid) {
+ u_int16 rev_data_size;
+
+ rcv_sensor_msg_fst = (const VEHICLESENS_DATA_MASTER_FST *)(&(msg->data[0]));
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ rev_data_size = static_cast<u_int16>(msg->hdr.hdr.msgbodysize - VEHICLESENS_DELIVERY_FSTSNS_HDR_SIZE);
+
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " DID = %08X, rev_data_size = %d ",
+ rcv_sensor_msg_fst->ul_did, rev_data_size);
+#endif
+
+ /* Sensor data reception for DR */
+ switch (rcv_sensor_msg_fst->ul_did) {
+ case POSHAL_DID_REV_FST :
+ {
+ (void)memcpy(
+ reinterpret_cast<void *>(&(g_fst_sns_buf.rev_data[g_fst_sns_buf.rev_rcv_size
+ / sizeof(g_fst_sns_buf.rev_data[0])])),
+ (const void *)(&(rcv_sensor_msg_fst->uc_data[0])),
+ (size_t)(rev_data_size));
+
+ g_fst_sns_buf.rev_rcv_size = static_cast<u_int16>(
+ g_fst_sns_buf.rev_rcv_size + rev_data_size);
+
+ if (g_fst_sns_buf.rev_rcv_size == rcv_sensor_msg_fst->us_size) {
+ g_sens_data_get_rev_fst_flg = TRUE;
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " REV receive flag = TRUE ");
+#endif
+ }
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FLAG_FST :
+ {
+ (void)memcpy(
+ reinterpret_cast<void *>(&(g_fst_sns_buf.spd_pulse_check_data[g_fst_sns_buf.spd_pulse_check_rcv_size
+ / sizeof(g_fst_sns_buf.spd_pulse_check_data[0])])),
+ (const void *)(&(rcv_sensor_msg_fst->uc_data[0])),
+ (size_t)(rev_data_size));
+
+ g_fst_sns_buf.spd_pulse_check_rcv_size = static_cast<u_int16>(
+ g_fst_sns_buf.spd_pulse_check_rcv_size + rev_data_size);
+
+ if (g_fst_sns_buf.spd_pulse_check_rcv_size == rcv_sensor_msg_fst->us_size) {
+ g_sens_data_get_spdpulse_chk_fst_flg = TRUE;
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " SPF receive flag = TRUE ");
+#endif
+ }
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FST :
+ {
+ (void)memcpy(
+ reinterpret_cast<void *>(&(g_fst_sns_buf.spd_pulse_data[g_fst_sns_buf.spd_pulse_rcv_size
+ / sizeof(g_fst_sns_buf.spd_pulse_data[0])])),
+ (const void *)(&(rcv_sensor_msg_fst->uc_data[0])),
+ (size_t)(rev_data_size));
+
+ g_fst_sns_buf.spd_pulse_rcv_size = static_cast<u_int16>(g_fst_sns_buf.spd_pulse_rcv_size + \
+ rev_data_size);
+
+ if (g_fst_sns_buf.spd_pulse_rcv_size == rcv_sensor_msg_fst->us_size) {
+ g_sens_data_get_spdpulse_fst_flg = TRUE;
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " SP receive flag = TRUE ");
+#endif
+ }
+ break;
+ }
+ case POSHAL_DID_GYRO_X_FST :
+ {
+ (void)memcpy(
+ reinterpret_cast<void *>(&(g_fst_sns_buf.gyro_x_data[g_fst_sns_buf.gyro_x_rcv_size
+ / sizeof(g_fst_sns_buf.gyro_x_data[0])])),
+ (const void *)(&(rcv_sensor_msg_fst->uc_data[0])),
+ (size_t)(rev_data_size));
+
+ g_fst_sns_buf.gyro_x_rcv_size = static_cast<u_int16>(g_fst_sns_buf.gyro_x_rcv_size + rev_data_size);
+
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ " g_fst_sns_buf.gyro_x_rcv_size = %d, rcv_sensor_msg_fst->us_size = %d ",
+ g_fst_sns_buf.gyro_x_rcv_size, rcv_sensor_msg_fst->us_size);
+#endif
+ if (g_fst_sns_buf.gyro_x_rcv_size == rcv_sensor_msg_fst->us_size) {
+ g_sens_data_get_gyro_x_fst_flg = TRUE;
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " GYRO_X receive flag = TRUE ");
+#endif
+ }
+ break;
+ }
+ case POSHAL_DID_GYRO_Y_FST :
+ {
+ (void)memcpy(
+ reinterpret_cast<void *>(&(g_fst_sns_buf.gyro_y_data[g_fst_sns_buf.gyro_y_rcv_size
+ / sizeof(g_fst_sns_buf.gyro_y_data[0])])),
+ (const void *)(&(rcv_sensor_msg_fst->uc_data[0])),
+ (size_t)(rev_data_size));
+
+ g_fst_sns_buf.gyro_y_rcv_size = static_cast<u_int16>(g_fst_sns_buf.gyro_y_rcv_size + rev_data_size);
+
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ " g_fst_sns_buf.gyro_y_rcv_size = %d, rcv_sensor_msg_fst->us_size = %d ",
+ g_fst_sns_buf.gyro_y_rcv_size, rcv_sensor_msg_fst->us_size);
+#endif
+ if (g_fst_sns_buf.gyro_y_rcv_size == rcv_sensor_msg_fst->us_size) {
+ g_sens_data_get_gyro_y_fst_flg = TRUE;
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " GYRO_Y receive flag = TRUE ");
+#endif
+ }
+ break;
+ }
+ case POSHAL_DID_GYRO_Z_FST :
+ {
+ (void)memcpy(
+ reinterpret_cast<void *>(&(g_fst_sns_buf.gyro_z_data[g_fst_sns_buf.gyro_z_rcv_size
+ / sizeof(g_fst_sns_buf.gyro_z_data[0])])),
+ (const void *)(&(rcv_sensor_msg_fst->uc_data[0])),
+ (size_t)(rev_data_size));
+
+ g_fst_sns_buf.gyro_z_rcv_size = static_cast<u_int16>(g_fst_sns_buf.gyro_z_rcv_size + rev_data_size);
+
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ " g_fst_sns_buf.gyro_z_rcv_size = %d, rcv_sensor_msg_fst->us_size = %d ",
+ g_fst_sns_buf.gyro_z_rcv_size, rcv_sensor_msg_fst->us_size);
+#endif
+ if (g_fst_sns_buf.gyro_z_rcv_size == rcv_sensor_msg_fst->us_size) {
+ g_sens_data_get_gyro_z_fst_flg = TRUE;
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " GYRO_Z receive flag = TRUE ");
+#endif
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ } else {
+ /* nop */
+ }
+
+ /* 4 data received? */
+ if ((g_sens_data_get_sns_cnt_flg == TRUE) &&
+ (g_sens_data_get_rev_flg == TRUE) &&
+ (g_sens_data_get_gyro_x_flg == TRUE) &&
+ (g_sens_data_get_gyro_y_flg == TRUE) &&
+ (g_sens_data_get_gyro_z_flg == TRUE) &&
+ (g_sens_data_get_spdpulse_flg == TRUE) &&
+ (g_sens_data_get_spdpulse_chk_flg == TRUE)) {
+ /* Sensor data acquisition flag ON */
+ g_sens_data_get_flg = TRUE;
+
+ /* Set all flags to FALSE */
+ g_sens_data_get_sns_cnt_flg = FALSE;
+ g_sens_data_get_gyro_x_flg = FALSE;
+ g_sens_data_get_gyro_y_flg = FALSE;
+ g_sens_data_get_gyro_z_flg = FALSE;
+ g_sens_data_get_rev_flg = FALSE;
+ g_sens_data_get_spdpulse_flg = FALSE;
+ g_sens_data_get_spdpulse_chk_flg = FALSE;
+ }
+
+ /* 4 data received? */
+ if ((g_sens_data_get_rev_fst_flg == TRUE) &&
+ (g_sens_data_get_gyro_x_fst_flg == TRUE) &&
+ (g_sens_data_get_gyro_y_fst_flg == TRUE) &&
+ (g_sens_data_get_gyro_z_fst_flg == TRUE) &&
+ (g_sens_data_get_spdpulse_fst_flg == TRUE) &&
+ (g_sens_data_get_spdpulse_chk_fst_flg == TRUE)) {
+ /* Initial sensor data acquisition flag ON */
+ g_fst_sens_data_get_flg = TRUE;
+
+ /* Set all flags to FALSE */
+ g_sens_data_get_gyro_x_fst_flg = FALSE;
+ g_sens_data_get_gyro_y_fst_flg = FALSE;
+ g_sens_data_get_gyro_z_fst_flg = FALSE;
+ g_sens_data_get_rev_fst_flg = FALSE;
+ g_sens_data_get_spdpulse_fst_flg = FALSE;
+ g_sens_data_get_spdpulse_chk_fst_flg = FALSE;
+ }
+
+ DeadReckoningRcvMsgFstSens(msg, location_info, rcv_gps_msg, &send_gps_msg, &send_sensor_msg);
+ }
+}
+
+void DeadReckoningRcvMsgFstSens(const DEAD_RECKONING_RCVDATA *msg, DEAD_RECKONING_LONLAT_INFO *location_info,
+ const SENSOR_MSG_GPSDATA_DAT *rcv_gps_msg, Struct_GpsData* send_gps_msg,
+ Struct_SensData* send_sensor_msg) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Verifying Debug Log Simulator Mode
+ Perform packet reading here to match some timing.
+ However,,Differ between GPS and SENSOR.
+ */
+ u_int8 fst_sens_send_num = 0U;
+ /* For GPS data */
+ if (g_gps_data_get_flg == TRUE) {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "DeadReckoningRcvMsg SEND GPS_DATA: DID[0x%08X] DSIZE[%d] MSG_SIZE[%d] SNS_CNT[%d] \r\n",
+ rcv_gps_msg.ulDid, rcv_gps_msg.ucData[4], msg->hdr.hdr.msgbodysize, rcv_gps_msg.ucSnsCnt);
+#endif
+
+ if (1) {
+ rcv_gps_msg = (const SENSOR_MSG_GPSDATA_DAT *)(&(msg->data[0]));
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+
+ /* Set and pass the data part except header/footer */
+ send_gps_msg->sens_cnt = rcv_gps_msg->uc_sns_cnt;
+ send_gps_msg->sens_cnt_flag = rcv_gps_msg->uc_gps_cnt_flag;
+ send_gps_msg->gps_data_size = rcv_gps_msg->us_size;
+ send_gps_msg->did = rcv_gps_msg->ul_did;
+ send_gps_msg->gps_data = (const void *)(&rcv_gps_msg->uc_data[0]);
+ }
+
+ /* Providing GPS data to DR_Lib */
+
+ g_gps_data_get_flg = FALSE;
+
+ } else if (g_sens_data_get_flg == TRUE) {
+ Struct_DR_DATA rcv_dr_data;
+ DR_CALC_INFO rcv_dr_calc_info;
+ DEADRECKONING_DATA_MASTER send_data_master;
+
+ if (1) {
+ /* Each data is stored in the data format for transmission. */
+ send_sensor_msg->sens_cnt_flag = 1U;
+ send_sensor_msg->sens_cnt = g_sns_buf[0].data[0];
+ send_sensor_msg->pulse_rev_tbl.reverse_flag = g_sns_buf[1].data[0];
+ send_sensor_msg->pulse_rev_tbl.pulse_flag = g_sns_buf[2].data[0];
+ send_sensor_msg->pulse_rev_tbl.pulse_sum_cyclic = static_cast<u_int16>(
+ ((((u_int16)g_sns_buf[3].data[0] << 0) & DR_MASK_WORD_L) |
+ (((u_int16)g_sns_buf[3].data[1] << 8) & DR_MASK_WORD_U)));
+ /* ToDo */
+ (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_x_tbl.gyro_data[0])),
+ (const void *)(&(g_sns_buf[4].data[0])), sizeof(u_int16) * NUM_OF_100msData);
+ (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_y_tbl.gyro_data[0])),
+ (const void *)(&(g_sns_buf[5].data[0])), sizeof(u_int16) * NUM_OF_100msData);
+ (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_z_tbl.gyro_data[0])),
+ (const void *)(&(g_sns_buf[6].data[0])), sizeof(u_int16) * NUM_OF_100msData);
+ }
+
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg SEND SENSOR_COUNTER %d \r\n",
+ send_sensor_msg->sens_cnt);
+#endif
+
+ /* When the sensor data are ready, Call the DR-calculation process. */
+ memset(&rcv_dr_data, 0x00, sizeof(rcv_dr_data)); /* Coverity CID:18805 compliant */
+ memset(&rcv_dr_calc_info, 0x00, sizeof(rcv_dr_calc_info)); /* Coverity CID:18806 compliant */
+
+ location_info->calc_called = static_cast<u_int8>(TRUE);
+ location_info->lonlat.latitude = static_cast<int32>(rcv_dr_data.latitude);
+ location_info->lonlat.longitude = static_cast<int32>(rcv_dr_data.longitude);
+
+ if (rcv_dr_data.dr_status != static_cast<u_int8>(SENSORLOCATION_DRSTATUS_INVALID)) {
+ location_info->available = static_cast<u_int8>(TRUE);
+ } else {
+ location_info->available = static_cast<u_int8>(FALSE);
+ }
+
+ /* Changing the order of registration and delivery of the out structure to the data master for DR */
+
+ send_data_master.ul_did = VEHICLE_DID_DR_SNS_COUNTER;
+ send_data_master.us_size = VEHICLE_DSIZE_DR_SNS_COUNTER;
+ send_data_master.uc_rcv_flag = 1;
+ send_data_master.dr_status = rcv_dr_data.dr_status;
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ (const void *)(&(rcv_dr_data.positioning_time)), (size_t)VEHICLE_DSIZE_DR_SNS_COUNTER);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_LONGITUDE;
+ send_data_master.us_size = VEHICLE_DSIZE_LONGITUDE;
+ send_data_master.uc_rcv_flag = 1;
+ send_data_master.dr_status = rcv_dr_data.dr_status;
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ (const void *)(&(rcv_dr_data.longitude)), (size_t)VEHICLE_DSIZE_LONGITUDE);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_LATITUDE;
+ send_data_master.us_size = VEHICLE_DSIZE_LATITUDE;
+ send_data_master.uc_rcv_flag = 1;
+ send_data_master.dr_status = rcv_dr_data.dr_status;
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ (const void *)(&(rcv_dr_data.latitude)), (size_t)VEHICLE_DSIZE_LATITUDE);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_ALTITUDE;
+ send_data_master.us_size = VEHICLE_DSIZE_ALTITUDE;
+ send_data_master.uc_rcv_flag = 1;
+ send_data_master.dr_status = rcv_dr_data.dr_status;
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ (const void *)(&(rcv_dr_data.altitude)), (size_t)VEHICLE_DSIZE_ALTITUDE);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_SPEED;
+ send_data_master.us_size = VEHICLE_DSIZE_SPEED;
+ send_data_master.uc_rcv_flag = 1;
+ send_data_master.dr_status = rcv_dr_data.dr_status;
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ (const void *)(&(rcv_dr_data.rate)), (size_t)VEHICLE_DSIZE_SPEED);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_HEADING;
+ send_data_master.us_size = VEHICLE_DSIZE_HEADING;
+ send_data_master.uc_rcv_flag = 1;
+ send_data_master.dr_status = rcv_dr_data.dr_status;
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ (const void *)(&(rcv_dr_data.heading)), (size_t)VEHICLE_DSIZE_HEADING);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ /* Data master setting,Data delivery(GyroParameter) */
+ /* As it is registered for delivery with DID = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL */
+ /* Process in GyroOffset-> GyroScaleFactor-> GyroScelFactorLevel order(Processing order cannot be changed.) */
+ send_data_master.ul_did = VEHICLE_DID_DR_GYRO_OFFSET;
+ send_data_master.us_size = VEHICLE_DSIZE_GYRO_OFFSET;
+ send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ send_data_master.dr_status = 0U; /* Not used */
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ reinterpret_cast<void *>(&(rcv_dr_calc_info.gyro_offset)), (size_t)send_data_master.us_size);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR;
+ send_data_master.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR;
+ send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ send_data_master.dr_status = 0U; /* Not used */
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ reinterpret_cast<void *>(&(rcv_dr_calc_info.gyro_scale_factor)),
+ (size_t)send_data_master.us_size);
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL;
+ send_data_master.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR_LEVEL;
+ send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ send_data_master.dr_status = 0U; /* Not used */
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ reinterpret_cast<void *>(&(rcv_dr_calc_info.gyro_scale_factor_level)),
+ (size_t)(send_data_master.us_size));
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ /* Data master setting,Data delivery(SpeedPulseParameter) */
+ /* As it is registered for delivery with DID = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL */
+ /* Process in SpeedPulseScaleFactor-> SpeedPulseScaleFactorLevel order(Processing order cannot be changed.) */
+ send_data_master.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR;
+ send_data_master.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR;
+ send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ send_data_master.dr_status = 0U; /* Not used */
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ reinterpret_cast<void *>(&(rcv_dr_calc_info.speed_pulse_scale_factor)),
+ (size_t)(send_data_master.us_size));
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ send_data_master.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL;
+ send_data_master.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR_LEVEL;
+ send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON;
+ send_data_master.dr_status = 0U; /* Not used */
+ (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])),
+ reinterpret_cast<void *>(&(rcv_dr_calc_info.speed_pulse_scale_factor_level)),
+ (size_t)(send_data_master.us_size));
+ DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc);
+
+ g_sens_data_get_flg = FALSE;
+ } else if (g_fst_sens_data_get_flg == TRUE) {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg FstSnsData -> DeadReckoningLibrary. \r\n");
+#endif
+ for (fst_sens_send_num = 0; fst_sens_send_num < g_fst_sns_buf.data_num; fst_sens_send_num++) {
+ /* Each data is stored in the data format for transmission. */
+ send_sensor_msg->sens_cnt_flag = 0U;
+ send_sensor_msg->sens_cnt = 0U;
+ send_sensor_msg->pulse_rev_tbl.reverse_flag = g_fst_sns_buf.rev_data[fst_sens_send_num];
+ send_sensor_msg->pulse_rev_tbl.pulse_flag = g_fst_sns_buf.spd_pulse_check_data[fst_sens_send_num];
+ send_sensor_msg->pulse_rev_tbl.pulse_sum_cyclic = g_fst_sns_buf.spd_pulse_data[fst_sens_send_num];
+ (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_x_tbl.gyro_data[0])),
+ (const void *)(&(g_fst_sns_buf.gyro_x_data[fst_sens_send_num * NUM_OF_100msData])),
+ (size_t)((sizeof(g_fst_sns_buf.gyro_x_data[fst_sens_send_num])) * NUM_OF_100msData));
+ (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_y_tbl.gyro_data[0])),
+ (const void *)(&(g_fst_sns_buf.gyro_y_data[fst_sens_send_num * NUM_OF_100msData])),
+ (size_t)((sizeof(g_fst_sns_buf.gyro_y_data[fst_sens_send_num])) * NUM_OF_100msData));
+ (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_z_tbl.gyro_data[0])),
+ (const void *)(&(g_fst_sns_buf.gyro_z_data[fst_sens_send_num * NUM_OF_100msData])),
+ (size_t)((sizeof(g_fst_sns_buf.gyro_z_data[fst_sens_send_num])) * NUM_OF_100msData));
+
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg send_sensor_msg.sens_cnt_flag %d \r\n",
+ send_sensor_msg->sens_cnt_flag);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg SEND SENSOR_COUNTER %d \r\n",
+ send_sensor_msg->sens_cnt);
+#endif
+
+ /* Sleep to reduce CPU load */
+ MilliSecSleep(DR_FST_SENS_CALC_SLEEP_TIME);
+
+ /* When the sensor data are ready, Call the DR-calculation process. */
+ }
+
+ g_sens_data_get_flg = FALSE;
+
+ g_fst_sens_data_get_flg = FALSE;
+
+ } else {
+ /* nop */
+ }
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningGetDRData
+* ABSTRACT : Vehicle sensor information acquisition
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningGetDRData(const DEADRECKONING_MSG_GET_DR_DATA *msg) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ void *share_top; /* Start address of shared memory */
+ u_int32 share_size; /* Size of shared memory area */
+ RET_API ret_api;
+ int32 ret;
+ int32 event_val = VEHICLE_RET_NORMAL;
+ EventID event_id;
+ DEADRECKONING_DATA_MASTER dr_master; /* GPS Data Master */
+
+ DEADRECKONING_MSG_GET_DR_DATA msg_buf;
+
+ /* Defines the data master for each API. */
+ SENSORLOCATION_MSG_LONLATINFO_DAT msg_lonlat_info;
+ SENSORLOCATION_MSG_ALTITUDEINFO_DAT msg_altitude_info;
+ SENSORMOTION_MSG_SPEEDINFO_DAT msg_speed_info;
+ SENSORMOTION_MSG_HEADINGINFO_DAT msg_heading_info;
+
+ (void)memset(reinterpret_cast<void *>(&msg_buf), 0, sizeof(DEADRECKONING_MSG_GET_DR_DATA));
+ memcpy(&(msg_buf), msg, sizeof(DEADRECKONING_MSG_GET_DR_DATA));
+
+ /* Check the DID */
+ ret = DeadReckoningCheckDid(msg_buf.data.did);
+
+ if (VEHICLESENS_INVALID != ret) {
+ /* DID normal */
+
+ /* Link to shared memory */
+ ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME), &share_top, &share_size);
+ if (RET_NORMAL == ret_api) {
+ /* Acquire the specified data from the data master. */
+ (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER));
+ DeadReckoningGetDataMaster(msg_buf.data.did, &dr_master);
+
+ /* Align data from the data master for API I/F */
+ switch ((u_int32)(msg_buf.data.did)) {
+ /* Describes the process for each DID. */
+ case VEHICLE_DID_DR_LATITUDE:
+ {
+ (void)memset(reinterpret_cast<void *>(&msg_lonlat_info),
+ 0, sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT));
+
+ /* Size storage(LATITUDE) */
+ msg_lonlat_info.size = static_cast<u_int16>(sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT));
+
+ /* DR status setting */
+ msg_lonlat_info.dr_status = dr_master.dr_status;
+
+ /* The DR enable flag is set to DR status. */
+ msg_lonlat_info.is_exist_dr = dr_master.dr_status;
+
+ /* Set the Latitude */
+ memcpy(&(msg_lonlat_info.latitude), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Obtain the data master Longitude */
+ (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER));
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_LONGITUDE, &dr_master);
+
+ /* Set the Longitude */
+ memcpy(&(msg_lonlat_info.longitude), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER));
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master);
+
+ /* Set the SensorCnt */
+ memcpy(&(msg_lonlat_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Write data master to shared memory */
+ PosSetShareData(share_top,
+ msg_buf.data.offset,
+ (const void *)&msg_lonlat_info,
+ sizeof(msg_lonlat_info));
+
+ /* Set Successful Completion */
+ event_val = VEHICLE_RET_NORMAL;
+
+ break;
+ }
+ case VEHICLE_DID_DR_ALTITUDE:
+ {
+ (void)memset(reinterpret_cast<void *>(&msg_altitude_info),
+ 0, sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT));
+
+ msg_altitude_info.size = static_cast<u_int16>(sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT));
+ /* The DR enable flag is set to DR status. */
+ msg_altitude_info.is_exist_dr = dr_master.dr_status;
+ msg_altitude_info.dr_status = dr_master.dr_status;
+
+ /* Set the Speed */
+ memcpy(&(msg_altitude_info.altitude), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER));
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master);
+
+ /* Set the SensorCnt */
+ memcpy(&(msg_altitude_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Write data master to shared memory */
+ PosSetShareData(share_top,
+ msg_buf.data.offset,
+ (const void *)&msg_altitude_info,
+ sizeof(msg_altitude_info));
+
+ /* Set Successful Completion */
+ event_val = VEHICLE_RET_NORMAL;
+
+ break;
+ }
+ case VEHICLE_DID_DR_SPEED:
+ {
+ (void)memset(reinterpret_cast<void *>(&msg_speed_info),
+ 0, sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT));
+
+ msg_speed_info.size = static_cast<u_int16>(sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT));
+ /* The DR enable flag is set to DR status. */
+ msg_speed_info.is_exist_dr = dr_master.dr_status;
+ msg_speed_info.dr_status = dr_master.dr_status;
+
+ /* Set the Speed */
+ memcpy(&(msg_speed_info.speed), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER));
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master);
+ /* Set the SensorCnt */
+ memcpy(&(msg_speed_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Write data master to shared memory */
+ PosSetShareData(share_top,
+ msg_buf.data.offset,
+ (const void *)&msg_speed_info,
+ sizeof(msg_speed_info));
+
+ /* Set Successful Completion */
+ event_val = VEHICLE_RET_NORMAL;
+
+ break;
+ }
+ case VEHICLE_DID_DR_HEADING:
+ {
+ (void)memset(reinterpret_cast<void *>(&msg_heading_info),
+ 0, sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT));
+
+ msg_heading_info.size = static_cast<u_int16>(sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT));
+ /* The DR enable flag is set to DR status. */
+ msg_heading_info.is_exist_dr = dr_master.dr_status;
+ msg_heading_info.dr_status = dr_master.dr_status;
+
+ /* Set the Heading */
+ memcpy(&(msg_heading_info.heading), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Acquire data master SensorCnt */
+ (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER));
+ DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master);
+ /* Set the SensorCnt */
+ memcpy(&(msg_heading_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size);
+
+ /* Write data master to shared memory */
+ PosSetShareData(share_top,
+ msg_buf.data.offset,
+ (const void *)&msg_heading_info,
+ sizeof(msg_heading_info));
+ /* Set Successful Completion */
+ event_val = VEHICLE_RET_NORMAL;
+
+ break;
+ }
+ /* Other than the above */
+ default:
+ /* Do not edit. */
+ break;
+ }
+
+ /* Check the data size */
+ if (msg_buf.data.size < dr_master.us_size) {
+ /* Shared memory error(Insufficient storage size) */
+ event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ }
+ } else {
+ /* Shared memory error */
+ event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ }
+ } else {
+ /* DID error */
+ event_val = VEHICLE_RET_ERROR_DID;
+ }
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(msg_buf.data.pno);
+
+ /* Publish Events */
+ ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val);
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningSetMapMatchingData
+* ABSTRACT : Map-Matching information setting
+* FUNCTION : Setting Map-Matching Information
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningSetMapMatchingData(const DR_MSG_MAP_MATCHING_DATA *msg) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningClearBackupData
+* ABSTRACT : Backup data clear function CALL
+* FUNCTION : Call the backup data clear function.
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void DeadReckoningClearBackupData(const DR_MSG_CLEAR_BACKUP_DATA *msg) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ char event_name[32]; /* Event name character string buffer */
+ EventID event_id; /* Event ID */
+ int32 event_val; /* Event value to set*/
+ RET_API ret_api; /* System API return value */
+
+ if (msg != NULL) {
+ /* DR backup data initialization function call */
+ event_val = RET_NORMAL;
+
+ /* Initialization of event name character string buffer */
+ (void)memset(reinterpret_cast<void *>(event_name), 0, sizeof(event_name));
+
+ /* Event name creation */
+ snprintf(event_name, sizeof(event_name), "DR_API_%X", msg->hdr.hdr.sndpno);
+ /* Match DR_API.cpp side with name */
+
+ /* Event Generation */
+ event_id = _pb_CreateEvent(_CWORD64_EVENT_MANUALRESET_OFF, DR_EVENT_VAL_INIT, event_name);
+
+ if (event_id != 0) {
+ /* For successful event generation */
+ /* Set the event */
+ ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val);
+
+ if (ret_api == RET_NORMAL) {
+ /* Successful event set */
+ } else {
+ /* Event set failed */
+ /* Delete Event and Return Event Generation Failed */
+ ret_api = _pb_DeleteEvent(event_id);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent Failed\r\n");
+ }
+ }
+ }
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningSetEvent
+* ABSTRACT : Set of events
+* FUNCTION : Set event to return successful or unsuccessful log configuration retrieval
+* ARGUMENT : PNO pno : Caller Pno
+* : RET_API ret : Log setting acquisition Success/Fail
+* : RET_NORMAL: Log setting acquisition success
+* : RET_ERROR: Log setting acquisition failure
+* NOTE :
+* RETURN : None
+******************************************************************************/
+static void DeadReckoningSetEvent(PNO pno, RET_API ret) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ char event_name[32]; /* Event name character string buffer */
+ EventID event_id; /* Event ID */
+ RET_API ret_api; /* System API return value */
+
+ /* Initialization of event name character string buffer */
+ (void)memset(reinterpret_cast<void *>(event_name), 0, sizeof(event_name));
+
+ /* Event name creation */
+ snprintf(event_name, sizeof(event_name), "VehicleDebug_%X", pno);
+ /* Event name should match VehicleDebug_API.cpp */
+
+ /* Event Generation */
+ event_id = _pb_CreateEvent(_CWORD64_EVENT_MANUALRESET_OFF, VEHICLEDEBUG_EVENT_VAL_INIT, event_name);
+
+ if (event_id != 0) {
+ /* For successful event generation */
+ /* Set the event */
+ ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, ret);
+
+ if (ret_api == RET_NORMAL) {
+ /* Successful event set */
+ } else {
+ /* Event set failed */
+ /* Delete Event */
+ ret_api = _pb_DeleteEvent(event_id);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent Failed\r\n");
+ }
+ }
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningLinkSharedMemory
+* ABSTRACT : Shared memory link
+* FUNCTION : Link to shared memory
+* ARGUMENT : char *shared_memory_name : Name of shared memory to link
+* : void **share_addr : Pointer to a variable that stores the address of the linked shared memory.
+* NOTE :
+* RETURN : None
+******************************************************************************/
+static void DeadReckoningLinkSharedMemory(char *shared_memory_name, void **share_addr) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api;
+ void *pv_share_mem; /* Store Shared Memory Address */
+ u_int32 share_mem_size; /* Size of the linked shared memory */
+
+ if ((shared_memory_name != NULL) && (share_addr != NULL)) {
+ /* Link to the handle storage area */
+ ret_api = _pb_LinkShareData(shared_memory_name, &pv_share_mem, &share_mem_size);
+
+ if (ret_api == RET_NORMAL) {
+ /* If the link is successful */
+ if (share_mem_size == VEHICLEDEBUG_MSGBUF_DSIZE) {
+ /* When the size of the linked shared memory is correct */
+ *share_addr = pv_share_mem; /* Set the address */
+ } else {
+ /* The size of the linked shared memory is incorrect. */
+ *share_addr = NULL;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Bad shared memory size\r\n");
+ }
+ } else {
+ /* If the link fails */
+ *share_addr = NULL;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Can't link shared memory\r\n");
+ }
+ }
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningWriteSharedMemory
+* ABSTRACT : Write Shared Memory
+* FUNCTION : Write Shared Memory
+* ARGUMENT : VEHICLEDEBUG_MSG_LOGINFO_DAT* loginfo : Logging information
+* RETURN : RET_API : Whether writing to shared memory was successful
+* : : RET_NORMAL Success
+* : : RET_ERROR Failed
+* NOTE :
+******************************************************************************/
+static RET_API DeadReckoningWriteSharedMemory(VEHICLEDEBUG_MSG_LOGINFO_DAT* loginfo) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static VEHICLEDEBUG_MSG_LOGINFO_DAT *share_addr = NULL; /* Store Shared Memory Address */
+ static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */
+
+ RET_API ret = RET_NORMAL; /* Return of the functions */
+ RET_API ret_api; /* Return of the functions */
+
+#if DEAD_RECKONING_MAIN_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Call %s\r\n", __func__);
+#endif
+
+ /* Get Semaphore ID */
+ if (sem_id == 0) {
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(SENSOR_LOG_SETTING_SEMAPHO_NAME));
+ }
+
+ if (sem_id != 0) {
+ /* Semaphore ID successfully acquired */
+ ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */
+
+ if (ret_api == RET_NORMAL) {
+ /* Semaphore lock successful */
+
+ /* When the shared memory is not linked */
+ if (share_addr == NULL) {
+ /* Link to shared memory */
+ DeadReckoningLinkSharedMemory(const_cast<char *>(LOG_SETTING_SHARE_MEMORY_NAME),
+ reinterpret_cast<void **>(&share_addr));
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ }
+
+ if (share_addr != NULL) {
+ /* The link to shared memory is successful. */
+ /* Writing Data to Shared Memory */
+ share_addr->log_sw = loginfo->log_sw;
+ (void)memcpy(reinterpret_cast<void *>(share_addr->severity),
+ (const void *)(loginfo->severity), sizeof(share_addr->severity));
+ } else {
+ /* Failed to link to shared memory */
+ ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "DeadReckoningLinkSharedMemory Failed");
+ }
+ /* Semaphore unlock */
+ (void)_pb_SemUnlock(sem_id);
+ } else {
+ /* Semaphore lock failed */
+ ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock Failed");
+ }
+ } else {
+ ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0");
+ }
+
+ return ret;
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningGetLocationLogStatus
+* ABSTRACT : CALL of functions for acquiring logging settings
+* FUNCTION : Call the log setting acquisition function.
+* ARGUMENT : None
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningGetLocationLogStatus(PNO pno) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api; /* System API return value */
+ RET_API ret;
+ VEHICLEDEBUG_MSG_LOGINFO_DAT loginfo; /* Logging information */
+ BOOL log_sw = FALSE;
+
+ /* CALL of functions for acquiring logging settings */
+ ret_api = RET_NORMAL;
+
+ if (ret_api == RET_NORMAL) {
+ /* Log setting acquisition function succeeded */
+ loginfo.log_sw = (u_int32)(log_sw);
+
+ /* Write to shared memory */
+ ret = DeadReckoningWriteSharedMemory(&loginfo);
+
+ /* Event publishing */
+ DeadReckoningSetEvent(pno, ret);
+ } else {
+ /* Log setting acquisition function failed */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "GetLocationLogSetting Failed");
+
+ /* Event publishing */
+ DeadReckoningSetEvent(pno, RET_ERROR);
+ }
+}
+
+/*******************************************************************************
+* MODULE : DeadReckoningSetLocationLogStatus
+* ABSTRACT : CALL of log-setting-request-function
+* FUNCTION : Call the log setting request function.
+* ARGUMENT : u_int32 log_sw : Log type
+* : u_int8 severity : Output level
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void DeadReckoningSetLocationLogStatus(BOOL log_sw, u_int8 severity) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/GpsInt.cpp b/vehicleservice/positioning/server/src/Sensor/GpsInt.cpp
new file mode 100755
index 0000000..75fb890
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/GpsInt.cpp
@@ -0,0 +1,171 @@
+/*
+ * @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 :GpsInt.cpp
+ * System name :PastModel002
+ * Subsystem name :GPS interrupt thread
+ ******************************************************************************/
+
+/*******************************************************************************
+* Include File
+*******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "POS_private.h"
+#include "GpsInt.h"
+
+#define RD_REG32(reg) \
+ (*(volatile ULONG * const)(reg))
+
+#define COMREGMSK_OR 1
+#define ALLINTMASK 0x0f
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void com_regmsk_dword(ULONG *, ULONG, UCHAR, UCHAR); // NOLINT(readability/nolint)
+#ifdef __cplusplus
+}
+#endif
+
+/*******************************************************************************
+* Define
+*******************************************************************************/
+#define GPS_INT_THREAD_DEBUG_SWITCH 0 /* 0:OFF 1:ON */
+
+/*******************************************************************************
+* Global Parameter
+*******************************************************************************/
+GPS_INT_DATA g_gps_int_data;
+
+/*******************************************************************************
+* Module
+*******************************************************************************/
+/*******************************************************************************
+ * MODULE : DEVGpsIntUnMapDevice
+ * ABSTRACT : Register mapping release processing
+ * FUNCTION : Release the register mapping
+ * ARGUMENT : None
+ * NOTE :
+ * RETURN : None
+ ******************************************************************************/
+void DEVGpsIntUnMapDevice(void) {
+ /* Release GPIO Register Mapping */
+ if ((g_gps_int_data.irq_status_reg != 0)
+ || (g_gps_int_data.irq_status_set_reg != 0)
+ || (g_gps_int_data.rising_detect_reg != 0)) {
+ /* When GPIO registers are mapped */
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ MunMapDeviceIo((HANDLE)g_gps_int_data.irq_status_reg, sizeof(g_gps_int_data.irq_status_reg));
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ MunMapDeviceIo((HANDLE)g_gps_int_data.irq_status_set_reg, sizeof(g_gps_int_data.irq_status_set_reg));
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ MunMapDeviceIo((HANDLE)g_gps_int_data.rising_detect_reg, sizeof(g_gps_int_data.rising_detect_reg));
+
+ g_gps_int_data.irq_status_reg = 0;
+ g_gps_int_data.irq_status_set_reg = 0;
+ g_gps_int_data.rising_detect_reg = 0;
+ }
+}
+
+/*******************************************************************************
+ * MODULE : DEVGpsIntSetInterupt
+ * ABSTRACT : GPS interrupt setting
+ * FUNCTION : Setting GPS Interrupt
+ * ARGUMENT : None
+ * NOTE :
+ * RETURN : TRUE : Interrupt setting success
+ * : FALSE : Interrupt setting failure
+ ******************************************************************************/
+void DEVGpsIntSetInterupt(void) {
+#if GPS_INT_THREAD_DEBUG_SWITCH
+ /* Dummy read */
+ itr_ret = RD_REG32(g_gps_int_data.irq_status_set_reg);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS_SET reg value(before) = 0x%08X ", itr_ret);
+#endif
+
+ /* GPS interrupt Enable setting */
+ /* Dummy read */
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ (void)RD_REG32(g_gps_int_data.irq_status_set_reg);
+
+#if GPS_INT_THREAD_DEBUG_SWITCH
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS_SET reg value(after) = 0x%08X ", itr_ret);
+#endif
+
+
+
+#if GPS_INT_THREAD_DEBUG_SWITCH
+ /* Dummy read */
+ itr_ret = RD_REG32(g_gps_int_data.rising_detect_reg);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, RISINGDETECT reg value(before) = 0x%08X ", itr_ret);
+#endif
+
+ /* GPS Interrupt Detection Method Setting */
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ com_regmsk_dword(reinterpret_cast<ULONG *>(g_gps_int_data.rising_detect_reg), \
+ GPS_MASK_6BIT, COMREGMSK_OR, ALLINTMASK);
+
+ /* Dummy read */
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ (void)RD_REG32(g_gps_int_data.rising_detect_reg);
+
+#if GPS_INT_THREAD_DEBUG_SWITCH
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, RISINGDETECT reg value(after) = 0x%08X ", itr_ret);
+#endif
+}
+
+/*******************************************************************************
+ * MODULE : DEVGpsIntIntRegClear
+ * ABSTRACT : Interrupt cause register clear processing
+ * FUNCTION : Clear the interrupt cause register
+ * ARGUMENT : None
+ * NOTE :
+ * RETURN : None
+ ******************************************************************************/
+void DEVGpsIntIntRegClear(void) {
+#if GPS_INT_THREAD_DEBUG_SWITCH
+ /* Dummy read */
+ itr_ret = RD_REG32(g_gps_int_data.irq_status_reg);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS reg value(before) = 0x%08X ", itr_ret);
+#endif
+
+ /* Clear Interrupt Source Register */
+ /* Dummy read */
+ /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */
+ (void)RD_REG32(g_gps_int_data.irq_status_reg);
+
+#if GPS_INT_THREAD_DEBUG_SWITCH
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS reg value(after) = 0x%08X ", itr_ret);
+#endif
+}
+
+/*******************************************************************************
+ * MODULE : DEVGpsIntSndMsg
+ * ABSTRACT : Send GPS interrupt occurrence notification
+ * FUNCTION : Notify GPS communication management that an interrupt has occurred.
+ * ARGUMENT : None
+ * NOTE :
+ * RETURN : RET_NORMAL : Normal completion
+ * : Other than the above : Processing error
+ ******************************************************************************/
+RET_API DEVGpsIntSndMsg(void) {
+ return RET_NORMAL;
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/Makefile b/vehicleservice/positioning/server/src/Sensor/Makefile
new file mode 100755
index 0000000..bb70229
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/Makefile
@@ -0,0 +1,181 @@
+#
+# @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.
+#
+
+######### installed library(*.a) #############
+INST_LIBS = libPOS_Sensor
+
+######### compiled sources #############
+libPOS_Sensor_SRCS += DeadReckoning_main.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Common.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_Heading_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_GyroOffset_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_Speed_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_Longitude_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_SnsCounter.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_Altitude_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_GyroScaleFactor_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_DataMasterMain.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_Latitude_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp
+libPOS_Sensor_SRCS += DeadReckoning_DeliveryCtrl.cpp
+libPOS_Sensor_SRCS += ClockUtility.cpp
+libPOS_Sensor_SRCS += VehicleUtility.cpp
+libPOS_Sensor_SRCS += GpsInt.cpp
+libPOS_Sensor_SRCS += VehicleSens_Thread.cpp
+libPOS_Sensor_SRCS += VehicleSens_FromAccess.cpp
+libPOS_Sensor_SRCS += VehicleSens_Common.cpp
+libPOS_Sensor_SRCS += VehicleSens_SelectionItemList.cpp
+libPOS_Sensor_SRCS += VehicleSens_SharedMemory.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MainGpsInterruptSignal.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsAntennaStatus.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Rev.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsCounter_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulse_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Rev_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Mon_Hw_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Clock_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SysGpsInterruptSignal.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SnsCounter_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroYExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroZExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroX.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroY.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroZ.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Dop_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroTrouble.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SnsCounterExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroX_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroY_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroZ_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroConnectStatus.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_RevFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_RevExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_SvInfo_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GPSInterruptFlag.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseFlag.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_TimeGps_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_TimeUtc_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseFlagFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SnsCounter.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroXFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroYFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroZFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Status_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulse.cpp
+libPOS_Sensor_SRCS += VehicleSens_DataMasterMain.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Velned_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Posllh_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsAntenna.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsAntenna_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedKmph.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SpeedKmph_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationLonLat.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationLonLat_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationAltitude.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationAltitude_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_n.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_i.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionHeading.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionHeading_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsTime.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsTime_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsTimeRaw.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsTimeRaw_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_NaviinfoDiagGPS_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsX.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsX_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsXExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsXFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsY.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsY_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsYExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsYFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZ.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZ_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroTemp.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroTemp_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroTempExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GyroTempFst_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsNmea_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationLonLat_n.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationAltitude_n.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_n.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_MotionHeading_n.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SettingTime.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_SettingTime_clock.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_PulseTime.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_PulseTime_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_PulseTimeExt_l.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_WknRollover.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_WknRollover_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockDrift.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockDrift_g.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockFreq.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockFreq_g.cpp
+
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationInfoNmea.cpp
+libPOS_Sensor_SRCS += VehicleSens_Did_LocationInfoNmea_n.cpp
+
+libPOS_Sensor_SRCS += VehicleSens_CanDeliveryEntry.cpp
+libPOS_Sensor_SRCS += VehicleSens_DeliveryCtrl.cpp
+libPOS_Sensor_SRCS += SensorLog.cpp
+
+######### add include path #############
+CPPFLAGS += -I../../include/Sensor
+CPPFLAGS += -I../../include/nsfw
+CPPFLAGS += -I../../include/ServiceInterface
+CPPFLAGS += -I../../../client/include
+
+CPPFLAGS += -I../ServiceInterface/VehicleIf
+CPPFLAGS += -I../nsfw/include
+#CPPFLAGS += -I../../../../diag_code/library/include
+
+CPPFLAGS += -I$(SDKTARGETSYSROOT)/usr/agl/include/vehicle_service
+
+######### add compile option #############
+CPPFLAGS += -DLINUX
+
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### add library path #############
+LDFLAGS +=
+
+INSTALL = install
+CREATE_DIR = $(DESTDIR)/nv/BS/vs/positioning/rwdata
+install-data:
+ $(INSTALL) -d -m 775 $(CREATE_DIR)
+
+include ../../../../vehicle_service.mk
+
diff --git a/vehicleservice/positioning/server/src/Sensor/SensorLog.cpp b/vehicleservice/positioning/server/src/Sensor/SensorLog.cpp
new file mode 100755
index 0000000..eed514f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/SensorLog.cpp
@@ -0,0 +1,1307 @@
+/*
+ * @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
+ * SensorLog.cpp
+ * @brief
+ * Sensor Logging service functionality
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <positioning_hal.h>
+#include <unistd.h>
+#include "SensorLog.h"
+#include "Sensor_Common_API.h"
+#include <zlib.h>
+#include "POS_private.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+/* Sensor Log Type */
+typedef enum {
+ SENSLOG_TYPE_SYS_INPUT = 0, /* Sensor Log Type-SYS (INPUT) */
+ SENSLOG_TYPE_SYS_OUTPUT, /* Sensor Log Type-SYS (OUTPUT) */
+ SENSLOG_TYPE_GPS_INPUT, /* Sensor Log Type-GPS (INPUT) */
+ SENSLOG_TYPE_GPS_OUTPUT, /* Sensor Log Type-GPS (OUTPUT) */
+ SENSLOG_TYPE_NAVI_INPUT, /* Sensor Log Type-NAVI(INPUT) */
+ SENSLOG_TYPE_NAVI_OUTPUT, /* Sensor Log Type-NAVI(OUTPUT) */
+ SENSLOG_TYPE_POS_OUTPUT, /* Sensor Log Type-POS (OUTPUT) */
+ SENSLOG_TYPE_CMD_INPUT, /* Sensor Log Type-CMD (INPUT) */
+ SENSLOG_TYPE_CMD_OUTPUT, /* Sensor Log Type-CMD (OUTPUT) */
+
+ SENSLOG_TYPE_COUNT /* Sensor Log Type-Counting */
+} SENSLOG_TYPE;
+
+#define SENSLOG_VALIDFLAG_ON (1) /* Effective specific flag ON */
+#define SENSLOG_VALIDFLAG_OFF (0) /* Enable flag OFF */
+#define SENSLOG_FILEPATH_SIZE (128) /* Output path size */
+#define SENSLOG_FILENAME_SIZE (64) /* Output file name size */
+#define SENSLOG_CONFIG_TEXT_SIZE (128) /* config file size/line */
+#define SENSLOG_LEN_MIN (1) /* Record Length-Minimum */
+#define SENSLOG_LEN_MAX (900) /* Record Length-Maximum */
+#define SENSLOG_LEN_DEFAULT (300) /* Record length-default value */
+#define SENSLOG_GEN_MIN (1) /* Number of generations-minimum value */
+#define SENSLOG_GEN_MAX (999) /* Number of generations-maximum value */
+#define SENSLOG_GEN_DEFAULT (100) /* Number of generations-default value */
+#define SENSLOG_BUF_MIN (2272) /* Buffer Size-Minimum */
+#define SENSLOG_BUF_MAX (11360) /* Buffer size-maximum value */
+#define SENSLOG_BUF_DEFAULT (4544) /* Buffer size-default value */
+#define SENSLOG_OUTPUTFLAG_NEW (0) /* Output Flag-New */
+#define SENSLOG_OUTPUTFLAG_ADD (1) /* Output Flag-Add */
+#define SENSLOG_PNAME_MAX (16) /* Maximum number of characters of process name */
+
+#define SENSLOG_SEMAPHO_NAME ("SENSLOG_SEMAPHO") /* Semaphore name(MAX 32Byte) */
+
+#define SENSLOG_CONFIG_FILE_PATH_1 "/nv/BS/vs/positioning/rwdata/" /* Sensor log-Config filepath-1 */
+#define SENSLOG_CONFIG_FILE_PATH_2 "/mnt/sda1/" /* Sensor log-Config filepath-2 */
+#define SENSLOG_CONFIG_FILE_NAME_SYS "POS_sys_log.cfg" /* Sensor log-Config filename-SYS */
+#define SENSLOG_CONFIG_FILE_NAME_GPS "POS_gps_log.cfg" /* Sensor log-Config filename-GPS */
+#define SENSLOG_CONFIG_FILE_NAME_NAVI "POS_nav_log.cfg" /* Sensor log-Config filename-NAVI */
+#define SENSLOG_CONFIG_FILE_NAME_POS "POS_pos_log.cfg" /* Sensor log-Config filename-POS */
+#define SENSLOG_CONFIG_FILE_NAME_CMD "POS_cmd_log.cfg" /* Sensor log-Config filename-CMD */
+#define SENSLOG_CONFIG_KEY_LEN "POS_log_len" /* Sensor log-config file-Record length */
+#define SENSLOG_CONFIG_KEY_GEN "POS_log_gen" /* Sensor log-config file-Number of generations */
+#define SENSLOG_CONFIG_KEY_BUF "POS_log_buf" /* Sensor log-config file-Buffer size */
+#define SENSLOG_NAV_SVINFO_FILE_NAME "POS_NAV_SVINFO" /* Sensor log-NAV-SVINFOFile name(Log output when file exists)*/
+#define SENSLOG_SEQ_START ">>>>" /* Sensor log sequence(Start) */
+#define SENSLOG_SEQ_END "<<<<" /* Sensor log sequence(End) */
+#define SENSLOG_SEQ_SIZE (4) /* Sensor Log Sequence Size */
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Structure to create SensorLog data
+*/
+typedef struct {
+ uint16_t us_len; /* Number of records */
+ uint16_t uc_gen; /* Number of generations */
+} SENSLOG_GEN;
+
+/*!
+ @brief Structure to create SensorLog data
+*/
+typedef struct {
+ uint8_t uc_valid_flag; /* Output enable flag */
+ SENSLOG_GEN st_gen; /* Generation information */
+ uint16_t us_file_rec_count; /* Number of file output records */
+ uint16_t us_rec_count; /* Number of output records */
+ uint16_t us_gen_count; /* Number of generations */
+ uint8_t uc_file_path[SENSLOG_FILEPATH_SIZE]; /* Output path */
+ uint8_t uc_file_name[SENSLOG_FILENAME_SIZE]; /* Output file name */
+ uint8_t uc_gen_fname[SENSLOG_FILENAME_SIZE]; /* Generation information output file name */
+ uint8_t uc_text_buf[SENSLOG_BUF_MAX]; /* Buffering area(Static) */
+ uint32_t ul_text_buf_size; /* Buffering area size */
+ uint32_t ul_text_buf_len; /* Data size in the buffer */
+ uint8_t uc_output_flag; /* Output flag */
+ uint8_t uc_temp_buf[SENSLOG_BUF_MAX]; /* Output data temporary area */
+ uint8_t uc_positioninglog_buf[SENSLOG_BUF_MAX]; /* FRAMEWORKUNIFIEDLOG outputs */
+} SENSLOG_INFO;
+
+/*!
+ @brief Structure to get System time
+*/
+typedef struct {
+ uint16_t us_year;
+ uint16_t us_month;
+ uint16_t us_day_of_week;
+ uint16_t us_day;
+ uint16_t us_hour;
+ uint16_t us_minute;
+ uint16_t us_second;
+ uint16_t us_milli_seconds;
+} SENSLOG_SYSTEMTIME;
+
+/*!
+ @brief Structure to create SensorLog data
+*/
+typedef struct {
+ uint16_t us_data_type; /* Data type */
+ SENSLOG_SYSTEMTIME st_sys_time; /* Current time */
+ DID ul_did; /* Data ID */
+ int8_t c_pname[SENSLOG_PNAME_MAX]; /* Destination information */
+ uint8_t uc_unit_type; /* Hardware configuration type(GRADE1 / GRADE2) */
+ uint8_t uc_result; /* Send/Receive result(Success:0 / Fail:1) */
+ uint16_t us_data_size; /* Size of the data */
+} SENSLOG_DATA_HEADER;
+
+
+/*!
+ @brief Structure to create SensorLog ID table
+*/
+typedef struct {
+ uint16_t us_data_type; /* Data type */
+ DID ul_did; /* Data ID */
+ uint16_t us_file_type; /* Sensor Log Type */
+ uint16_t us_write_type; /* FRAMEWORKUNIFIEDLOG Output Type */
+} SENSLOG_ID_TBL;
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+static void SensLogGetConfig(const uint8_t*, SENSLOG_INFO*);
+static void SensLogGetConfigVal(uint8_t*, uint8_t*);
+static void SensLogCheckNAVSVINFOFile(void);
+static void SensLogWrite(uint16_t, uint16_t, uint16_t, DID did, PNO pno, uint8_t*, uint16_t, uint8_t, uint8_t, uint8_t);
+static uint16_t SensLogGetFileType(const SENSLOG_ID_TBL*, uint16_t*, uint16_t*, DID did);
+static void SensLogOutputFile(uint8_t);
+static void SensLogOutputGenFile(uint8_t);
+static void SensLogGetSystemTime(SENSLOG_SYSTEMTIME*);
+static void Num2String2Digit(uint8_t* buf, uint32_t num);
+static void Num2String3Digit(uint8_t* buf, uint32_t num);
+static void Num2String4Digit(uint8_t* buf, uint32_t num);
+static void Num2HexString(uint8_t* buf, uint8_t digits, uint32_t num);
+static void SensLogmakeHeader(uint8_t* buf, SENSLOG_DATA_HEADER data_header);
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+/* Sensor log information */
+static SENSLOG_INFO g_sens_log_info[SENSLOG_TYPE_COUNT]; // NOLINT(readability/nolint)
+static uint8_t g_navsv_info_flag = FALSE;
+uint8_t g_mount_path[SENSLOG_FILEPATH_SIZE]; /* Mount path */
+UNIT_TYPE g_unit_type = UNIT_TYPE_NONE; /* HW configuration type */
+SemID g_sem_id = 0; /* Lock semaphore ID */
+
+/* Sensor log type definition table */
+const SENSLOG_ID_TBL kSensLogInputTbl[] = {
+ /* Data type DID Sensor Log Type FRAMEWORKUNIFIEDLOG Output Type */
+ {SENSLOG_DATA_I_SYS, 0, SENSLOG_TYPE_SYS_INPUT, POS_SENSLOG_TYPE_SYS },
+ {SENSLOG_DATA_I_SYS_STS, 0, SENSLOG_TYPE_SYS_INPUT, POS_SENSLOG_TYPE_SYS },
+ {SENSLOG_DATA_I_GPS, 0, SENSLOG_TYPE_GPS_INPUT, POS_SENSLOG_TYPE_GPS },
+ {SENSLOG_DATA_I_LOC, POSHAL_DID_GPS_CUSTOMDATA_NAVI, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV },
+ {SENSLOG_DATA_I_SPEED, VEHICLE_DID_MOTION_SPEED_NAVI, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV },
+ {SENSLOG_DATA_I_TIME, VEHICLE_DID_SETTINGTIME, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV },
+ {SENSLOG_DATA_I_TIME, POSHAL_DID_GPS_TIME, SENSLOG_TYPE_GPS_INPUT, POS_SENSLOG_TYPE_GPS },
+ {SENSLOG_DATA_I_GPSINF, 0, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV },
+ {SENSLOG_DATA_I_GPSRST, 0, SENSLOG_TYPE_CMD_INPUT, POS_SENSLOG_TYPE_CMD },
+ {SENSLOG_DATA_I_GPSSET, 0, SENSLOG_TYPE_CMD_INPUT, POS_SENSLOG_TYPE_CMD },
+ {SENSLOG_DATA_I_NAVSVINFO, 0, SENSLOG_TYPE_GPS_INPUT, POS_SENSLOG_TYPE_GPS },
+ {SENSLOG_DATA_I_SYS_ABNORMAL, 0, SENSLOG_TYPE_SYS_INPUT, POS_SENSLOG_TYPE_SYS },
+ {SENSLOG_DATA_I_UNSPECIFIED, 0, SENSLOG_TYPE_COUNT, POS_SENSLOG_TYPE_NONE }
+};
+
+const SENSLOG_ID_TBL kSensLogOutputTbl[] = {
+ /* Data type DID Sensor Log Type FRAMEWORKUNIFIEDLOG Output Type */
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_SPEED_PULSE, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_SPEED_KMPH, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_X, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Y, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Z, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_X, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Y, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Z, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_ANTENNA, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_SNS_COUNTER, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_SPEED_PULSE_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_X_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Y_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Z_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, VEHICLE_DID_GPS__CWORD82__NMEA, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS__CWORD82___CWORD44_GP4, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS__CWORD82__FULLBINARY, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_NMEA, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_REV, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_REV_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_TEMP, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_TEMP_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_X_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Y_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Z_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_PULSE_TIME, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_CLOCK_DRIFT, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_CLOCK_FREQ, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SYS_PKG, 0, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_GPS, 0, SENSLOG_TYPE_CMD_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_LONLAT_N, VEHICLE_DID_LOCATION_LONLAT_NAVI, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_LONLAT_G, VEHICLE_DID_LOCATION_LONLAT, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_ALT, VEHICLE_DID_LOCATION_ALTITUDE, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SPEED_N, VEHICLE_DID_MOTION_SPEED_NAVI, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_SPEED_P, VEHICLE_DID_MOTION_SPEED_INTERNAL, SENSLOG_TYPE_POS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_HEAD_N, VEHICLE_DID_MOTION_HEADING_NAVI, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_HEAD_G, VEHICLE_DID_MOTION_HEADING, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_TIME_SETREQ, VEHICLE_DID_SETTINGTIME, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_TIME, POSHAL_DID_GPS_TIME, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_GPSINF, VEHICLE_DID_NAVIINFO_DIAG_GPS, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_TIME_CS, 0, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+ {SENSLOG_DATA_O_GPSRST, 0, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE },
+
+ {SENSLOG_DATA_O_UNSPECIFIED, 0, SENSLOG_TYPE_COUNT, POS_SENSLOG_TYPE_NONE }
+};
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Sensor Log Initial Processing
+ *
+ * @param[in] p_mount_path Mount path
+ */
+void SensLogInitialize(uint8_t *p_mount_path) {
+ static SENSLOG_INFO st_sens_log_info; /* Coverity CID:23609 compliant */
+ uint8_t uc_hw[16]; /* HW name */
+ uint8_t ret = 0;
+ uint8_t i;
+ static uint8_t tzset_flag = 0; /* Not initialized */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ /* Not initialized */
+ if (tzset_flag == 0) {
+ tzset();
+ tzset_flag = 1; /* Initialization complete */
+ }
+
+ /* Initialization of sensor log information structure */
+ memset(&g_sens_log_info, 0, sizeof(g_sens_log_info));
+
+ /* Get mount path */
+ memset(&g_mount_path[0], 0, sizeof(g_mount_path));
+ if (NULL == p_mount_path) {
+ snprintf(reinterpret_cast<char*>(&g_mount_path[0]), sizeof(g_mount_path), SENSLOG_CONFIG_FILE_PATH_2);
+ } else {
+ snprintf(reinterpret_cast<char*>(&g_mount_path[0]), sizeof(g_mount_path), "%s/", p_mount_path);
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "mount path[%s]", g_mount_path);
+
+ /* HW judgment */
+ memset(&uc_hw[0], 0, sizeof(uc_hw));
+ g_unit_type = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == g_unit_type) {
+ /* GRADE1 */
+ snprintf(reinterpret_cast<char*>(&uc_hw[0]), sizeof(uc_hw), "GRADE1");
+ } else if (UNIT_TYPE_GRADE2 == g_unit_type) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ } else {
+ /* Environment error */
+ /* Do not output sensor log */
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Environment Error.");
+ ret = 1;
+ }
+
+ /* Get Semaphore ID */
+ g_sem_id = _pb_CreateSemaphore(const_cast<char *>(SENSLOG_SEMAPHO_NAME));
+ if (g_sem_id == 0) { // LCOV_EXCL_BR_LINE 200: can not return zero
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Semaphore create Error.(ID = 0)");
+ ret = 1;
+ // LCOV_EXCL_STOP
+ }
+
+ if (ret == 0) {
+ /* Read config files */
+ /* SYS */
+ memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO));
+ SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_SYS, &st_sens_log_info);
+ if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) {
+ st_sens_log_info.us_gen_count = 1;
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_SYS_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_file_name), "POS_%s_sys_i_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_file_name), "POS_%s_sys_o_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_gen_fname), "POS_%s_sys_i_gen.dat", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_gen_fname), "POS_%s_sys_o_gen.dat", uc_hw);
+ SensLogOutputGenFile(SENSLOG_TYPE_SYS_INPUT);
+ SensLogOutputGenFile(SENSLOG_TYPE_SYS_OUTPUT);
+ }
+
+ /* GPS */
+ memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO));
+ SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_GPS, &st_sens_log_info);
+ if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) {
+ st_sens_log_info.us_gen_count = 1;
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_GPS_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_file_name), "POS_%s_gps_i_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_file_name), "POS_%s_gps_o_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_gen_fname), "POS_%s_gps_i_gen.dat", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_gen_fname), "POS_%s_gps_o_gen.dat", uc_hw);
+ SensLogOutputGenFile(SENSLOG_TYPE_GPS_INPUT);
+ SensLogOutputGenFile(SENSLOG_TYPE_GPS_OUTPUT);
+ }
+
+ /* NAVI */
+ memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO));
+ SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_NAVI, &st_sens_log_info);
+ if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) {
+ st_sens_log_info.us_gen_count = 1;
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_file_name), "POS_%s_nav_i_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_file_name), "POS_%s_nav_o_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_gen_fname), "POS_%s_nav_i_gen.dat", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_gen_fname), "POS_%s_nav_o_gen.dat", uc_hw);
+ SensLogOutputGenFile(SENSLOG_TYPE_NAVI_INPUT);
+ SensLogOutputGenFile(SENSLOG_TYPE_NAVI_OUTPUT);
+ }
+
+ /* POS */
+ memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO));
+ SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_POS, &st_sens_log_info);
+ if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) {
+ st_sens_log_info.us_gen_count = 1;
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_file_name), "POS_%s_pos_o_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_gen_fname), "POS_%s_pos_o_gen.dat", uc_hw);
+ SensLogOutputGenFile(SENSLOG_TYPE_POS_OUTPUT);
+ }
+
+ /* CMD */
+ memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO));
+ SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_CMD, &st_sens_log_info);
+ if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) {
+ st_sens_log_info.us_gen_count = 1;
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_CMD_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ memcpy(&g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO));
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_file_name), "POS_%s_cmd_i_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_file_name[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_file_name), "POS_%s_cmd_o_%%03d.log", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_gen_fname), "POS_%s_cmd_i_gen.dat", uc_hw);
+ snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_gen_fname[0])),
+ sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_gen_fname), "POS_%s_cmd_o_gen.dat", uc_hw);
+ SensLogOutputGenFile(SENSLOG_TYPE_CMD_INPUT);
+ SensLogOutputGenFile(SENSLOG_TYPE_CMD_OUTPUT);
+ }
+
+ /* NAV-SVINFO */
+ SensLogCheckNAVSVINFOFile();
+ }
+
+ for (i = 0; i < SENSLOG_TYPE_COUNT; i++) {
+ if (g_sens_log_info[i].uc_valid_flag == SENSLOG_VALIDFLAG_ON) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].uc_valid_flag:%d", i, g_sens_log_info[i].uc_valid_flag);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].st_gen.us_len:%d", i, g_sens_log_info[i].st_gen.us_len);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].st_gen.uc_gen:%d", i, g_sens_log_info[i].st_gen.uc_gen);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].us_file_rec_count:%d", i, g_sens_log_info[i].us_file_rec_count);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].us_rec_count:%d", i, g_sens_log_info[i].us_rec_count);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].us_gen_count:%d", i, g_sens_log_info[i].us_gen_count);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].uc_file_path:%s", i, g_sens_log_info[i].uc_file_path);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].uc_file_name:%s", i, g_sens_log_info[i].uc_file_name);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].uc_gen_fname:%s", i, g_sens_log_info[i].uc_gen_fname);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "g_sens_log_info[%d].ul_text_buf_size:%d", i, g_sens_log_info[i].ul_text_buf_size);
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Sensor log stop processing
+ */
+void SensLogTerminate(void) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Initialization of sensor log information structure */
+ memset(&g_sens_log_info, 0, sizeof(g_sens_log_info));
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Sensor log saving process
+ */
+void SensLogStore(void) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ uint8_t i;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ for (i = 0; i < SENSLOG_TYPE_COUNT; i++) {
+ /* Output buffering log */
+ if ((g_sens_log_info[i].uc_valid_flag == SENSLOG_VALIDFLAG_ON) &&
+ (g_sens_log_info[i].ul_text_buf_len > 0)) {
+ SensLogOutputFile(i);
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Sensor log config file information acquisition
+ *
+ * @param[in] uc_config_file Config filename
+ * @param[out] st_sens_log_info Sensor log information
+ */
+static void SensLogGetConfig(const uint8_t* uc_config_file, SENSLOG_INFO* st_sens_log_info) {
+ FILE* fp;
+ uint8_t uc_file_path[SENSLOG_FILEPATH_SIZE];
+ uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE];
+ uint8_t ucBuf[SENSLOG_CONFIG_TEXT_SIZE];
+ uint8_t uc_val[SENSLOG_CONFIG_TEXT_SIZE];
+ uint8_t flag = 0;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ if ((uc_config_file == NULL) || (st_sens_log_info == NULL)) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Unprocessed if the argument is invalid. */
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Parameter Error.");
+ // LCOV_EXCL_STOP
+ } else {
+ memset(&uc_file_path, 0, sizeof(uc_file_path));
+ memset(&uc_file_name, 0, sizeof(uc_file_name));
+
+ /* Refer to the config files in the built-in memory. */
+ snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), \
+ SENSLOG_CONFIG_FILE_PATH_1);
+ snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), \
+ "%s%s", uc_file_path, uc_config_file);
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r");
+ if (NULL == fp) {
+ /* If there are no config files in the built-in memory, refer to the USB memory. */
+ snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), \
+ "%s", (const char*)&g_mount_path[0]);
+ snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), \
+ "%s%s", uc_file_path, uc_config_file);
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r");
+ }
+
+ if (NULL == fp) {
+ /* Do not print when there are no config files.(Console log output)*/
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "Not SensorLog config file. [%s]", uc_file_name);
+ } else {
+ /* Read config files */
+ for (;;) {
+ if (fgets(reinterpret_cast<char*>(&ucBuf), SENSLOG_CONFIG_TEXT_SIZE, fp) == NULL) {
+ /* EOF detection(Fail-safe:Normally it does not pass because it is break at the flag judgment place.)*/
+ break;
+ }
+ memset(&uc_val, 0, sizeof(uc_val));
+ if ((strncmp(reinterpret_cast<char*>(&ucBuf), SENSLOG_CONFIG_KEY_LEN, \
+ strlen(SENSLOG_CONFIG_KEY_LEN)) == 0) && ((flag & 0x01) != 0x01)) {
+ /* Get record length */
+ SensLogGetConfigVal(ucBuf, uc_val);
+ st_sens_log_info->st_gen.us_len = static_cast<uint16_t>(atoi((const char *)uc_val));
+ flag ^= 0x01;
+ } else if ((strncmp(reinterpret_cast<char*>(&ucBuf), SENSLOG_CONFIG_KEY_GEN, \
+ strlen(SENSLOG_CONFIG_KEY_GEN)) == 0) && ((flag & 0x02) != 0x02)) {
+ /* Get number of generations */
+ SensLogGetConfigVal(ucBuf, uc_val);
+ st_sens_log_info->st_gen.uc_gen = static_cast<uint16_t>(atoi((const char *)uc_val));
+ flag ^= 0x02;
+ } else {
+ /* nop */
+ }
+
+ if (flag == 0x03) {
+ break;
+ }
+ }
+ fclose(fp);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \
+ "SensorLog read : file[%s] : config[0x%02x]", uc_file_name, flag);
+
+ if ((st_sens_log_info->st_gen.us_len < SENSLOG_LEN_MIN) \
+ || (st_sens_log_info->st_gen.us_len > SENSLOG_LEN_MAX)) {
+ /* The default value is applied if it is outside the valid range. */
+ st_sens_log_info->st_gen.us_len = SENSLOG_LEN_DEFAULT;
+ }
+ if ((st_sens_log_info->st_gen.uc_gen < SENSLOG_GEN_MIN) \
+ || (st_sens_log_info->st_gen.uc_gen > SENSLOG_GEN_MAX)) {
+ /* The default value is applied if it is outside the valid range. */
+ st_sens_log_info->st_gen.uc_gen = SENSLOG_GEN_DEFAULT;
+ }
+ st_sens_log_info->ul_text_buf_size = SENSLOG_BUF_MAX; /* Static area(Maximum security) */
+
+ st_sens_log_info->uc_valid_flag = SENSLOG_VALIDFLAG_ON;
+ st_sens_log_info->uc_output_flag = SENSLOG_OUTPUTFLAG_NEW;
+ /* The log output path should be the same path as the config file. */
+ memcpy(st_sens_log_info->uc_file_path, uc_file_path, SENSLOG_FILEPATH_SIZE);
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Sensor log config file setting value acquisition
+ *
+ * @param[in] uc_text Config setting information
+ * @param[out] uc_val Config setting
+ */
+static void SensLogGetConfigVal(uint8_t* uc_text, uint8_t* uc_val) {
+ uint8_t ucBuf[SENSLOG_CONFIG_TEXT_SIZE];
+ uint16_t i = 0;
+ uint16_t j = 0;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ if ((uc_text == NULL) || (uc_val == NULL)) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Unprocessed if the argument is invalid. */
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Parameter Error.");
+ // LCOV_EXCL_STOP
+ } else {
+ memset(ucBuf, 0, sizeof(ucBuf));
+ while ((*uc_text != ':') && (*uc_text != '\0')) {
+ uc_text++;
+ i++;
+ if (i >= (SENSLOG_CONFIG_TEXT_SIZE - 1)) {
+ break;
+ }
+ }
+ while ((*uc_text != '\r') && (*uc_text != '\n') && (*uc_text != '\0')) {
+ uc_text++;
+ i++;
+ ucBuf[j++] = *uc_text;
+ if (i >= SENSLOG_CONFIG_TEXT_SIZE) { // LCOV_EXCL_BR_LINE 200: can not exceed size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&ucBuf, 0, sizeof(ucBuf));
+ break;
+ // LCOV_EXCL_STOP
+ }
+ }
+ memcpy(uc_val, ucBuf, sizeof(ucBuf));
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Acquisition of sensor log NAV-SVINFO file information
+ *
+ * @param[in] none
+ */
+static void SensLogCheckNAVSVINFOFile(void) {
+ FILE* fp;
+ const uint8_t* uc_config_file;
+ uint8_t uc_file_path[SENSLOG_FILEPATH_SIZE];
+ uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE];
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ uc_config_file = (const uint8_t*)SENSLOG_NAV_SVINFO_FILE_NAME;
+
+ memset(&uc_file_path, 0, sizeof(uc_file_path));
+ memset(&uc_file_name, 0, sizeof(uc_file_name));
+
+ /* Refer to the config files in the built-in memory. */
+ snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), SENSLOG_CONFIG_FILE_PATH_1);
+ snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), "%s%s", uc_file_path, uc_config_file);
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r");
+ if (NULL == fp) {
+ /* If there are no config files in the built-in memory, refer to the USB memory. */
+ snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), \
+ "%s", (const char*)&g_mount_path[0]);
+ snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), \
+ "%s%s", uc_file_path, uc_config_file);
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r");
+ }
+
+ if (NULL == fp) {
+ /* Do not print when there are no config files.(Console log output)*/
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Not SensorLog config file. [%s]", uc_file_name);
+ g_navsv_info_flag = FALSE;
+ } else {
+ fclose(fp);
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SensorLog read : file[%s]", uc_file_name);
+ g_navsv_info_flag = TRUE;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Acquisition of sensor log NAV-SVINFO file information
+ *
+ * @param[in] none
+ *
+ * @return Destination sensor log file type
+ */
+uint8_t SensLogGetNavSvinfoFlag(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return g_navsv_info_flag;
+}
+// LCOV_EXCL_STOP
+/**
+ * @brief
+ * Sensor log output(Input information)
+ *
+ * Writes the specified log (input information) to the buffer area
+ *
+ * @param[in] us_data_type Data type
+ * @param[in] ul_did Data ID
+ * @param[in] us_pno Destination PNO
+ * @param[in] p_data Write data pointer
+ * @param[in] us_size Write data size
+ * @param[in] uc_result Reception result
+ * @param[in] u_write_flag ability to write sensor log
+ * @param[in] u_write_abnormal_flag When an error occurs ability to write sensor log
+ */
+void SensLogWriteInputData(uint16_t us_data_type, DID ul_did, PNO us_pno, uint8_t *p_data, \
+ uint16_t us_size, uint8_t uc_result, uint8_t u_write_flag, uint8_t u_write_abnormal_flag) {
+ uint16_t file_type = 0;
+ uint16_t data_type = us_data_type;
+ uint16_t write_type = POS_SENSLOG_TYPE_NONE;
+ RET_API lret_sem = RET_ERROR;
+
+ /* Sensor log file type determination */
+ file_type = SensLogGetFileType(kSensLogInputTbl, &data_type, &write_type, ul_did);
+
+ /* For the target type,Perform exclusive control */
+ /* Currently, only GPS input can be written from multiple threads. */
+ if (file_type == SENSLOG_TYPE_GPS_INPUT) {
+ /* Semaphore ID determination */
+ if (g_sem_id != 0) { // LCOV_EXCL_BR_LINE 200: can not zero
+ lret_sem = _pb_SemLock(g_sem_id); /* Semaphore Lock */
+ if (lret_sem != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not return error
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "SemLock Error.");
+ // LCOV_EXCL_STOP
+ } else {
+ /* Sensor log output */
+ SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, \
+ us_size, uc_result, u_write_flag, u_write_abnormal_flag);
+ (void)_pb_SemUnlock(g_sem_id); /* Semaphore unlock */
+ }
+ }
+ } else {
+ /* Sensor log output */
+ SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, us_size, \
+ uc_result, u_write_flag, u_write_abnormal_flag);
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Sensor log output(Outputs the information)
+ *
+ * Writes the specified log (output information) to the buffer area
+ *
+ * @param[in] us_data_type Data type
+ * @param[in] ul_did Data ID
+ * @param[in] us_pno Destination PNO
+ * @param[in] p_data Write data pointer
+ * @param[in] us_size Write data size
+ * @param[in] uc_result Reception result
+ */
+void SensLogWriteOutputData(uint16_t us_data_type, DID ul_did, PNO us_pno, uint8_t *p_data, \
+ uint16_t us_size, uint8_t uc_result) {
+ uint16_t file_type = 0;
+ uint16_t data_type = us_data_type;
+ uint16_t write_type = POS_SENSLOG_TYPE_NONE;
+ RET_API lret_sem = RET_ERROR;
+
+ /* Sensor log file type determination */
+ file_type = SensLogGetFileType(kSensLogOutputTbl, &data_type, &write_type, ul_did);
+
+ /* For the target type,Perform exclusive control */
+ /* Currently, only GPS output can be written from multiple threads. */
+ if (file_type == SENSLOG_TYPE_GPS_OUTPUT) {
+ /* Semaphore ID determination */
+ if (g_sem_id != 0) { // LCOV_EXCL_BR_LINE 200: can not zero
+ lret_sem = _pb_SemLock(g_sem_id); /* Semaphore Lock */
+ if (lret_sem != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not return error
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "SemLock Error.");
+ // LCOV_EXCL_STOP
+ } else {
+ /* Sensor log output */
+ SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, \
+ us_size, uc_result, SENSLOG_ON, SENSLOG_OFF);
+ (void)_pb_SemUnlock(g_sem_id); /* Semaphore unlock */
+ }
+ }
+ } else {
+ /* Sensor log output */
+ SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, us_size, \
+ uc_result, SENSLOG_ON, SENSLOG_OFF);
+ }
+ return;
+}
+
+/**
+ * @brief
+ * Convert number to ASCII code(For two digits,Fill up to zero)
+ *
+ * @param[out] buf Data saving
+ * @param[in] num Numbers to be converted
+ */
+static void Num2String2Digit(uint8_t* buf, uint32_t num) {
+ int8_t c;
+ if (num >= 100) { // LCOV_EXCL_BR_LINE 200: can not exceed size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *buf++ = '0';
+ *buf = '0';
+ // LCOV_EXCL_STOP
+ } else {
+ c = static_cast<int8_t>(num / 10);
+ *buf++ = static_cast<uint8_t>(c + '0');
+ *buf = static_cast<uint8_t>(num - (c * 10) + '0');
+ }
+}
+
+/**
+ * @brief
+ * Convert number to ASCII code(For 3 digits,Fill up to zero)
+ *
+ * @param[out] buf Data saving
+ * @param[in] num Numbers to be converted
+ */
+static void Num2String3Digit(uint8_t* buf, uint32_t num) {
+ int8_t c;
+ if (num >= 1000) { // LCOV_EXCL_BR_LINE 200: can not exceed size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *buf++ = '0';
+ *buf++ = '0';
+ *buf = '0';
+ // LCOV_EXCL_STOP
+ } else {
+ c = static_cast<int8_t>(num / 100);
+ *buf++ = static_cast<uint8_t>(c + '0');
+ num = num - (c * 100);
+ c = static_cast<int8_t>(num / 10);
+ *buf++ = static_cast<uint8_t>(c + '0');
+ *buf = static_cast<uint8_t>(num - (c * 10) + '0');
+ }
+}
+
+/**
+ * @brief
+ * Convert number to ASCII code(For 4 digits,Fill up to zero)
+ *
+ * @param[out] buf Data saving
+ * @param[in] num Numbers to be converted
+ */
+static void Num2String4Digit(uint8_t* buf, uint32_t num) {
+ int8_t c;
+ if (num >= 10000) { // LCOV_EXCL_BR_LINE 200: can not exceed size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *buf++ = '0';
+ *buf++ = '0';
+ *buf++ = '0';
+ *buf = '0';
+ // LCOV_EXCL_STOP
+ } else {
+ c = static_cast<int8_t>(num / 1000);
+ *buf++ = static_cast<uint8_t>(c + '0');
+ num = num - (c * 1000);
+ c = static_cast<int8_t>(num / 100);
+ *buf++ = static_cast<uint8_t>(c + '0');
+ num = num - (c * 100);
+ c = static_cast<int8_t>(num / 10);
+ *buf++ = static_cast<uint8_t>(c + '0');
+ *buf = static_cast<uint8_t>(num - (c * 10) + '0');
+ }
+}
+
+/**
+ * @brief
+ * Convert digits to hexadecimal ASCII code(Fill up to zero)
+ *
+ * @param[out] buf Data saving
+ * @param[in] Number of digits to be converted to digits
+ * @param[in] num Numbers to be converted
+ */
+static void Num2HexString(uint8_t* buf, uint8_t digits, uint32_t num) {
+ uint8_t* p = buf + digits;
+ uint8_t calc;
+ int32_t i;
+
+ /* Only within the displayable range,Convert */
+ if ((digits == 8) || (num < (uint32_t)(1 << (4 *digits)))) {
+ while (num) {
+ calc = num % 16;
+ if (10 > calc) {
+ calc = static_cast<uint8_t>(calc + 0x30); // 0x30 is 0 character
+ } else {
+ calc = static_cast<uint8_t>(calc + (0x61 - 0x0A)); // 0x41 is the letter of a
+ }
+ *(--p) = calc;
+ num /= 16;
+ digits--;
+ }
+ }
+
+ /* Insert 0 in the remaining significant digits. */
+ for (i = 0; i < digits; i++) {
+ *(--p) = '0';
+ }
+}
+
+/**
+ * @brief
+ * Sensor Log Header Creation
+ *
+ * @param[out] buf Data saving
+ * @param[in] DataHeader data headers
+ * @note For buf, Up to 62 bytes are used. As 64 bytes are allocated in the upper digit, Without current problems, dataHeader.c_pname size increase,
+ * Need to be reviewed when changing the format.
+ */
+static void SensLogmakeHeader(uint8_t* buf, SENSLOG_DATA_HEADER dataHeader) {
+ /* "%02d %04d/%02d/%02d %02d:%02d:%02d.%03d %08x %s %01x %01x %04d " */
+ int8_t *p;
+ uint16_t i = 0;
+ Num2String2Digit(buf, dataHeader.us_data_type);
+ buf += 2;
+ *(buf++) = ' ';
+ Num2String4Digit(buf, dataHeader.st_sys_time.us_year);
+ buf += 4;
+ *(buf++) = '/';
+ Num2String2Digit(buf, dataHeader.st_sys_time.us_month);
+ buf += 2;
+ *(buf++) = '/';
+ Num2String2Digit(buf, dataHeader.st_sys_time.us_day);
+ buf += 2;
+ *(buf++) = ' ';
+ Num2String2Digit(buf, dataHeader.st_sys_time.us_hour);
+ buf += 2;
+ *(buf++) = ':';
+ Num2String2Digit(buf, dataHeader.st_sys_time.us_minute);
+ buf += 2;
+ *(buf++) = ':';
+ Num2String2Digit(buf, dataHeader.st_sys_time.us_second);
+ buf += 2;
+ *(buf++) = '.';
+ Num2String3Digit(buf, dataHeader.st_sys_time.us_milli_seconds);
+ buf += 3;
+ *(buf++) = ' ';
+ Num2HexString(buf, 8, dataHeader.ul_did);
+ buf += 8;
+ *(buf++) = ' ';
+ p = dataHeader.c_pname;
+ for (i = 0; i < sizeof(dataHeader.c_pname); i++) {
+ if (*p == 0) {
+ break;
+ }
+ *(buf++) = *(p++);
+ }
+ *(buf++) = ' ';
+ Num2HexString((buf++), 1, dataHeader.uc_unit_type);
+ *(buf++) = ' ';
+ Num2HexString((buf++), 1, dataHeader.uc_result);
+ *(buf++) = ' ';
+ Num2String4Digit(buf, dataHeader.us_data_size);
+ buf += 4;
+ *(buf++) = ' ';
+
+ return;
+}
+
+/**
+ * @brief
+ * Sensor log output
+ *
+ * Write specified log to buffer area(Common process)
+ *
+ * @param[in] us_file_type File type
+ * @param[in] us_data_type Data type
+ * @param[in] us_write_type FRAMEWORKUNIFIEDLOG Output Type
+ * @param[in] ul_did Data ID
+ * @param[in] us_pno Destination PNO
+ * @param[in] p_data Write data pointer
+ * @param[in] us_size Write data size
+ * @param[in] uc_result Reception result
+ * @param[in] uWriteFlag ability to write sensor log
+ * @param[in] u_write_abnormal_flag When an error occursability to write sensor log
+ */
+static void SensLogWrite(uint16_t us_file_type, uint16_t us_data_type, uint16_t us_write_type, \
+ DID ul_did, PNO us_pno, uint8_t *p_data, uint16_t us_size, uint8_t uc_result, uint8_t uWriteFlag, \
+ uint8_t u_write_abnormal_flag) {
+ uint32_t len = 0;
+ SENSLOG_DATA_HEADER dataHeader;
+ uint16_t headSize = sizeof(SENSLOG_DATA_HEADER);
+ uint16_t i = 0;
+ uint8_t workBuf[64];
+ uint16_t workBufLen = 0;
+ PCSTR pPname = NULL;
+ uint32_t ulTempBufLen;
+ uint32_t ulPositioninglogBufLen = SENSLOG_BUF_MAX;
+ uint32_t retComp;
+
+ if ((p_data == NULL) || (us_size == 0) || (us_size > SENSLOG_BUF_MIN)) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ /* Unprocessed if write specified log data is invalid */
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__,
+ "Parameter Error. File[%d] Data[%d] DID[%d] Size[%d]",
+ us_file_type, us_data_type, ul_did, us_size);
+ } else {
+ /* Sensor log file type determination */
+ if (us_file_type < SENSLOG_TYPE_COUNT) {
+ if ((g_sens_log_info[us_file_type].uc_valid_flag == SENSLOG_VALIDFLAG_ON) ||
+ (us_write_type != POS_SENSLOG_TYPE_NONE)) {
+ /* Setting of header information */
+ memset(&dataHeader, 0x00, sizeof(dataHeader));
+ dataHeader.us_data_type = us_data_type;
+ SensLogGetSystemTime(&dataHeader.st_sys_time);
+ dataHeader.ul_did = ul_did;
+ pPname = _pb_CnvPno2Name(us_pno);
+ if (pPname == NULL) {
+ dataHeader.c_pname[0] = '-';
+ } else {
+ snprintf(reinterpret_cast<char *>(&(dataHeader.c_pname[0])), \
+ sizeof(dataHeader.c_pname), "%s", pPname);
+ }
+ dataHeader.uc_unit_type = (uint8_t)g_unit_type;
+ dataHeader.uc_result = uc_result;
+ dataHeader.us_data_size = us_size;
+
+ /* Buffer storage(Header)*/
+ memset(&workBuf[0], 0x00, sizeof(workBuf));
+ SensLogmakeHeader(workBuf, dataHeader);
+ workBufLen = static_cast<uint16_t>(strlen(reinterpret_cast<char *>(&(workBuf[0]))));
+ memcpy(reinterpret_cast<char *>(&(g_sens_log_info[us_file_type].uc_temp_buf[0])), \
+ &workBuf[0], workBufLen);
+
+ /* Buffer storage(Data portion)*/
+ for (i = 0; i < us_size; i++) {
+ Num2HexString(&(g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + i * 3]), 2, *p_data);
+ g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + i * 3 + 2] = ' ';
+ g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + i * 3 + 3] = 0; /* NULL */
+ p_data++;
+ }
+ g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + (us_size * 3)] = '\r';
+ g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + (us_size * 3) + 1] = '\n';
+ ulTempBufLen = workBufLen + (us_size * 3) + 2;
+
+ /* FRAMEWORKUNIFIEDLOG out */
+ if ((us_file_type == SENSLOG_TYPE_NAVI_INPUT) || (us_file_type == SENSLOG_TYPE_NAVI_OUTPUT)) {
+ if (g_unit_type != UNIT_TYPE_GRADE1) {
+ /* Sensor log is not output when an error occurs except for _CWORD80_ in NAV. */
+ u_write_abnormal_flag = 0;
+ }
+ }
+ if ((us_write_type != POS_SENSLOG_TYPE_NONE) && (u_write_abnormal_flag == SENSLOG_ON)) {
+ /* Data compression */
+ retComp = compress2(reinterpret_cast<Bytef*>(&(g_sens_log_info[us_file_type]. \
+ uc_positioninglog_buf[SENSLOG_SEQ_SIZE + sizeof(ulPositioninglogBufLen)])), \
+ reinterpret_cast<uLongf*>(&ulPositioninglogBufLen), \
+ reinterpret_cast<Bytef*>(&(g_sens_log_info[us_file_type].uc_temp_buf[0])), \
+ ulTempBufLen, Z_DEFAULT_COMPRESSION);
+
+ if (retComp == Z_OK) {
+ memcpy(&(g_sens_log_info[us_file_type].uc_positioninglog_buf[0]), \
+ SENSLOG_SEQ_START, SENSLOG_SEQ_SIZE);
+ memcpy(&(g_sens_log_info[us_file_type].uc_positioninglog_buf[SENSLOG_SEQ_SIZE]), \
+ &ulPositioninglogBufLen, sizeof(ulPositioninglogBufLen));
+ memcpy(&(g_sens_log_info[us_file_type].uc_positioninglog_buf[SENSLOG_SEQ_SIZE \
+ + sizeof(ulPositioninglogBufLen) + ulPositioninglogBufLen]), SENSLOG_SEQ_END, SENSLOG_SEQ_SIZE);
+ g_sens_log_info[us_file_type].uc_positioninglog_buf[SENSLOG_SEQ_SIZE + sizeof(ulPositioninglogBufLen) \
+ + ulPositioninglogBufLen + SENSLOG_SEQ_SIZE] = '\n';
+ ulPositioninglogBufLen = static_cast<uint32_t>(SENSLOG_SEQ_SIZE + sizeof(ulPositioninglogBufLen) \
+ + ulPositioninglogBufLen + SENSLOG_SEQ_SIZE + 1);
+ POS_SENSLOG(us_write_type, (PCSTR)&(g_sens_log_info[us_file_type].uc_positioninglog_buf[0]), \
+ ulPositioninglogBufLen);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, \
+ "compress error[retComp = %d]", retComp);
+ }
+ }
+
+ if ((g_sens_log_info[us_file_type].uc_valid_flag == SENSLOG_VALIDFLAG_ON) \
+ && (uWriteFlag == SENSLOG_ON)) {
+ /* For executing file output */
+ /* Buffer size determination */
+ len = g_sens_log_info[us_file_type].ul_text_buf_len;
+ if (g_sens_log_info[us_file_type].ul_text_buf_size <= (len + ((headSize + us_size) * 3))) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "[%d]:DataSize[%d]/BufLen[%d]",
+ us_data_type, us_size, len);
+
+ /* In case of buffer upper limit,Write File */
+ SensLogOutputFile(static_cast<uint8_t>(us_file_type));
+
+ /* Buffer clear */
+ memset(&(g_sens_log_info[us_file_type].uc_text_buf[0]), 0x00,
+ g_sens_log_info[us_file_type].ul_text_buf_size);
+ len = 0;
+ }
+
+ /* Buffer storage */
+ memcpy(reinterpret_cast<char*>(&(g_sens_log_info[us_file_type].uc_text_buf[len])), \
+ &g_sens_log_info[us_file_type].uc_temp_buf[0], ulTempBufLen);
+ g_sens_log_info[us_file_type].ul_text_buf_len = len + ulTempBufLen;
+ g_sens_log_info[us_file_type].us_rec_count++;
+
+ /* Determining whether the number of file write records is the upper limit (the number of records per file) */
+ if (g_sens_log_info[us_file_type].st_gen.us_len <= g_sens_log_info[us_file_type].us_rec_count) {
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "[%d]:RecCnt[%d/%d]",
+ us_data_type, g_sens_log_info[us_file_type].us_rec_count, \
+ g_sens_log_info[us_file_type].st_gen.us_len);
+
+ /* In case of buffer upper limit,Write File */
+ SensLogOutputFile(static_cast<uint8_t>(us_file_type));
+
+ /* Buffer clear */
+ memset(&(g_sens_log_info[us_file_type].uc_text_buf[0]), 0x00, \
+ g_sens_log_info[us_file_type].ul_text_buf_size);
+ g_sens_log_info[us_file_type].ul_text_buf_len = 0;
+ g_sens_log_info[us_file_type].us_rec_count = 0;
+ /* Update the number of generations */
+ g_sens_log_info[us_file_type].us_gen_count++;
+ if (g_sens_log_info[us_file_type].st_gen.uc_gen < g_sens_log_info[us_file_type].us_gen_count) {
+ g_sens_log_info[us_file_type].us_gen_count = 1;
+ }
+ g_sens_log_info[us_file_type].uc_output_flag = SENSLOG_OUTPUTFLAG_NEW;
+ }
+ }
+ }
+ }
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Sensor log file type determination
+ *
+ * Determine the type of the output destination sensor log file
+ *
+ * @param[in] pstTbl Sensor log type definition table
+ * @param[in] Pus_data_type Data type
+ * @param[out] pus_write_type FRAMEWORKUNIFIEDLOG Output Type
+ * @param[in] ul_did Data ID
+ *
+ * @return Destination sensor log file type
+ */
+static uint16_t SensLogGetFileType(const SENSLOG_ID_TBL *pstTbl, uint16_t *pus_data_type, \
+ uint16_t *pus_write_type, DID ul_did) {
+ uint16_t file_type = SENSLOG_TYPE_COUNT;
+ uint16_t cnt = 0;
+
+ /* Determination of output log file type */
+ /* DID,Prioritize the beginning of the table for both data types. */
+ /* If DID is specified, it is judged by DID.*/
+ if (ul_did != 0) {
+ for (cnt = 0; pstTbl[cnt].us_file_type != SENSLOG_TYPE_COUNT; cnt++) {
+ if (pstTbl[cnt].ul_did == ul_did) {
+ *pus_data_type = pstTbl[cnt].us_data_type;
+ file_type = pstTbl[cnt].us_file_type;
+ *pus_write_type = pstTbl[cnt].us_write_type;
+ break;
+ }
+ }
+ }
+ /* If no DID is specified or cannot be found, judge according to the data type. */
+ if (file_type == SENSLOG_TYPE_COUNT) {
+ for (cnt = 0; pstTbl[cnt].us_file_type != SENSLOG_TYPE_COUNT; cnt++) {
+ if (pstTbl[cnt].us_data_type == *pus_data_type) {
+ file_type = pstTbl[cnt].us_file_type;
+ *pus_write_type = pstTbl[cnt].us_write_type;
+ break;
+ }
+ }
+ }
+ return file_type;
+}
+
+/**
+ * @brief
+ * Sensor log file output
+ *
+ * Write the log data in the buffer area to a file
+ *
+ * @param[in] ucFileType File type
+ */
+static void SensLogOutputFile(uint8_t ucFileType) {
+ FILE *fp;
+ int fd;
+ uint8_t uc_file_name_base[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE];
+ uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE];
+
+ if (ucFileType < SENSLOG_TYPE_COUNT) { // LCOV_EXCL_BR_LINE 200: can not exceed type
+ /* File path generation */
+ snprintf(reinterpret_cast<char*>(&uc_file_name_base[0]), sizeof(uc_file_name_base),
+ "%s%s",
+ g_sens_log_info[ucFileType].uc_file_path, g_sens_log_info[ucFileType].uc_file_name);
+ snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name),
+ reinterpret_cast<char*>(&uc_file_name_base[0]),
+ g_sens_log_info[ucFileType].us_gen_count);
+
+ /* Writing to a File */
+ if (g_sens_log_info[ucFileType].uc_output_flag == SENSLOG_OUTPUTFLAG_NEW) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \
+ "SensLog create file. : file[%s] : uc_output_flag[%d]", \
+ uc_file_name, g_sens_log_info[ucFileType].uc_output_flag);
+
+ /* Export New File(Write From Beginning)*/
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "w+");
+ g_sens_log_info[ucFileType].uc_output_flag = SENSLOG_OUTPUTFLAG_ADD;
+
+ /* Update generation information file */
+ SensLogOutputGenFile(ucFileType);
+ } else {
+ /* Append export */
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "a+");
+ }
+
+ if (NULL != fp) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ /* Log file output(ASCII)*/
+ fd = fileno(fp);
+ fwrite(&(g_sens_log_info[ucFileType].uc_text_buf[0]), g_sens_log_info[ucFileType].ul_text_buf_len, 1, fp);
+ fflush(fp); /* Flush the userspace buffers provided by the C library */
+ fdatasync(fd); /* Flush cache of files referenced by fd to disk */
+ fclose(fp); /* Coverity CID:23371 compliant */
+ } else {
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "SensLog fopen fail. : file[%s] : uc_output_flag[%d]", \
+ uc_file_name, g_sens_log_info[ucFileType].uc_output_flag);
+ // LCOV_EXCL_STOP
+ }
+ }
+ return;
+}
+
+/**
+ * @brief
+ * Generation information file output
+ *
+ * Holds the number of generations being output in the generation information file.
+ *
+ * @param[in] ucFileType File type
+ */
+static void SensLogOutputGenFile(uint8_t ucFileType) {
+ FILE *fp;
+ int fd;
+ uint8_t uc_file_name_base[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE];
+ uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE];
+
+ if (ucFileType < SENSLOG_TYPE_COUNT) { // LCOV_EXCL_BR_LINE 200: can not exceed type
+ /* File path generation */
+ snprintf(reinterpret_cast<char*>(&uc_file_name_base[0]), sizeof(uc_file_name_base),
+ "%s%s",
+ g_sens_log_info[ucFileType].uc_file_path, g_sens_log_info[ucFileType].uc_gen_fname);
+ snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name),
+ reinterpret_cast<char*>(&uc_file_name_base[0]),
+ g_sens_log_info[ucFileType].us_gen_count);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "SensLog create file. : file[%s] : us_gen_count[%d]",
+ uc_file_name, g_sens_log_info[ucFileType].us_gen_count);
+
+ /* Export New File(Write From Beginning)*/
+ fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "w+");
+ if (NULL != fp) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ /* Generation control number output */
+ fd = fileno(fp);
+ fprintf(fp, "%03d", g_sens_log_info[ucFileType].us_gen_count);
+ fflush(fp); /* Flush the userspace buffers provided by the C library */
+ fdatasync(fd); /* Flush cache of files referenced by fd to disk */
+ fclose(fp); /* Coverity CID:23372 compliant */
+ } else {
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "SensLog fopen fail. : file[%s] : us_gen_count[%d]", \
+ uc_file_name, g_sens_log_info[ucFileType].us_gen_count);
+ // LCOV_EXCL_STOP
+ }
+ }
+ return;
+}
+
+/**
+ * @brief
+ * Get system time
+ *
+ * Get the system time(Millisecond)
+ *
+ * @param[out] st_sys_time System time
+ */
+void SensLogGetSystemTime(SENSLOG_SYSTEMTIME *st_sys_time) {
+ time_t time_sec = 0;
+ struct timespec tp = {0};
+ struct tm time_cal= {0};
+
+ if (NULL != st_sys_time) { // LCOV_EXCL_BR_LINE 200: not NULL
+ if (0 == clock_gettime(CLOCK_REALTIME, &tp)) {
+ time_sec = tp.tv_sec;
+ localtime_r(&time_sec, &time_cal);
+ st_sys_time->us_year = static_cast<uint16_t>((WORD)time_cal.tm_year + 1900);
+ st_sys_time->us_month = static_cast<uint16_t>((WORD)time_cal.tm_mon + 1);
+ st_sys_time->us_day_of_week = (WORD)time_cal.tm_wday;
+ st_sys_time->us_day = (WORD)time_cal.tm_mday;
+ st_sys_time->us_hour = (WORD)time_cal.tm_hour;
+ st_sys_time->us_minute = (WORD)time_cal.tm_min;
+ st_sys_time->us_second = (WORD)time_cal.tm_sec;
+ st_sys_time->us_milli_seconds = (WORD)(static_cast<double>(tp.tv_nsec) * 1e-6); /* Calculating milliseconds */
+ }
+ }
+ return;
+}
+
+/* end of file */
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp
new file mode 100755
index 0000000..f1cd695
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp
@@ -0,0 +1,47 @@
+/*
+ * @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 :VehicleSensCanDeliveryEntry.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :CAN data delivery registration
+ * Module configuration :VehicleSensCanDeliveryEntry() CAN data delivery registration
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DeliveryCtrl.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensCanDeliveryEntry
+* ABSTRACT : CAN data delivery registration
+* FUNCTION : Register delivery of CAN data required as vehicle sensor middleware
+* ARGUMENT : void
+* NOTE :
+* RETURN : CANIF_RET_NORMAL :Normal completion
+* CANIF_RET_ERROR_CREATE_EVENT :Event generation failure
+* CANIF_RET_ERROR_PARAM :Parameter error
+* CANIF_RET_ERROR_BUFFULL :FULL of delivery registers
+* CANIF_RET_ERROR_CANIDFULL :FULL of delivery CAN ID numbers
+******************************************************************************/
+RET_API VehicleSensCanDeliveryEntry(void) {
+ return RET_NORMAL;
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp
new file mode 100755
index 0000000..aeb180e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp
@@ -0,0 +1,429 @@
+/*
+ * @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_Common.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor common processing(VEHICLE_COMMON)
+ * Module configuration :VehicleSensmemcmp() Functions for Common Processing Memory Block Comparisons
+ * VehicleSensCheckDid() Common Processing Data ID Check Function
+ * VehicleSensGetDataMasterOffset() Get function for common processing data master offset value
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_Common.h"
+#include "POS_private.h"
+#include <system_service/ss_ver.h>
+#include <system_service/ss_package.h>
+#include "gps_hal.h"
+#include "VehicleSens_DataMaster.h"
+
+
+#define _pb_strcat(pdest, psrc, size) (strncat(pdest, psrc, size) , (0))
+
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static const VEHICLESENS_DID_OFFSET_TBL kGstDidList[] = {
+ /* Data ID Offset size Reserved */
+ { VEHICLE_DID_DESTINATION, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_HV, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_STEERING_WHEEL, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_VB, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_IG, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MIC, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_BACKDOOR, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_PKB, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_ADIM, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_ILL, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_RHEOSTAT, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_SYSTEMP, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_SPEED_PULSE, VEHICLESENS_OFFSET_20WORD, {0, 0} },
+ { POSHAL_DID_SPEED_PULSE_FLAG, VEHICLESENS_OFFSET_20WORD, {0, 0} },
+ { POSHAL_DID_SPEED_KMPH, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GYRO_X, VEHICLESENS_OFFSET_20WORD, {0, 0} },
+ { POSHAL_DID_GYRO_Y, VEHICLESENS_OFFSET_20WORD, {0, 0} },
+ { POSHAL_DID_GYRO_Z, VEHICLESENS_OFFSET_20WORD, {0, 0} },
+ { POSHAL_DID_GSNS_X, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GSNS_Y, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GSNS_Z, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_REV, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GPS_ANTENNA, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_SNS_COUNTER, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_GPS_COUNTER, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GPS_VERSION, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} },
+ { VEHICLE_DID_LOCATION, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} },
+ /* ++GPS _CWORD82_ support */
+ { POSHAL_DID_GPS__CWORD82___CWORD44_GP4, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} },
+ { VEHICLE_DID_GPS__CWORD82__NMEA, VEHICLESENS_OFFSET_GPS_NMEA, {0, 0} },
+ { POSHAL_DID_GPS_NMEA, VEHICLESENS_OFFSET_GPS_NMEA, {0, 0} },
+ { POSHAL_DID_GPS__CWORD82__FULLBINARY, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} },
+ /* --GPS _CWORD82_ support */
+ { VEHICLE_DID_REV_LINE, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_REV_CAN, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ { POSHAL_DID_GYRO_EXT, VEHICLESENS_OFFSET_20WORD, {0, 0} },
+ { POSHAL_DID_SPEED_PULSE_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GYRO_X_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GYRO_Y_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GYRO_Z_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_SPEED_PULSE_FLAG_FST, VEHICLESENS_OFFSET_20WORD_FST, {0, 0} },
+ { POSHAL_DID_REV_FST, VEHICLESENS_OFFSET_20WORD_FST, {0, 0} },
+#endif
+ /* ++ PastModel002 support */
+ { VEHICLE_DID_GPS_UBLOX_NAV_POSLLH, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_STATUS, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_VELNED, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_DOP, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_SVINFO, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_NAV_CLOCK, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GPS_UBLOX_MON_HW, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} },
+ { VEHICLE_DID_GYRO_TROUBLE, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_GYRO_CONNECT_STATUS, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ /* -- PastModel002 support */
+ { POSHAL_DID_GPS_TIME, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GPS_TIME_RAW, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GPS_WKNROLLOVER, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_NAVIINFO_DIAG_GPS, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GYRO_TEMP, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GYRO_TEMP_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GSNS_X_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GSNS_Y_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GSNS_Z_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_PULSE_TIME, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_LOCATION_LONLAT, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_LOCATION_ALTITUDE, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MOTION_SPEED, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MOTION_HEADING, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_LOCATION_LONLAT_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_LOCATION_ALTITUDE_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MOTION_SPEED_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MOTION_HEADING_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_SETTINGTIME, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { VEHICLE_DID_MOTION_SPEED_INTERNAL, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GPS_CLOCK_DRIFT, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { POSHAL_DID_GPS_CLOCK_FREQ, VEHICLESENS_OFFSET_NORMAL, {0, 0} },
+ { 0, 0, {0, 0} } /* Termination code */
+};
+
+/*******************************************************************************
+* MODULE : VehicleSensmemcmp
+* ABSTRACT : Functions for Common Processing Memory Block Comparisons
+* FUNCTION : Memory block comparison processing
+* ARGUMENT : *vp_data1 : Comparison target address 1
+* : *vp_data2 : Comparison target address 2
+* : uc_size : Comparison Size
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* : VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensmemcmp(const void *vp_data1, const void *vp_data2, size_t uc_size) {
+ u_int8 ret = VEHICLESENS_EQ;
+ const u_int8 *ucp_data1 = (const u_int8 *)vp_data1;
+ const u_int8 *ucp_data2 = (const u_int8 *)vp_data2;
+
+ /* Loop by data size */
+ while (uc_size > 0) {
+ if (*ucp_data1 != *ucp_data2) {
+ /* Data mismatch */
+ ret = VEHICLESENS_NEQ;
+ break;
+ }
+ ucp_data1++;
+ ucp_data2++;
+ uc_size--;
+ }
+ return( ret );
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensCheckDid
+* ABSTRACT : Common Processing Data ID Check Function
+* FUNCTION : Check if the specified DID corresponds to the vehicle sensor information
+* ARGUMENT : ul_did : Data ID
+* NOTE :
+* RETURN : VEHICLESENS_INVALID :Disabled
+* : VEHICLESENS_EFFECTIVE :Enabled
+******************************************************************************/
+int32 VehicleSensCheckDid(DID ul_did) {
+ int32 i = 0;
+ int32 ret = VEHICLESENS_INVALID;
+
+ while (0 != kGstDidList[i].ul_did) { // LCOV_EXCL_BR_LINE 200: did always valid
+ if (kGstDidList[i].ul_did == ul_did) {
+ /* DID enabled */
+ ret = VEHICLESENS_EFFECTIVE;
+ break;
+ }
+ i++;
+ }
+ return( ret );
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterOffset
+* ABSTRACT : Get function for common processing data master offset value
+* FUNCTION : Get the fixed offset value for a given DID
+* ARGUMENT : ul_did : Data ID
+* NOTE :
+* RETURN : Offset value(Returns 0 if DID is invalid)
+******************************************************************************/
+u_int16 VehicleSensGetDataMasterOffset(DID ul_did) {
+ int32 i = 0; /* Generic counters */
+ u_int16 ret = 0; /* Return value of this function */
+
+ while (0 != kGstDidList[i].ul_did) { // LCOV_EXCL_BR_LINE 200: did always valid
+ if (kGstDidList[i].ul_did == ul_did) {
+ /* DID enabled */
+ ret = kGstDidList[i].us_offset;
+ break;
+ }
+ i++;
+ }
+ return( ret );
+}
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterExtOffset
+* ABSTRACT : Get function for common processing data master offset value
+* FUNCTION : Get the fixed offset value for the first package delivery of the specified DID
+* ARGUMENT : ul_did : Data ID
+* NOTE :
+* RETURN : Offset value(Returns 0 for unspecified DID)
+******************************************************************************/
+u_int16 VehicleSensGetDataMasterExtOffset(DID ul_did) {
+ u_int16 usRet = 0; /* Return value of this function */
+
+ switch (ul_did) {
+ case POSHAL_DID_GYRO_EXT:
+ case POSHAL_DID_GYRO_X:
+ case POSHAL_DID_GYRO_Y:
+ case POSHAL_DID_GYRO_Z:
+ case POSHAL_DID_GSNS_X: /* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+ case POSHAL_DID_GSNS_Y: /* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+ case POSHAL_DID_GSNS_Z:
+ case POSHAL_DID_SPEED_PULSE:
+ {
+ /* Returns the extended package size (one data 2byte) at the time of initial delivery */
+ usRet = VEHICLESENS_OFFSET_10WORD_PKG_EXT;
+ break;
+ }
+ case POSHAL_DID_SNS_COUNTER:
+ case POSHAL_DID_REV:
+ {
+ /* Returns the extended package size (one data 1byte) at the time of initial delivery */
+ usRet = VEHICLESENS_OFFSET_BYTE_PKG_EXT;
+ break;
+ }
+ case POSHAL_DID_GYRO_TEMP:
+ {
+ /* Returns the extended package size (one data 2byte) at the time of initial delivery */
+ usRet = VEHICLESENS_OFFSET_WORD_PKG_EXT;
+ break;
+ }
+ case POSHAL_DID_PULSE_TIME:
+ {
+ /* Returns the expansion package size (132 bytes per data) at the time of initial delivery */
+ usRet = VEHICLESENS_OFFSET_32LONG_PKG_EXT;
+ break;
+ }
+ default: /* Other than the above */ /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+ return( usRet );
+}
+#endif
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+
+/**
+ * @brief
+ * GPS version information setting request
+ *
+ * Request to set GPS version information to SS
+ *
+ * @param[in] pstData Pointer to received message data
+ */
+void VehicleSensSetGpsVersion(const SENSOR_MSG_GPSDATA_DAT *pstData) {
+ static BOOL isExistGpsVersion = FALSE;
+ SSVER_PkgInfo info;
+ CSSVer cssVer;
+ UNIT_TYPE eType = UNIT_TYPE_NONE; /* Supported HW Configuration Type */
+ EFrameworkunifiedStatus ret;
+
+ if (isExistGpsVersion == FALSE) {
+ memset(&info, 0x00, sizeof(info));
+ /* Supported HW Configuration Check */
+ eType = GetEnvSupportInfo();
+ if (UNIT_TYPE_GRADE1 == eType) { // LCOV_EXCL_BR_LINE 6:cannot be this env
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* GRADE1 */
+ memcpy(info.version, pstData->uc_data, sizeof(info.version));
+
+ /* Calling setPkgInfo() */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "--- VehicleUtility_SetGpsVersion setPkgInfo -->");
+ ret = cssVer.setPkgInfo(SS_PKG_NAVI_GPS, info);
+ if (ret == eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "--- VehicleUtility_SetGpsVersion setPkgInfo <-- GPSVersion = %s", info.version);
+ isExistGpsVersion = TRUE; /* Update Flag */
+ } else {
+ /* Error log */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "Failed to set PkgInfo EpositioningStatus = %d", ret);
+ }
+ // LCOV_EXCL_STOP
+ } else if ( UNIT_TYPE_GRADE2 == eType ) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ } else {
+ /* nop */
+ }
+ }
+ return;
+}
+
+/**
+ * @brief
+* Acquisition of location and time information (dump)
+ *
+ * @param[out] pBuf Dump information
+ * @param[in] Uc_get_method Retrieval method
+ */
+void VehicleSensGetDebugPosDate(void* pBuf, u_int8 uc_get_method) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[256];
+ VEHICLESENS_DATA_MASTER stSnsData;
+ SENSORLOCATION_LONLATINFO_DAT *pstLonLat;
+ SENSORLOCATION_ALTITUDEINFO_DAT *pstAltitude;
+ SENSORMOTION_HEADINGINFO_DAT *pstHeading;
+ SENSOR_MSG_GPSDATA_DAT stGpsData;
+ SENSOR_MSG_GPSTIME *pstDateTimeGps;
+ NAVIINFO_DIAG_GPS *pstDiagGps;
+ uint8_t i;
+
+ memset(&buf, 0x00, sizeof(buf));
+ /* Title */
+ switch ( uc_get_method ) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ snprintf(reinterpret_cast<char *>(&buf), sizeof(buf), "GPS Info");
+ break;
+ case VEHICLESENS_GETMETHOD_NAVI:
+ snprintf(reinterpret_cast<char *>(&buf), sizeof(buf), "Navi Info");
+ break;
+ default:
+ /* nop */
+ break;
+ }
+
+ /* Latitude,Longitude */
+ VehicleSensGetLocationLonLat(&stSnsData, uc_get_method);
+ pstLonLat = reinterpret_cast<SENSORLOCATION_LONLATINFO_DAT*>(stSnsData.uc_data);
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf( reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [LonLat] sync:%3d, Enable:%01d, Lon:%10d, Lat:%10d, PosSts:0x%02x, PosAcc:0x%04x",
+ pstLonLat->SyncCnt,
+ pstLonLat->isEnable,
+ pstLonLat->Longitude,
+ pstLonLat->Latitude,
+ pstLonLat->posSts,
+ pstLonLat->posAcc);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+
+ /* Altitude */
+ VehicleSensGetLocationAltitude(&stSnsData, uc_get_method);
+ pstAltitude = reinterpret_cast<SENSORLOCATION_ALTITUDEINFO_DAT*>(stSnsData.uc_data);
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [Alt] sync:%3d, Enable:%01d, Alt:%10d",
+ pstAltitude->SyncCnt,
+ pstAltitude->isEnable,
+ pstAltitude->Altitude);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+
+ /* Orientation */
+ VehicleSensGetMotionHeading(&stSnsData, uc_get_method);
+ pstHeading = reinterpret_cast<SENSORMOTION_HEADINGINFO_DAT*>(stSnsData.uc_data);
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [Head] sync:%3d, Enable:%01d, Head:%5d, PosSts:0x%02x",
+ pstHeading->SyncCnt,
+ pstHeading->isEnable,
+ pstHeading->Heading,
+ pstHeading->posSts);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+
+ switch ( uc_get_method ) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ /* Satellite information */
+ VehicleSensGetNaviinfoDiagGPSg(&stGpsData);
+ pstDiagGps = reinterpret_cast<NAVIINFO_DIAG_GPS*>(stGpsData.uc_data);
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [Diag]\n FixSts:0x%02x",
+ pstDiagGps->stFix.ucFixSts);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ for (i = 0; i < 12; i++) {
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] RcvSts:0x%02x, prn:0x%02x, elv:0x%02x, Lv:0x%02x, azm:0x%04x",
+ i,
+ pstDiagGps->stSat.stPrn[i].ucRcvSts,
+ pstDiagGps->stSat.stPrn[i].ucPrn,
+ pstDiagGps->stSat.stPrn[i].ucelv,
+ pstDiagGps->stSat.stPrn[i].ucLv,
+ pstDiagGps->stSat.stPrn[i].usAzm);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ }
+
+ /* Time */
+ VehicleSensGetGpsTime(&stGpsData, VEHICLESENS_GETMETHOD_GPS);
+ pstDateTimeGps = reinterpret_cast<SENSOR_MSG_GPSTIME*>(stGpsData.uc_data);
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [Time] %04d/%02d/%02d %02d:%02d:%02d, sts:%d",
+ pstDateTimeGps->utc.year,
+ pstDateTimeGps->utc.month,
+ pstDateTimeGps->utc.date,
+ pstDateTimeGps->utc.hour,
+ pstDateTimeGps->utc.minute,
+ pstDateTimeGps->utc.second,
+ pstDateTimeGps->tdsts);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ break;
+ case VEHICLESENS_GETMETHOD_NAVI:
+ /* nop */
+ break;
+ default:
+ /* nop */
+ break;
+ }
+ memcpy(pBuf, &buf[0], sizeof(buf));
+ return;
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp
new file mode 100755
index 0000000..7bf40d1
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp
@@ -0,0 +1,1880 @@
+/*
+ * @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_DataMasterMain.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master
+ * Module configuration :VehicleSensInitDataMaster() Vehicle data master initialization function
+ * :VehicleSensSetDataMasterCan() Vehicle sensor data master CAN data set processing
+ * :VehicleSensSetDataMasterLineSens() Vehicle sensor data master LineSensor data set process
+ * :VehicleSensSetDataMasterGps() Vehicle Sensor Data Master GPS Data Set Processing
+ * :VehicleSensGetDataMaster() Vehicle Sensor Data Master Get Processing
+ * :VehicleSensGetGpsDataMaster() Vehicle Sensor Data Master GPS Data Get Processing
+ * :VehicleSensGetGps_CWORD82_NmeaSensorCnt() Vehicle sensor GPS_sensor counter GET function
+ * :VehicleSensSetDataMaster_CWORD82_() Vehicle sensor data master GPS data (_CWORD82_) set processing
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "gps_hal.h"
+#include "POS_private.h"
+#include "DeadReckoning_main.h"
+#include "VehicleSens_DeliveryCtrl.h"
+#include "Vehicle_API.h"
+#include "CommonDefine.h"
+#include <vehicle_service/POS_common_API.h>
+#include "SensorMotion_API.h"
+#include "SensorLog.h"
+#include "ClockIf.h"
+#include "DiagSrvIf.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+VEHICLESENS_PKG_DELIVERY_TEMP_EXT gstPkgTempExt; // NOLINT(readability/nolint)
+#endif
+
+#define DR_DEBUG 0
+#define GPS_DEBUG 0
+
+/*************************************************/
+/* Function prototype */
+/*************************************************/
+static uint8_t VehicleSensGetSensorCnt(void);
+
+
+/*******************************************************************************
+* MODULE : VehicleSensInitDataMaster
+* ABSTRACT : Vehicle sensor data master initialization
+* FUNCTION : Initializing Vehicle Sensor Data Master
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitDataMaster(void) {
+ /* Vehicle sensor data master initialization */
+
+ VehicleSensInitSpeedPulsel();
+ VehicleSensInitSpeedKmphl();
+ VehicleSensInitGyroXl();
+ VehicleSensInitGyroYl();
+ VehicleSensInitGyroZl();
+ VehicleSensInitGsnsXl();
+ VehicleSensInitGsnsYl();
+ VehicleSensInitGsnsZl();
+ VehicleSensInitRevl();
+ VehicleSensInitGpsAntennal();
+ VehicleSensInitSnsCounterl();
+ VehicleSensInitGpsCounterg();
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ VehicleSensInitGyroRevl();
+ VehicleSensInitSnsCounterExtl();
+ VehicleSensInitGyroExtl();
+ VehicleSensInitGyroYExtl();
+ VehicleSensInitGyroZExtl();
+ VehicleSensInitSpeedPulseExtl();
+ VehicleSensInitRevExtl();
+ VehicleSensInitGsnsXExtl();
+ VehicleSensInitGsnsYExtl();
+ VehicleSensInitGsnsZExtl();
+ VehicleSensInitGsnsXFstl();
+ VehicleSensInitGsnsYFstl();
+ VehicleSensInitGsnsZFstl();
+ VehicleSensInitGyroXFstl();
+ VehicleSensInitGyroYFstl();
+ VehicleSensInitGyroZFstl();
+ VehicleSensInitSpeedPulseFstl();
+ VehicleSensInitSpeedPulseFlagFstl();
+ VehicleSensInitRevFstl();
+#endif
+ /* ++ GPS _CWORD82_ support */
+ VehicleSensInitGps_CWORD82_FullBinaryG();
+ VehicleSensInitGps_CWORD82_NmeaG();
+ VehicleSensInitGps_CWORD82__CWORD44_Gp4G();
+ VehicleSensInitGpsNmeaG();
+ /* -- GPS _CWORD82_ support */
+
+ /* ++ PastModel002 support */
+ VehicleSensInitNavVelnedG();
+ VehicleSensInitNavTimeUtcG();
+ VehicleSensInitNavTimeGpsG();
+ VehicleSensInitNavSvInfoG();
+ VehicleSensInitNavStatusG();
+ VehicleSensInitNavPosllhG();
+ VehicleSensInitNavClockG();
+ VehicleSensInitNavDopG();
+ VehicleSensInitMonHwG();
+
+ VehicleSensInitSpeedPulseFlag();
+ VehicleSensInitGpsInterruptFlag();
+
+ VehicleSensInitGyroTrouble();
+ VehicleSensInitMainGpsInterruptSignal();
+ VehicleSensInitSysGpsInterruptSignal();
+ VehicleSensInitGyroConnectStatus();
+ VehicleSensInitGpsAntennaStatus();
+ /* -- PastModel002 support */
+
+ VehicleSensInitGyroTempFstl();
+ VehicleSensInitGyroTempExtl();
+ VehicleSensInitGyroTempl();
+ VehicleSensInitPulseTimeExtl();
+ VehicleSensInitPulseTimel();
+
+ VehicleSensInitLocationLonLatG();
+ VehicleSensInitLocationAltitudeG();
+ VehicleSensInitMotionSpeedG();
+ VehicleSensInitMotionHeadingG();
+ VehicleSensInitNaviinfoDiagGPSg();
+ VehicleSensInitGpsTimeG();
+ VehicleSensInitGpsTimeRawG();
+ VehicleSensInitWknRolloverG();
+ VehicleSensInitLocationLonLatN();
+ VehicleSensInitLocationAltitudeN();
+ VehicleSensInitMotionSpeedN();
+ VehicleSensInitMotionHeadingN();
+ VehicleSensInitSettingTimeclock();
+ VehicleSensInitMotionSpeedI();
+ VehicleSensInitGpsClockDriftG();
+ VehicleSensInitGpsClockFreqG();
+
+ VehicleSens_InitLocationInfoNmea_n();
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterLineSens
+* ABSTRACT : Vehicle sensor data master LineSensor data set process
+* FUNCTION : Set LineSensor data
+* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterLineSens(const LSDRV_LSDATA *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n,
+ BOOL b_sens_ext) {
+ u_int8 uc_chg_type;
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (pst_data->ul_did) {
+ case POSHAL_DID_SPEED_PULSE:
+ {
+ uc_chg_type = VehicleSensSetSpeedPulsel(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+
+ break;
+ }
+// case POSHAL_DID_GYRO_X:
+// {
+// uc_chg_type = VehicleSensSetGyroXl(pst_data);
+// (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+// break;
+// }
+ case POSHAL_DID_GYRO_Y:
+ {
+ uc_chg_type = VehicleSensSetGyroYl(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GYRO_Z:
+ {
+ uc_chg_type = VehicleSensSetGyroZl(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_REV:
+ {
+ uc_chg_type = VehicleSensSetRevl(pst_data);
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_REV \r\n");
+#endif
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* -- PastModel002 support DR */
+ break;
+ }
+ case POSHAL_DID_GPS_ANTENNA:
+ {
+ uc_chg_type = VehicleSensSetGpsAntennal(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GYRO_X:
+ case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ uc_chg_type = VehicleSensSetGyroRevl(pst_data);
+// if (b_sens_ext == TRUE) {
+// VehicleSensSetGyroExtl(pst_data);
+// }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterLineSensG
+* ABSTRACT : Vehicle sensor data master LineSensor data set process
+* FUNCTION : Set LineSensor data
+* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterLineSensG(const LSDRV_LSDATA_G *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n,
+ BOOL b_sens_ext) {
+ u_int8 uc_chg_type;
+ SENSORMOTION_SPEEDINFO_DAT stSpeed;
+ const VEHICLESENS_DATA_MASTER* pst_master;
+ u_int16 usSP_KMPH = 0; /* Vehicle speed(km/h) */
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (pst_data->ul_did) {
+ case POSHAL_DID_SPEED_PULSE:
+ {
+ uc_chg_type = VehicleSensSetSpeedPulselG(pst_data);
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_SPEED_PULSE \r\n");
+#endif
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetSpeedPulseExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* -- PastModel002 support DR */
+ break;
+ }
+ case POSHAL_DID_SPEED_KMPH:
+ {
+ uc_chg_type = VehicleSensSetSpeedKmphlG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+
+ /* Set the data master of Motion Seepd (Internal) */
+ pst_master = (const VEHICLESENS_DATA_MASTER*)pst_data;
+ memset(&stSpeed, 0x00, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+ /* When the notified size is ""0"",The vehicle speed cannot be calculated with the line sensor. */
+ if (pst_master->us_size == 0) {
+ stSpeed.isEnable = FALSE;
+ } else {
+ stSpeed.isEnable = TRUE;
+ memcpy(&usSP_KMPH, pst_master->uc_data, sizeof(u_int16));
+ }
+ stSpeed.getMethod = SENSOR_GET_METHOD_POS;
+ /* Unit conversion [0.01km/h] -> [0.01m/s] */
+ stSpeed.Speed = static_cast<uint16_t>((1000 * usSP_KMPH) / 3600);
+
+ uc_chg_type = VehicleSensSetMotionSpeedI(&stSpeed);
+ (*p_data_master_set_n)(VEHICLE_DID_MOTION_SPEED_INTERNAL, uc_chg_type, VEHICLESENS_GETMETHOD_INTERNAL);
+ break;
+ }
+// case POSHAL_DID_GYRO_X:
+// {
+// uc_chg_type = VehicleSensSetGyroXlG(pst_data);
+//#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+// FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_GYRO_X \r\n");
+//#endif
+// (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+// /* ++ PastModel002 support DR */
+// VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+// /* -- PastModel002 support DR */
+// break;
+// }
+ case POSHAL_DID_GYRO_Y:
+ {
+ uc_chg_type = VehicleSensSetGyroYlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGyroYExtlG(pst_data);
+ }
+#if (DR_DEBUG == 1)
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_GYRO_Y \r\n");
+#endif
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GYRO_Z:
+ {
+ uc_chg_type = VehicleSensSetGyroZlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGyroZExtlG(pst_data);
+ }
+#if (DR_DEBUG == 1)
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_GYRO_Z \r\n");
+#endif
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_SNS_COUNTER:
+ {
+#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_SNS_COUNTER \r\n");
+#endif
+ uc_chg_type = VehicleSensSetSnsCounterlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetSnsCounterExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* -- PastModel002 support DR */
+ break;
+ }
+ case POSHAL_DID_GYRO_X:
+ case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ uc_chg_type = VehicleSensSetGyroRevlG(pst_data);
+
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGyroExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+
+ break;
+ }
+
+ case POSHAL_DID_SPEED_PULSE_FLAG:
+ {
+ uc_chg_type = VehicleSensSetSpeedPulseFlag((const LSDRV_LSDATA_G *)pst_data);
+
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ /* -- PastModel002 support DR */
+
+ break;
+ }
+ case POSHAL_DID_GPS_INTERRUPT_FLAG:
+ {
+ uc_chg_type = VehicleSensSetGpsInterruptFlag((const LSDRV_LSDATA_G *)pst_data);
+
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+
+ break;
+ }
+ case POSHAL_DID_REV:
+ {
+ uc_chg_type = VehicleSensSetRevlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetRevExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GYRO_TEMP:
+ {
+ uc_chg_type = VehicleSensSetGyroTemplG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGyroTempExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GSNS_X:
+ {
+ uc_chg_type = VehicleSensSetGsnsXlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGsnsXExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GSNS_Y:
+ {
+ uc_chg_type = VehicleSensSetGsnsYlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGsnsYExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GSNS_Z:
+ {
+ uc_chg_type = VehicleSensSetGsnsZlG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetGsnsZExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_PULSE_TIME:
+ {
+ uc_chg_type = VehicleSensSetPulseTimelG(pst_data);
+ if (b_sens_ext == TRUE) {
+ VehicleSensSetPulseTimeExtlG(pst_data);
+ }
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterLineSensFst
+* ABSTRACT : Vehicle sensor data master LineSensor data set process
+* FUNCTION : Set LineSensor data
+* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterLineSensFst(const LSDRV_LSDATA_FST *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n) { // LCOV_EXCL_START 8: dead code // // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_chg_type;
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (pst_data->ul_did) {
+ case POSHAL_DID_GYRO_X_FST: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ uc_chg_type = VehicleSensSetGyroXFstl(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GYRO_Y_FST: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ uc_chg_type = VehicleSensSetGyroYFstl(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_GYRO_Z_FST: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ uc_chg_type = VehicleSensSetGyroZFstl(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FST:
+ {
+ uc_chg_type = VehicleSensSetSpeedPulseFstl(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ break;
+ }
+ default:
+ break;
+ }
+}
+// LCOV_EXCL_STOP
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterLineSensFstG
+* ABSTRACT : Vehicle sensor data master LineSensor data set process
+* FUNCTION : Set LineSensor data
+* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterLineSensFstG(const LSDRV_MSG_LSDATA_DAT_FST *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n) {
+ u_int8 uc_chg_type;
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (pst_data->st_gyro_x.ul_did) {
+ case POSHAL_DID_GYRO_X_FST:
+ {
+ uc_chg_type = VehicleSensSetGyroXFstG(&(pst_data->st_gyro_x));
+ if (pst_data->st_gyro_x.uc_partition_max == pst_data->st_gyro_x.uc_partition_num)
+ {
+ (*p_data_master_set_n)(pst_data->st_gyro_x.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_gyro_y.ul_did) {
+ case POSHAL_DID_GYRO_Y_FST:
+ {
+ uc_chg_type = VehicleSensSetGyroYFstG(&(pst_data->st_gyro_y));
+ if (pst_data->st_gyro_y.uc_partition_max == pst_data->st_gyro_y.uc_partition_num) {
+ (*p_data_master_set_n)(pst_data->st_gyro_y.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_gyro_z.ul_did) {
+ case POSHAL_DID_GYRO_Z_FST:
+ {
+ uc_chg_type = VehicleSensSetGyroZFstG(&(pst_data->st_gyro_z));
+ if (pst_data->st_gyro_z.uc_partition_max == pst_data->st_gyro_z.uc_partition_num) {
+ (*p_data_master_set_n)(pst_data->st_gyro_z.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_speed.ul_did) {
+ case POSHAL_DID_SPEED_PULSE_FST:
+ {
+ uc_chg_type = VehicleSensSetSpeedPulseFstG(&(pst_data->st_speed));
+ if (pst_data->st_speed.uc_partition_max == pst_data->st_speed.uc_partition_num)
+ {
+ (*p_data_master_set_n)(pst_data->st_speed.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_spd_pulse_flg.ul_did) {
+ case POSHAL_DID_SPEED_PULSE_FLAG_FST:
+ {
+ uc_chg_type = VehicleSensSetSpeedPulseFlagFstG(&(pst_data->st_spd_pulse_flg));
+ if (pst_data->st_spd_pulse_flg.uc_partition_max == pst_data->st_spd_pulse_flg.uc_partition_num)
+ {
+ (*p_data_master_set_n)(pst_data->st_spd_pulse_flg.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_rev.ul_did) {
+ case POSHAL_DID_REV_FST:
+ {
+ uc_chg_type = VehicleSensSetRevFstG(&(pst_data->st_rev));
+ if (pst_data->st_rev.uc_partition_max == pst_data->st_rev.uc_partition_num)
+ {
+ (*p_data_master_set_n)(pst_data->st_rev.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_gyro_temp.ul_did) {
+ case POSHAL_DID_GYRO_TEMP_FST:
+ {
+ uc_chg_type = VehicleSensSetGyroTempFstG(&(pst_data->st_gyro_temp));
+
+ if (pst_data->st_gyro_temp.uc_partition_max == pst_data->st_gyro_temp.uc_partition_num) {
+ (*p_data_master_set_n)(pst_data->st_gyro_temp.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_gsns_x.ul_did) {
+ case POSHAL_DID_GSNS_X_FST:
+ {
+ uc_chg_type = VehicleSensSetGsnsXFstG(&(pst_data->st_gsns_x));
+
+ if (pst_data->st_gsns_x.uc_partition_max == pst_data->st_gsns_x.uc_partition_num) {
+ (*p_data_master_set_n)(pst_data->st_gsns_x.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_gsns_y.ul_did) {
+ case POSHAL_DID_GSNS_Y_FST:
+ {
+ uc_chg_type = VehicleSensSetGsnsYFstG(&(pst_data->st_gsns_y));
+
+ if (pst_data->st_gsns_y.uc_partition_max == pst_data->st_gsns_y.uc_partition_num) {
+ (*p_data_master_set_n)(pst_data->st_gsns_y.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (pst_data->st_gsns_z.ul_did) {
+ case POSHAL_DID_GSNS_Z_FST:
+ {
+ uc_chg_type = VehicleSensSetGsnsZFstG(&(pst_data->st_gsns_z));
+
+ if (pst_data->st_gsns_z.uc_partition_max == pst_data->st_gsns_z.uc_partition_num) {
+ (*p_data_master_set_n)(pst_data->st_gsns_z.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+}
+#endif
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterGps
+* ABSTRACT : Vehicle Sensor Data Master GPS Data Set Processing
+* FUNCTION : Set GPS data
+* ARGUMENT : *pst_data : GPS received message data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterGps(SENSOR_MSG_GPSDATA_DAT *pst_data,
+ PFUNC_DMASTER_SET_N p_data_master_set_n) {
+ u_int8 uc_chg_type;
+ SENSORLOCATION_LONLATINFO_DAT lstLonLat;
+ SENSORLOCATION_ALTITUDEINFO_DAT lstAltitude;
+ SENSORMOTION_HEADINGINFO_DAT lstHeading;
+ MDEV_GPS_CUSTOMDATA *pstCustomData;
+
+ VEHICLESENS_DATA_MASTER st_data;
+ u_int8 antennaState = 0;
+ u_int8 sensCount = 0;
+ u_int8 ucResult = SENSLOG_RES_SUCCESS;
+
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail;
+ BOOL bIsAvailable;
+ PNO us_pno;
+
+ /* Antenna Connection Information */
+ (void)memset(reinterpret_cast<void *>(&st_data), 0, sizeof(st_data));
+ VehicleSensGetGpsAntennal(&st_data);
+ antennaState = st_data.uc_data[0];
+
+ /* Sensor Counter */
+ (void)memset(reinterpret_cast<void *>(&st_data), 0, sizeof(st_data));
+ VehicleSensGetSnsCounterl(&st_data);
+ /** Sensor Counter Value Calculation */
+ /** Subtract sensor counter according to data amount from sensor counter.(Rounded off) */
+ /** Communication speed9600bps = 1200byte/s,Sensor counter is 1 count at 100ms. */
+ sensCount = st_data.uc_data[0];
+
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "antennaState = %d, sensCount = %d", antennaState, sensCount);
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (pst_data->ul_did) { // LCOV_EXCL_BR_LINE 6:some DID is not used
+ case VEHICLE_DID_GPS_UBLOX_NAV_VELNED:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_VELNED \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavVelnedG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavTimeUtcG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavTimeGpsG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_SVINFO:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_SVINFO \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavSvInfoG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_STATUS:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_STATUS \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavStatusG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_POSLLH:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_POSLLH \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavPosllhG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_CLOCK:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_CLOCK \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavClockG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_DOP:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_DOP \r\n");
+#endif
+ uc_chg_type = VehicleSensSetNavDopG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* ++ PastModel002 support DR */
+ VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ /* -- PastModel002 support DR */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_MON_HW:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_MON_HW \r\n");
+#endif
+ uc_chg_type = VehicleSensSetMonHwG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_COUNTER:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ uc_chg_type = VehicleSensSetGpsCounterg(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ /* GPS raw data(_CWORD82_ NMEA) */
+ case VEHICLE_DID_GPS__CWORD82__NMEA:
+ {
+ /* NMEA data */
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "VehicleSens_GpsDataDelivery VEHICLE_DID_GPS__CWORD82__NMEA -->");
+
+ /* Insert Antenna Connection Status and Sensor Counter */
+ pst_data->uc_data[1] = antennaState; /* Insert Antennas into 2byte Eyes */
+ /* Place counters at 3byte */
+ pst_data->uc_data[2] = static_cast<u_int8>(sensCount - (u_int8)(((GPS_NMEA_SZ * 10) / 1200) + 1));
+
+ uc_chg_type = VehicleSensSetGps_CWORD82_NmeaG(pst_data); /* Ignore->MISRA-C++:2008 Rule 5-2-5 */
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "VehicleSens_GpsDataDelivery VEHICLE_DID_GPS__CWORD82__NMEA <--");
+ break;
+ }
+ /* GPS raw data(FullBinary) */
+ case POSHAL_DID_GPS__CWORD82__FULLBINARY:
+ {
+ /* FullBin data */
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "VehicleSens_GpsDataDelivery POSHAL_DID_GPS__CWORD82__FULLBINARY -->");
+
+ /* Insert Antenna Connection Status and Sensor Counter */
+ pst_data->uc_data[0] = antennaState; /* Insert Antennas into 1byte Eyes */
+ /* Place counters at 2byte */
+ pst_data->uc_data[1] = static_cast<u_int8>(sensCount - (u_int8)(((GPS_CMD_FULLBIN_SZ * 10) / 1200) + 1));
+
+ uc_chg_type = VehicleSensSetGps_CWORD82_FullBinaryG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "VehicleSens_GpsDataDelivery POSHAL_DID_GPS__CWORD82__FULLBINARY <--");
+ break;
+ }
+ /* GPS raw data(Specific information) */
+ case POSHAL_DID_GPS__CWORD82___CWORD44_GP4:
+ {
+ /* GPS-specific information */
+ uc_chg_type = VehicleSensSetGps_CWORD82__CWORD44_Gp4G(pst_data); /* Ignore->MISRA-C++:2008 Rule 5-2-5 */
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ }
+ case POSHAL_DID_GPS_CUSTOMDATA:
+ {
+ pstCustomData = reinterpret_cast<MDEV_GPS_CUSTOMDATA*>(pst_data->uc_data);
+ /* Latitude/LongitudeInformation */
+ (void)memcpy(&lstLonLat, &(pstCustomData->st_lonlat), sizeof(SENSORLOCATION_LONLATINFO_DAT));
+ lstLonLat.SyncCnt = VehicleSensGetSensorCnt(); /* Synchronization counter setting */
+ uc_chg_type = VehicleSensSetLocationLonLatG(&lstLonLat);
+ (*p_data_master_set_n)(VEHICLE_DID_LOCATION_LONLAT, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+
+ /* Altitude information */
+ (void)memcpy(&lstAltitude, &(pstCustomData->st_altitude), sizeof(SENSORLOCATION_ALTITUDEINFO_DAT));
+ lstAltitude.SyncCnt = VehicleSensGetSensorCnt(); /* Synchronization counter setting */
+ uc_chg_type = VehicleSensSetLocationAltitudeG(&lstAltitude);
+ (*p_data_master_set_n)(VEHICLE_DID_LOCATION_ALTITUDE, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+
+ /* Bearing information */
+ (void)memcpy(&lstHeading, &(pstCustomData->st_heading), sizeof(SENSORMOTION_HEADINGINFO_DAT));
+ lstHeading.SyncCnt = VehicleSensGetSensorCnt(); /* Synchronization counter setting */
+ uc_chg_type = VehicleSensSetMotionHeadingG(&lstHeading);
+ (*p_data_master_set_n)(VEHICLE_DID_MOTION_HEADING, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+
+ /* GPS time information */
+ uc_chg_type = VehicleSensSetGpsTimeG(&(pstCustomData->st_gps_time));
+ (*p_data_master_set_n)(POSHAL_DID_GPS_TIME, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+
+ /* Set GPS time to CLOCK */
+ eStatus = ClockIfDtimeSetGpsTime(&(pstCustomData->st_gps_time), &bIsAvailable);
+ if ((bIsAvailable == TRUE) && (eStatus != eFrameworkunifiedStatusOK)) {
+ ucResult = SENSLOG_RES_FAIL;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ClockIfDtimeSetGpsTime ERROR!! [ret=%d, y=%d, m=%d, d=%d, h=%d, n=%d, s=%d, sts=%d]",
+ eStatus, pstCustomData->st_gps_time.utc.year, pstCustomData->st_gps_time.utc.month,
+ pstCustomData->st_gps_time.utc.date,
+ pstCustomData->st_gps_time.utc.hour, pstCustomData->st_gps_time.utc.minute,
+ pstCustomData->st_gps_time.utc.second, pstCustomData->st_gps_time.tdsts);
+ }
+ us_pno = _pb_CnvName2Pno(SENSLOG_PNAME_CLOCK);
+ SensLogWriteOutputData(SENSLOG_DATA_O_TIME_CS, 0, us_pno,
+ reinterpret_cast<uint8_t *>(&(pstCustomData->st_gps_time)),
+ sizeof(pstCustomData->st_gps_time), ucResult);
+
+ /* Diag Info */
+ uc_chg_type = VehicleSensSetNaviinfoDiagGPSg(&(pstCustomData->st_diag_gps));
+ (*p_data_master_set_n)(VEHICLE_DID_NAVIINFO_DIAG_GPS, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ }
+ /* GPS raw data(NMEA except _CWORD82_) */
+ case POSHAL_DID_GPS_NMEA:
+ {
+ /* NMEA data */
+ uc_chg_type = VehicleSensSetGpsNmeaG(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ }
+ /* GPS version(except _CWORD82_) */
+ case POSHAL_DID_GPS_VERSION:
+ {
+ VehicleSensSetGpsVersion(pst_data);
+ break;
+ }
+ /* Raw GPS time data */
+ case POSHAL_DID_GPS_TIME_RAW:
+ {
+ (void)VehicleSensSetGpsTimeRawG(reinterpret_cast<SENSOR_GPSTIME_RAW*>(pst_data->uc_data));
+ break;
+ }
+ case POSHAL_DID_GPS_TIME:
+ {
+ uc_chg_type = VehicleSensSetGpsTimeG(reinterpret_cast<SENSOR_MSG_GPSTIME*>(pst_data->uc_data));
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ }
+ case POSHAL_DID_GPS_WKNROLLOVER:
+ {
+ (void)VehicleSensSetWknRolloverG(reinterpret_cast<SENSOR_WKNROLLOVER*>(pst_data->uc_data));
+ break;
+ }
+ /* GPS clock drift */
+ case POSHAL_DID_GPS_CLOCK_DRIFT:
+ {
+ uc_chg_type = VehicleSensSetGpsClockDriftG(reinterpret_cast<int32_t*>(pst_data->uc_data));
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ }
+ /* GPS clock frequency */
+ case POSHAL_DID_GPS_CLOCK_FREQ:
+ {
+ uc_chg_type = VehicleSensSetGpsClockFreqG(reinterpret_cast<uint32_t*>(pst_data->uc_data));
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+ * MODULE : VehicleSensSetDataMasterData
+ * ABSTRACT : Vehicle sensor data master common data set processing
+ * FUNCTION : Set vehicle data
+ * ARGUMENT : *pstMsg : Received message data
+ * : p_data_master_set_n : Data Master Set Notification(Callback function)
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensSetDataMasterData(const POS_MSGINFO *pstMsg,
+ PFUNC_DMASTER_SET_N p_data_master_set_n) {
+ u_int8 uc_chg_type = 0;
+ const POS_POSDATA *pstPosData = NULL;
+ const u_int16 *pucSpeed = 0;
+ SENSORLOCATION_LONLATINFO_DAT stLonLat;
+ SENSORLOCATION_ALTITUDEINFO_DAT stAltitude;
+ SENSORMOTION_SPEEDINFO_DAT stSpeed;
+ SENSORMOTION_HEADINGINFO_DAT stHeading;
+ const SENSOR_MSG_GPSTIME *pstGpsTime;
+
+// RET_API ret;
+
+// char* pEnvPositioning_CWORD86_ = NULL;
+// BOOL sndFlg;
+
+
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail;
+ BOOL bIsAvailable;
+ u_int8 ucResult = SENSLOG_RES_SUCCESS;
+ PNO us_pno;
+
+ /*------------------------------------------------------*/
+ /* Call the data set processing associated with the DID */
+ /* Call the data master set notification process */
+ /*------------------------------------------------------*/
+ switch (pstMsg->did) {
+ case POSHAL_DID_GPS_CUSTOMDATA_NAVI:
+ {
+ pstPosData = (const POS_POSDATA *) & (pstMsg->data);
+
+ /* Latitude/LongitudeInformation */
+ if (((pstPosData->status & POS_LOC_INFO_LAT) == POS_LOC_INFO_LAT) ||
+ ((pstPosData->status & POS_LOC_INFO_LON) == POS_LOC_INFO_LON)) {
+ memset(&stLonLat, 0x00, sizeof(stLonLat));
+ stLonLat.getMethod = SENSOR_GET_METHOD_NAVI;
+ stLonLat.SyncCnt = VehicleSensGetSensorCnt();
+ stLonLat.isEnable = SENSORLOCATION_STATUS_ENABLE;
+ stLonLat.posSts = pstPosData->posSts;
+ stLonLat.posAcc = pstPosData->posAcc;
+ stLonLat.Longitude = pstPosData->longitude;
+ stLonLat.Latitude = pstPosData->latitude;
+ uc_chg_type = VehicleSensSetLocationLonLatN((const SENSORLOCATION_LONLATINFO_DAT *)&stLonLat);
+ (*p_data_master_set_n)(VEHICLE_DID_LOCATION_LONLAT_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI);
+ }
+
+ /* Altitude information */
+ if ((pstPosData->status & POS_LOC_INFO_ALT) == POS_LOC_INFO_ALT) {
+ memset(&stAltitude, 0x00, sizeof(stAltitude));
+ stAltitude.getMethod = SENSOR_GET_METHOD_NAVI;
+ stAltitude.SyncCnt = VehicleSensGetSensorCnt();
+ stAltitude.isEnable = SENSORLOCATION_STATUS_ENABLE;
+ stAltitude.Altitude = pstPosData->altitude;
+ uc_chg_type = VehicleSensSetLocationAltitudeN((const SENSORLOCATION_ALTITUDEINFO_DAT *)&stAltitude);
+ (*p_data_master_set_n)(VEHICLE_DID_LOCATION_ALTITUDE_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI);
+ }
+
+ /* Bearing information */
+ if ((pstPosData->status & POS_LOC_INFO_HEAD) == POS_LOC_INFO_HEAD) {
+ memset(&stHeading, 0x00, sizeof(stHeading));
+ stHeading.getMethod = SENSOR_GET_METHOD_NAVI;
+ stHeading.SyncCnt = VehicleSensGetSensorCnt();
+ stHeading.isEnable = SENSORMOTION_STATUS_ENABLE;
+ stHeading.posSts = pstPosData->posSts;
+ stHeading.Heading = pstPosData->heading;
+ uc_chg_type = VehicleSensSetMotionHeadingN((const SENSORMOTION_HEADINGINFO_DAT *)&stHeading);
+ (*p_data_master_set_n)(VEHICLE_DID_MOTION_HEADING_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI);
+ }
+
+ ( *p_data_master_set_n )( POSHAL_DID_GPS_CUSTOMDATA_NAVI, VEHICLESENS_NEQ, VEHICLESENS_GETMETHOD_NAVI );
+
+ break;
+ }
+ case VEHICLE_DID_MOTION_SPEED_NAVI:
+ {
+ pucSpeed = (const u_int16 *) & (pstMsg->data);
+
+ /* Vehicle speed information */
+ memset(&stSpeed, 0x00, sizeof(stSpeed));
+ stSpeed.getMethod = SENSOR_GET_METHOD_NAVI;
+ stSpeed.SyncCnt = VehicleSensGetSensorCnt();
+ stSpeed.isEnable = SENSORMOTION_STATUS_ENABLE;
+ stSpeed.Speed = *pucSpeed;
+ uc_chg_type = VehicleSensSetMotionSpeedN((const SENSORMOTION_SPEEDINFO_DAT *)&stSpeed);
+ (*p_data_master_set_n)(VEHICLE_DID_MOTION_SPEED_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI);
+ break;
+ }
+ case POSHAL_DID_GPS_TIME:
+ {
+ pstGpsTime = (const SENSOR_MSG_GPSTIME*)(pstMsg->data);
+ uc_chg_type = VehicleSensSetGpsTimeG((const SENSOR_MSG_GPSTIME *)pstGpsTime);
+ (*p_data_master_set_n)(POSHAL_DID_GPS_TIME, uc_chg_type, VEHICLESENS_GETMETHOD_GPS);
+
+ /* Set GPS time to CLOCK */
+ eStatus = ClockIfDtimeSetGpsTime(pstGpsTime, &bIsAvailable);
+ if ((bIsAvailable == TRUE) && (eStatus != eFrameworkunifiedStatusOK)) {
+ ucResult = SENSLOG_RES_FAIL;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ClockIfDtimeSetGpsTime ERROR!! [ret=%d, y=%d, m=%d, d=%d, h=%d, n=%d, s=%d, sts=%d]",
+ eStatus, pstGpsTime->utc.year, pstGpsTime->utc.month, pstGpsTime->utc.date,
+ pstGpsTime->utc.hour, pstGpsTime->utc.minute, pstGpsTime->utc.second, pstGpsTime->tdsts);
+ }
+ us_pno = _pb_CnvName2Pno(SENSLOG_PNAME_CLOCK);
+ SensLogWriteOutputData(SENSLOG_DATA_O_TIME_CS, 0, us_pno,
+ (uint8_t *)(pstGpsTime), // NOLINT(readability/casting)
+ sizeof(SENSOR_MSG_GPSTIME), ucResult);
+ break;
+ }
+ case VEHICLE_DID_SETTINGTIME:
+ {
+ /* GPS time information */
+ uc_chg_type = VehicleSensSetSettingTimeclock((const POS_DATETIME *) & (pstMsg->data));
+ (*p_data_master_set_n)(VEHICLE_DID_SETTINGTIME, uc_chg_type, VEHICLESENS_GETMETHOD_OTHER);
+ break;
+ }
+
+ case VEHICLE_DID_LOCATIONINFO_NMEA_NAVI:
+ {
+ uc_chg_type = VehicleSens_SetLocationInfoNmea_n((const POS_LOCATIONINFO_NMEA*)&(pstMsg->data));
+ (*p_data_master_set_n)(VEHICLE_DID_LOCATIONINFO_NMEA_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI );
+ break;
+ }
+
+ default:
+ break;
+ }
+ return;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterGyroTrouble
+* ABSTRACT : Vehicle Sensor Data Master Gyro Failure Status Setting Process
+* FUNCTION : Set a gyro fault condition
+* ARGUMENT : *pst_data : Gyro Failure Status Notification Data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterGyroTrouble(const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_chg_type;
+
+ if ((pst_data != NULL) && (p_data_master_set_n != NULL)) {
+ if (pst_data->ul_did == VEHICLE_DID_GYRO_TROUBLE) {
+ uc_chg_type = VehicleSensSetGyroTrouble(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n");
+ }
+}
+// LCOV_EXCL_STOP
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterSysGpsInterruptSignal
+* ABSTRACT : Vehicle Sensor Data Master SYS GPS Interrupt Signal Setting
+* FUNCTION : Setting SYS GPS Interrupt Signals
+* ARGUMENT : *pst_data : SYS GPS interrupt notification
+* : p_data_master_set_shared_memory : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data, PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_chg_type;
+ if ((pst_data != NULL) && (p_data_master_set_shared_memory != NULL)) {
+ if (pst_data->ul_did == VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL) {
+ uc_chg_type = VehicleSensSetSysGpsInterruptSignal(pst_data);
+ /* As SYS GPS interrupt signals are not registered for delivery, */
+ /* Disposal quantity,To avoid risks,DeliveryProc shall not be called. */
+ (*p_data_master_set_shared_memory)(pst_data->ul_did, uc_chg_type);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n");
+ }
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterMainGpsInterruptSignal
+* ABSTRACT : Vehicle Sensor Data Master MAIN GPS Interrupt Signal Setting
+* FUNCTION : Setting MAIN GPS Interrupt Signals
+* ARGUMENT : *pst_data : MAIN GPS interrupt notification
+* : p_data_master_set_shared_memory : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterMainGpsInterruptSignal(const SENSOR_MSG_GPSDATA_DAT *pst_data, PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_chg_type;
+
+ if ((pst_data != NULL) &&
+ (p_data_master_set_shared_memory != NULL)) {
+ if (pst_data->ul_did == VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) {
+ uc_chg_type = VehicleSensSetMainGpsInterruptSignal(pst_data);
+ /* As MAIN GPS interrupt signals are not registered for delivery, */
+ /* Disposal quantity,To avoid risks,DeliveryProc shall not be called. */
+ (*p_data_master_set_shared_memory)(pst_data->ul_did, uc_chg_type);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n");
+ }
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterGyroConnectStatus
+* ABSTRACT : Vehicle Sensor Data Master Gyro Connection Status Setting Processing
+* FUNCTION : Set the state of the gyro connection
+* ARGUMENT : *pst_data : Gyro Connect Status Notification Data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterGyroConnectStatus(const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *pst_data, PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_chg_type;
+
+ if ((pst_data != NULL) &&
+ (p_data_master_set_shared_memory != NULL)) {
+ if (pst_data->ul_did == VEHICLE_DID_GYRO_CONNECT_STATUS) {
+ uc_chg_type = VehicleSensSetGyroConnectStatus(pst_data);
+ /* As MAIN GPS interrupt signals are not registered for delivery, */
+ /* Disposal quantity,To avoid risks,DeliveryProc shall not be called. */
+ (*p_data_master_set_shared_memory)(pst_data->ul_did, uc_chg_type);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n");
+ }
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetDataMasterGpsAntennaStatus
+* ABSTRACT : Vehicle Sensor Data Master GPS Antenna Connection Status Setting Processing
+* FUNCTION : Setting the GPS Antenna Connection Status
+* ARGUMENT : *pst_data : GPS antenna connection status notification data
+* : p_data_master_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetDataMasterGpsAntennaStatus(const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_chg_type;
+
+ if ((pst_data != NULL) && (p_data_master_set_n != NULL)) {
+ if (pst_data->ul_did == POSHAL_DID_GPS_ANTENNA) {
+ uc_chg_type = VehicleSensSetGpsAntennaStatus(pst_data);
+ (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n");
+ }
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMaster
+* ABSTRACT : Vehicle Sensor Data Master Get Processing
+* FUNCTION : Provide vehicle sensor data master
+* ARGUMENT : ul_did : Data ID corresponding to the vehicle information
+* : uc_get_method : Data collection way
+* : VEHICLESENS_GETMETHOD_CAN: CAN communication
+* : VEHICLESENS_GETMETHOD_LINE: LineSensor drivers
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMaster(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER *pst_data) {
+ /*------------------------------------------------------*/
+ /* Call the data Get processing associated with the DID */
+ /*------------------------------------------------------*/
+ switch (ul_did) { // LCOV_EXCL_BR_LINE 6:some DID is not used
+ /*------------------------------------------------------*/
+ /* Vehicle sensor data group */
+ /*------------------------------------------------------*/
+ case POSHAL_DID_SPEED_PULSE:
+ {
+ VehicleSensGetSpeedPulse(pst_data, uc_get_method);
+ break;
+ }
+// case POSHAL_DID_GYRO_X:
+// {
+// VehicleSensGetGyroX(pst_data, uc_get_method);
+// break;
+// }
+ case POSHAL_DID_GYRO_Y:
+ {
+ VehicleSensGetGyroY(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_Z:
+ {
+ VehicleSensGetGyroZ(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_X:
+ case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ VehicleSensGetGyroRev(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_X:
+ {
+ VehicleSensGetGsnsX(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_Y:
+ {
+ VehicleSensGetGsnsY(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_Z:
+ {
+ VehicleSensGetGsnsZ(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_REV:
+ {
+ VehicleSensGetRev(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FLAG:
+ {
+ /* Data acquisition not selected */
+ VehicleSensGetSpeedPulseFlag(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_ANTENNA:
+ {
+ VehicleSensGetGpsAntenna(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_SNS_COUNTER:
+ {
+ VehicleSensGetSnsCounter(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GPS_INTERRUPT_FLAG:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Data acquisition not selected */
+ VehicleSensGetGpsInterruptFlag(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case POSHAL_DID_SPEED_KMPH:
+ {
+ VehicleSensGetSpeedKmph(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_TEMP:
+ {
+ VehicleSensGetGyroTemp(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_PULSE_TIME:
+ {
+ VehicleSensGetPulseTime(pst_data, uc_get_method);
+ break;
+ }
+ case VEHICLE_DID_LOCATION_LONLAT:
+ case VEHICLE_DID_LOCATION_LONLAT_NAVI:
+ {
+ VehicleSensGetLocationLonLat(pst_data, uc_get_method);
+ break;
+ }
+ case VEHICLE_DID_LOCATION_ALTITUDE:
+ case VEHICLE_DID_LOCATION_ALTITUDE_NAVI:
+ {
+ VehicleSensGetLocationAltitude(pst_data, uc_get_method);
+ break;
+ }
+ case VEHICLE_DID_MOTION_SPEED_NAVI:
+ case VEHICLE_DID_MOTION_SPEED_INTERNAL:
+ {
+ VehicleSensGetMotionSpeed(pst_data, uc_get_method);
+ break;
+ }
+ case VEHICLE_DID_MOTION_HEADING:
+ case VEHICLE_DID_MOTION_HEADING_NAVI:
+ {
+ VehicleSensGetMotionHeading(pst_data, uc_get_method);
+ break;
+ }
+ case VEHICLE_DID_SETTINGTIME:
+ {
+ VehicleSensGetSettingTime(pst_data, uc_get_method);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterExt
+* ABSTRACT : Vehicle Sensor Data Master Get Processing(Initial delivery)
+* FUNCTION : Provide vehicle sensor data master
+* ARGUMENT : ul_did : Data ID corresponding to the vehicle information
+* : uc_get_method : Data collection way
+* : VEHICLESENS_GETMETHOD_CAN: CAN communication
+* : VEHICLESENS_GETMETHOD_LINE: LineSensor drivers
+* : VEHICLESENS_GETMETHOD_NAVI: Navi
+* : VEHICLESENS_GETMETHOD_CLOCK:Clock
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterExt(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ /*------------------------------------------------------*/
+ /* Call the data Get processing associated with the DID */
+ /*------------------------------------------------------*/
+ switch (ul_did) {
+ /*------------------------------------------------------*/
+ /* Vehicle sensor data group */
+ /*------------------------------------------------------*/
+ case POSHAL_DID_SPEED_PULSE:
+ {
+ VehicleSensGetSpeedPulseExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_X:
+ {
+ VehicleSensGetGsnsXExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_Y:
+ {
+ VehicleSensGetGsnsYExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_Z:
+ {
+ VehicleSensGetGsnsZExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_SNS_COUNTER:
+ {
+ VehicleSensGetSnsCounterExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_X:
+ case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ VehicleSensGetGyroExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_Y:
+ {
+ VehicleSensGetGyroYExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_Z:
+ {
+ VehicleSensGetGyroZExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_REV:
+ {
+ VehicleSensGetRevExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_TEMP:
+ {
+ VehicleSensGetGyroTempExt(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_PULSE_TIME:
+ {
+ VehicleSensGetPulseTimeExt(pst_data, uc_get_method);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterFst
+* ABSTRACT : Vehicle Sensor Data Master Get Processing(Initial transmission data)
+* FUNCTION : Provide vehicle sensor data master
+* ARGUMENT : ul_did : Data ID corresponding to the vehicle information
+* : uc_get_method : Data collection way
+* : VEHICLESENS_GETMETHOD_CAN: CAN communication
+* : VEHICLESENS_GETMETHOD_LINE: LineSensor drivers
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterFst(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ /*------------------------------------------------------*/
+ /* Call the data Get processing associated with the DID */
+ /*------------------------------------------------------*/
+ switch (ul_did) {
+ /*------------------------------------------------------*/
+ /* Vehicle sensor data group */
+ /*------------------------------------------------------*/
+ case POSHAL_DID_GYRO_X_FST: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ VehicleSensGetGyroXFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_Y_FST: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ VehicleSensGetGyroYFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_Z_FST: /* 3 to 14bit A/D value,0bit:REV */
+ {
+ VehicleSensGetGyroZFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FST:
+ {
+ VehicleSensGetSpeedPulseFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_SPEED_PULSE_FLAG_FST:
+ {
+ VehicleSensGetSpeedPulseFlagFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_REV_FST:
+ {
+ VehicleSensGetRevFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GYRO_TEMP_FST:
+ {
+ VehicleSensGetGyroTempFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_X_FST:
+ {
+ VehicleSensGetGsnsXFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_Y_FST:
+ {
+ VehicleSensGetGsnsYFst(pst_data, uc_get_method);
+ break;
+ }
+ case POSHAL_DID_GSNS_Z_FST:
+ {
+ VehicleSensGetGsnsZFst(pst_data, uc_get_method);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGpsDataMaster
+* ABSTRACT : Vehicle Sensor Data Master GPS Data Get Processing
+* FUNCTION : Provide vehicle sensor data master GPS data
+* ARGUMENT : ul_did : Data ID corresponding to the vehicle information
+* : uc_get_method : Data collection way
+* : VEHICLESENS_GETMETHOD_GPS: GPS
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGpsDataMaster(DID ul_did,
+ u_int8 uc_get_method,
+ SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ /*------------------------------------------------------*/
+ /* Call the data Get processing associated with the DID */
+ /*------------------------------------------------------*/
+ switch (ul_did) { // LCOV_EXCL_BR_LINE 6:some DID is not used
+ /*------------------------------------------------------*/
+ /* GPS data group */
+ /*------------------------------------------------------*/
+
+ case VEHICLE_DID_GPS_UBLOX_NAV_VELNED:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavVelnedG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavTimeUtcG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavTimeGpsG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_SVINFO:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavSvInfoG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_STATUS:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavStatusG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_POSLLH:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavPosllhG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_CLOCK:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetNavClockG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_NAV_DOP:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED();
+ VehicleSensGetNavDopG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_UBLOX_MON_HW:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED();
+ VehicleSensGetMonHwG(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS_COUNTER:
+ {
+ // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetGpsCounterg(pst_data);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case VEHICLE_DID_GPS__CWORD82__NMEA:
+ {
+ VehicleSensGetGps_CWORD82_NmeaG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS__CWORD82__FULLBINARY:
+ {
+ VehicleSensGetGps_CWORD82_FullBinaryG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS__CWORD82___CWORD44_GP4:
+ {
+ VehicleSensGetGps_CWORD82__CWORD44_Gp4G(pst_data);
+ break;
+ }
+ case VEHICLE_DID_NAVIINFO_DIAG_GPS:
+ {
+ VehicleSensGetNaviinfoDiagGPSg(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_TIME:
+ {
+ VehicleSensGetGpsTimeG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_TIME_RAW:
+ {
+ VehicleSensGetGpsTimeRawG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_NMEA:
+ {
+ VehicleSensGetGpsNmeaG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_WKNROLLOVER:
+ {
+ VehicleSensGetWknRolloverG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_CLOCK_DRIFT:
+ {
+ VehicleSensGetGpsClockDriftG(pst_data);
+ break;
+ }
+ case POSHAL_DID_GPS_CLOCK_FREQ:
+ {
+ VehicleSensGetGpsClockFreqG(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterGyroTrouble
+* ABSTRACT : Vehicle Sensor Data Master Gyro Failure Status Get Processing
+* FUNCTION : Provide a gyro fault condition
+* ARGUMENT : ul_did : Data ID
+* : uc_get_method : Data collection way(Not used)
+* : VEHICLESENS_GETMETHOD_CAN : CAN communication
+* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers
+* : VEHICLESENS_GETMETHOD_GPS : GPS
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterGyroTrouble(DID ul_did, u_int8 uc_get_method, VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_data) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (pst_data != NULL) {
+ if (ul_did == VEHICLE_DID_GYRO_TROUBLE) {
+ VehicleSensGetGyroTrouble(pst_data);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n");
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterSysGpsInterruptSignal
+* ABSTRACT : Vehicle Sensor Data Master SYS GPS Interrupt Signal Get Processing
+* FUNCTION : Provide SYS GPS interrupt signals
+* ARGUMENT : ul_did : Data ID
+* : uc_get_method : Data collection way(Not used)
+* : VEHICLESENS_GETMETHOD_CAN : CAN communication
+* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers
+* : VEHICLESENS_GETMETHOD_GPS : GPS
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterSysGpsInterruptSignal(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (pst_data != NULL) {
+ if (ul_did == VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL) {
+ VehicleSensGetSysGpsInterruptSignal(pst_data);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n");
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterMainGpsInterruptSignal
+* ABSTRACT : Vehicle Sensor Data Master MAIN GPS Interrupt Signal Get Processing
+* FUNCTION : Provide MAIN GPS interrupt signals
+* ARGUMENT : ul_did : Data ID
+* : uc_get_method : Data collection way(Not used)
+* : VEHICLESENS_GETMETHOD_CAN : CAN communication
+* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers
+* : VEHICLESENS_GETMETHOD_GPS : GPS
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterMainGpsInterruptSignal(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (pst_data != NULL) {
+ if (ul_did == VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) {
+ VehicleSensGetMainGpsInterruptSignal(pst_data);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n");
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterGyroConnectStatus
+* ABSTRACT : Vehicle Sensor Data Master Gyro Connection Status Get Processing
+* FUNCTION : Provide the status of the gyro connection
+* ARGUMENT : ul_did : Data ID
+* : uc_get_method : Data collection way(Not used)
+* : VEHICLESENS_GETMETHOD_CAN : CAN communication
+* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers
+* : VEHICLESENS_GETMETHOD_GPS : GPS
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterGyroConnectStatus(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (pst_data != NULL) {
+ if (ul_did == VEHICLE_DID_GYRO_CONNECT_STATUS) {
+ VehicleSensGetGyroConnectStatus(pst_data);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x)\r\n", ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n");
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetDataMasterGpsAntennaStatus
+* ABSTRACT : Vehicle Sensor Data Master GPS Antenna Connection Status Get Processing
+* FUNCTION : Provide GPS antenna connection status
+* ARGUMENT : ul_did : Data ID
+* : uc_get_method : Data collection way(Not used)
+* : VEHICLESENS_GETMETHOD_CAN : CAN communication
+* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers
+* : VEHICLESENS_GETMETHOD_GPS : GPS
+* : *pst_data : Pointer to the data master provider
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetDataMasterGpsAntennaStatus(DID ul_did,
+ u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (pst_data != NULL) {
+ if (ul_did == POSHAL_DID_GPS_ANTENNA) {
+ VehicleSensGetGpsAntennaStatus(pst_data);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n");
+ }
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Sensor counter acquisition
+ *
+ * @return Sensor Counter
+ *
+ */
+static uint8_t VehicleSensGetSensorCnt(void) {
+ VEHICLESENS_DATA_MASTER st_data;
+ uint8_t sensCnt;
+
+ /* Synchronous counter acquisition */
+ VehicleSensGetSnsCounterl(&st_data);
+
+ sensCnt = st_data.uc_data[0];
+
+ return sensCnt;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp
new file mode 100755
index 0000000..15aabff
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp
@@ -0,0 +1,2243 @@
+/*
+ * @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_DeliveryCtrl.cpp
+ * System name :GPF
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle Sensor Destination Management
+ * Module configuration VehicleSensInitDeliveryCtrlTbl() Vehicle sensor delivery destination management table initialization function
+ * VehicleSensInitDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management area initialization function
+ * VehicleSensInitPkgDeliveryTblMng() Vehicle Sensor Package Delivery Management Table Initialization Function
+ * VehicleSensEntryDeliveryCtrl() Vehicle sensor delivery destination management registration function
+ * VehicleSensAddDeliveryCtrlTbl() Vehicle sensor delivery destination management table addition function
+ * VehicleSensUpdateDeliveryCtrlTbl() Vehicle sensor delivery destination management table update function
+ * VehicleSensUpdatePkgDeliveryCtrlTbl() Vehicle Sensor Delivery Destination Management Table Package Delivery Data Update Function
+ * VehicleSensAddDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management addition function
+ * VehicleSensUpdateDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management update function
+ * VehicleSensAddPkgDeliveryTblMng() Vehicle Sensor Package Delivery Management Table Additional Function
+ * VehicleSensEntryPkgDeliveryCtrl() Vehicle sensor package delivery management registration function
+ * VehicleSensMakeDeliveryPnoTbl() Vehicle Sensor Destination PNO Table Creation Function
+ * VehicleSensAddPnoTbl() Vehicle Sensor Destination PNO Table Addition Function
+ * VehicleSensDeliveryProc() Vehicle Sensor Data Delivery Process
+ * VehicleSensFirstDelivery() Vehicle Sensor Initial Data Delivery Process
+ * VehicleSensFirstPkgDelivery() Vehicle Sensor Initial Package Data Delivery Process
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include <vehicle_service/POS_common_API.h>
+#include <vehicle_service/POS_gps_API.h>
+#include "VehicleSens_DeliveryCtrl.h"
+#include "Dead_Reckoning_Local_Api.h"
+#include "SensorLog.h"
+#include "POS_private.h"
+
+#define VEHICLE_SENS_DELIVERY_CTRL_DEBUG 0
+#define VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG 0
+
+#define GYRO_NORMAL (0U)
+#define GYRO_ERROR (1U)
+#define GYRO_UNFIXED (2U)
+
+#define _pb_strcat(pdest, psrc, size) (strncat(pdest, psrc, size) , (0))
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DELIVERY_CTRL_TBL g_stdelivery_ctrl_tbl;
+static VEHICLESENS_DELIVERY_CTRL_TBL_MNG g_stdelivery_ctrl_tbl_mng;
+static VEHICLESENS_PKG_DELIVERY_TBL_MNG g_stpkgdelivery_tbl_mng;
+static VEHICLESENS_DELIVERY_PNO_TBL g_stdelivery_pno_tbl;
+
+/* ++ PastModel002 response DR */
+static VEHICLESENS_DELIVERY_CTRL_TBL g_stdelivery_ctrl_tbl_dr;
+static VEHICLESENS_DELIVERY_CTRL_TBL_MNG g_stdelivery_ctrl_tbl_mng_dr;
+static VEHICLESENS_DELIVERY_PNO_TBL g_stdelivery_pno_tbl_dr;
+
+/* -- PastModel002 response DR */
+
+#if CONFIG_HW_PORTSET_TYPE_C
+u_int16 gusSeqNum; /* Sequence number for split transmission */
+#endif
+
+/*******************************************************************************
+* MODULE : VehicleSensInitDeliveryCtrlTbl
+* ABSTRACT : Vehicle sensor delivery destination management table initialization function
+* FUNCTION : Delivery destination management table initialization processing
+* ARGUMENT : void
+* NOTE :
+******************************************************************************/
+void VehicleSensInitDeliveryCtrlTbl(void) {
+ memset(&g_stdelivery_ctrl_tbl, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL));
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensInitDeliveryCtrlTblMng
+* ABSTRACT : Vehicle Sensor DR Internal Delivery Destination Management Table Management Area Initialization Function
+* FUNCTION : Delivery destination management table management area initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitDeliveryCtrlTblMng(void) {
+ memset(&g_stdelivery_ctrl_tbl_mng, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL_MNG));
+}
+
+/* ++ PastModel002 response DR */
+/*******************************************************************************
+* MODULE : VehicleSensInitDeliveryCtrlTblDR
+* ABSTRACT : Vehicle sensor delivery destination management table initialization function
+* FUNCTION : DR distribution target management table initialization processing
+* ARGUMENT : void
+* NOTE :
+******************************************************************************/
+void VehicleSensInitDeliveryCtrlTblDR(void) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&g_stdelivery_ctrl_tbl_dr, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL));
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensInitDeliveryCtrlTblMngDR
+* ABSTRACT : Vehicle sensor delivery destination management table management area initialization function
+* FUNCTION : Initialization processing for the management table area of the delivery destination management table for DR
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitDeliveryCtrlTblMngDR(void) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ memset(&g_stdelivery_ctrl_tbl_mng_dr, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL_MNG));
+}
+// LCOV_EXCL_STOP
+
+/* -- PastModel002 response DR */
+
+/*******************************************************************************
+* MODULE : VehicleSensInitPkgDeliveryTblMng
+* ABSTRACT : Vehicle Sensor Package Delivery Management Table Initialization Function
+* FUNCTION : Delivery Package Management Table Initialization Processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitPkgDeliveryTblMng(void) {
+ memset(&g_stpkgdelivery_tbl_mng, 0x00, sizeof(VEHICLESENS_PKG_DELIVERY_TBL_MNG));
+}
+
+#if CONFIG_HW_PORTSET_TYPE_C
+/*******************************************************************************
+* MODULE : VehicleSensInitSeqNum
+* ABSTRACT : Sequence number initialization function for split transmission
+* FUNCTION : Sequence number initialization processing for split transmission
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSeqNum(void) {
+ gusSeqNum = 0;
+}
+#endif
+
+/*******************************************************************************
+* MODULE : VehicleSensEntryDeliveryCtrl
+* ABSTRACT : Vehicle sensor delivery destination management registration function
+* FUNCTION : Shipping management table,Update the shipping management table management.
+* ARGUMENT : pst_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : VEHICLE_RET_NORMAL :Successful registration
+******************************************************************************/
+VEHICLE_RET_API VehicleSensEntryDeliveryCtrl(const VEHICLE_MSG_DELIVERY_ENTRY *pst_delivery_entry) {
+ int32 i;
+ u_int8 uc_action_type = VEHICLESENS_ACTION_TYPE_ADD;
+ int32 uc_did_flag;
+ DID ulentry_did = pst_delivery_entry->data.did;
+ VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data = NULL;
+ VEHICLE_RET_API ret = VEHICLE_RET_NORMAL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ BOOL bexist_flag = FALSE;
+
+ /* Check if the data ID exists. */
+ uc_did_flag = VehicleSensCheckDid(ulentry_did);
+ if (uc_did_flag == 0) { // LCOV_EXCL_BR_LINE 6:alway be 1
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+
+ ret = VEHICLE_RET_ERROR_DID; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ // LCOV_EXCL_LINE 8: dead code // NOLINT(whitespace/line_length)
+ }
+
+ /* Check the number of registered shipments. */
+ if ((ret == VEHICLE_RET_NORMAL) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (g_stdelivery_ctrl_tbl.us_dnum >= VEHICLESENS_DELIVERY_INFO_MAX)) {
+ /* Return the FULL of delivery registrations*/
+ ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* Duplicate delivery registration check*/
+ for (i = 0; i < g_stdelivery_ctrl_tbl.us_dnum; i++) {
+ if ((g_stdelivery_ctrl_tbl.st_ctrl_data[i].ul_did == ulentry_did) &&
+ (g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pno == pst_delivery_entry->data.pno) &&
+ (g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_method == VEHICLESENS_DELIVERY_METHOD_NORMAL)) {
+ /* When the same shipping address (PNO) and shipping DID are already registered,Update registration information and exit */
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_chg_type = pst_delivery_entry->data.delivery_timing;
+ bexist_flag = TRUE;
+ break;
+ }
+ }
+
+ if (bexist_flag == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "Duplicate DID=0x%x PNO=0x%x ChgType=%d",
+ ulentry_did,
+ pst_delivery_entry->data.pno,
+ pst_delivery_entry->data.delivery_timing);
+ } else {
+ /* By searching for the delivery registration of the relevant DID,Hold the address. */
+ for (i = 0; i < g_stdelivery_ctrl_tbl_mng.us_dnum; i++) {
+ if (g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ulentry_did) {
+ uc_action_type = VEHICLESENS_ACTION_TYPE_UPDATE;
+ pst_existing_mng_data = &g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i];
+ }
+ }
+ /* Add to the shipping management table.*/
+ VehicleSensAddDeliveryCtrlTbl(pst_delivery_entry);
+
+ /* Processing when updating existing data*/
+ if (uc_action_type == VEHICLESENS_ACTION_TYPE_UPDATE) {
+ /* Update the shipping management table.*/
+ VehicleSensUpdateDeliveryCtrlTbl(pst_existing_mng_data);
+
+ /* Update the shipping destination management table management information.*/
+ VehicleSensUpdateDeliveryCtrlTblMng(pst_existing_mng_data);
+ } else { /* Newly added processing*/
+ /* Add to the shipping management table management information.*/
+ VehicleSensAddDeliveryCtrlTblMng(pst_delivery_entry);
+ }
+ }
+ }
+ return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensAddDeliveryCtrlTbl
+* ABSTRACT : Vehicle sensor delivery destination management table addition function
+* FUNCTION : Add to the shipping management table.
+* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddDeliveryCtrlTbl(const VEHICLE_MSG_DELIVERY_ENTRY *pst_delivery_entry) {
+ VEHICLESENS_DELIVERY_CTRL_TBL_DATA *pst_ctrl_data;
+
+ pst_ctrl_data = &g_stdelivery_ctrl_tbl.st_ctrl_data[g_stdelivery_ctrl_tbl.us_dnum];
+ pst_ctrl_data->ul_did = pst_delivery_entry->data.did;
+ pst_ctrl_data->us_pno = pst_delivery_entry->data.pno;
+ pst_ctrl_data->uc_chg_type = pst_delivery_entry->data.delivery_timing;
+ pst_ctrl_data->uc_ctrl_flg = pst_delivery_entry->data.ctrl_flg;
+ pst_ctrl_data->us_link_idx = VEHICLESENS_LINK_INDEX_END;
+ pst_ctrl_data->us_pkg_start_idx = VEHICLESENS_LINK_INDEX_END;
+ pst_ctrl_data->us_pkg_end_idx = VEHICLESENS_LINK_INDEX_END;
+ pst_ctrl_data->uc_method = VEHICLESENS_DELIVERY_METHOD_NORMAL;
+ g_stdelivery_ctrl_tbl.us_dnum = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum + 1);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensUpdateDeliveryCtrlTbl
+* ABSTRACT : Vehicle sensor delivery destination management table update function
+* FUNCTION : Update the shipping management table.
+* ARGUMENT : *pstExistingMngData : Pointer to the previous data information with the same data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensUpdateDeliveryCtrlTbl(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) {
+ /* Ignore->MISRA-C++:2008 Rule 7-1-2 */
+ /* Update Link Index Only.
+ For indexes of usEndIdx values matching the data IDs in the target management table
+ Making usLinkIdx an Index-Registered Index */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ g_stdelivery_ctrl_tbl.st_ctrl_data[pst_existing_mng_data->us_end_idx].us_link_idx =
+ static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensUpdatePkgDeliveryCtrlTbl
+* ABSTRACT : Vehicle Sensor Delivery Destination Management Table Package Delivery Data Update Function
+* FUNCTION : Updating Package Delivery Data in the Destination Management Table.
+* ARGUMENT : us_dnum : Number of data items in the package delivery management table
+* : us_pkg_num : Number of packages to create
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensUpdatePkgDeliveryCtrlTbl(u_int16 us_dnum, u_int16 us_pkg_num) {
+ VEHICLESENS_DELIVERY_CTRL_TBL_DATA *pst_ctrl_data;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_ctrl_data = &g_stdelivery_ctrl_tbl.st_ctrl_data[g_stdelivery_ctrl_tbl.us_dnum - 1];
+ pst_ctrl_data->us_pkg_start_idx = us_dnum;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_ctrl_data->us_pkg_end_idx = static_cast<u_int16>(us_dnum + us_pkg_num - 1);
+ pst_ctrl_data->uc_method = VEHICLESENS_DELIVERY_METHOD_PACKAGE;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensAddDeliveryCtrlTblMng
+* ABSTRACT : Vehicle sensor delivery destination management table management addition function
+* FUNCTION : Add to the shipping management table management.
+* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddDeliveryCtrlTblMng(const VEHICLE_MSG_DELIVERY_ENTRY *pst_delivery_entry) {
+ VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_ctrl_mng_data;
+
+ pst_ctrl_mng_data = &g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[g_stdelivery_ctrl_tbl_mng.us_dnum];
+ pst_ctrl_mng_data->ul_did = pst_delivery_entry->data.did;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_ctrl_mng_data->us_start_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_ctrl_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1);
+ pst_ctrl_mng_data->usdlvry_entry_num++;
+ g_stdelivery_ctrl_tbl_mng.us_dnum++;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensUpdateDeliveryCtrlTblMng
+* ABSTRACT : Vehicle sensor delivery destination management table management update function
+* FUNCTION : Update the shipping management table management.
+* ARGUMENT : *pst_existing_mng_data : Pointer to the previous data information with the same data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensUpdateDeliveryCtrlTblMng(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) {
+ /* Update only the end index and the number of registered shipping destinations. */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_existing_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1);
+ pst_existing_mng_data->usdlvry_entry_num++;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensAddPkgDeliveryTblMng
+* ABSTRACT : Vehicle Sensor Package Delivery Management Table Additional Function
+* FUNCTION : Add to the shipping management table management.
+* ARGUMENT : *pst_pkg : Pointer to package delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddPkgDeliveryTblMng(const SENSOR_MSG_DELIVERY_ENTRY *pst_pkg) {
+ int32 i; /* Generic counters */
+
+ /* Data ID registration */
+ /* Registration of delivery data index */
+ for (i = 0; i < (pst_pkg->data.pkg_num); i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ g_stpkgdelivery_tbl_mng.st_pkg_data[g_stpkgdelivery_tbl_mng.us_dnum].ul_did = pst_pkg->data.did[i];
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ g_stpkgdelivery_tbl_mng.st_pkg_data[g_stpkgdelivery_tbl_mng.us_dnum].usdlvry_idx = \
+ static_cast<u_int16>(g_stpkgdelivery_tbl_mng.us_dnum + 1);
+ g_stpkgdelivery_tbl_mng.us_dnum++;
+ }
+ /* The final delivery data index overwrites the terminating code */
+ g_stpkgdelivery_tbl_mng.st_pkg_data[g_stpkgdelivery_tbl_mng.us_dnum - 1].usdlvry_idx = VEHICLESENS_LINK_INDEX_END;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensEntryPkgDeliveryCtrl
+* ABSTRACT : Vehicle sensor package delivery management registration function
+* FUNCTION : Shipping management table,Destination management table management,Update the package delivery management table.
+* ARGUMENT : *pst_pkg : Pointer to package delivery registration information
+* NOTE :
+* RETURN : VEHICLE_RET_NORMAL : Successful registration
+******************************************************************************/
+VEHICLE_RET_API VehicleSensEntryPkgDeliveryCtrl(const SENSOR_MSG_DELIVERY_ENTRY *pst_pkg ,
+ u_int8 uc_ext_chk) { /* Ignore->MISRA-C++:2008 Rule 6-6-5 */
+ int32 i;
+ u_int16 us_size = 0;
+ u_int8 uc_action_type = VEHICLESENS_ACTION_TYPE_ADD;
+ VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data = NULL;
+ VEHICLE_MSG_DELIVERY_ENTRY st_delivery_entry;
+ u_int16 us_boundary_adj; /* For boundary adjustment */
+ u_int16 us_next_offset; /* For size calculation */
+ VEHICLE_RET_API ret = VEHICLE_RET_NORMAL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ BOOL bexist_flag = FALSE;
+
+ /* Check if the data ID exists. */
+ for (i = 0; i < (pst_pkg->data.pkg_num); i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ if (VEHICLESENS_INVALID == VehicleSensCheckDid(pst_pkg->data.did[i])) { // LCOV_EXCL_BR_LINE 200: always Valid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret = VEHICLE_RET_ERROR_DID; // // LCOV_EXCL_LINE 8 :dead code
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+ }
+
+ /* Check the number of registered shipments. */
+ if ((ret == VEHICLE_RET_NORMAL) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (VEHICLESENS_DELIVERY_INFO_MAX <= g_stdelivery_ctrl_tbl.us_dnum)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Return the FULL of delivery registrations*/
+ ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Check the number of registered package shipments. */
+ if ((ret == VEHICLE_RET_NORMAL) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (VEHICLESENS_PKG_DELIVERY_INFO_MAX < (g_stpkgdelivery_tbl_mng.us_dnum + pst_pkg->data.pkg_num))) {
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Return the FULL of delivery registrations*/
+ ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* Check that the size of the buffer to be delivered does not exceed the maximum size. */
+ /* For boundary adjustment */
+ us_boundary_adj = (u_int16)VEHICLESENS_BIT1 | (u_int16)VEHICLESENS_BIT0;
+ for (i = 0; i < pst_pkg->data.pkg_num; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ if (uc_ext_chk == VEHICLESENS_EXT_OFF) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ // LCOV_EXCL_BR_LINE 200: VEHICLESENS_EXT_OFF passed in function is dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ us_next_offset = VehicleSensGetDataMasterOffset(pst_pkg->data.did[i]); // LCOV_EXCL_LINE 8: dead code
+ } else {
+ us_next_offset = VehicleSensGetDataMasterExtOffset(pst_pkg->data.did[i]);
+ }
+#else
+ us_next_offset = VehicleSensGetDataMasterOffset(pst_pkg->data.did[i]);
+#endif
+ /* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */
+ if ((us_next_offset & us_boundary_adj) != 0) {
+ /* If you need to adjust */
+ /* Mask Lower Bit Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */
+ us_next_offset = static_cast<u_int16>(us_next_offset & ~us_boundary_adj);
+ us_next_offset = static_cast<u_int16>(us_next_offset + (u_int16)VEHICLESENS_BIT2); /* Add numbers */
+ }
+ us_size = static_cast<u_int16>(us_size + us_next_offset); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ }
+ if (SENSOR_VSINFO_DSIZE < us_size) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Return the FULL of delivery registrations(Exceed the size of the buffer to be delivered due to the combination of packages)*/
+ ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+ }
+
+ if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ for (i = 0; i < g_stdelivery_ctrl_tbl.us_dnum; i++) {
+ if ((g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pno == pst_pkg->data.pno) &&
+ (g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_method == VEHICLESENS_DELIVERY_METHOD_PACKAGE)) {
+ /* When the same shipping address (PNO) is already registered,Update registration information and exit */
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_chg_type = pst_pkg->data.delivery_timing;
+ bexist_flag = TRUE;
+ break;
+ }
+ }
+
+ if (bexist_flag == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Duplicate PNO=0x%x ChgType=%d",
+ pst_pkg->data.pno, pst_pkg->data.delivery_timing);
+ } else {
+ /* By searching for the delivery registration of the relevant DID,Hold the address. */
+ for (i = 0; i < g_stdelivery_ctrl_tbl_mng.us_dnum; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ if (g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did == pst_pkg->data.did[0]) {
+ uc_action_type = VEHICLESENS_ACTION_TYPE_UPDATE;
+ pst_existing_mng_data = &g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i];
+ }
+ }
+ /* Type conversion,And copies of the data section(Because the header is unused,Not involved) */
+ memset(reinterpret_cast<void *>(&st_delivery_entry),
+ static_cast<int32>(0),
+ (size_t)sizeof(VEHICLE_MSG_DELIVERY_ENTRY));
+ st_delivery_entry.data.did = pst_pkg->data.did[0];
+ st_delivery_entry.data.pno = pst_pkg->data.pno;
+ st_delivery_entry.data.delivery_timing = pst_pkg->data.delivery_timing;
+ st_delivery_entry.data.ctrl_flg = pst_pkg->data.ctrl_flg;
+ st_delivery_entry.data.event_id = pst_pkg->data.event_id;
+ /* Add to the shipping management table.*/
+ VehicleSensAddDeliveryCtrlTbl(&st_delivery_entry);
+
+ /* Processing when updating existing data*/
+ /* Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */
+ if (uc_action_type == VEHICLESENS_ACTION_TYPE_UPDATE) {
+ /* Update the shipping management table.*/
+ VehicleSensUpdateDeliveryCtrlTbl(pst_existing_mng_data);
+
+ /* Update the shipping destination management table management information.*/
+ VehicleSensUpdateDeliveryCtrlTblMng(pst_existing_mng_data);
+ } else { /* Newly added processing*/
+ /* Add to the shipping management table management information.*/
+ VehicleSensAddDeliveryCtrlTblMng(&st_delivery_entry);
+ }
+
+ /* Updating Package Relationship Data in the Destination Management Table.*/
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ VehicleSensUpdatePkgDeliveryCtrlTbl(g_stpkgdelivery_tbl_mng.us_dnum, pst_pkg->data.pkg_num);
+ /* Add to the package delivery management table.*/
+ VehicleSensAddPkgDeliveryTblMng(pst_pkg);
+ }
+ }
+
+ return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensMakeDeliveryPnoTbl
+* ABSTRACT : Vehicle sensor delivery destination PNO table creation function
+* FUNCTION : Create the shipping destination PNO table
+* ARGUMENT : ul_did Data ID
+* Change_type Delivery Trigger
+* NOTE :
+* RETURN : VEHICLESENS_DELIVERY_PNO_TBL* Pointer to the shipping PNO table
+******************************************************************************/
+VEHICLESENS_DELIVERY_PNO_TBL* VehicleSensMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type) {
+ int32 i;
+ u_int8 uc_ctrl_tbl_mng_data_list;
+ u_int16 us_index = 0;
+ u_int16 us_dnum = 0;
+
+ /* Get the start index and count of the corresponding data ID. */
+ uc_ctrl_tbl_mng_data_list = static_cast<u_int8>(
+ (sizeof(g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data)) /
+ (sizeof(g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[0])));
+ for (i = 0; i < uc_ctrl_tbl_mng_data_list; i++) {
+ /* Stores the information of the corresponding DID.. */
+ if (g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ul_did) {
+ us_index = g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].us_start_idx;
+ us_dnum = g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].usdlvry_entry_num;
+ break;
+ }
+ }
+
+ /* Create a PNO list */
+ g_stdelivery_pno_tbl.us_dnum = 0;
+ if (change_type == VEHICLESENS_CHGTYPE_CHG) {
+ /* Processing when delivery timing is changed*/
+ for (i = 0; i < us_dnum; i++) {
+ /* Functionalization by Increasing Structure Members */
+ VehicleSensAddPnoTbl(us_index);
+ us_index = g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_link_idx;
+ }
+ } else {
+ /* Processing when delivery timing is update */
+ for (i = 0; i < us_dnum; i++) {
+ if (VEHICLE_DELIVERY_TIMING_UPDATE == g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].uc_chg_type) {
+ /* Functionalization by Increasing Structure Members */
+ VehicleSensAddPnoTbl(us_index);
+ }
+ us_index = g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_link_idx;
+ }
+ }
+ return(&g_stdelivery_pno_tbl);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensAddPnoTbl
+* ABSTRACT : Vehicle Sensor Destination PNO Table Addition Function
+* FUNCTION : Add to the shipping PNO table.
+* ARGUMENT : us_index : Index of the referenced destination management table
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddPnoTbl(u_int16 us_index) {
+ u_int16 us_pno_tbl_idx;
+
+ us_pno_tbl_idx = g_stdelivery_pno_tbl.us_dnum;
+ g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].us_pno = \
+ g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_pno;
+ g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].us_pkg_start_idx = \
+ g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_pkg_start_idx;
+ g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].us_pkg_end_idx = \
+ g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_pkg_end_idx;
+ g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].uc_method = \
+ g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].uc_method;
+ g_stdelivery_pno_tbl.us_dnum++;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensDeliveryGPS
+* ABSTRACT : Vehicle Sensor Data Delivery Process
+* FUNCTION : Deliver data to a destination.
+* ARGUMENT : ul_did :Data ID
+* uc_chg_type :Delivery timing
+* uc_get_method :Acquisition method
+* NOTE :
+* RETURN : void
+******************************************************************************/
+u_int8 VehicleSensDeliveryGPS(DID ul_did, u_int8 uc_get_method, u_int8 uc_current_get_method, int32 pno_index,
+ u_int32* cid,
+ VEHICLESENS_DATA_MASTER* stmaster,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) {
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ SENSORLOCATION_MSG_LONLATINFO *plonlat_msg;
+ SENSORLOCATION_MSG_ALTITUDEINFO *paltitude_msg;
+ SENSORMOTION_MSG_HEADINGINFO *pheading_msg;
+#endif
+
+ SENSOR_MSG_GPSDATA_DAT gps_master;
+ VEHICLESENS_DELIVERY_FORMAT delivery_data;
+ u_int16 length;
+ u_int16 senslog_len;
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+
+ VehicleSensGetGpsDataMaster(ul_did, uc_current_get_method, &gps_master);
+
+ if (ul_did == POSHAL_DID_GPS_TIME) {
+ /* GPS time,Because there is no header in the message to be delivered,
+ Padding deliveryData headers */
+ (void)memcpy(reinterpret_cast<void*>(&delivery_data),
+ reinterpret_cast<void*>(&gps_master.uc_data[0]), gps_master.us_size);
+ length = gps_master.us_size;
+ senslog_len = length;
+ *cid = CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME;
+ } else if (ul_did == VEHICLE_DID_LOCATION_LONLAT) {
+ plonlat_msg = reinterpret_cast<SENSORLOCATION_MSG_LONLATINFO*>(&delivery_data);
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_current_get_method, stmaster);
+ (void)memcpy(reinterpret_cast<void*>(&(plonlat_msg->data)),
+ reinterpret_cast<void*>(&(stmaster->uc_data[0])), stmaster->us_size);
+ length = (u_int16)(stmaster->us_size);
+ senslog_len = length;
+ *cid = CID_POSIF_REGISTER_LISTENER_LONLAT;
+ } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE) {
+ paltitude_msg = reinterpret_cast<SENSORLOCATION_MSG_ALTITUDEINFO*>(&delivery_data);
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_get_method, stmaster);
+ (void)memcpy(reinterpret_cast<void*>(&(paltitude_msg->data)),
+ reinterpret_cast<void*>(&stmaster->uc_data[0]), stmaster->us_size);
+ length = (u_int16)(stmaster->us_size);
+ senslog_len = length;
+ *cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE;
+ } else if (ul_did == VEHICLE_DID_MOTION_HEADING) {
+ pheading_msg = reinterpret_cast<SENSORMOTION_MSG_HEADINGINFO*>(&delivery_data);
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_get_method, stmaster);
+ (void)memcpy(reinterpret_cast<void*>(&(pheading_msg->data)),
+ reinterpret_cast<void*>(&stmaster->uc_data[0]), stmaster->us_size);
+ length = (u_int16)(stmaster->us_size);
+ senslog_len = length;
+ *cid = CID_POSIF_REGISTER_LISTENER_HEADING;
+ } else {
+ delivery_data.header.did = gps_master.ul_did;
+ delivery_data.header.size = gps_master.us_size;
+ delivery_data.header.rcv_flag = gps_master.uc_rcv_flag;
+ delivery_data.header.sensor_cnt = gps_master.uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(&delivery_data.data[0]),
+ reinterpret_cast<void *>(&gps_master.uc_data[0]),
+ (size_t)delivery_data.header.size);
+
+ length = static_cast<u_int16>((u_int16)sizeof(delivery_data.header) + \
+ delivery_data.header.size);
+ senslog_len = delivery_data.header.size;
+ *cid = CID_VEHICLESENS_VEHICLE_INFO;
+ }
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ static_cast<CID>(*cid),
+ length,
+ (const void *)&delivery_data);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ if (*cid != CID_VEHICLESENS_VEHICLE_INFO) {
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&delivery_data),
+ senslog_len, uc_result);
+ } else {
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(delivery_data.data[0])),
+ senslog_len, uc_result);
+ }
+ return uc_result;
+}
+
+u_int8 VehicleSensDeliveryFst(DID ul_did, u_int8 uc_get_method, int32 pno_index,
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) {
+ VEHICLESENS_DATA_MASTER_FST st_master_fst; /* Master of initial sensor data */
+ VEHICLESENS_DATA_MASTER_FST st_master_fst_temp; /* For temporary storage */
+
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+ (void)memset(reinterpret_cast<void *>(&st_master_fst),
+ 0,
+ sizeof(VEHICLESENS_DATA_MASTER_FST));
+ (void)memset(reinterpret_cast<void *>(&st_master_fst_temp),
+ 0,
+ sizeof(VEHICLESENS_DATA_MASTER_FST));
+ VehicleSensGetDataMasterFst(ul_did, uc_get_method, &st_master_fst);
+ if (st_master_fst.partition_flg == 1) {
+ /* When the partitioning flag is enabled,Or exceeds the size that can be sent,Perform split transmission */
+ memcpy(&st_master_fst_temp, &st_master_fst, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ if ((ul_did == POSHAL_DID_GYRO_X_FST) || /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ (ul_did == POSHAL_DID_GYRO_Y_FST) ||
+ (ul_did == POSHAL_DID_GYRO_Z_FST) ||
+ (ul_did == POSHAL_DID_GSNS_X_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Y_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Z_FST)) {
+ /* 1st session */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ /* Size of data that can be transmitted in one division(Same size definition used)*/
+ st_master_fst_temp.us_size = LSDRV_FSTSNS_DSIZE_GYRO_X;
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst_temp.us_size + 8),
+ (const void *)&st_master_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])),
+ st_master_fst_temp.us_size,
+ uc_result);
+
+ /* Second time */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)memset(reinterpret_cast<void *>(&st_master_fst_temp.uc_data[0]),
+ 0,
+ sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST);
+ /* Size of the data - Transmission size(Same size definition used)Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ st_master_fst_temp.us_size = static_cast<u_int16>(st_master_fst.us_size - \
+ LSDRV_FSTSNS_DSIZE_GYRO_X);
+ memcpy(&st_master_fst_temp.uc_data[0],
+ &st_master_fst.uc_data[LSDRV_FSTSNS_DSIZE_GYRO_X],
+ st_master_fst_temp.us_size);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 #Coverity_19347 */
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst_temp.us_size + 8),
+ (const void *)&st_master_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])),
+ st_master_fst_temp.us_size,
+ uc_result);
+ } else if (ul_did == POSHAL_DID_REV_FST) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* 1st session */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ /* Size of data that can be transmitted in one division */
+ st_master_fst_temp.us_size = LSDRV_FSTSNS_DSIZE_REV;
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst_temp.us_size + 8),
+ (const void *)&st_master_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])),
+ st_master_fst_temp.us_size,
+ uc_result);
+
+ /* Second time */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)memset(reinterpret_cast<void *>(&st_master_fst_temp.uc_data[0]),
+ 0,
+ sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST);
+ /* Size of the data - Transmission size Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ st_master_fst_temp.us_size = static_cast<u_int16>(st_master_fst.us_size - \
+ LSDRV_FSTSNS_DSIZE_REV);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 #Coverity_19347 */
+ memcpy(&st_master_fst_temp.uc_data[0],
+ &st_master_fst.uc_data[LSDRV_FSTSNS_DSIZE_REV],
+ st_master_fst_temp.us_size);
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst_temp.us_size + 8),
+ (const void *)&st_master_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])),
+ st_master_fst_temp.us_size,
+ uc_result);
+ } else {
+ /* 1st session */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ /* Size of data that can be transmitted in one division(Same size definition used)*/
+ st_master_fst_temp.us_size = LSDRV_FSTSNS_DSIZE_GYRO_TEMP;
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst_temp.us_size + 8),
+ (const void *)&st_master_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])),
+ st_master_fst_temp.us_size,
+ uc_result);
+ /* Second time */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)memset(reinterpret_cast<void *>(&st_master_fst_temp.uc_data[0]),
+ 0,
+ sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST);
+ /* Size of the data - Transmission size(Same size definition used)Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ st_master_fst_temp.us_size = static_cast<u_int16>(st_master_fst.us_size - \
+ LSDRV_FSTSNS_DSIZE_GYRO_TEMP);
+ memcpy(&st_master_fst_temp.uc_data[0],
+ &st_master_fst.uc_data[LSDRV_FSTSNS_DSIZE_GYRO_TEMP],
+ st_master_fst_temp.us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 #Coverity_19347*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst_temp.us_size + 8),
+ (const void *)&st_master_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])),
+ st_master_fst_temp.us_size,
+ uc_result);
+ }
+ } else {
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(st_master_fst.us_size + 8),
+ (const void *)&st_master_fst);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(st_master_fst.uc_data[0])),
+ st_master_fst.us_size,
+ uc_result);
+ }
+
+ return uc_result;
+}
+
+u_int8 VehicleSensDeliveryGyro(DID ul_did, u_int8 uc_current_get_method, int32 pno_index, const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+
+ VEHICLESENS_DATA_MASTER_GYRO_TROUBLE st_master_gyro_trouble;
+ SENSORMOTION_MSG_GYROTROUBLEINFO_DAT st_msg_gyro_trouble_info;
+
+ /* Initialization */
+ st_msg_gyro_trouble_info.reserve = 0;
+
+ VehicleSensGetDataMasterGyroTrouble(ul_did, uc_current_get_method, &st_master_gyro_trouble);
+
+ /* Size storage(GYROTROUBLE) */
+ st_msg_gyro_trouble_info.size = st_master_gyro_trouble.us_size;
+
+ /* Set the GyroTrouble */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_gyro_trouble_info.gyro_trouble)),
+ reinterpret_cast<void *>(&(st_master_gyro_trouble.uc_data)),
+ sizeof(st_msg_gyro_trouble_info.gyro_trouble));
+
+#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[DIAG] ul_did = VEHICLE_DID_GYRO_TROUBLE");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[DIAG] st_msg_gyro_trouble_info.size = %d", st_msg_gyro_trouble_info.size);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[DIAG] st_msg_gyro_trouble_info.gyro_trouble = 0x%08X \r\n",
+ st_msg_gyro_trouble_info.gyro_trouble);
+#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */
+ /* Since the undefined state is not a device specification,Do not deliver to the app side */
+ if (st_msg_gyro_trouble_info.gyro_trouble != GYRO_UNFIXED) {
+
+ /* Send GyroTrouble to API-caller */
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLE_SENSORMOTION_GYROTROUBLE,
+ sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT),
+ (const void *)&st_msg_gyro_trouble_info);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&st_msg_gyro_trouble_info),
+ sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT),
+ uc_result);
+#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] GyroTrouble Delivery");
+#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */
+ }
+ return uc_result;
+}
+// LCOV_EXCL_STOP
+
+void VehicleSensDeliveryAntenna(DID ul_did, u_int8 uc_current_get_method, int32 pno_index, const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS gps_antenna_status;
+ VEHICLESENS_DELIVERY_FORMAT delivery_data;
+ u_int16 length;
+
+ VehicleSensGetDataMasterGpsAntennaStatus(ul_did, uc_current_get_method, &gps_antenna_status);
+
+ delivery_data.header.did = gps_antenna_status.ul_did;
+ delivery_data.header.size = gps_antenna_status.us_size;
+ delivery_data.header.rcv_flag = gps_antenna_status.uc_rcvflag;
+ delivery_data.header.sensor_cnt = gps_antenna_status.uc_sensor_cnt;
+ (void)memcpy(reinterpret_cast<void *>(&delivery_data.data[0]),
+ reinterpret_cast<void *>(&gps_antenna_status.uc_data),
+ (size_t)delivery_data.header.size);
+
+ length = static_cast<u_int16>(static_cast<u_int32>(sizeof(delivery_data.header)) + delivery_data.header.size);
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ length,
+ (const void *)&delivery_data);
+}
+// LCOV_EXCL_STOP
+
+u_int8 VehicleSensDeliveryOther(DID ul_did, u_int8 uc_current_get_method, int32 pno_index,
+ u_int32* cid, // NOLINT(readability/nolint)
+ VEHICLESENS_DATA_MASTER* stmaster, // NOLINT(readability/nolint)
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) {
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+/* Determine CID */
+ if (ul_did == VEHICLE_DID_LOCATION_LONLAT_NAVI) {
+ *cid = CID_POSIF_REGISTER_LISTENER_LONLAT;
+ } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE_NAVI) { // LCOV_EXCL_BR_LINE 6:VEHICLE_DID_LOCATION_ALTITUDE_NAVI no API to pass in // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE; // LCOV_EXCL_LINE 8: dead code
+ } else if ((ul_did == VEHICLE_DID_MOTION_SPEED_NAVI) ||
+ (ul_did == VEHICLE_DID_MOTION_SPEED_INTERNAL)) {
+ *cid = CID_VEHICLE_SENSORMOTION_SPEED;
+ } else if (ul_did == VEHICLE_DID_MOTION_HEADING_NAVI) {
+ *cid = CID_POSIF_REGISTER_LISTENER_HEADING;
+ } else if (ul_did == VEHICLE_DID_SETTINGTIME) {
+ *cid = CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ;
+ } else { // LCOV_EXCL_BR_LINE 6: cannot be this one
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *cid = 0xFFFF; /* DID error */ // LCOV_EXCL_LINE 8: dead code
+ }
+
+ /* Send vehicle sensor information notification */
+ if (*cid == 0xFFFF) { // LCOV_EXCL_BR_LINE 6: cannot be this one
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Error log */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Unknown DID [%d]", ul_did);
+ } else {
+ /* Acquire the applicable data information from the data master..*/
+ (void)memset(reinterpret_cast<void *>(stmaster), 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ VehicleSensGetDataMaster(ul_did, uc_current_get_method, stmaster);
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ static_cast<CID>(*cid),
+ (u_int16)(stmaster->us_size),
+ (const void *)&(stmaster->uc_data[0]));
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED,
+ ul_did,
+ pst_pno_tbl->st_pno_data[pno_index].us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster->uc_data[0])),
+ stmaster->us_size,
+ uc_result);
+ }
+
+ return uc_result;
+}
+
+void VehicleSensDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method) {
+ VEHICLESENS_DATA_MASTER stmaster; /* Data master of normal data */
+ const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl; /* Vehicle Sensor Destination PNO Table Pointer */
+ SENSOR_PKG_MSG_VSINFO st_pkg_master; /* Data master for package delivery */
+ uint32_t cid;
+ uint8_t uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+
+ /* Obtain the data acquisition method from the Vehicle Selection Item List */
+ uint8_t uc_current_get_method = VehicleSensGetSelectionItemList(ul_did);
+
+ if (uc_current_get_method == uc_get_method) {
+ /* When the data acquisition methods match (= delivery target) */
+
+ /* Obtain the shipping destination PNO */
+ pst_pno_tbl = (const VEHICLESENS_DELIVERY_PNO_TBL *) VehicleSensMakeDeliveryPnoTbl(ul_did, uc_chg_type);
+
+ if ((pst_pno_tbl->us_dnum) > 0) {
+ /* When there is a shipping destination PNO registration */
+ /* For boundary adjustment */
+ uint16_t us_boundary_adj = (u_int16) VEHICLESENS_BIT1 | (u_int16) VEHICLESENS_BIT0; /* #012 */
+ /* Vehicle sensor information notification transmission process */
+ for (uint32_t i = 0; i < (pst_pno_tbl->us_dnum); i++) {
+ if (VEHICLESENS_DELIVERY_METHOD_PACKAGE == pst_pno_tbl->st_pno_data[i].uc_method) {
+ /* When the delivery method is the package method */
+ (void) memset(reinterpret_cast<void *>(&st_pkg_master), 0, sizeof(SENSOR_PKG_MSG_VSINFO));
+
+ uint16_t us_index = pst_pno_tbl->st_pno_data[i].us_pkg_start_idx;
+ uint8_t uc_data_cnt = 0U;
+ uint16_t us_offset = 0U;
+ for (uint32_t j = 0; j < SENSOR_PKG_DELIVERY_MAX; j++) {
+ DID ul_pkg_did = g_stpkgdelivery_tbl_mng.st_pkg_data[us_index].ul_did; /* Get DID */
+ st_pkg_master.usOffset[uc_data_cnt] = us_offset; /* Offset setting */
+ uc_current_get_method = VehicleSensGetSelectionItemList(ul_pkg_did); /* Data collection way */
+ if (VEHICLESENS_GETMETHOD_GPS == uc_current_get_method) {
+ VehicleSensGetGpsDataMaster(ul_pkg_did, uc_current_get_method,
+ reinterpret_cast<SENSOR_MSG_GPSDATA_DAT *>(&st_pkg_master.ucData[us_offset]));
+ }
+ else {
+ VehicleSensGetDataMaster(ul_pkg_did, uc_current_get_method,
+ reinterpret_cast<VEHICLESENS_DATA_MASTER *>(&st_pkg_master.ucData[us_offset]));
+ }
+ uc_data_cnt++; /* Data count increment */
+ if ((us_index == pst_pno_tbl->st_pno_data[i].us_pkg_end_idx)
+ || (VEHICLESENS_LINK_INDEX_END == g_stpkgdelivery_tbl_mng.st_pkg_data[us_index].usdlvry_idx)) {
+ st_pkg_master.ucDNum = uc_data_cnt; /* To save the number of data */
+ break;
+ }
+ else {
+ /* By creating the following processing contents,Need to obtain an offset value */
+ uint16_t us_next_offset = VehicleSensGetDataMasterOffset(ul_pkg_did); /* Next offset calculation */
+ /* Boundary adjustment of data size */
+ if ((us_next_offset & us_boundary_adj) != 0) {
+ /* If you need to adjust */
+ /* Mask Lower Bit */
+ us_next_offset = static_cast<u_int16>(us_next_offset & ~us_boundary_adj);
+ /* Add numbers */
+ us_next_offset = static_cast<u_int16>(us_next_offset + (u_int16) VEHICLESENS_BIT2);
+ }
+ us_offset = static_cast<u_int16>(us_offset + us_next_offset);
+ /* Get next index */
+ us_index = g_stpkgdelivery_tbl_mng.st_pkg_data[us_index].usdlvry_idx;
+ }
+ }
+ RET_API ret = PosSndMsg(PNO_VEHICLE_SENSOR, pst_pno_tbl->st_pno_data[i].us_pno,
+ CID_SENSOR_PKG_INFO, (u_int16) sizeof(SENSOR_PKG_MSG_VSINFO), (const void *) &st_pkg_master);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS_PKG, 0, pst_pno_tbl->st_pno_data[i].us_pno,
+ reinterpret_cast<uint8_t *>(&st_pkg_master), sizeof(SENSOR_PKG_MSG_VSINFO), uc_result);
+ }
+ else {
+ /* When the delivery system is normal */
+ /* Acquire the applicable data information from the data master..*/
+ if (VEHICLESENS_GETMETHOD_GPS == uc_current_get_method) {
+ uc_result = VehicleSensDeliveryGPS(ul_did, uc_get_method, uc_current_get_method, i, &cid, &stmaster,
+ pst_pno_tbl);
+ }
+ else if ((VEHICLESENS_GETMETHOD_NAVI == uc_get_method) || // NOLINT(readability/braces)
+ (VEHICLESENS_GETMETHOD_OTHER == uc_get_method) || (VEHICLESENS_GETMETHOD_INTERNAL == uc_get_method)) {
+ uc_result = VehicleSensDeliveryOther(ul_did, uc_current_get_method, i, &cid, &stmaster, pst_pno_tbl);
+ }
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ else if ((ul_did == POSHAL_DID_GYRO_X_FST) || // NOLINT(readability/braces)
+ (ul_did == POSHAL_DID_GYRO_Y_FST) || // NOLINT(readability/braces)
+ (ul_did == POSHAL_DID_GYRO_Z_FST) || // NOLINT(readability/braces)
+ (ul_did == POSHAL_DID_REV_FST) ||
+ (ul_did == POSHAL_DID_GYRO_TEMP_FST) ||
+ (ul_did == POSHAL_DID_GSNS_X_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Y_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Z_FST) ||
+ (ul_did == POSHAL_DID_SPEED_PULSE_FST)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Acquire the applicable data information from the data master for the initial sensor..*/
+ uc_result = VehicleSensDeliveryFst(ul_did, uc_get_method, i, pst_pno_tbl);
+ }
+#endif
+ else if (ul_did == VEHICLE_DID_GYRO_TROUBLE) { // LCOV_EXCL_BR_LINE 6:DID is not used
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ uc_result = VehicleSensDeliveryGyro(ul_did, uc_current_get_method, i, pst_pno_tbl); // LCOV_EXCL_LINE 8: dead code // NOLINT(whitespace/line_length)
+ }
+ else { // NOLINT(readability/braces)
+ (void) memset(reinterpret_cast<void *>(&stmaster), 0x00, sizeof(stmaster));
+ VehicleSensGetDataMaster(ul_did, uc_current_get_method, &stmaster);
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ RET_API ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, pst_pno_tbl->st_pno_data[i].us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO, (u_int16) sizeof(VEHICLESENS_DATA_MASTER), (const void *) &stmaster);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, pst_pno_tbl->st_pno_data[i].us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster.uc_data[0])), stmaster.us_size, uc_result);
+ }
+ }
+ }
+ }
+ }
+}
+
+u_int8 VehicleSensFirstDeliverySens(PNO us_pno, DID ul_did, u_int8 uc_get_method,
+ VEHICLESENS_DATA_MASTER_FST* stmaster_fst,
+ VEHICLESENS_DATA_MASTER_FST* stmaster_fst_temp) {
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+ /* Acquire the applicable data information from the data master for the initial sensor..*/
+ (void)memset(reinterpret_cast<void *>(stmaster_fst), 0, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ (void)memset(reinterpret_cast<void *>(stmaster_fst_temp), 0, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ VehicleSensGetDataMasterFst(ul_did, uc_get_method, stmaster_fst);
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "[LOG:POSHAL_DID_GYRO_FST,POSHAL_DID_SPEED_PULSE_FST]");
+
+ if (stmaster_fst->partition_flg == 1) {
+ /* When the partitioning flag is enabled,Or exceeds the size that can be sent,Perform split transmission */
+ memcpy(stmaster_fst_temp, stmaster_fst, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ if ((ul_did == POSHAL_DID_GYRO_X_FST) || /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ (ul_did == POSHAL_DID_GYRO_Y_FST) ||
+ (ul_did == POSHAL_DID_GYRO_Z_FST) ||
+ (ul_did == POSHAL_DID_GSNS_X_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Y_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Z_FST)) {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "[CALL:VehicleSndMsg:INPOSHAL_DID_GYRO_FST Partition]");
+
+ /* 1st session */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ /* Size of data that can be transmitted in one division(Same size definition used) */
+ stmaster_fst_temp->us_size = LSDRV_FSTSNS_DSIZE_GYRO_X;
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst_temp->us_size + 8),
+ (const void *)stmaster_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS,
+ ul_did,
+ us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])),
+ stmaster_fst_temp->us_size,
+ uc_result);
+
+ /* Second time */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)memset(reinterpret_cast<void *>(&stmaster_fst_temp->uc_data[0]),
+ 0,
+ sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST);
+ /* Size of the data - Transmission size(Same size definition used) Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stmaster_fst_temp->us_size = static_cast<u_int16>(stmaster_fst->us_size - LSDRV_FSTSNS_DSIZE_GYRO_X);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ memcpy(&stmaster_fst_temp->uc_data[0],
+ &stmaster_fst->uc_data[LSDRV_FSTSNS_DSIZE_GYRO_X],
+ stmaster_fst_temp->us_size);
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst_temp->us_size + 8),
+ (const void *)stmaster_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])),
+ stmaster_fst_temp->us_size, uc_result);
+ } else if (ul_did == POSHAL_DID_REV_FST) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "[CALL:VehicleSndMsg:INPOSHAL_DID_REV_FST Partition]");
+
+ /* 1st session */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ stmaster_fst_temp->us_size = LSDRV_FSTSNS_DSIZE_REV; /* Size of data that can be transmitted in one division */
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst_temp->us_size + 8),
+ (const void *)stmaster_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])),
+ stmaster_fst_temp->us_size, uc_result);
+
+ /* Second time */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)memset(reinterpret_cast<void *>(&stmaster_fst_temp->uc_data[0]),
+ 0,
+ sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST);
+ /* Size of the data - Transmission size Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stmaster_fst_temp->us_size = static_cast<u_int16>(stmaster_fst->us_size - LSDRV_FSTSNS_DSIZE_REV);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ memcpy(&stmaster_fst_temp->uc_data[0],
+ &stmaster_fst->uc_data[LSDRV_FSTSNS_DSIZE_REV],
+ stmaster_fst_temp->us_size);
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst_temp->us_size + 8),
+ (const void *)stmaster_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])),
+ stmaster_fst_temp->us_size, uc_result);
+ } else {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "[CALL:Vehicle_SndMsg:POSHAL_DID_SPEED_PULSE_FST Partition]");
+
+ /* 1st session */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ /* Size of data that can be transmitted in one division(Same size definition used) */
+ stmaster_fst_temp->us_size = LSDRV_FSTSNS_DSIZE_GYRO_TEMP;
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst_temp->us_size + 8),
+ (const void *)stmaster_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])),
+ stmaster_fst_temp->us_size, uc_result);
+
+ /* Second time */
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ (void)memset(reinterpret_cast<void *>(&stmaster_fst_temp->uc_data[0]),
+ 0,
+ sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST);
+ /* Size of the data - Transmission size(Same size definition used) Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stmaster_fst_temp->us_size = static_cast<u_int16>(stmaster_fst->us_size - LSDRV_FSTSNS_DSIZE_GYRO_TEMP);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ memcpy(&stmaster_fst_temp->uc_data[0],
+ &stmaster_fst->uc_data[LSDRV_FSTSNS_DSIZE_GYRO_TEMP],
+ stmaster_fst_temp->us_size);
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst_temp->us_size + 8),
+ (const void *)stmaster_fst_temp);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])),
+ stmaster_fst_temp->us_size, uc_result);
+ }
+ } else {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "[CALL:VehicleSndMsg]");
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ static_cast<u_int16>(stmaster_fst->us_size + 8),
+ (const void *)stmaster_fst);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster_fst->uc_data[0])),
+ stmaster_fst->us_size, uc_result);
+ }
+
+ return uc_result;
+}
+
+u_int8 VehicleSensFirstDeliveryOther(PNO us_pno, DID ul_did, u_int8 uc_get_method,
+ u_int32* cid,
+ VEHICLESENS_DATA_MASTER* stmaster) {
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+ /* Determine CID */
+ if (ul_did == VEHICLE_DID_LOCATION_LONLAT_NAVI) {
+ *cid = CID_POSIF_REGISTER_LISTENER_LONLAT;
+ } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE_NAVI) { // LCOV_EXCL_BR_LINE 6:VEHICLE_DID_LOCATION_ALTITUDE_NAVI no API to pass in // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE; // LCOV_EXCL_LINE 8: dead code
+ } else if ((ul_did == VEHICLE_DID_MOTION_SPEED_NAVI) ||
+ (ul_did == VEHICLE_DID_MOTION_SPEED_INTERNAL)) {
+ *cid = CID_VEHICLE_SENSORMOTION_SPEED;
+ } else if (ul_did == VEHICLE_DID_MOTION_HEADING_NAVI) {
+ *cid = CID_POSIF_REGISTER_LISTENER_HEADING;
+ } else if (ul_did == VEHICLE_DID_SETTINGTIME) {
+ *cid = CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ;
+ } else { // LCOV_EXCL_BR_LINE 6: cannot be this one
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *cid = 0xFFFF; /* DID error */ // LCOV_EXCL_LINE 8: dead code
+ }
+
+ /* Vehicle sensor information notification transmission */
+ if (*cid == 0xFFFF) { // LCOV_EXCL_BR_LINE 6: cannot be this one
+ /* Error log */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Unknown DID [%d]", ul_did); // LCOV_EXCL_LINE 8: dead code // NOLINT(whitespace/line_length)
+ } else {
+ /* Acquire the applicable data information from the data master..*/
+ (void)memset(reinterpret_cast<void *>(stmaster), 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ VehicleSensGetDataMaster(ul_did, uc_get_method, stmaster);
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ static_cast<CID>(*cid),
+ (u_int16)stmaster->us_size,
+ (const void *)&(stmaster->uc_data[0]));
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED,
+ ul_did,
+ us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster->uc_data[0])),
+ stmaster->us_size,
+ uc_result);
+ }
+
+ return uc_result;
+}
+/*******************************************************************************
+* MODULE : VehicleSensFirstDelivery
+* ABSTRACT : Vehicle Sensor Initial Data Delivery Process
+* FUNCTION : Deliver the initial data to the destination.
+* ARGUMENT : us_pno :Addresses for delivery NO
+* ul_did :Data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensFirstDelivery(PNO us_pno, DID ul_did) {
+ u_int8 uc_get_method;
+ VEHICLESENS_DATA_MASTER stmaster;
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ VEHICLESENS_DATA_MASTER_FST stMasterFst; /* Master of initial sensor data */
+ VEHICLESENS_DATA_MASTER_FST stMasterFst_temp; /* For temporary storage */
+ u_int32 cid;
+ SENSORLOCATION_MSG_LONLATINFO *pLonLatMsg;
+ SENSORLOCATION_MSG_ALTITUDEINFO *pAltitudeMsg;
+ SENSORMOTION_MSG_HEADINGINFO *pHeadingMsg;
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */
+#endif
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+ [ul_did = 0x%x us_pno:0x%x]", ul_did, us_pno);
+
+ /* Obtain the data acquisition method.*/
+ uc_get_method = VehicleSensGetSelectionItemList(ul_did);
+
+ if (VEHICLESENS_GETMETHOD_GPS == uc_get_method) {
+ SENSOR_MSG_GPSDATA_DAT gps_master;
+ VEHICLESENS_DELIVERY_FORMAT delivery_data;
+ u_int16 length;
+ u_int16 senslog_len;
+
+ VehicleSensGetGpsDataMaster(ul_did, uc_get_method, &gps_master);
+
+ if (ul_did == POSHAL_DID_GPS_TIME) {
+ /* GPS time,Because there is no header in the message to be delivered,Padding deliveryData headers */
+ (void)memcpy(reinterpret_cast<void*>(&delivery_data),
+ reinterpret_cast<void*>(&gps_master.uc_data[0]), gps_master.us_size);
+ length = gps_master.us_size;
+ senslog_len = length;
+ cid = CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME;
+ } else if (ul_did == VEHICLE_DID_LOCATION_LONLAT) {
+ pLonLatMsg = reinterpret_cast<SENSORLOCATION_MSG_LONLATINFO*>(&delivery_data);
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster);
+ (void)memcpy(reinterpret_cast<void*>(&(pLonLatMsg->data)),
+ reinterpret_cast<void*>(&(stmaster.uc_data[0])), stmaster.us_size);
+ length = (u_int16)stmaster.us_size;
+ senslog_len = length;
+ cid = CID_POSIF_REGISTER_LISTENER_LONLAT;
+ } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE) {
+ pAltitudeMsg = reinterpret_cast<SENSORLOCATION_MSG_ALTITUDEINFO*>(&delivery_data);
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster);
+ (void)memcpy(reinterpret_cast<void*>(&(pAltitudeMsg->data)),
+ reinterpret_cast<void*>(&stmaster.uc_data[0]), stmaster.us_size);
+ length = (u_int16)stmaster.us_size;
+ senslog_len = length;
+ cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE;
+ } else if (ul_did == VEHICLE_DID_MOTION_HEADING) {
+ pHeadingMsg = reinterpret_cast<SENSORMOTION_MSG_HEADINGINFO*>(&delivery_data);
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster);
+ (void)memcpy(reinterpret_cast<void*>(&(pHeadingMsg->data)),
+ reinterpret_cast<void*>(&stmaster.uc_data[0]), stmaster.us_size);
+ length = (u_int16)stmaster.us_size;
+ senslog_len = length;
+ cid = CID_POSIF_REGISTER_LISTENER_HEADING;
+ } else {
+
+ delivery_data.header.did = gps_master.ul_did;
+ delivery_data.header.size = gps_master.us_size;
+ delivery_data.header.rcv_flag = gps_master.uc_rcv_flag;
+ delivery_data.header.sensor_cnt = gps_master.uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(&delivery_data.data[0]),
+ reinterpret_cast<void *>(&gps_master.uc_data[0]),
+ (size_t)delivery_data.header.size);
+
+ length = static_cast<u_int16>((u_int16)sizeof(delivery_data.header) + delivery_data.header.size);
+ senslog_len = delivery_data.header.size;
+ cid = CID_VEHICLESENS_VEHICLE_INFO;
+ }
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ static_cast<CID>(cid),
+ length,
+ (const void *)&delivery_data);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ if (cid != CID_VEHICLESENS_VEHICLE_INFO) {
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&delivery_data), senslog_len, uc_result);
+ } else {
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(delivery_data.data[0])), senslog_len, uc_result);
+ }
+ }
+ else if ((VEHICLESENS_GETMETHOD_NAVI == uc_get_method) || // NOLINT(readability/braces)
+ (VEHICLESENS_GETMETHOD_OTHER == uc_get_method) ||
+ (VEHICLESENS_GETMETHOD_INTERNAL == uc_get_method)) {
+ uc_result = VehicleSensFirstDeliveryOther(us_pno, ul_did, uc_get_method, &cid, &stmaster);
+ }
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ else if ((ul_did == POSHAL_DID_GYRO_X_FST) || // NOLINT(readability/braces)
+ (ul_did == POSHAL_DID_GYRO_Y_FST) || // NOLINT(readability/braces)
+ (ul_did == POSHAL_DID_GYRO_Z_FST) || // NOLINT(readability/braces)
+ (ul_did == POSHAL_DID_REV_FST) ||
+ (ul_did == POSHAL_DID_GYRO_TEMP_FST) ||
+ (ul_did == POSHAL_DID_GSNS_X_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Y_FST) ||
+ (ul_did == POSHAL_DID_GSNS_Z_FST) ||
+ (ul_did == POSHAL_DID_SPEED_PULSE_FST)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Acquire the applicable data information from the data master for the initial sensor..*/
+ uc_result = VehicleSensFirstDeliverySens(us_pno, ul_did, uc_get_method, &stMasterFst, &stMasterFst_temp);
+ }
+#endif
+ else if (ul_did == VEHICLE_DID_GYRO_TROUBLE) { // LCOV_EXCL_BR_LINE 8 : DID in not used
+ // LCOV_EXCL_START 8: DID is not used
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VEHICLESENS_DATA_MASTER_GYRO_TROUBLE st_master_gyro_trouble;
+ SENSORMOTION_MSG_GYROTROUBLEINFO_DAT st_msg_gyro_trouble_info;
+
+ /* Initialization */
+ st_master_gyro_trouble.uc_reserve = 0;
+ st_msg_gyro_trouble_info.reserve = 0;
+
+ VehicleSensGetDataMasterGyroTrouble(ul_did, uc_get_method, &st_master_gyro_trouble);
+
+ /* Size storage(GYROTROUBLE) */
+ st_msg_gyro_trouble_info.size = st_master_gyro_trouble.us_size;
+
+ /* Set the GyroTrouble */
+ (void)memcpy(reinterpret_cast<void *>(&(st_msg_gyro_trouble_info.gyro_trouble)),
+ reinterpret_cast<void *>(&(st_master_gyro_trouble.uc_data)),
+ sizeof(st_msg_gyro_trouble_info.gyro_trouble));
+
+#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] ul_did = VEHICLE_DID_GYRO_TROUBLE");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[DIAG] st_msg_gyro_trouble_info.size = %d",
+ st_msg_gyro_trouble_info.size);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[DIAG] st_msg_gyro_trouble_info.gyro_trouble = 0x%08X \r\n",
+ st_msg_gyro_trouble_info.gyro_trouble);
+#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */
+ /* Since the undefined state is not a device specification,Do not deliver to the app for the first time */
+ if (st_msg_gyro_trouble_info.gyro_trouble != GYRO_UNFIXED) {
+
+ /* Send GyroTrouble to API-caller */
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLE_SENSORMOTION_GYROTROUBLE,
+ sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT),
+ (const void *)&st_msg_gyro_trouble_info);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&st_msg_gyro_trouble_info),
+ sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT),
+ uc_result);
+#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] GyroTrouble FirstDelivery");
+#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */
+ }
+ // LCOV_EXCL_STOP
+ }
+ else { // NOLINT(readability/braces)
+ (void)memset(reinterpret_cast<void *>(&stmaster), 0x00, sizeof(stmaster));
+ /* Acquire the applicable data information from the data master..*/
+ VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster);
+
+ /* Call Vehicle Sensor Information Notification Transmission Process.*/
+ ret = VehicleSndMsg(PNO_VEHICLE_SENSOR,
+ us_pno,
+ CID_VEHICLESENS_VEHICLE_INFO,
+ (u_int16)sizeof(VEHICLESENS_DATA_MASTER),
+ (const void *)&stmaster);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno,
+ reinterpret_cast<uint8_t *>(&(stmaster.uc_data[0])),
+ stmaster.us_size, uc_result);
+ }
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensFirstPkgDelivery
+* ABSTRACT : Vehicle Sensor Initial Package Data Delivery Process
+* FUNCTION : Deliver the initial package data to the destination.
+* ARGUMENT : *pst_data :Data portion pointer of the message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensFirstPkgDelivery(const SENSOR_MSG_DELIVERY_ENTRY_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_get_method; /* Data collection way */
+ int32 i; /* Generic counters */
+ SENSOR_PKG_MSG_VSINFO st_pkg_master; /* Data master for package delivery */
+ DID ul_pkg_did; /* DID for package data acquisition */
+ u_int16 us_offset = 0; /* For offset calculation */
+ u_int16 us_next_offset; /* Next offset value */
+ u_int16 us_boundary_adj; /* For boundary adjustment */
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = 0; /* Send/Receive result */
+
+ (void)memset(reinterpret_cast<void *>(&st_pkg_master), 0, sizeof(SENSOR_PKG_MSG_VSINFO));
+ /* For boundary adjustment */
+ us_boundary_adj = (u_int16)VEHICLESENS_BIT1 | (u_int16)VEHICLESENS_BIT0;
+ for (i = 0; i < pst_data->pkg_num; i++) {
+ ul_pkg_did = pst_data->did[i]; /* Get DID */
+ st_pkg_master.usOffset[i] = us_offset; /* Offset setting */
+ /* Data collection way */
+ uc_get_method = VehicleSensGetSelectionItemList(ul_pkg_did);
+ if (VEHICLESENS_GETMETHOD_GPS == uc_get_method) {
+ VehicleSensGetGpsDataMaster(ul_pkg_did,
+ uc_get_method,
+ reinterpret_cast<SENSOR_MSG_GPSDATA_DAT *>(&st_pkg_master.ucData[us_offset]));
+ } else {
+ VehicleSensGetDataMaster(ul_pkg_did,
+ uc_get_method,
+ reinterpret_cast<VEHICLESENS_DATA_MASTER *>(&st_pkg_master.ucData[us_offset]));
+ }
+ /* Next offset calculation */
+ /* Boundary adjustment of data size */
+ us_next_offset = VehicleSensGetDataMasterOffset(ul_pkg_did);
+ if ((us_next_offset & us_boundary_adj) != 0) {
+ /* If you need to adjust */
+ us_next_offset = static_cast<u_int16>(us_next_offset & ~us_boundary_adj); /* Mask Lower Bit */
+ us_next_offset = static_cast<u_int16>(us_next_offset + (u_int16)VEHICLESENS_BIT2); /* Add numbers */
+ }
+ us_offset = static_cast<u_int16>(us_offset + us_next_offset);
+ }
+
+ st_pkg_master.ucDNum = pst_data->pkg_num; /* To save the number of data */
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR,
+ pst_data->pno,
+ CID_SENSOR_PKG_INFO,
+ (u_int16)sizeof(SENSOR_PKG_MSG_VSINFO),
+ (const void *)&st_pkg_master);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS_PKG, 0, pst_data->pno,
+ reinterpret_cast<uint8_t *>(&st_pkg_master),
+ sizeof(SENSOR_PKG_MSG_VSINFO),
+ uc_result);
+}
+// LCOV_EXCL_STOP
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensFirstPkgDeliveryExt
+* ABSTRACT : Vehicle Sensor Initial Expansion Package Data Delivery Process
+* FUNCTION : Deliver the initial expansion package data to the destination.
+* ARGUMENT : *pst_data :Data portion pointer of the message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensFirstPkgDeliveryExt(const SENSOR_MSG_DELIVERY_ENTRY_DAT *pst_data) {
+ u_int8 ucGetMethod; /* Data collection way */
+ int32 i; /* Generic counters */
+ static SENSOR_PKG_MSG_VSINFO stPkgMaster; /* Data master for package delivery */
+ DID ulPkgDid; /* DID for package data acquisition */
+ u_int16 usOffset = 0; /* For offset calculation */
+ u_int16 usNextOffset; /* Next offset value */
+ u_int16 usBoundaryAdj; /* For boundary adjustment */
+ static VEHICLESENS_DATA_MASTER_EXT stExtDataTemp[11];/* Extended data master temporary storage area */
+ u_int16 usDataCnt[11] = {0}; /* For storing the number of data items */
+ u_int8 ucDivideCnt; /* Total number of partitions */
+ u_int8 ucDivide100Cnt = 0; /* Total number of 100 partitions */
+ u_int8 ucDivideSendCnt; /* Number of divided transmissions */
+ u_int16 usDivideSendSize[11] = {0}; /* Split Send Size */
+ u_int16 ucDivideSendPoint; /* Split transmission data acquisition position */
+ u_int8 ucDataBreak; /* Storage area of all data undelivered flag */
+ RET_API ret = RET_NORMAL; /* API return value */
+ u_int8 uc_result = 0; /* Send/Receive result */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* For boundary adjustment */
+ usBoundaryAdj = (u_int16)VEHICLESENS_BIT1 | (u_int16)VEHICLESENS_BIT0;
+ /* #Polaris_004 START */ /* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+ (void)memset(reinterpret_cast<void *>(&stExtDataTemp), 0, sizeof(stExtDataTemp));
+ for (i = 0; i < pst_data->pkg_num; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ulPkgDid = pst_data->did[i]; /* Get DID */
+ ucGetMethod = VehicleSensGetSelectionItemList(ulPkgDid); /* Data collection way */
+ if (VEHICLESENS_GETMETHOD_GPS < ucGetMethod) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "VEHICLESENS_DELIVERYCTRL: VehicleSensGetSelectionItemList error :%d\r\n", ucGetMethod);
+ }
+
+ if ((ulPkgDid == POSHAL_DID_GYRO_EXT) ||
+ (ulPkgDid == POSHAL_DID_GYRO_X) ||
+ (ulPkgDid == POSHAL_DID_GYRO_Y) ||
+ (ulPkgDid == POSHAL_DID_GYRO_Z) ||
+ (ulPkgDid == POSHAL_DID_GSNS_X) ||
+ (ulPkgDid == POSHAL_DID_GSNS_Y) ||
+ (ulPkgDid == POSHAL_DID_GSNS_Z) ||
+ (ulPkgDid == POSHAL_DID_SPEED_PULSE) ||
+ (ulPkgDid == POSHAL_DID_REV) ||
+ (ulPkgDid == POSHAL_DID_GYRO_TEMP) ||
+ (ulPkgDid == POSHAL_DID_PULSE_TIME) ||
+ (ulPkgDid == POSHAL_DID_SNS_COUNTER)) {
+ /* Store in the extended data master information buffer */
+ VehicleSensGetDataMasterExt(ulPkgDid, ucGetMethod, &stExtDataTemp[i]);
+ /* Obtain the number of data items */
+ if ((ulPkgDid == POSHAL_DID_SNS_COUNTER) ||
+ (ulPkgDid == POSHAL_DID_REV)) {
+ usDataCnt[i] = stExtDataTemp[i].us_size; /* 1data 1byte */
+ /* Store the transmission size for 10 items */
+ usDivideSendSize[i] = 10;
+ } else if (ulPkgDid == POSHAL_DID_GYRO_TEMP) {
+ usDataCnt[i] = stExtDataTemp[i].us_size / 2; /* 1data 2byte */
+ /* Store the transmission size for 10 items */
+ usDivideSendSize[i] = 20;
+ }
+ else if (ulPkgDid == POSHAL_DID_PULSE_TIME) { // NOLINT(readability/braces)
+ usDataCnt[i] = stExtDataTemp[i].us_size / 132; /* 1data 132byte */
+ /* Store the transmission size for 10 items */
+ usDivideSendSize[i] = 1320;
+ }
+ else { // NOLINT(readability/braces)
+ usDataCnt[i] = stExtDataTemp[i].us_size / 2; /* 1data 2byte Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Store the transmission size for 100 items */
+ usDivideSendSize[i] = 200;
+
+ // divide cnt is 100
+ if (((usDataCnt[i] % VEHICLESENS_PKG_EXT_SEND_MAX_10DATA) > 0) || (usDataCnt[i] == 0)) {
+ ucDivide100Cnt = static_cast<u_int8>((usDataCnt[i] / VEHICLESENS_PKG_EXT_SEND_MAX_10DATA) + 1);
+ } else {
+ ucDivide100Cnt = static_cast<u_int8>(usDataCnt[i] / VEHICLESENS_PKG_EXT_SEND_MAX_10DATA);
+ }
+ }
+ }
+ }
+ /* All-data undelivered flag holding Ignore->MISRA-C ++: 2008 Rule 5-0-5 */
+ ucDataBreak = static_cast<u_int8>(gstPkgTempExt.data_break);
+
+ /* From the number of data items in the acquired buffer,Calculate the number of transmissions */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ if (((usDataCnt[0] % VEHICLESENS_PKG_EXT_SEND_MAX) > 0) || (usDataCnt[0] == 0)) {
+ /* If there is a remainder,,Division result + 1 */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ucDivideCnt = static_cast<u_int8>((usDataCnt[0] / VEHICLESENS_PKG_EXT_SEND_MAX) + 1);
+ } else {
+ /* If there is no remainder,,The result of division is the total number of transmissions. */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ucDivideCnt = static_cast<u_int8>(usDataCnt[0] / VEHICLESENS_PKG_EXT_SEND_MAX);
+ }
+
+ // if ucDivide100cnt is valid (greater than 0)
+ ucDivideCnt = (ucDivide100Cnt > 0) ? ucDivide100Cnt : ucDivideCnt;
+
+ ucDivideSendCnt = 0; /* Number of divided transmissions */
+ while (ucDivideSendCnt < ucDivideCnt) {
+ /* Clear send message buffer */
+ (void)memset(reinterpret_cast<void *>(&stPkgMaster), 0, sizeof(SENSOR_PKG_MSG_VSINFO));
+ usOffset = 0;
+ for (i = 0; i < pst_data->pkg_num; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ulPkgDid = pst_data->did[i]; /* Get DID */
+ stPkgMaster.usOffset[i] = usOffset; /* Offset setting */
+ /* copy Data ID of extended data master structure,Size of the data,Receive flag,Reserved */
+ memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset]),
+ reinterpret_cast<void *>(&stExtDataTemp[i]), 11);
+ if ((ulPkgDid == POSHAL_DID_SNS_COUNTER) ||
+ (ulPkgDid == POSHAL_DID_REV) ||
+ (ulPkgDid == POSHAL_DID_PULSE_TIME) ||
+ (ulPkgDid == POSHAL_DID_GYRO_TEMP)) {
+ if (usDataCnt[i] > VEHICLESENS_PKG_EXT_SEND_MAX) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Calculate the data acquisition position */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]);
+ /* Update the data size*/
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucData[usOffset + 4] = (u_int8)usDivideSendSize[i];
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucData[usOffset + 5] = (u_int8)(usDivideSendSize[i] >> 8);
+ /* Create 10 divided transmission data of sensor counters of extended data master structure */
+ memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]),
+ reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]),
+ usDivideSendSize[i]); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Subtract the number of created transmission data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ usDataCnt[i] = static_cast<u_int16>(usDataCnt[i] - VEHICLESENS_PKG_EXT_SEND_MAX);
+ } else {
+ /* Calculate the data acquisition position */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]);
+ /* Update the data size*/
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucData[usOffset + 4] = (u_int8)(stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */
+ stPkgMaster.ucData[usOffset + 5] = \
+ (u_int8)((stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint) >> 8);
+ /* Create the remaining divided send data of sensor counter of extended data master structure */
+ memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]),
+ reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]),
+ stExtDataTemp[i].us_size - ucDivideSendPoint); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Since all buffers have been created, the number of data is set to 0. */
+ usDataCnt[i] = 0;
+ }
+ } else {
+ if (usDataCnt[i] > VEHICLESENS_PKG_EXT_SEND_MAX_10DATA) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Calculate the data acquisition position */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]);
+ /* Update the data size*/
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucData[usOffset + 4] = (u_int8)usDivideSendSize[i];
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucData[usOffset + 5] = (u_int8)(usDivideSendSize[i] >> 8);
+ /* Create 100 divided transmission data of vehicle sensor data of extended data master structure */
+ memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]),
+ reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]),
+ usDivideSendSize[i]); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Subtract the number of created transmission data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ usDataCnt[i] = static_cast<u_int16>(usDataCnt[i] - VEHICLESENS_PKG_EXT_SEND_MAX_10DATA);
+ } else {
+ /* Calculate the data acquisition position */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]);
+ /* Update the data size*/
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucData[usOffset + 4] = \
+ (u_int8)(stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */
+ stPkgMaster.ucData[usOffset + 5] = \
+ (u_int8)((stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint) >> 8);
+ /* Create the remaining divided transmission data of the vehicle sensor data of the extended data master structure. */
+ memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]),
+ reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]),
+ stExtDataTemp[i].us_size - ucDivideSendPoint); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Since all buffers have been created, the number of data is set to 0. */
+ usDataCnt[i] = 0;
+ }
+ }
+ /* Next offset calculation */
+ /* Boundary adjustment of data size */
+ usNextOffset = VehicleSensGetDataMasterExtOffset(ulPkgDid);
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */
+ if ((usNextOffset & usBoundaryAdj) != 0) {
+ /* If you need to adjust */
+ /* Mask Lower Bit Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */
+ usNextOffset = static_cast<u_int16>(usNextOffset & ~usBoundaryAdj);
+ usNextOffset = static_cast<u_int16>(usNextOffset + (u_int16)VEHICLESENS_BIT2); /* Add numbers */
+ }
+ usOffset = static_cast<u_int16>(usOffset + usNextOffset); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ }
+ stPkgMaster.ucDNum = pst_data->pkg_num; /* To save the number of data */
+ stPkgMaster.ucDataBreak = ucDataBreak; /* Set all data undelivered flag */
+ stPkgMaster.ucDivideCnt = ucDivideCnt; /* Set total number of partitions */
+ /* Division number setting Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ stPkgMaster.ucDivideSendCnt = static_cast<uint8_t>(ucDivideSendCnt + 1);
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR,
+ pst_data->pno,
+ CID_SENSOR_PKG_INFO,
+ (u_int16)sizeof(SENSOR_PKG_MSG_VSINFO),
+ (const void *)&stPkgMaster);
+ uc_result = SENSLOG_RES_SUCCESS;
+ if (ret != RET_NORMAL) {
+ uc_result = SENSLOG_RES_FAIL;
+ }
+ SensLogWriteOutputData(SENSLOG_DATA_O_SYS_PKG, 0, pst_data->pno,
+ reinterpret_cast<uint8_t *>(&stPkgMaster),
+ sizeof(SENSOR_PKG_MSG_VSINFO), uc_result);
+
+ ucDivideSendCnt++;
+
+ /* Package delivery (split) confirmation debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__,
+ "### SENS RECV # FST PKG DELIVERY : cnt[%d/7]", ucDivideSendCnt);
+ if (7 <= ucDivideSendCnt) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__,
+ "### SENS RECV # FST PKG DELIVERY : last sns_cnt[%d][%d][%d][%d]",
+ stPkgMaster.ucData[8], stPkgMaster.ucData[9], stPkgMaster.ucData[10], stPkgMaster.ucData[11]);
+ }
+ }
+ /* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+}
+#endif
+
+/* ++ PastModel002 response DR */
+
+/*******************************************************************************
+ * MODULE : VehicleSensEntryDeliveryCtrlDR
+ * ABSTRACT : Internal delivery destination management registration function for vehicle sensor DR
+ * FUNCTION : Internal distribution destination management table for DR,Update the shipping management table management.
+ * ARGUMENT : pst_delivery_entry : Pointer to the delivery registration information
+ * NOTE :
+ * RETURN : VEHICLE_RET_NORMAL :Successful registration
+ ******************************************************************************/
+VEHICLE_RET_API VehicleSensEntryDeliveryCtrlDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *pst_delivery_entry) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i;
+ u_int8 uc_action_type = VEHICLESENS_ACTION_TYPE_ADD;
+ int32 uc_did_flag;
+ DID ulentry_did = pst_delivery_entry->data.did;
+ VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data = NULL;
+ VEHICLE_RET_API ret = VEHICLE_RET_NORMAL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+
+ /* Check if the data ID exists. */
+ uc_did_flag = VehicleSensCheckDid(ulentry_did);
+ if (uc_did_flag == 0) {
+ ret = VEHICLE_RET_ERROR_DID; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Check the number of registered shipments. */
+ if ((ret == VEHICLE_RET_NORMAL) &&/* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (g_stdelivery_ctrl_tbl_dr.us_dnum >= VEHICLESENS_DELIVERY_INFO_MAX)) {
+ /* Return the FULL of delivery registrations*/
+ ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* By searching for the delivery registration of the relevant DID,Hold the address. */
+ for (i = 0; i < g_stdelivery_ctrl_tbl_mng_dr.us_dnum; i++) {
+ if (g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].ul_did == ulentry_did) {
+ uc_action_type = VEHICLESENS_ACTION_TYPE_UPDATE;
+ pst_existing_mng_data = &g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i];
+ }
+ }
+
+ /* Add to the shipping management table.*/
+ VehicleSensAddDeliveryCtrlTblDR(pst_delivery_entry);
+ /* Processing when updating existing data*/
+ if (uc_action_type == VEHICLESENS_ACTION_TYPE_UPDATE) {
+ /* Update the shipping management table.*/
+ VehicleSensUpdateDeliveryCtrlTblDR(pst_existing_mng_data);
+
+ /* Update the shipping destination management table management information.*/
+ VehicleSensUpdateDeliveryCtrlTblMngDR(pst_existing_mng_data);
+ } else { /* Newly added processing*/
+ /* Add to the shipping management table management information.*/
+ VehicleSensAddDeliveryCtrlTblMngDR(pst_delivery_entry);
+ }
+ }
+ return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensMakeDeliveryPnoTblDR
+* ABSTRACT : Vehicle sensor internal delivery destination PNO table creation function for DR
+* FUNCTION : Create an internal delivery destination PNO table for DR
+* ARGUMENT : ul_did Data ID
+* Change_type Delivery Trigger
+* NOTE :
+* RETURN : VEHICLESENS_DELIVERY_PNO_TBL* Pointer to the shipping PNO table
+******************************************************************************/
+VEHICLESENS_DELIVERY_PNO_TBL* VehicleSensMakeDeliveryPnoTblDR(DID ul_did, u_int8 change_type) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i;
+ u_int8 uc_ctrl_tbl_mng_data_list;
+ u_int16 us_index = 0;
+ u_int16 us_dnum = 0;
+
+ /* Get the start index and count of the corresponding data ID. */
+ uc_ctrl_tbl_mng_data_list = static_cast<u_int8>(
+ (sizeof(g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data)) /
+ (sizeof(g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[0])));
+
+ for (i = 0; i < uc_ctrl_tbl_mng_data_list; i++) {
+ /* Stores the information of the corresponding DID.. */
+ if (g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].ul_did == ul_did) {
+ us_index = g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].us_start_idx;
+ us_dnum = g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].usdlvry_entry_num;
+ break;
+ }
+ }
+
+ /* Create a PNO list */
+ (void)memset(reinterpret_cast<void *>(&g_stdelivery_pno_tbl_dr),
+ static_cast<int32>(0),
+ (size_t)sizeof(g_stdelivery_pno_tbl_dr));
+ if (change_type == VEHICLESENS_CHGTYPE_CHG) {
+ /* Processing when delivery timing is changed*/
+ for (i = 0; i < us_dnum; i++) {
+ /* Functionalization by Increasing Structure Members */
+ VehicleSensAddPnoTblDR(us_index);
+ us_index = g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_link_idx;
+ }
+ } else {
+ /* Processing when delivery timing is update */
+ for (i = 0; i < us_dnum; i++) {
+ if (VEHICLE_DELIVERY_TIMING_UPDATE == g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].uc_chg_type) {
+ /* Functionalization by Increasing Structure Members */
+ VehicleSensAddPnoTblDR(us_index);
+ }
+ us_index = g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_link_idx;
+ }
+ }
+
+ return(&g_stdelivery_pno_tbl_dr);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensAddPnoTblDR
+* ABSTRACT : Vehicle sensor DR internal delivery destination PNO table addition function
+* FUNCTION : Add to the internal DR shipping destination PNO table.
+* ARGUMENT : us_index : Index of the referenced destination management table
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddPnoTblDR(u_int16 us_index) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int16 us_pno_tbl_idx;
+
+ us_pno_tbl_idx = g_stdelivery_pno_tbl_dr.us_dnum;
+ g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].us_pno = \
+ g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_pno;
+ g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].us_pkg_start_idx = \
+ g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_pkg_start_idx;
+ g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].us_pkg_end_idx = \
+ g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_pkg_end_idx;
+ g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].uc_method = \
+ g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].uc_method;
+ g_stdelivery_pno_tbl_dr.us_dnum++;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensAddDeliveryCtrlTblDR
+* ABSTRACT : Vehicle sensor DR internal delivery destination management table addition function
+* FUNCTION : Add to the DR internal shipping management table.
+* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddDeliveryCtrlTblDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *pst_delivery_entry) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VEHICLESENS_DELIVERY_CTRL_TBL_DATA *pst_ctrl_data;
+
+ pst_ctrl_data = &g_stdelivery_ctrl_tbl_dr.st_ctrl_data[g_stdelivery_ctrl_tbl_dr.us_dnum];
+ pst_ctrl_data->ul_did = pst_delivery_entry->data.did;
+ pst_ctrl_data->us_pno = pst_delivery_entry->data.pno;
+ pst_ctrl_data->uc_chg_type = pst_delivery_entry->data.delivery_timing;
+ pst_ctrl_data->uc_ctrl_flg = pst_delivery_entry->data.ctrl_flg;
+ pst_ctrl_data->us_link_idx = VEHICLESENS_LINK_INDEX_END;
+ pst_ctrl_data->us_pkg_start_idx = VEHICLESENS_LINK_INDEX_END;
+ pst_ctrl_data->us_pkg_end_idx = VEHICLESENS_LINK_INDEX_END;
+ pst_ctrl_data->uc_method = VEHICLESENS_DELIVERY_METHOD_NORMAL;
+ g_stdelivery_ctrl_tbl_dr.us_dnum = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum + 1);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensAddDeliveryCtrlTblMngDR
+* ABSTRACT : Internal delivery destination management table management addition function for vehicle sensor DR
+* FUNCTION : Add to the DR internal shipping management table management.
+* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensAddDeliveryCtrlTblMngDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *pst_delivery_entry) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_ctrl_mng_data;
+
+ pst_ctrl_mng_data = &g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[g_stdelivery_ctrl_tbl_mng_dr.us_dnum];
+ pst_ctrl_mng_data->ul_did = pst_delivery_entry->data.did;
+ pst_ctrl_mng_data->us_start_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1);
+ pst_ctrl_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1);
+ pst_ctrl_mng_data->usdlvry_entry_num++;
+ g_stdelivery_ctrl_tbl_mng_dr.us_dnum++;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : VehicleSensUpdateDeliveryCtrlTblMngDR
+ * ABSTRACT : Internal delivery destination management table management update function for vehicle sensor DR
+ * FUNCTION : Update the internal delivery destination management table management for DR.
+ * ARGUMENT : *pst_existing_mng_data : Pointer to the previous data information with the same data ID
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensUpdateDeliveryCtrlTblMngDR(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Update only the end index and the number of registered shipping destinations. */
+ pst_existing_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1);
+ pst_existing_mng_data->usdlvry_entry_num++;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensUpdateDeliveryCtrlTblDR
+* ABSTRACT : Vehicle sensor DR internal delivery destination management table update function
+* FUNCTION : Update the internal distribution destination management table for DR.
+* ARGUMENT : *pst_existing_mng_data : Pointer to the previous data information with the same data ID
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensUpdateDeliveryCtrlTblDR(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Update Link Index Only.
+ For indexes of usEndIdx values matching the data IDs in the target management table
+ Making usLinkIdx an Index-Registered Index */
+ g_stdelivery_ctrl_tbl_dr.st_ctrl_data[pst_existing_mng_data->us_end_idx].us_link_idx =
+ static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : VehicleSensDeliveryProcDR
+ * ABSTRACT : Internal Data Delivery Process for Vehicle Sensor DR
+ * FUNCTION : Deliver data to internal DR destinations.
+ * ARGUMENT : ul_did :Data ID
+ * uc_chg_type :Delivery timing
+ * uc_get_method :Acquisition method
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensDeliveryProcDR(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method) {
+ return;
+}
+
+/**
+ * @brief
+ * Obtain dump info(g_stdelivery_ctrl_tbl)
+ *
+ * @param[out] pbuf Dump information
+ */
+void VehicleSensGetDebugDeliveryCtrlTbl(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[256];
+ u_int16 i;
+
+ memset(&buf, 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&(buf)),
+ 32,
+ "Delivery-Tbl\n DNum:%d", g_stdelivery_ctrl_tbl.us_dnum);
+ for (i = 0; i < g_stdelivery_ctrl_tbl.us_dnum; i++) {
+ if (i >= 30) {
+ break;
+ }
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] did:0x%08x, pno:0x%04x, chgT:0x%02x, ctrlFg:0x%02x, "\
+ "lnkidx:0x%04x, pkgSidx:0x%04x, pkgEidx:0x%04x, Mth:0x%02x",
+ i,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].ul_did,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pno,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_chg_type,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_ctrl_flg,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_link_idx,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pkg_start_idx,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pkg_end_idx,
+ g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_method);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ }
+ memcpy(pbuf, &buf[0], sizeof(buf));
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Obtain dump info(g_stdelivery_ctrl_tbl_mng)
+ *
+ * @param[out] pbuf Dump information
+ */
+void VehicleSensGetDebugDeliveryCtrlTblMng(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[256];
+ u_int16 i;
+
+ memset(&buf, 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&(buf)),
+ 32,
+ "Delivery-TblMng\n DNum:%d",
+ g_stdelivery_ctrl_tbl_mng.us_dnum);
+ for (i = 0; i < g_stdelivery_ctrl_tbl_mng.us_dnum; i++) {
+ if (i >= 60) {
+ break;
+ }
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] did:0x%08x, Sidx:0x%04x, Eidx:0x%04x, EntNum:0x%04x",
+ i,
+ g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did,
+ g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].us_start_idx,
+ g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].us_end_idx,
+ g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].usdlvry_entry_num);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ }
+ memcpy(pbuf, &buf[0], sizeof(buf));
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Obtain dump info(g_stpkgdelivery_tbl_mng)
+ *
+ * @param[out] pbuf Dump information
+ */
+void VehicleSensGetDebugPkgDeliveryTblMng(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[256];
+ u_int16 i;
+
+ memset(&buf, 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&(buf)),
+ 32,
+ "Delivery-PkgTblMng\n DNum:%d",
+ g_stpkgdelivery_tbl_mng.us_dnum);
+ for (i = 0; i < g_stpkgdelivery_tbl_mng.us_dnum; i++) {
+ if (i >= 100) {
+ break;
+ }
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] did:0x%08x, Didx:0x%04x",
+ i,
+ g_stpkgdelivery_tbl_mng.st_pkg_data[i].ul_did,
+ g_stpkgdelivery_tbl_mng.st_pkg_data[i].usdlvry_idx);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ }
+ memcpy(pbuf, &buf[0], sizeof(buf));
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Obtain dump info(g_stdelivery_pno_tbl)
+ *
+ * @param[out] pbuf Dump information
+ */
+void VehicleSensGetDebugDeliveryPnoTbl(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[256];
+ u_int16 i;
+
+ memset(&buf, 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&(buf)),
+ 32,
+ "Delivery-PnoTbl\n DNum:%d",
+ g_stdelivery_pno_tbl.us_dnum);
+ for (i = 0; i < g_stdelivery_pno_tbl.us_dnum; i++) {
+ if (i >= 60) {
+ break;
+ }
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] pno:0x%04x, pkgSidx:0x%04x, pkgEidx:0x%04x, Mth:0x%02x",
+ i,
+ g_stdelivery_pno_tbl.st_pno_data[i].us_pno,
+ g_stdelivery_pno_tbl.st_pno_data[i].us_pkg_start_idx,
+ g_stdelivery_pno_tbl.st_pno_data[i].us_pkg_end_idx,
+ g_stdelivery_pno_tbl.st_pno_data[i].uc_method);
+ _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp));
+ }
+ memcpy(pbuf, &buf[0], sizeof(buf));
+ return;
+}
+// LCOV_EXCL_STOP
+/* -- PastModel002 support DR */
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp
new file mode 100755
index 0000000..eefbc51
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp
@@ -0,0 +1,105 @@
+/*
+ * @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 VehicleSens_Did_GPSInterruptFlag.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_INTERRUPT_FLAG)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGpsInterruptFlag; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief VehicleSensInitGpsInterruptFlag<BR>
+ Vehicle sensor SPEED_PULSE initialization function
+@outline SPEED_PULSE_FLAG initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitGpsInterruptFlag(void) {
+ memset(&gstGpsInterruptFlag, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGpsInterruptFlag.ul_did = POSHAL_DID_GPS_INTERRUPT_FLAG;
+ gstGpsInterruptFlag.us_size = VEHICLE_DSIZE_GPS_INTERRUPT_FLAG;
+
+ gstGpsInterruptFlag.uc_data[0] = VEHICLE_DINIT_GPS_INTERRUPT_FLAG;
+}
+
+/***************************************************************************
+@brief NAV-CLOCK SET vehicle sensor function
+@outline To update the master data NAV-CLOCK.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetGpsInterruptFlag(const LSDRV_LSDATA_G *pst_data) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsInterruptFlag;
+
+ /** 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-CLOCK GET
+@outline Master Data provides the NAV-CLOCK
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetGpsInterruptFlag(VEHICLESENS_DATA_MASTER *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER *pst_masterdata;
+
+ pst_masterdata = &gstGpsInterruptFlag;
+
+ /** Store the data master in the specified destination. */
+ pst_data->ul_did = pst_masterdata->ul_did;
+ pst_data->us_size = pst_masterdata->us_size;
+ pst_data->uc_rcvflag = pst_masterdata->uc_rcvflag;
+ pst_data->uc_snscnt = pst_masterdata->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_masterdata->uc_data), (size_t)(pst_masterdata->us_size));
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp
new file mode 100755
index 0000000..bbf4965
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp
@@ -0,0 +1,58 @@
+/*
+ * @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_GpsAntenna.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_ANTENNA)
+ * Module configuration :VehicleSensGetGpsAntenna() Vehicle Sensor GPS_ANTENNA GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGpsAntenna
+* ABSTRACT : Vehicle sensor GPS_ANTENNA GET function
+* FUNCTION : Provide the GPS_ANTENNA data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGpsAntenna(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGpsAntennal(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp
new file mode 100755
index 0000000..dc950cc
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp
@@ -0,0 +1,112 @@
+/*
+ * @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_GpsAntennaStatus.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_ANTENNA)
+ * Module configuration :VehicleSensInitGpsAntennaStatus() Vehicle sensor GPS_ANTENNA_STATUS initialization function
+ * :VehicleSensSetGpsAntennaStatus() Vehicle sensor GPS_ANTENNA_STATUS SET function
+ * :VehicleSensGetGpsAntennaStatus() Vehicle sensor GPS_ANTENNA_STATUS GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS gstGpsAntennaStatus; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGpsAntennaStatus
+* ABSTRACT : Vehicle sensor GPS_ANTENNA_STATUS initialization function
+* FUNCTION : GPS_ANTENNA_STATUS data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGpsAntennaStatus(void) {
+ (void)memset(reinterpret_cast<void *>(&gstGpsAntennaStatus), 0, sizeof(gstGpsAntennaStatus));
+ gstGpsAntennaStatus.ul_did = POSHAL_DID_GPS_ANTENNA;
+ gstGpsAntennaStatus.us_size = VEHICLE_DSIZE_GPS_ANTENNA;
+ gstGpsAntennaStatus.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+ gstGpsAntennaStatus.uc_sensor_cnt = 0U;
+ gstGpsAntennaStatus.uc_data = VEHICLE_DINIT_GPS_ANTENNA;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGpsAntennaStatus
+* ABSTRACT : Vehicle sensor GPS_ANTENNA_STATUS SET function
+* FUNCTION : Update the GPS_ANTENNA_STATUS data master
+* ARGUMENT : *pst_data : Pointer to received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* : VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGpsAntennaStatus(const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstGpsAntennaStatus;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), (size_t)(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_sensor_cnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data));
+ }
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGpsAntennaStatus
+* ABSTRACT : Vehicle sensor GPS_ANTENNA_STATUS GET function
+* FUNCTION : Provide the GPS_ANTENNA_STATUS data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGpsAntennaStatus(VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_master;
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstGpsAntennaStatus;
+
+ /* 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;
+ pst_data->uc_sensor_cnt = pst_master->uc_sensor_cnt;
+ (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)),
+ (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data));
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp
new file mode 100755
index 0000000..00db159
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp
@@ -0,0 +1,97 @@
+/*
+ * @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_GpsAntenna_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_ANTENNA)
+ * Module configuration :VehicleSensInitGpsAntennal() Vehicle sensor GPS_ANTENNA initialization function
+ * :VehicleSensSetGpsAntennal() Vehicle Sensor GPS_ANTENNA SET Function
+ * :VehicleSensGetGpsAntennal() Vehicle Sensor GPS_ANTENNA GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGpsAntenna_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGpsAntennal
+* ABSTRACT : Vehicle sensor GPS_ANTENNA initialization function
+* FUNCTION : GPS_ANTENNA data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGpsAntennal(void) {
+ memset(&gstGpsAntenna_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGpsAntenna_l.ul_did = POSHAL_DID_GPS_ANTENNA;
+ gstGpsAntenna_l.us_size = VEHICLE_DSIZE_GPS_ANTENNA;
+ gstGpsAntenna_l.uc_data[0] = VEHICLE_DINIT_GPS_ANTENNA;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGpsAntennal
+* ABSTRACT : Vehicle Sensor GPS_ANTENNA SET Function
+* FUNCTION : Update the GPS_ANTENNA data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGpsAntennal(const LSDRV_LSDATA *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsAntenna_l;
+
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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 = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGpsAntennal
+* ABSTRACT : Vehicle Sensor GPS_ANTENNA GET Function
+* FUNCTION : Provide the GPS_ANTENNA data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGpsAntennal(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsAntenna_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp
new file mode 100755
index 0000000..955e161
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp
@@ -0,0 +1,51 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsClockDrift.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS clock drift data master GET processing
+ *
+ * @param[out] SENSOR_MSG_GPSDATA_DAT*
+ * @param[in] u_int8
+ */
+void VehicleSensGetGpsClockDrift(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetGpsClockDriftG(pst_data);
+ break;
+ }
+
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp
new file mode 100755
index 0000000..ecfbb4f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp
@@ -0,0 +1,102 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsClockDrift_g.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gGpsClockDrift_g; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS clock drift data master initialization process
+ */
+void VehicleSensInitGpsClockDriftG(void) {
+ int32_t l_gps_clock_drift;
+
+ memset(&gGpsClockDrift_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gGpsClockDrift_g.ul_did = POSHAL_DID_GPS_CLOCK_DRIFT;
+ /** Data size setting */
+ gGpsClockDrift_g.us_size = sizeof(int32_t);
+ /** Data content setting */
+ l_gps_clock_drift = 0xFFFFFFFF;
+ memcpy(&gGpsClockDrift_g.uc_data[0], &l_gps_clock_drift, sizeof(l_gps_clock_drift));
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS clock drift data master SET process
+ *
+ * @param[in] int32_t*
+ *
+ * @return u_int8
+ */
+u_int8 VehicleSensSetGpsClockDriftG(const int32_t *p_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gGpsClockDrift_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, p_data, sizeof(int32_t));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = POSHAL_DID_GPS_CLOCK_DRIFT;
+ pst_master->us_size = sizeof(int32_t);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, p_data, sizeof(int32_t));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * GPS clock drift data master GET processing
+ *
+ * @param[out] SENSOR_MSG_GPSDATA_DAT*
+ */
+void VehicleSensGetGpsClockDriftG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gGpsClockDrift_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp
new file mode 100755
index 0000000..39fac42
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp
@@ -0,0 +1,51 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsClockFreq.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS clock frequency data master GET processing
+ *
+ * @param[out] SENSOR_MSG_GPSDATA_DAT*
+ * @param[in] u_int8
+ */
+void VehicleSensGetGpsClockFreq(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetGpsClockFreqG(pst_data);
+ break;
+ }
+
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp
new file mode 100755
index 0000000..85cbdd6
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp
@@ -0,0 +1,102 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsClockFreq_g.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gGpsClockFreq_g; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Initialization of GPS clock frequency data master
+ */
+void VehicleSensInitGpsClockFreqG(void) {
+ uint32_t ul_gps_clock_freq;
+
+ memset(&gGpsClockFreq_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gGpsClockFreq_g.ul_did = POSHAL_DID_GPS_CLOCK_FREQ;
+ /** Data size setting */
+ gGpsClockFreq_g.us_size = sizeof(uint32_t);
+ /** Data content setting */
+ ul_gps_clock_freq = 0xFFFFFFFF;
+ memcpy(&gGpsClockFreq_g.uc_data[0], &ul_gps_clock_freq, sizeof(ul_gps_clock_freq));
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS clock frequency data master SET process
+ *
+ * @param[in] uint32_t*
+ *
+ * @return u_int8
+ */
+u_int8 VehicleSensSetGpsClockFreqG(const uint32_t *p_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gGpsClockFreq_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, p_data, sizeof(uint32_t));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = POSHAL_DID_GPS_CLOCK_FREQ;
+ pst_master->us_size = sizeof(uint32_t);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, p_data, sizeof(uint32_t));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * GPS clock frequency data master GET processing
+ *
+ * @param[out] SENSOR_MSG_GPSDATA_DAT*
+ */
+void VehicleSensGetGpsClockFreqG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gGpsClockFreq_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp
new file mode 100755
index 0000000..d4aba14
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp
@@ -0,0 +1,98 @@
+/*
+ * @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_GpsCounter_g.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_COUNTER)
+ * Module configuration :VehicleSensInitGpsCounterg() Vehicle sensor GPS_COUNTER initialization function
+ * :VehicleSensSetGpsCounterg() Vehicle Sensor GPS_COUNTER SET Function
+ * :VehicleSensGetGpsCounterg() Vehicle Sensor GPS_COUNTER GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGpsCounter_g; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGpsCounterg
+* ABSTRACT : Vehicle sensor GPS_COUNTER initialization function
+* FUNCTION : GPS_COUNTER data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGpsCounterg(void) {
+ memset(&gstGpsCounter_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGpsCounter_g.ul_did = VEHICLE_DID_GPS_COUNTER;
+ gstGpsCounter_g.us_size = VEHICLE_DSIZE_GPS_COUNTER;
+ gstGpsCounter_g.uc_data[0] = VEHICLE_DINIT_GPS_COUNTER;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGpsCounterg
+* ABSTRACT : Vehicle Sensor GPS_COUNTER SET Function
+* FUNCTION : Update the GPS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to CAN received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGpsCounterg(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsCounter_g;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = (u_int8)pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGpsCounterg
+* ABSTRACT : Vehicle Sensor GPS_COUNTER GET Function
+* FUNCTION : Provide the GPS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGpsCounterg(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsCounter_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp
new file mode 100755
index 0000000..a7b733e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp
@@ -0,0 +1,89 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsNmea_g.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files
+ *---------------------------------------------------------------------------------*/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "gps_hal.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGpsNmea_g; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor GPS_NMEA initialization processing
+ */
+void VehicleSensInitGpsNmeaG(void) {
+ memset(&gstGpsNmea_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
+ gstGpsNmea_g.ul_did = POSHAL_DID_GPS_NMEA;
+ gstGpsNmea_g.us_size = VEHICLE_DSIZE_GPS_FORMAT;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GPS_NMEA SET processing
+ *
+ * @param[in] Pointer to received message data
+ *
+ * @return VEHICLESENS_EQ No data change<BR>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGpsNmeaG(const SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGpsNmea_g;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle sensor GPS_NMEA GET processing
+ *
+ * @param[out] pst_data Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGpsNmeaG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGpsNmea_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp
new file mode 100755
index 0000000..8c23e3e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp
@@ -0,0 +1,53 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsTime.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS time information data master GET processing
+ *
+ * @param[out] VEHICLESENS_DATA_MASTER*
+ * @param[in] u_int8
+ */
+void VehicleSensGetGpsTime(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPSorNAVI */
+ VehicleSensGetGpsTimeG(pst_data);
+ break;
+ }
+
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp
new file mode 100755
index 0000000..9637b72
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp
@@ -0,0 +1,51 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsTimeRaw.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Raw GPS time information data master GET processing
+ *
+ * @param[out] VEHICLESENS_DATA_MASTER*
+ * @param[in] u_int8
+ */
+void VehicleSensGetGpsTimeRaw(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetGpsTimeRawG(pst_data);
+ break;
+ }
+
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp
new file mode 100755
index 0000000..52cda83
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp
@@ -0,0 +1,107 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsTimeRaw_g.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstGpsTimeRaw_g; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS time information data master initialization processing
+ */
+void VehicleSensInitGpsTimeRawG(void) {
+ SENSOR_GPSTIME_RAW st_gps_time_raw;
+
+ memset(&gstGpsTimeRaw_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstGpsTimeRaw_g.ul_did = POSHAL_DID_GPS_TIME_RAW;
+ /** Data size setting */
+ gstGpsTimeRaw_g.us_size = sizeof(SENSOR_GPSTIME_RAW);
+ /** Data content setting */
+ memset(&st_gps_time_raw, 0x00, sizeof(st_gps_time_raw));
+ memcpy(&gstGpsTimeRaw_g.uc_data[0], &st_gps_time_raw, sizeof(st_gps_time_raw));
+
+ return;
+}
+
+/**
+ * @brief
+ * Raw GPS Time Data Master SET Processing
+ *
+ * @param[in] SENSOR_GPSTIME_RAW*
+ *
+ * @return u_int8
+ */
+u_int8 VehicleSensSetGpsTimeRawG(const SENSOR_GPSTIME_RAW *pst_gps_time_raw) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsTimeRaw_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_gps_time_raw, sizeof(SENSOR_GPSTIME_RAW));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = POSHAL_DID_GPS_TIME_RAW;
+ pst_master->us_size = sizeof(SENSOR_GPSTIME_RAW);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_gps_time_raw, sizeof(SENSOR_GPSTIME_RAW));
+
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "year=%04d, month=%02d, date=%02d, hour=%02d, minute=%02d, second=%02d, tdsts=%d",
+ pst_gps_time_raw->utc.year, pst_gps_time_raw->utc.month, pst_gps_time_raw->utc.date,
+ pst_gps_time_raw->utc.hour, pst_gps_time_raw->utc.minute,
+ pst_gps_time_raw->utc.second, pst_gps_time_raw->tdsts);
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Raw GPS time information data master GET processing
+ *
+ * @param[out] SENSOR_MSG_GPSDATA_DAT*
+ */
+void VehicleSensGetGpsTimeRawG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsTimeRaw_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp
new file mode 100755
index 0000000..404e60e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp
@@ -0,0 +1,102 @@
+/*
+ * @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
+ * VehicleSens_Did_GpsTime_g.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstGpsTime_g; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS time information data master initialization processing
+ */
+void VehicleSensInitGpsTimeG(void) {
+ SENSOR_MSG_GPSTIME st_gps_time;
+
+ memset(&gstGpsTime_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstGpsTime_g.ul_did = POSHAL_DID_GPS_TIME;
+ /** Data size setting */
+ gstGpsTime_g.us_size = sizeof(SENSOR_MSG_GPSTIME);
+ /** Data content setting */
+ memset(&st_gps_time, 0x00, sizeof(st_gps_time));
+ memcpy(&gstGpsTime_g.uc_data[0], &st_gps_time, sizeof(st_gps_time));
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS time information data master SET process
+ *
+ * @param[in] SENSOR_MSG_GPS*
+ *
+ * @return u_int8
+ */
+u_int8 VehicleSensSetGpsTimeG(const SENSOR_MSG_GPSTIME *pst_gps_time) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsTime_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_gps_time, sizeof(SENSOR_MSG_GPSTIME));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = POSHAL_DID_GPS_TIME;
+ pst_master->us_size = sizeof(SENSOR_MSG_GPSTIME);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_gps_time, sizeof(SENSOR_MSG_GPSTIME));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * GPS time information data master GET processing
+ *
+ * @param[out] SENSOR_MSG_GPS*
+ */
+void VehicleSensGetGpsTimeG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGpsTime_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp
new file mode 100755
index 0000000..8f84200
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp
@@ -0,0 +1,99 @@
+/*
+ * @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_Gps_CWORD82_FullBinary_g.cpp
+ * System name :_CWORD72_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS__CWORD82__FULLBINARY)
+ * Module configuration :VehicleSensInitGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY initialization function
+ * :VehicleSensSetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY SET function
+ * :VehicleSensGetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "VehicleSens_Common.h"
+#include "gps_hal.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGps_CWORD82_FullBinary_g; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGps_CWORD82_FullBinaryG
+* ABSTRACT : Vehicle sensor GPS_VERSION initialization function
+* FUNCTION : GPS__CWORD82__FULLBINARY data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGps_CWORD82_FullBinaryG(void) {
+ memset(&gstGps_CWORD82_FullBinary_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
+ gstGps_CWORD82_FullBinary_g.ul_did = POSHAL_DID_GPS__CWORD82__FULLBINARY;
+ /* _CWORD82_-only format with a fixed magic number */
+ /* GPS antenna connection information(1byte) + Sensor Counter(1byte) + 191 */
+ gstGps_CWORD82_FullBinary_g.us_size = (VEHICLE_DSIZE_GPS_ANTENNA + VEHICLE_DSIZE_SNS_COUNTER + GPS_CMD_FULLBIN_SZ);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGps_CWORD82_FullBinaryG
+* ABSTRACT : Vehicle sensor GPS_VERSION SET function
+* FUNCTION : Update the GPS__CWORD82__FULLBINARY data master
+* ARGUMENT : *pst_data : Pointer to CAN received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGps_CWORD82_FullBinaryG(const SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+ VehicleSensSetGpsVersion(pst_data); /* Pass the _CWORD82_ binary */
+
+ pst_master = &gstGps_CWORD82_FullBinary_g;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGps_CWORD82_FullBinaryG
+* ABSTRACT : Vehicle sensor GPS_VERSION GET function
+* FUNCTION : Provide the GPS__CWORD82__FULLBINARY data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGps_CWORD82_FullBinaryG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGps_CWORD82_FullBinary_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp
new file mode 100755
index 0000000..9f69054
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp
@@ -0,0 +1,102 @@
+/*
+ * @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_Gps_CWORD82_Nmea_g.cpp
+ * System name :_CWORD72_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS__CWORD82__FULLBINARY)
+ * Module configuration :VehicleSensInitGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY initialization function
+ * :VehicleSensSetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY SET function
+ * :VehicleSensGetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "gps_hal.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGps_CWORD82_Nmea_g; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGps_CWORD82_NmeaG
+* ABSTRACT : Vehicle sensor GPS__CWORD82__NMEA initialization function
+* FUNCTION : GPS__CWORD82__NMEA data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGps_CWORD82_NmeaG(void) {
+ memset(&gstGps_CWORD82_Nmea_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
+ gstGps_CWORD82_Nmea_g.ul_did = VEHICLE_DID_GPS__CWORD82__NMEA;
+ /* _CWORD82_-only format with a fixed magic number */
+ gstGps_CWORD82_Nmea_g.us_size = 3 /* NMEA reception flag + GPS antenna connection information + sensor counter */
+ + VEHICLE_DSIZE_GPS_NMEA_DRMC
+ + VEHICLE_DSIZE_GPS_NMEA_GSA
+ + VEHICLE_DSIZE_GPS_NMEA_GSV_1
+ + VEHICLE_DSIZE_GPS_NMEA_GSV_2
+ + VEHICLE_DSIZE_GPS_NMEA_GSV_3
+ + VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_3;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGps_CWORD82_NmeaG
+* ABSTRACT : Vehicle sensor GPS_NMEA SET function
+* FUNCTION : Update the GPS__CWORD82___CWORD44__GP4 data master
+* ARGUMENT : *pst_data : Pointer to CAN received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+*******************************************************************************/
+u_int8 VehicleSensSetGps_CWORD82_NmeaG(const SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGps_CWORD82_Nmea_g;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGps_CWORD82_NmeaG
+* ABSTRACT : Vehicle sensor GPS__CWORD82__NMEA GET function
+* FUNCTION : GPS__CWORD82__NMEA Provides a data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGps_CWORD82_NmeaG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGps_CWORD82_Nmea_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp
new file mode 100755
index 0000000..4ce8678
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp
@@ -0,0 +1,101 @@
+/*
+ * @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_Gps_CWORD82_Nmea_g.cpp
+ * System name :_CWORD72_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GPS__CWORD82__FULLBINARY)
+ * Module configuration :VehicleSensInitGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY initialization function
+ * :VehicleSensSetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY SET function
+ * :VehicleSensGetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "gps_hal.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGps_CWORD82__CWORD44_Gp4_g; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGps_CWORD82__CWORD44_Gp4G
+* ABSTRACT : Vehicle sensor GPS__CWORD44__GP4 initialization function
+* FUNCTION : GPS__CWORD82___CWORD44__GP4 data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGps_CWORD82__CWORD44_Gp4G(void) {
+ memset(&gstGps_CWORD82__CWORD44_Gp4_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
+ gstGps_CWORD82__CWORD44_Gp4_g.ul_did = POSHAL_DID_GPS__CWORD82___CWORD44_GP4;
+ /* Initialize with _CWORD82_ only and size fixed VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4 */
+ /* GPS antenna connection information(1byte) + Sensor Counter(1byte) + VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4 */
+ gstGps_CWORD82__CWORD44_Gp4_g.us_size = (VEHICLE_DSIZE_GPS_ANTENNA + VEHICLE_DSIZE_SNS_COUNTER) \
+ + (VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGps_CWORD82__CWORD44_Gp4G
+* ABSTRACT : Vehicle sensor GPS_NMEA SET function
+* FUNCTION : Update the GPS__CWORD82___CWORD44__GP4 data master
+* ARGUMENT : *pst_data : Pointer to CAN received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+*******************************************************************************/
+u_int8 VehicleSensSetGps_CWORD82__CWORD44_Gp4G(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGps_CWORD82__CWORD44_Gp4_g;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = (u_int8)pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGps_CWORD82__CWORD44_Gp4G
+* ABSTRACT : Vehicle sensor GPS__CWORD44__GP4 GET function
+* FUNCTION : Provide the GPS__CWORD82___CWORD44__GP4 data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGps_CWORD82__CWORD44_Gp4G(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstGps_CWORD82__CWORD44_Gp4_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp
new file mode 100755
index 0000000..e68edc6
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp
@@ -0,0 +1,119 @@
+/*
+ * @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_GsnsX.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GSNS_X)
+ * Module configuration :VehicleSensGetGsnsX() Vehicle sensor GSNS_X GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsX
+* ABSTRACT : Vehicle sensor GSNS_X GET function
+* FUNCTION : Provide the GSNS_X data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsX(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsXl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsXExt
+* ABSTRACT : Vehicle sensor GSNS_X GET function
+* FUNCTION : Provide the GSNS_X data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsXExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsXExtl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+#endif
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_X GET function
+ *
+ * Provide the GSNS_X data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetGsnsXFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsXFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp
new file mode 100755
index 0000000..4a481bb
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp
@@ -0,0 +1,145 @@
+/*
+ * @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_GsnsXExt_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_X)
+ * Module configuration :VehicleSensInitGsnsXExtl() Vehicle sensor GSNS_X initialization function
+ * :VehicleSensSetGsnsXExtlG() Vehicle sensor GSNS_X SET function
+ * :VehicleSensGetGsnsXExtl() Vehicle sensor GSNS_X GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstGsnsXExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGsnsXExtl
+* ABSTRACT : Vehicle sensor GSNS_X initialization function
+* FUNCTION : GSNS_X data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGsnsXExtl(void) {
+ memset(&gstGsnsXExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstGsnsXExt_l.ul_did = POSHAL_DID_GSNS_X;
+ gstGsnsXExt_l.us_size = VEHICLE_DSIZE_GSNS_X_EXT_INIT;
+ gstGsnsXExt_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_X SET function
+ *
+ * Update the GSNS_X data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ */
+void VehicleSensSetGsnsXExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstGsnsXExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Store the latest one in the internal data structure */
+ us_start = gstPkgTempExt.start_point[GsnsX]; /* Location to store one received message */
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[GsnsX] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GSNS_X_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsXExtl
+* ABSTRACT : Vehicle sensor GSNS_X GET function
+* FUNCTION : Provide the GSNS_X data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsXExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstGsnsXExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GsnsX];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GsnsX] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GsnsX] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp
new file mode 100755
index 0000000..61ee990
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp
@@ -0,0 +1,127 @@
+/*
+ * @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
+ * VehicleSens_Did_GsnsXFst_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_GSNS_X_FST)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST g_st_gsnsx_fst_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_X initialization function
+ *
+ * GSNS_X data master initialization processing
+ */
+void VehicleSensInitGsnsXFstl(void) {
+ memset(&g_st_gsnsx_fst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ g_st_gsnsx_fst_l.ul_did = POSHAL_DID_GSNS_X_FST;
+ g_st_gsnsx_fst_l.us_size = VEHICLE_DSIZE_GSNS_X_EXT_INIT;
+ g_st_gsnsx_fst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+ g_st_gsnsx_fst_l.partition_flg = 0;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_X SET function
+ *
+ * Update the GSNS_X data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGsnsXFstG(const LSDRV_LSDATA_FST_GSENSOR_X *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ pst_master = &g_st_gsnsx_fst_l;
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ if (partition_max == 1) {
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_max == 2) {
+ if (partition_num == 1) {
+ /* 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_num == 2) {
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GSNSX_FST],
+ 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GSNSX_FST], pst_data->uc_data, pst_data->uc_size);
+ } else { }
+ } else { }
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_X GET function
+ *
+ * Provide the GSNS_X data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGsnsXFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &g_st_gsnsx_fst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp
new file mode 100755
index 0000000..90d16ce
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp
@@ -0,0 +1,98 @@
+/*
+ * @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_GsnsX_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_X)
+ * Module configuration :VehicleSensInitGsnsXl() Vehicle sensor GSNS_X initialization function
+ * :VehicleSensSetGsnsXlG() Vehicle sensor GSNS_X SET function
+ * :VehicleSensGetGsnsXl() Vehicle sensor GSNS_X GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGsnsX_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGsnsXl
+* ABSTRACT : Vehicle sensor GSNS_X initialization function
+* FUNCTION : GSNS_X data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGsnsXl(void) {
+ memset(&gstGsnsX_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGsnsX_l.ul_did = POSHAL_DID_GSNS_X;
+ gstGsnsX_l.us_size = VEHICLE_DSIZE_GSNS_X;
+ gstGsnsX_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_X SET function
+ *
+ * Update the GSNS_X data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGsnsXlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGsnsX_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsXl
+* ABSTRACT : Vehicle sensor GSNS_X GET function
+* FUNCTION : Provide the GSNS_X data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsXl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGsnsX_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.cpp
new file mode 100755
index 0000000..0ab4b67
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.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_GsnsY.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GSNS_Y)
+ * Module configuration :VehicleSensGetGsnsY() Vehicle sensor GSNS_Y GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsY
+* ABSTRACT : Vehicle sensor GSNS_Y GET function
+* FUNCTION : Provide the GSNS_Y data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsY(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsYl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsYExt
+* ABSTRACT : Vehicle sensor GSNS_Y GET function
+* FUNCTION : Provide the GSNS_Y data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsYExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsYExtl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+#endif
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Y GET function
+ *
+ * Provide the GSNS_Y data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetGsnsYFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsYFstl(pst_data);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp
new file mode 100755
index 0000000..947da7f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp
@@ -0,0 +1,145 @@
+/*
+ * @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_GsnsYExt_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Y)
+ * Module configuration :VehicleSensInitGsnsYExtl() Vehicle sensor GSNS_Y initialization function
+ * :VehicleSensSetGsnsYExtlG() Vehicle sensor GSNS_Y SET function
+ * :VehicleSensGetGsnsYExtl() Vehicle sensor GSNS_Y GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstGsnsYExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGsnsYExtl
+* ABSTRACT : Vehicle sensor GSNS_Y initialization function
+* FUNCTION : GSNS_Y data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGsnsYExtl(void) {
+ memset(&gstGsnsYExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstGsnsYExt_l.ul_did = POSHAL_DID_GSNS_Y;
+ gstGsnsYExt_l.us_size = VEHICLE_DSIZE_GSNS_Y_EXT_INIT;
+ gstGsnsYExt_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Y SET function
+ *
+ * Update the GSNS_Y data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ */
+void VehicleSensSetGsnsYExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstGsnsYExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Store the latest one in the internal data structure */
+ us_start = gstPkgTempExt.start_point[GsnsY]; /* Location to store one received message */
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[GsnsY] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GSNS_Y_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsYExtl
+* ABSTRACT : Vehicle sensor GSNS_Y GET function
+* FUNCTION : Provide the GSNS_Y data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsYExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstGsnsYExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GsnsY];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GsnsY] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GsnsY] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp
new file mode 100755
index 0000000..1fc1b92
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp
@@ -0,0 +1,128 @@
+/*
+ * @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
+ * VehicleSens_Did_GsnsYFst_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_GSNS_Y_FST)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST g_st_gsnsy_fst_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Y initialization function
+ *
+ * GSNS_Y data master initialization processing
+ */
+void VehicleSensInitGsnsYFstl(void) {
+ memset(&g_st_gsnsy_fst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ g_st_gsnsy_fst_l.ul_did = POSHAL_DID_GSNS_Y_FST;
+ g_st_gsnsy_fst_l.us_size = VEHICLE_DSIZE_GSNS_Y_EXT_INIT;
+ g_st_gsnsy_fst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+ g_st_gsnsy_fst_l.partition_flg = 0;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Y SET function
+ *
+ * Update the GSNS_Y data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGsnsYFstG(const LSDRV_LSDATA_FST_GSENSOR_Y *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ pst_master = &g_st_gsnsy_fst_l;
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ if (partition_max == 1) {
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_max == 2) {
+ if (partition_num == 1) {
+ /* 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_num == 2) {
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GSNSY_FST],
+ 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GSNSY_FST], pst_data->uc_data, pst_data->uc_size);
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Y GET function
+ *
+ * Provide the GSNS_Y data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGsnsYFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &g_st_gsnsy_fst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp
new file mode 100755
index 0000000..1bf2e30
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp
@@ -0,0 +1,99 @@
+/*
+ * @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_GsnsY_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Y)
+ * Module configuration :VehicleSensInitGsnsYl() Vehicle sensor GSNS_Y initialization function
+ * :VehicleSensSetGsnsYlG() Vehicle sensor GSNS_Y SET function
+ * :VehicleSensGetGsnsYl() Vehicle sensor GSNS_Y GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGsnsY_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGsnsYl
+* ABSTRACT : Vehicle sensor GSNS_Y initialization function
+* FUNCTION : GSNS_Y data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGsnsYl(void) {
+ memset(&gstGsnsY_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGsnsY_l.ul_did = POSHAL_DID_GSNS_Y;
+ gstGsnsY_l.us_size = VEHICLE_DSIZE_GSNS_Y;
+ gstGsnsY_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Y SET function
+ *
+ * Update the GSNS_Y data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ *
+ */
+u_int8 VehicleSensSetGsnsYlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGsnsY_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsYl
+* ABSTRACT : Vehicle sensor GSNS_Y GET function
+* FUNCTION : Provide the GSNS_Y data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsYl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGsnsY_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp
new file mode 100755
index 0000000..ec865c3
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp
@@ -0,0 +1,116 @@
+/*
+ * @copyright Copyright (c) 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_GsnsY.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GSNS_Z)
+ * Module configuration :VehicleSensGetGsnsZ() Vehicle sensor GSNS_Z GET function
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsZ
+* ABSTRACT : Vehicle sensor GSNS_Z GET function
+* FUNCTION : Provide the GSNS_Z data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsZ(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsZl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsZExt
+* ABSTRACT : Vehicle sensor GSNS_Z GET function
+* FUNCTION : Provide the GSNS_Z data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsZExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsZExtl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Z GET function
+ *
+ * Provide the GSNS_Z data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetGsnsZFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGsnsZFstl(pst_data);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp
new file mode 100755
index 0000000..9dc1e39
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp
@@ -0,0 +1,142 @@
+/*
+ * @copyright Copyright (c) 2019-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_GsnsZExt_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Z)
+ * Module configuration :VehicleSensInitGsnsZExtl() Vehicle sensor GSNS_Z initialization function
+ * :VehicleSensSetGsnsZExtlG() Vehicle sensor GSNS_Z SET function
+ * :VehicleSensGetGsnsZExtl() Vehicle sensor GSNS_Z GET function
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstGsnsZExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGsnsZExtl
+* ABSTRACT : Vehicle sensor GSNS_Z initialization function
+* FUNCTION : GSNS_Z data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGsnsZExtl(void) {
+ memset(&gstGsnsZExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstGsnsZExt_l.ul_did = POSHAL_DID_GSNS_Z;
+ gstGsnsZExt_l.us_size = VEHICLE_DSIZE_GSNS_Z_EXT_INIT;
+ gstGsnsZExt_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Z SET function
+ *
+ * Update the GSNS_Z data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ */
+void VehicleSensSetGsnsZExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstGsnsZExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Store the latest one in the internal data structure */
+ us_start = gstPkgTempExt.start_point[GsnsZ]; /* Location to store one received message */
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[GsnsZ] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GSNS_Z_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsZExtl
+* ABSTRACT : Vehicle sensor GSNS_Z GET function
+* FUNCTION : Provide the GSNS_Z data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsZExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstGsnsZExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GsnsZ];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GsnsZ] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GsnsZ] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp
new file mode 100755
index 0000000..a69bb87
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp
@@ -0,0 +1,127 @@
+/*
+ * @copyright Copyright (c) 2019-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
+ * VehicleSens_Did_GsnsZFst_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_GSNS_Z_FST)
+ */
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST g_st_gsnsz_fst_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Z initialization function
+ *
+ * GSNS_Z data master initialization processing
+ */
+void VehicleSensInitGsnsZFstl(void) {
+ memset(&g_st_gsnsz_fst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ g_st_gsnsz_fst_l.ul_did = POSHAL_DID_GSNS_Z_FST;
+ g_st_gsnsz_fst_l.us_size = VEHICLE_DSIZE_GSNS_Z_EXT_INIT;
+ g_st_gsnsz_fst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+ g_st_gsnsz_fst_l.partition_flg = 0;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Z SET function
+ *
+ * Update the GSNS_Z data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGsnsZFstG(const LSDRV_LSDATA_FST_GSENSOR_Z *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ pst_master = &g_st_gsnsz_fst_l;
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ if (partition_max == 1) {
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_max == 2) {
+ if (partition_num == 1) {
+ /* 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_num == 2) {
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GSNSZ_FST],
+ 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GSNSZ_FST], pst_data->uc_data, pst_data->uc_size);
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Z GET function
+ *
+ * Provide the GSNS_Z data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGsnsZFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &g_st_gsnsz_fst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp
new file mode 100755
index 0000000..8614535
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp
@@ -0,0 +1,97 @@
+/*
+ * @copyright Copyright (c) 2019-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_GsnsZ_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Z)
+ * Module configuration :VehicleSensInitGsnsZl() Vehicle sensor GSNS_Z initialization function
+ * :VehicleSensSetGsnsZlG() Vehicle sensor GSNS_Z SET function
+ * :VehicleSensGetGsnsZl() Vehicle sensor GSNS_Z GET function
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGsnsZ_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGsnsZl
+* ABSTRACT : Vehicle sensor GSNS_Z initialization function
+* FUNCTION : GSNS_Z data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGsnsZl(void) {
+ memset(&gstGsnsZ_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGsnsZ_l.ul_did = POSHAL_DID_GSNS_Z;
+ gstGsnsZ_l.us_size = VEHICLE_DSIZE_GSNS_Z;
+ gstGsnsZ_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor GSNS_Z SET function
+ *
+ * Update the GSNS_Z data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ *
+ */
+u_int8 VehicleSensSetGsnsZlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGsnsZ_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGsnsZl
+* ABSTRACT : Vehicle sensor GSNS_Z GET function
+* FUNCTION : Provide the GSNS_Z data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGsnsZl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGsnsZ_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp
new file mode 100755
index 0000000..d6fee30
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp
@@ -0,0 +1,110 @@
+/*
+ * @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_GyroConnectStatus.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_CONNECT_STATUS)
+ * Module configuration :VehicleSensInitGyroConnectStatus() Vehicle Sensor GYRO CONNECT STATUS Initialization Functions
+ * :VehicleSensSetGyroConnectStatus() Vehicle Sensor GYRO CONNECT STATUS SET Functions
+ * :VehicleSensGetGyroConnectStatus() Vehicle Sensor GYRO CONNECT STATUS GET Functions
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS gstGyroConnectStatus; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroConnectStatus
+* ABSTRACT : Vehicle sensor GYRO_CONNECT_STATUS initialization function
+* FUNCTION : GYRO_CONNECT_STATUS data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroConnectStatus(void) {
+ (void)memset(reinterpret_cast<void *>(&(gstGyroConnectStatus)), static_cast<int>(0x00),
+ sizeof(VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS));
+ gstGyroConnectStatus.ul_did = VEHICLE_DID_GYRO_CONNECT_STATUS;
+ gstGyroConnectStatus.us_size = VEHICLE_DSIZE_GYRO_CONNECT_STATUS;
+ gstGyroConnectStatus.uc_data = VEHICLE_DINIT_GYRO_CONNECT_STATUS;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroConnectStatus
+* ABSTRACT : Vehicle sensor GYRO_CONNECT_STATUS SET function
+* FUNCTION : Update the GYRO_CONNECT_STATUS data master
+* ARGUMENT : *pst_data : Pointer to received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroConnectStatus(const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *pst_data) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstGyroConnectStatus;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), (size_t)(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;
+ (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data));
+ }
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroConnectStatus
+* 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 VehicleSensGetGyroConnectStatus(VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstGyroConnectStatus;
+
+ /* 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<void *>(&(pst_data->uc_data)),
+ (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data));
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp
new file mode 100755
index 0000000..0470c9f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp
@@ -0,0 +1,257 @@
+/*
+ * @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_GyroExt_l.cpp
+ * System name :Polaris
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_EXT)
+ * Module configuration :VehicleSensInitGyroExtl() Vehicle Sensor GYRO (Initial Delivery) Initialization Functions
+ * :VehicleSensSetGyroExtlG() Vehicle Sensor GYRO (Initial Delivery) Set Functions
+ * :VehicleSensGetGyroExtl() Vehicle Sensor GYRO (Initial Delivery) Get Functions
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstGyroExt_l; // NOLINT(readability/nolint)
+static VEHICLESENS_DATA_MASTER gstGyroRev_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroRevl
+* ABSTRACT : Vehicle Sensor GYRO Initialization Functions(Extensions data)
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroRevl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroRev_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ /* POSHAL_DID_GYRO initialized by POSHAL_DID_GYRO_X because POSHAL_DID_GYRO is internally replaced by POSHAL_DID_GYRO_EXT */
+ gstGyroRev_l.ul_did = POSHAL_DID_GYRO_X;
+ gstGyroRev_l.us_size = VEHICLE_DSIZE_GYRO;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroRev_l.uc_data);
+ pus[0] = VEHICLE_DINIT_GYRO; /* Ignore->MISRA-C++:2008 Rule 5-0-15 */
+ pus[1] = VEHICLE_DINIT_GYRO; /* Ignore->MISRA-C++:2008 Rule 5-0-15 */
+ pus[2] = VEHICLE_DINIT_GYRO; /* Ignore->MISRA-C++:2008 Rule 5-0-15 */
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroExtl
+* ABSTRACT : Vehicle Sensor GYRO Initialization Functions(Initial delivery)
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroExtl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ /* POSHAL_DID_GYRO initialized by POSHAL_DID_GYRO_X because POSHAL_DID_GYRO is internally replaced by POSHAL_DID_GYRO_EXT */
+ gstGyroExt_l.ul_did = POSHAL_DID_GYRO_X;
+ gstGyroExt_l.us_size = VEHICLE_DSIZE_GYRO_EXT_INIT;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroExt_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO, VEHICLE_DSIZE_GYRO_EXT);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroRevl
+* ABSTRACT : Vehicle Sensor GYRO SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroRevl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroRev_l;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data,
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = POSHAL_DID_GYRO_X;
+ pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroRevlG
+* ABSTRACT : Vehicle Sensor GYRO SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroRevlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroRev_l;
+
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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 = POSHAL_DID_GYRO_X;
+ pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroExtlG
+* ABSTRACT : Vehicle Sensor GYRO SET Functions(Initial delivery)
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+void VehicleSensSetGyroExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstGyroExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[GyroExt];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = POSHAL_DID_GYRO_X;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[GyroExt] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GYRO_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroExtl
+* ABSTRACT : Vehicle Sensor GYRO GET Functions(Initial delivery)
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstGyroExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GyroExt];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GyroExt] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GyroExt] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroRevl
+* ABSTRACT : Vehicle Sensor GYRO GET Functions(Initial delivery)
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroRevl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroRev_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp
new file mode 100755
index 0000000..d6debe6
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp
@@ -0,0 +1,114 @@
+/*
+ * @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
+ * VehicleSens_Did_GyroTemp.cpp
+ * @brief
+ * Vehicle sensor data master(VEHICLE_DID_GYRO_TEMP_)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature GET Function
+ *
+ * Provide a gyro temperature data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetGyroTemp(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroTempl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature (Initial Delivery) GET Function
+ *
+ * Provide a gyro temperature data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetGyroTempExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroTempExtl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/**
+ * @brief
+ * Vehicle sensor gyro temperature (initial sensor) GET function
+ *
+ * Provide a gyro temperature data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetGyroTempFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroTempFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp
new file mode 100755
index 0000000..aee750d
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp
@@ -0,0 +1,140 @@
+/*
+ * @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
+ * VehicleSens_Did_GyroTempExt_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_GYRO_TEMP)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT g_stgyro_temp_ext_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor gyro temperature initialization function
+ *
+ * Gyro Temperature Data Master Initialization Processing
+ */
+void VehicleSensInitGyroTempExtl(void) {
+ (void)memset(reinterpret_cast<void *>(&g_stgyro_temp_ext_l), 0, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ g_stgyro_temp_ext_l.ul_did = POSHAL_DID_GYRO_TEMP;
+ g_stgyro_temp_ext_l.us_size = VEHICLE_DSIZE_GYRO_TEMP_EXT_INIT;
+ g_stgyro_temp_ext_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature SET Function
+ *
+ * Update the gyro temperature data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+void VehicleSensSetGyroTempExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &g_stgyro_temp_ext_l;
+ us_size = sizeof(u_int16); /* Size of one data item: 2byte */
+
+ /* Store the latest one in the internal data structure */
+ us_start = gstPkgTempExt.start_point[GyroTemp]; /* Location to store one received message */
+ /* Stored in data master(Order of reception)*/
+ if (us_start == VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position. */
+ us_start++;
+ gstPkgTempExt.start_point[GyroTemp] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GYRO_TEMP_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature GET Function
+ *
+ * Provide a gyro temperature data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGyroTempExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &g_stgyro_temp_ext_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = sizeof(u_int16); /* Size of one data item: 2byte */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GyroTemp];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GyroTemp] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GyroTemp] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp
new file mode 100755
index 0000000..3c2906d
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp
@@ -0,0 +1,128 @@
+/*
+ * @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
+ * VehicleSens_Did_GyroTempFst_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_GYRO_TEMP_FST)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST g_st_gyro_tempfst_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor gyro temperature initialization function
+ *
+ * Gyro Temperature Data Master Initialization Processing
+ */
+void VehicleSensInitGyroTempFstl(void) {
+ memset(&g_st_gyro_tempfst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ g_st_gyro_tempfst_l.ul_did = POSHAL_DID_GYRO_TEMP_FST;
+ g_st_gyro_tempfst_l.us_size = VEHICLE_DSIZE_GYRO_TEMP_EXT_INIT;
+ g_st_gyro_tempfst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+ g_st_gyro_tempfst_l.partition_flg = 0;
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature SET Function
+ *
+ * Update the gyro temperature data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGyroTempFstG(const LSDRV_LSDATA_FST_GYRO_TEMP *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ pst_master = &g_st_gyro_tempfst_l;
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ if (partition_max == 1) {
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_max == 2) {
+ if (partition_num == 1) {
+ /* 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_num == 2) {
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYROTEMP_FST],
+ 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYROTEMP_FST], pst_data->uc_data, pst_data->uc_size);
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature GET Function
+ *
+ * Provide a gyro temperature data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGyroTempFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &g_st_gyro_tempfst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp
new file mode 100755
index 0000000..002cf02
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp
@@ -0,0 +1,95 @@
+/*
+ * @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
+ * VehicleSens_Did_GyroTemp_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_GYRO_TEMP)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGyroTemp_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor gyro temperature initialization function
+ *
+ * Gyro Temperature Data Master Initialization Processing
+ */
+void VehicleSensInitGyroTempl(void) {
+ (void)memset(reinterpret_cast<void *>(&gstGyroTemp_l), 0, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGyroTemp_l.ul_did = POSHAL_DID_GYRO_TEMP;
+ gstGyroTemp_l.us_size = VEHICLE_DSIZE_GYRO_TEMP;
+ gstGyroTemp_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature SET Function
+ *
+ * Update the gyro temperature data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetGyroTemplG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroTemp_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle Sensor Gyro Temperature GET Function
+ *
+ * Provide a gyro temperature data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetGyroTempl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroTemp_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp
new file mode 100755
index 0000000..e588c39
--- /dev/null
+++ b/vehicleservice/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 <vehicle_service/positioning_base_library.h>
+#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<void *>(&(gstGyroTrouble)),
+ static_cast<int>(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<void *>(&(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<void *>(&(pst_data->uc_data)),
+ (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data));
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp
new file mode 100755
index 0000000..3cda53a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp
@@ -0,0 +1,145 @@
+/*
+ * @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_GyroX.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_X)
+ * Module configuration :VehicleSensGetGyroX() Vehicle Sensor GYRO GET Functions
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroX
+* ABSTRACT : Vehicle Sensor GYRO_X GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroX(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroXl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroRev
+* ABSTRACT : Vehicle Sensor GYRO GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroRev(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroRevl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroExt
+* ABSTRACT : Vehicle Sensor GYRO GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroExtl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroXFst
+* ABSTRACT : Vehicle Sensor GYRO_X GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroXFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroXFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp
new file mode 100755
index 0000000..e9997ac
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp
@@ -0,0 +1,176 @@
+/*
+ * @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_GyroXFst_l.cpp
+ * System name :Polaris
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_X_FST)
+ * Module configuration :VehicleSensInitGyroXFstl() Vehicle sensor GYRO (initial sensor) initialization functions
+ * :VehicleSensSetGyroXFstl() Vehicle sensor GYRO (initial sensor) SET-function
+ * :VehicleSensSetGyroXFstG() Vehicle sensor GYRO (initial sensor) SET-function
+ * :VehicleSensGetGyroXFstl() Vehicle sensor GYRO (initial sensor) GET-function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST gstGyroXFst_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroXFstl
+* ABSTRACT : Vehicle Sensor GYRO_X Initialization Functions
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroXFstl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroXFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ gstGyroXFst_l.ul_did = POSHAL_DID_GYRO_X_FST;
+ gstGyroXFst_l.us_size = 0;
+ gstGyroXFst_l.partition_flg = 0;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroXFst_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO_X, VEHICLE_DSIZE_GYRO_X_FST);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroXFstl
+* ABSTRACT : Vehicle Sensor GYRO_X SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroXFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstGyroXFst_l;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data,
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->uc_size;
+ pst_master->partition_flg = 0;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroXFstG
+* ABSTRACT : Vehicle Sensor GYRO SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroXFstG(const LSDRV_LSDATA_FST_GYRO_X *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ pst_master = &gstGyroXFst_l;
+
+ if (partition_max == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data,
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else if (partition_max == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ if (partition_num == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else if (partition_num == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_X_FST],
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ }
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_X_FST], pst_data->uc_data, pst_data->uc_size);
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroXFstl
+* ABSTRACT : Vehicle Sensor GYRO GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroXFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstGyroXFst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
+
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp
new file mode 100755
index 0000000..af90e25
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp
@@ -0,0 +1,128 @@
+/*
+ * @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_GyroX_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_X)
+ * Module configuration :VehicleSensInitGyroXl() Vehicle Sensor GYRO Initialization Functions
+ * :VehicleSensSetGyroXl() Vehicle Sensor GYRO SET Functions
+ * :VehicleSensGetGyroXl() Vehicle Sensor GYRO GET Functions
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGyroX_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroXl
+* ABSTRACT : Vehicle Sensor GYRO_X Initialization Functions
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroXl(void) {
+ memset(&gstGyroX_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGyroX_l.ul_did = POSHAL_DID_GYRO_X;
+ gstGyroX_l.us_size = VEHICLE_DSIZE_GYRO_X;
+ gstGyroX_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroXl
+* ABSTRACT : Vehicle Sensor GYRO_X SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroXl(const LSDRV_LSDATA *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroX_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)pst_data->uc_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroXlG
+* ABSTRACT : Vehicle Sensor GYRO_X SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroXlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroX_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroXl
+* ABSTRACT : Vehicle Sensor GYRO_X GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroXl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroX_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp
new file mode 100755
index 0000000..b7d0e5a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp
@@ -0,0 +1,113 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroY.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_Y)
+ * Module configuration :VehicleSensGetGyroY() Vehicle Sensor GYRO GET Functions
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroY
+* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroY(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroYl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroYExt
+* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroYExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroYExtl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroYFst
+* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroYFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroYFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp
new file mode 100755
index 0000000..898dafb
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp
@@ -0,0 +1,148 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroYExt_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_EXT)
+ * Module configuration :VehicleSensInitGyroYExtl() Vehicle Sensor GYRO (Initial Delivery) Initialization Functions
+ * :VehicleSensSetGyroYExtlG() Vehicle Sensor GYRO (Initial Delivery) Set Functions
+ * :VehicleSensGetGyroYExtl() Vehicle Sensor GYRO (Initial Delivery) Get Functions
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstGyroYExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroYExtl
+* ABSTRACT : Vehicle Sensor GYRO_Y Initialization Functions(Initial delivery)
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroYExtl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroYExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstGyroYExt_l.ul_did = POSHAL_DID_GYRO_Y;
+ gstGyroYExt_l.us_size = VEHICLE_DSIZE_GYRO_EXT_INIT;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroYExt_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO, VEHICLE_DSIZE_GYRO_EXT);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroYExtlG
+* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions(Initial delivery)
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+void VehicleSensSetGyroYExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstGyroYExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[GyroY];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[GyroY] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GYRO_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroYExtl
+* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions(Initial delivery)
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroYExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstGyroYExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GyroY];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GyroY] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GyroY] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+#endif // CONFIG_SENSOR_EXT_VALID
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp
new file mode 100755
index 0000000..164cf4d
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp
@@ -0,0 +1,169 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroYFst_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Y_FST)
+ * Module configuration :VehicleSensInitGyroYFstl() Vehicle sensor GYRO (initial sensor) initialization functions
+ * :VehicleSensSetGyroYFstl() Vehicle sensor GYRO (initial sensor) SET-function
+ * :VehicleSensSetGyroYFstG() Vehicle sensor GYRO (initial sensor) SET-function
+ * :VehicleSensGetGyroYFstl() Vehicle sensor GYRO (initial sensor) GET-function
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST gstGyroYFst_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroYFstl
+* ABSTRACT : Vehicle Sensor GYRO_Y Initialization Functions
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroYFstl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroYFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ gstGyroYFst_l.ul_did = POSHAL_DID_GYRO_Y_FST;
+ gstGyroYFst_l.us_size = 0;
+ gstGyroYFst_l.partition_flg = 0;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroYFst_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO_Y, VEHICLE_DSIZE_GYRO_Y_FST);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroYFstl
+* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroYFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstGyroYFst_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->partition_flg = 0;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroYFstG
+* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroYFstG(const LSDRV_LSDATA_FST_GYRO_Y *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ pst_master = &gstGyroYFst_l;
+
+ if (partition_max == 1) {
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_max == 2) {
+ if (partition_num == 1) {
+ /* 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_num == 2) {
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Y_FST],
+ 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Y_FST], pst_data->uc_data, pst_data->uc_size);
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroYFstl
+* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroYFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstGyroYFst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp
new file mode 100755
index 0000000..9799b29
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp
@@ -0,0 +1,126 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroY_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Y)
+ * Module configuration :VehicleSensInitGyroYl() Vehicle Sensor GYRO Initialization Functions
+ * :VehicleSensSetGyroYl() Vehicle Sensor GYRO SET Functions
+ * :VehicleSensGetGyroYl() Vehicle Sensor GYRO GET Functions
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGyroY_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroYl
+* ABSTRACT : Vehicle Sensor GYRO_Y Initialization Functions
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroYl(void) {
+ memset(&gstGyroY_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGyroY_l.ul_did = POSHAL_DID_GYRO_Y;
+ gstGyroY_l.us_size = VEHICLE_DSIZE_GYRO_Y;
+ gstGyroY_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroYl
+* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroYl(const LSDRV_LSDATA *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroY_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)pst_data->uc_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroYlG
+* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroYlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroY_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroYl
+* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroYl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroY_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp
new file mode 100755
index 0000000..1b84af7
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp
@@ -0,0 +1,113 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroZ.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_Z)
+ * Module configuration :VehicleSensGetGyroZ() Vehicle Sensor GYRO GET Functions
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroZ
+* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroZ(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroZl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroZExt
+* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroZExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroZExtl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroZFst
+* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroZFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetGyroZFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp
new file mode 100755
index 0000000..9ef9996
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp
@@ -0,0 +1,148 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroZExt_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_EXT)
+ * Module configuration :VehicleSensInitGyroxiZYExtl() Vehicle Sensor GYRO (Initial Delivery) Initialization Functions
+ * :VehicleSensSetGyroZExtlG() Vehicle Sensor GYRO (Initial Delivery) Set Functions
+ * :VehicleSensGetGyroZExtl() Vehicle Sensor GYRO (Initial Delivery) Get Functions
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstGyroZExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroZExtl
+* ABSTRACT : Vehicle Sensor GYRO_Z Initialization Functions(Initial delivery)
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroZExtl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroZExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstGyroZExt_l.ul_did = POSHAL_DID_GYRO_Z;
+ gstGyroZExt_l.us_size = VEHICLE_DSIZE_GYRO_EXT_INIT;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroZExt_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO, VEHICLE_DSIZE_GYRO_EXT);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroZExtlG
+* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions(Initial delivery)
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+void VehicleSensSetGyroZExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstGyroZExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[GyroZ];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[GyroZ] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_GYRO_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroZExtl
+* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions(Initial delivery)
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroZExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstGyroZExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[GyroZ];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[GyroZ] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[GyroZ] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+#endif // CONFIG_SENSOR_EXT_VALID
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp
new file mode 100755
index 0000000..587f565
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp
@@ -0,0 +1,169 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroZFst_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Z_FST)
+ * Module configuration :VehicleSensInitGyroZFstl() Vehicle sensor GYRO (initial sensor) initialization functions
+ * :VehicleSensSetGyroZFstl() Vehicle sensor GYRO (initial sensor) SET-function
+ * :VehicleSensSetGyroZFstG() Vehicle sensor GYRO (initial sensor) SET-function
+ * :VehicleSensGetGyroZFstl() Vehicle sensor GYRO (initial sensor) GET-function
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST gstGyroZFst_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroZFstl
+* ABSTRACT : Vehicle Sensor GYRO_Z Initialization Functions
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroZFstl(void) {
+ u_int16 *pus;
+
+ memset(&gstGyroZFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ gstGyroZFst_l.ul_did = POSHAL_DID_GYRO_Z_FST;
+ gstGyroZFst_l.us_size = 0;
+ gstGyroZFst_l.partition_flg = 0;
+
+ pus = reinterpret_cast<u_int16 *>(gstGyroZFst_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO_Z, VEHICLE_DSIZE_GYRO_Z_FST);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroZFstl
+* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroZFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstGyroZFst_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->partition_flg = 0;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroZFstG
+* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroZFstG(const LSDRV_LSDATA_FST_GYRO_Z *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ pst_master = &gstGyroZFst_l;
+
+ if (partition_max == 1) {
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_max == 2) {
+ if (partition_num == 1) {
+ /* 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+ } else if (partition_num == 2) {
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Z_FST],
+ 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 = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Z_FST], pst_data->uc_data, pst_data->uc_size);
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroZFstl
+* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroZFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstGyroZFst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp
new file mode 100755
index 0000000..8296dab
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp
@@ -0,0 +1,126 @@
+/*
+ * @copyright Copyright (c) 2019-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_GyroZ_l.cpp
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Z)
+ * Module configuration :VehicleSensInitGyroZl() Vehicle Sensor GYRO Initialization Functions
+ * :VehicleSensSetGyroZl() Vehicle Sensor GYRO SET Functions
+ * :VehicleSensGetGyroZl() Vehicle Sensor GYRO GET Functions
+ ******************************************************************************/
+
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstGyroZ_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitGyroZl
+* ABSTRACT : Vehicle Sensor GYRO_Z Initialization Functions
+* FUNCTION : GYRO data master initialization process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitGyroZl(void) {
+ memset(&gstGyroZ_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstGyroZ_l.ul_did = POSHAL_DID_GYRO_Z;
+ gstGyroZ_l.us_size = VEHICLE_DSIZE_GYRO_Z;
+ gstGyroZ_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroZl
+* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroZl(const LSDRV_LSDATA *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroZ_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)pst_data->uc_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetGyroZlG
+* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions
+* FUNCTION : Update the GYRO data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetGyroZlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroZ_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetGyroZl
+* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions
+* FUNCTION : Provide a GYRO data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetGyroZl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstGyroZ_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp
new file mode 100755
index 0000000..167fa0a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp
@@ -0,0 +1,55 @@
+/*
+ * @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 VehicleSens_Did_LocationAltitude.cpp
+@detail Altitude information data master management
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+
+/****************************************************************************
+@brief VehicleSensGetLocationAltitude<BR>
+ Altitude Information Data Master GET Processing
+@outline Provide an altitude information data master
+@param[in] u_int8 uc_get_method : Acquisition method(GPS or Navi)
+@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetLocationAltitude(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:no other parameter pass in
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetLocationAltitudeG(pst_data);
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_NAVI:
+ {
+ /** To acquire from NAVI */
+ VehicleSensGetLocationAltitudeN(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp
new file mode 100755
index 0000000..cae429c
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp
@@ -0,0 +1,105 @@
+/*
+ * @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 VehicleSens_Did_LocationAltitude_g.cpp
+@detail Altitude information data master management(NMEA information)
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "CommonDefine.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+static VEHICLESENS_DATA_MASTER gstLocationAltitude_g; // NOLINT(readability/nolint)
+
+/****************************************************************************
+@brief VehicleSensInitLocationAltitudeG<BR>
+ Altitude information data master initialization processing(NMEA information)
+@outline Initialize the altitude information data master
+@param[in] none
+@param[out] none
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensInitLocationAltitudeG(void) {
+ SENSORLOCATION_ALTITUDEINFO_DAT st_altitude;
+
+ memset(&gstLocationAltitude_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstLocationAltitude_g.ul_did = VEHICLE_DID_LOCATION_ALTITUDE;
+ /** Data size setting */
+ gstLocationAltitude_g.us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT);
+ /** Data content setting */
+ memset(&st_altitude, 0x00, sizeof(st_altitude));
+ st_altitude.getMethod = SENSOR_GET_METHOD_GPS;
+ st_altitude.SyncCnt = 0x00;
+ st_altitude.isEnable = SENSORLOCATION_STATUS_DISABLE;
+ memcpy(&gstLocationAltitude_g.uc_data[0], &st_altitude, sizeof(st_altitude));
+}
+
+/****************************************************************************
+@brief VehicleSensSetLocationAltitudeG<BR>
+ Altitude information data master SET processing(NMEA information)
+@outline Update the altitude information data master
+@param[in] u_int8 ucSensCnt : Sensor counter value
+@param[in] u_int8* pucDGGA : Double precision GGAInformation(_CWORD82_ NMEA)
+@param[out] none
+@return u_int8
+@retval VEHICLESENS_EQ : No data change
+@retval VEHICLESENS_NEQ : Data change
+*******************************************************************************/
+u_int8 VehicleSensSetLocationAltitudeG(const SENSORLOCATION_ALTITUDEINFO_DAT *pst_altitude) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationAltitude_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_LOCATION_ALTITUDE;
+ pst_master->us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT));
+
+ return(uc_ret);
+}
+
+/****************************************************************************
+@brief VehicleSensGetLocationAltitudeG<BR>
+ Altitude Information Data Master GET Processing(NMEA information)
+@outline Provide an altitude information data master
+@param[in] none
+@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetLocationAltitudeG(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationAltitude_g;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.cpp
new file mode 100755
index 0000000..1d6064f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.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
+ * VehicleSens_Did_LocationAltitude_n.cpp
+ * @brief
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "SensorLocation_API.h"
+#include "CommonDefine.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstLocationAltitude_n; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Altitude information data master initialization processing(NAVI information)
+ *
+ * Initialize the altitude information data master
+ *
+ * @param[in] none
+ * @param[out] none
+ * @return none
+ * @retval none
+ */
+void VehicleSensInitLocationAltitudeN(void) {
+ SENSORLOCATION_ALTITUDEINFO_DAT st_altitude;
+
+ memset(&gstLocationAltitude_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstLocationAltitude_n.ul_did = VEHICLE_DID_LOCATION_ALTITUDE_NAVI;
+
+ /** Data size setting */
+ gstLocationAltitude_n.us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT);
+
+ /** Data content setting */
+ memset(&st_altitude, 0x00, sizeof(st_altitude));
+ st_altitude.getMethod = SENSOR_GET_METHOD_NAVI;
+ st_altitude.SyncCnt = 0x00;
+ st_altitude.isEnable = SENSORLOCATION_STATUS_DISABLE;
+ st_altitude.Altitude = 0x00;
+ memcpy(&gstLocationAltitude_n.uc_data[0], &st_altitude, sizeof(st_altitude));
+
+ return;
+}
+
+/**
+ * @brief
+ * Altitude information data master SET processing(NAVI information)
+ *
+ * Update the altitude information data master
+ *
+ * @param[in] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @param[out] none
+ * @return u_int8
+ * @retval VEHICLESENS_EQ : No data change
+ * @retval VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetLocationAltitudeN(const SENSORLOCATION_ALTITUDEINFO_DAT *pst_altitude) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationAltitude_n;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_LOCATION_ALTITUDE_NAVI;
+ pst_master->us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Altitude Information Data Master GET Processing(NAVI information)
+ *
+ * Provide an altitude information data master
+ *
+ * @param[in] none
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @return none
+ * @retval none
+ */
+void VehicleSensGetLocationAltitudeN(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationAltitude_n;
+
+ /** 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp
new file mode 100755
index 0000000..496e5ac
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp
@@ -0,0 +1,50 @@
+/*
+ * @copyright Copyright (c) 2018-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 VehicleSens_Did_LocationInfoNmea.cpp
+@detail Location Information (NMEA) Management of information data master
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+
+/**************************************************************************//**
+@brief VehicleSens_GetLocationInfoNmea<BR>
+ Location Information (NMEA) Information Data Master GET Processing
+@outline Location Information (NMEA) Provide an information data master
+@param[in] u_int8 ucGetMethod : Acquisition method(GPS or Navi)
+@param[out] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSens_GetLocationInfoNmea(VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData, u_int8 ucGetMethod)
+{
+ switch(ucGetMethod)
+ {
+ case VEHICLESENS_GETMETHOD_NAVI:
+ {
+ VehicleSens_GetLocationInfoNmea_n(pstData);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp
new file mode 100755
index 0000000..048e522
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp
@@ -0,0 +1,118 @@
+/*
+ * @copyright Copyright (c) 2018-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
+ * VehicleSens_Did_LocationInfoNmea_n.cpp
+ * @brief
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "SensorLocation_API.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstLocationInfoNmea_n;
+
+/**
+ * @brief
+ * Location Information (NMEA) Initialization of information data master(NAVI information)
+ *
+ * Location Information (NMEA) Initialize the information data master
+ *
+ * @param[in] none
+ * @param[out] none
+ * @return none
+ */
+void VehicleSens_InitLocationInfoNmea_n(void)
+{
+ POS_LOCATIONINFO_NMEA stLocInfoNmea;
+
+ _pb_memset(&gstLocationInfoNmea_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
+
+ /* Set Data ID */
+ gstLocationInfoNmea_n.ul_did = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI;
+
+ /* Set Data Size */
+ gstLocationInfoNmea_n.us_size = sizeof(POS_LOCATIONINFO_NMEA);
+
+ /** Set Data itself */
+ _pb_memset(&stLocInfoNmea, 0x00, sizeof(stLocInfoNmea));
+ _pb_memcpy(&gstLocationInfoNmea_n.uc_data[0], &stLocInfoNmea, sizeof(stLocInfoNmea));
+
+ return;
+}
+
+/**
+ * @brief
+ * Location Information (NMEA) Information data master SET process(NAVI information)
+ *
+ * Location Information (NMEA) Update the information data master
+ *
+ * @param[in] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination
+ * @param[out] none
+ * @return u_int8
+ * @retval VEHICLESENS_EQ : No data change
+ * @retval VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSens_SetLocationInfoNmea_n( const POS_LOCATIONINFO_NMEA *pstLocInfoNmea )
+{
+ u_int8 ucRet;
+ VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster;
+
+ pstMaster = &gstLocationInfoNmea_n;
+
+ /* Compare Received Data with Master Data */
+ ucRet = VehicleSensmemcmp( pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA) );
+
+ /* Set Received Data as Master Data */
+ pstMaster->ul_did = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI;
+ pstMaster->us_size = sizeof(POS_LOCATIONINFO_NMEA);
+ pstMaster->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ _pb_memcpy(pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA));
+
+ return ucRet;
+}
+
+/**
+ * @brief
+ * Location Information (NMEA) Information Data Master GET Processing(NAVI information)
+ *
+ * Location Information (NMEA) Provide an information data master
+ *
+ * @param[in] none
+ * @param[out] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination
+ * @return none
+ * @retval none
+ */
+void VehicleSens_GetLocationInfoNmea_n(VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData)
+{
+ const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster;
+
+ pstMaster = &gstLocationInfoNmea_n;
+
+ /* Set Master Data to Indicated Region */
+ pstData->ul_did = pstMaster->ul_did;
+ pstData->us_size = pstMaster->us_size;
+ pstData->uc_rcvflag = pstMaster->uc_rcvflag;
+ _pb_memcpy(pstData->uc_data, pstMaster->uc_data, pstMaster->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp
new file mode 100755
index 0000000..1ae1b59
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp
@@ -0,0 +1,56 @@
+/*
+ * @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 VehicleSens_Did_LocationLonLat.cpp
+@detail Latitude and longitudeManagement of information data master
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+
+/****************************************************************************
+@brief VehicleSensGetLocationLonLat<BR>
+ Latitude and longitudeInformation Data Master GET Processing
+@outline Latitude and longitudeProvide an information data master
+@param[in] u_int8 uc_get_method : Acquisition method(GPS or Navi)
+@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetLocationLonLat(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetLocationLonLatG(pst_data);
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_NAVI:
+ {
+ /** To acquire from NAVI */
+ VehicleSensGetLocationLonLatnUnitCnv(pst_data);
+ break;
+ }
+
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp
new file mode 100755
index 0000000..07075c0
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_LocationLonLat_g.cpp
+@detail Latitude and longitudeManagement of information data master(NMEA information)
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "CommonDefine.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+static VEHICLESENS_DATA_MASTER gstLocationLonLat_g; // NOLINT(readability/nolint)
+
+/****************************************************************************
+@brief VehicleSensInitLocationLonLatG<BR>
+ Latitude and longitudeInitialization of information data master(NMEA information)
+@outline Latitude and longitudeInitialize the information data master
+@param[in] none
+@param[out] none
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensInitLocationLonLatG(void) {
+ SENSORLOCATION_LONLATINFO_DAT st_lonlat;
+
+ memset(&gstLocationLonLat_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstLocationLonLat_g.ul_did = VEHICLE_DID_LOCATION_LONLAT;
+ /** Data size setting */
+ gstLocationLonLat_g.us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT);
+ /** Data content setting */
+ memset(&st_lonlat, 0x00, sizeof(st_lonlat));
+ st_lonlat.getMethod = SENSOR_GET_METHOD_GPS;
+ st_lonlat.SyncCnt = 0x00;
+ st_lonlat.isEnable = SENSORLOCATION_STATUS_DISABLE;
+ memcpy(&gstLocationLonLat_g.uc_data[0], &st_lonlat, sizeof(st_lonlat));
+}
+
+/****************************************************************************
+@brief VehicleSensSetLocationLonLatG<BR>
+ Latitude and longitudeInformation data master SET process(NMEA information)
+@outline Latitude and longitudeUpdate the information data master
+@param[in] SENSORLOCATION_LONLATINFO_DAT * pst_lonlat : Latitude and longitude information
+@param[out] none
+@return u_int8
+@retval VEHICLESENS_EQ : No data change
+@retval VEHICLESENS_NEQ : Data change
+*******************************************************************************/
+u_int8 VehicleSensSetLocationLonLatG(const SENSORLOCATION_LONLATINFO_DAT *pst_lonlat) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationLonLat_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_LOCATION_LONLAT;
+ pst_master->us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT));
+
+ return(uc_ret);
+}
+
+/****************************************************************************
+@brief VehicleSensGetLocationLonLatG<BR>
+ Latitude and longitudeInformation Data Master GET Processing(NMEA information)
+@outline Latitude and longitudeProvide an information data master
+@param[in] none
+@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetLocationLonLatG(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationLonLat_g;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp
new file mode 100755
index 0000000..dcaecff
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp
@@ -0,0 +1,163 @@
+/*
+ * @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
+ * VehicleSens_Did_LocationLonLat_n.cpp
+ * @brief
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "SensorLocation_API.h"
+#include "CommonDefine.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstLocationLonLat_n; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Latitude and longitudeInitialization of information data master(NAVI information)
+ *
+ * Latitude and longitudeInitialize the information data master
+ *
+ * @param[in] none
+ * @param[out] none
+ * @return none
+ * @retval none
+ */
+void VehicleSensInitLocationLonLatN(void) {
+ SENSORLOCATION_LONLATINFO_DAT st_lonlat;
+
+ memset(&gstLocationLonLat_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstLocationLonLat_n.ul_did = VEHICLE_DID_LOCATION_LONLAT_NAVI;
+
+ /** Data size setting */
+ gstLocationLonLat_n.us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT);
+
+ /** Data content setting */
+ memset(&st_lonlat, 0x00, sizeof(st_lonlat));
+ st_lonlat.getMethod = SENSOR_GET_METHOD_NAVI;
+ st_lonlat.SyncCnt = 0x00;
+ st_lonlat.isEnable = SENSORLOCATION_STATUS_DISABLE;
+ st_lonlat.posSts = 0x00;
+ st_lonlat.posAcc = 0x00;
+ st_lonlat.Longitude = 0x00;
+ st_lonlat.Latitude = 0x00;
+ memcpy(&gstLocationLonLat_n.uc_data[0], &st_lonlat, sizeof(st_lonlat));
+
+ return;
+}
+
+/**
+ * @brief
+ * Latitude and longitudeInformation data master SET process(NAVI information)
+ *
+ * Latitude and longitudeUpdate the information data master
+ *
+ * @param[in] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @param[out] none
+ * @return u_int8
+ * @retval VEHICLESENS_EQ : No data change
+ * @retval VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetLocationLonLatN(const SENSORLOCATION_LONLATINFO_DAT *pst_lonlat) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationLonLat_n;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_LOCATION_LONLAT_NAVI;
+ pst_master->us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Latitude and longitudeInformation Data Master GET Processing(NAVI information)
+ *
+ * Latitude and longitudeProvide an information data master
+ *
+ * @param[in] none
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @return none
+ * @retval none
+ */
+void VehicleSensGetLocationLonLatN(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstLocationLonLat_n;
+
+ /** 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
+
+/**
+ * @brief
+ * Latitude and longitudeInformation Data Master GET Processing(NAVI information)
+ *
+ * Latitude and longitudeProvide an information data master(Unit:10^-7th degree)
+ *
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ */
+void VehicleSensGetLocationLonLatnUnitCnv(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+ SENSORLOCATION_LONLATINFO_DAT st_lonlat;
+ int32_t l_lon;
+ int32_t l_lat;
+ int64_t ll_tmp;
+
+ pst_master = &gstLocationLonLat_n;
+
+ /* Perform unit conversion[1/128Second] -> [10^-7 degree] */
+ memcpy(&st_lonlat, pst_master->uc_data, sizeof(st_lonlat));
+
+ /* Longitude */
+ l_lon = st_lonlat.Longitude;
+ ll_tmp = (int64_t)l_lon * 10000000;
+ st_lonlat.Longitude = (int32_t)(ll_tmp / (128 * 60 * 60));
+
+ /* Latitude */
+ l_lat = st_lonlat.Latitude;
+ ll_tmp = (int64_t)l_lat * 10000000;
+ st_lonlat.Latitude = (int32_t)(ll_tmp / (128 * 60 * 60));
+
+ /** 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;
+ memcpy(pst_data->uc_data, &st_lonlat, sizeof(st_lonlat));
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp
new file mode 100755
index 0000000..7066324
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp
@@ -0,0 +1,132 @@
+/*
+ * @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_MainGpsInterruptSignal.cpp
+ * System name :PastModel002
+ * Subsystem name :GPS process
+ * Program name :MAIN GPS interrupt data master(VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL)
+ * Module configuration :VehicleSensInitMainGpsInterruptSignal() Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL initialization function
+ * :VehicleSensSetMainGpsInterruptSignal() Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL SET function
+ * :VehicleSensGetMainGpsInterruptSignal() Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+#define VEHICLE_SENS_DID_MAIN_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY 0
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL gstMainGpsInterruptSignal; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitMainGpsInterruptSignal
+* ABSTRACT : Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL initialization function
+* FUNCTION : MAIN_GPS_INTERRUPT_SIGNAL data master initialization processing
+* ARGUMENT : None
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void VehicleSensInitMainGpsInterruptSignal(void) {
+ (void)memset(reinterpret_cast<void *>(&(gstMainGpsInterruptSignal)),
+ static_cast<int>(0x00), sizeof(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL));
+ gstMainGpsInterruptSignal.ul_did = VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL;
+ gstMainGpsInterruptSignal.us_size = VEHICLE_DSIZE_MAIN_GPS_INTERRUPT_SIGNAL;
+ gstMainGpsInterruptSignal.uc_data = VEHICLE_DINIT_MAIN_GPS_INTERRUPT_SIGNAL;
+
+#if VEHICLE_SENS_DID_MAIN_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstMainGpsInterruptSignal.uc_data.uc_data == 0x%x\r\n", gstMainGpsInterruptSignal.uc_data);
+#endif
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetMainGpsInterruptSignal
+* ABSTRACT : Vehicle sensor MAIN_GPS_INTERRUPT_SIGNALE SET function
+* FUNCTION : Update the Main_GPS_INTERRUPT_SIGNAL data master
+* ARGUMENT : *pst_data : Pointer to received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetMainGpsInterruptSignal(const SENSOR_MSG_GPSDATA_DAT *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_GPS_INTERRUPT_SIGNAL *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstMainGpsInterruptSignal;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), (size_t)(pst_data->us_size));
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data));
+
+#if VEHICLE_SENS_DID_MAIN_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] pst_data->ul_did == 0x%x", pst_data->ul_did);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstMainGpsInterruptSignal.ul_did == 0x%x\r\n", gstMainGpsInterruptSignal.ul_did);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] (u_int8)pst_data->us_size == 0x%x", (u_int8)pst_data->us_size);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstMainGpsInterruptSignal.us_size == 0x%x\r\n", gstMainGpsInterruptSignal.us_size);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] pst_data->uc_data == 0x%x", pst_data->uc_data[0]);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstMainGpsInterruptSignal.uc_data == 0x%x\r\n", gstMainGpsInterruptSignal.uc_data);
+#endif
+ }
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetMainGpsInterruptSignal
+* ABSTRACT : Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL GET function
+* FUNCTION : Provide the MAIN_GPS_INTERRUPT_SIGNAL data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void VehicleSensGetMainGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstMainGpsInterruptSignal;
+
+ /* 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<void *>(&(pst_data->uc_data)),
+ (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data));
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp
new file mode 100755
index 0000000..1859f76
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Mon_Hw_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_MON_HW)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstMonHw_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief MON-HW vehicle sensor initialization function
+@outline MON-HW initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitMonHwG(void) {
+ memset(&gstMonHw_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstMonHw_g.ul_did = VEHICLE_DID_GPS_UBLOX_MON_HW;
+ gstMonHw_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_MON_HW + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstMonHw_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_MON_HW;
+}
+
+/***************************************************************************
+@brief MON-HW SET vehicle sensor function
+@outline To update the master data MON-HW.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetMonHwG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstMonHw_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function MON-HW GET
+@outline Master Data provides the MON-HW
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetMonHwG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstMonHw_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp
new file mode 100755
index 0000000..67a218e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp
@@ -0,0 +1,55 @@
+/*
+ * @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 VehicleSens_Did_MotionHeading.cpp
+@detail Orientation Information Data Master Management
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+
+/****************************************************************************
+@brief VehicleSensGetMotionHeading<BR>
+ Compass Data Master GET Processing
+@outline Provide an orientation information data master
+@param[in] u_int8 uc_get_method : Acquisition method(GPS or Navi)
+@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetMotionHeading(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetMotionHeadingG(pst_data);
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_NAVI:
+ {
+ /** To acquire from NAVI */
+ VehicleSensGetMotionHeadingnCnvData(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp
new file mode 100755
index 0000000..751b199
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp
@@ -0,0 +1,105 @@
+/*
+ * @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 VehicleSens_Did_MotionHeading_g.cpp
+@detail Orientation Information Data Master Management(NMEA information)
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "CommonDefine.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+static VEHICLESENS_DATA_MASTER gstMotionHeading_g; // NOLINT(readability/nolint)
+
+/****************************************************************************
+@brief VehicleSensInitMotionHeadingG<BR>
+ Orientation information data master initialization process(NMEA information)
+@outline Initialize the orientation information data master
+@param[in] none
+@param[out] none
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensInitMotionHeadingG(void) {
+ SENSORMOTION_HEADINGINFO_DAT st_heading;
+
+ memset(&gstMotionHeading_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstMotionHeading_g.ul_did = VEHICLE_DID_MOTION_HEADING;
+ /** Data size setting */
+ gstMotionHeading_g.us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT);
+ /** Data content setting */
+ memset(&st_heading, 0x00, sizeof(st_heading));
+ st_heading.getMethod = SENSOR_GET_METHOD_GPS;
+ st_heading.SyncCnt = 0x00;
+ st_heading.isEnable = SENSORMOTION_STATUS_DISABLE;
+ memcpy(&gstMotionHeading_g.uc_data[0], &st_heading, sizeof(st_heading));
+}
+
+/****************************************************************************
+@brief VehicleSensSetMotionHeadingG<BR>
+ Compass Data Master SET Processing(NMEA information)
+@outline Update the orientation information data master
+@param[in] SENSORMOTION_HEADINGINFO_DAT* pst_heading : Bearing information
+@param[out] none
+@return u_int8
+@retval VEHICLESENS_EQ : No data change
+@retval VEHICLESENS_NEQ : Data change
+*******************************************************************************/
+u_int8 VehicleSensSetMotionHeadingG(const SENSORMOTION_HEADINGINFO_DAT *pst_heading) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionHeading_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_heading,
+ sizeof(SENSORMOTION_HEADINGINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_MOTION_HEADING;
+ pst_master->us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_heading, sizeof(SENSORMOTION_HEADINGINFO_DAT));
+
+ return(uc_ret);
+}
+
+/****************************************************************************
+@brief VehicleSensGetMotionHeadingG<BR>
+ Compass Data Master GET Processing(NMEA information)
+@outline Provide an orientation information data master
+@param[in] none
+@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetMotionHeadingG(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionHeading_g;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp
new file mode 100755
index 0000000..4475b24
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp
@@ -0,0 +1,162 @@
+/*
+ * @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
+ * VehicleSens_Did_MotionHeading_n.cpp
+ * @brief
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "SensorMotion_API.h"
+#include "CommonDefine.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstMotionHeading_n; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Orientation information data master initialization process(NAVI information)
+ *
+ * Initialize the orientation information data master
+ *
+ * @param[in] none
+ * @param[out] none
+ * @return none
+ * @retval none
+ */
+void VehicleSensInitMotionHeadingN(void) {
+ SENSORMOTION_HEADINGINFO_DAT st_heading;
+
+ memset(&gstMotionHeading_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstMotionHeading_n.ul_did = VEHICLE_DID_MOTION_HEADING_NAVI;
+
+ /** Data size setting */
+ gstMotionHeading_n.us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT);
+
+ /** Data content setting */
+ memset(&st_heading, 0x00, sizeof(st_heading));
+ st_heading.getMethod = SENSOR_GET_METHOD_NAVI;
+ st_heading.SyncCnt = 0x00;
+ st_heading.isEnable = SENSORMOTION_STATUS_DISABLE;
+ st_heading.posSts = 0x00;
+ st_heading.Heading = 0x00;
+ memcpy(&gstMotionHeading_n.uc_data[0], &st_heading, sizeof(st_heading));
+
+ return;
+}
+
+/**
+ * @brief
+ * Compass Data Master SET Processing(NAVI information)
+ *
+ * Update the orientation information data master
+ *
+ * @param[in] VEHICLESENS_DATA_MASTER *pst_heading : Pointer to the data master acquisition destination
+ * @param[out] none
+ * @return u_int8
+ * @retval VEHICLESENS_EQ : No data change
+ * @retval VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetMotionHeadingN(const SENSORMOTION_HEADINGINFO_DAT *pst_heading) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionHeading_n;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_heading, sizeof(SENSORMOTION_HEADINGINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_MOTION_HEADING_NAVI;
+ pst_master->us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_heading, sizeof(SENSORMOTION_HEADINGINFO_DAT));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Compass Data Master GET Processing(NAVI information)
+ *
+ * Provide an orientation information data master
+ *
+ * @param[in] none
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @return none
+ * @retval none
+ */
+void VehicleSensGetMotionHeadingN(VEHICLESENS_DATA_MASTER *pst_data) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionHeading_n;
+
+ /** 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Compass Data Master GET Processing(NAVI information)
+ *
+ * Providing orientation information data master with orientation and unit conversion
+ *
+ * @param[in] none
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @return none
+ * @retval none
+ */
+void VehicleSensGetMotionHeadingnCnvData(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+ SENSORMOTION_HEADINGINFO_DAT st_heading;
+ int16 i_heading;
+
+ pst_master = &gstMotionHeading_n;
+
+ /* Perform the orientation conversion[-179 to +180] -> [0 to 359] */
+ memcpy(&st_heading, pst_master->uc_data, sizeof(st_heading));
+ i_heading = static_cast<int16>(st_heading.Heading);
+ if (i_heading > 0) {
+ i_heading = static_cast<int16>(360 - i_heading);
+ } else {
+ i_heading = static_cast<int16>(i_heading * -1);
+ }
+ /* Perform unit conversion[Once] -> [0.01 degree] */
+ st_heading.Heading = (u_int16)(i_heading * 100);
+
+ /** 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;
+ memcpy(pst_data->uc_data, &st_heading, sizeof(st_heading));
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp
new file mode 100755
index 0000000..0f7abe3
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp
@@ -0,0 +1,57 @@
+/*
+ * @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
+ * VehicleSens_Did_MotionSpeed.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Speed information data master GET processing
+ *
+ * @param[out] *pst_data - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination
+ * @param[in] uc_get_method - u_int8 acquisition method
+ */
+void VehicleSensGetMotionSpeed(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in
+ case VEHICLESENS_GETMETHOD_INTERNAL:
+ {
+ /** When acquiring internal calculation data */
+ VehicleSensGetMotionSpeedI(pst_data);
+ }
+ break;
+ case VEHICLESENS_GETMETHOD_NAVI:
+ {
+ /** To acquire NAVI data */
+ VehicleSensGetMotionSpeedN(pst_data);
+ break;
+ }
+ default:
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp
new file mode 100755
index 0000000..9b8ae6c
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp
@@ -0,0 +1,107 @@
+/*
+ * @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
+ * VehicleSens_Did_MotionSpeed_g.cpp
+ * @brief
+ * Vehicle Speed Information Data Master Management(NMEA information)
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "CommonDefine.h"
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstMotionSpeed_g; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Speed information data master initialization process(NMEA information)
+ */
+void VehicleSensInitMotionSpeedG(void) {
+ SENSORMOTION_SPEEDINFO_DAT st_speed;
+
+ memset(&gstMotionSpeed_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstMotionSpeed_g.ul_did = VEHICLE_DID_MOTION_SPEED;
+ /** Data size setting */
+ gstMotionSpeed_g.us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT);
+ /** Data content setting */
+ memset(&st_speed, 0x00, sizeof(st_speed));
+ st_speed.getMethod = SENSOR_GET_METHOD_GPS;
+ st_speed.SyncCnt = 0x00;
+ st_speed.isEnable = SENSORMOTION_STATUS_DISABLE;
+ memcpy(&gstMotionSpeed_g.uc_data[0], &st_speed, sizeof(st_speed));
+}
+
+/**
+ * @brief
+ * Rate information data master SET process(NMEA information)
+ *
+ * @param[in] *pst_speed - SENSORMOTION_SPEEDINFO_DAT Pointer to vehicle speed information
+ *
+ * @return VEHICLESENS_EQ : No data change<br>
+ * VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetMotionSpeedG(const SENSORMOTION_SPEEDINFO_DAT *pst_speed) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionSpeed_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_MOTION_SPEED;
+ pst_master->us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Speed information data master GET processing(NMEA information)
+ *
+ * @param[out] *pst_speed - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination
+ */
+void VehicleSensGetMotionSpeedG(VEHICLESENS_DATA_MASTER *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionSpeed_g;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp
new file mode 100755
index 0000000..7f01e2f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp
@@ -0,0 +1,103 @@
+/*
+ * @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
+ * VehicleSens_Did_MotionSpeed_i.cpp
+ * @brief
+ * Vehicle Speed Information Data Master Management(Internal calculation information)
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "CommonDefine.h"
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstMotionSpeed_i; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Speed information data master initialization process(Internal calculation information)
+ */
+void VehicleSensInitMotionSpeedI(void) {
+ SENSORMOTION_SPEEDINFO_DAT st_speed;
+
+ memset(&gstMotionSpeed_i, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstMotionSpeed_i.ul_did = VEHICLE_DID_MOTION_SPEED_INTERNAL;
+ /** Data size setting */
+ gstMotionSpeed_i.us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT);
+ /** Data content setting */
+ memset(&st_speed, 0x00, sizeof(st_speed));
+ st_speed.getMethod = SENSOR_GET_METHOD_POS;
+ st_speed.SyncCnt = 0x00;
+ st_speed.isEnable = SENSORMOTION_STATUS_DISABLE;
+ memcpy(&gstMotionSpeed_i.uc_data[0], &st_speed, sizeof(st_speed));
+}
+
+/**
+ * @brief
+ * Rate information data master SET process(Internal calculation information)
+ *
+ * @param[in] *pst_speed - SENSORMOTION_SPEEDINFO_DAT Pointer to vehicle speed information
+ *
+ * @return VEHICLESENS_EQ : No data change<br>
+ * VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetMotionSpeedI(const SENSORMOTION_SPEEDINFO_DAT *pst_speed) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionSpeed_i;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_MOTION_SPEED_INTERNAL;
+ pst_master->us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Speed information data master GET processing(Internal calculation information)
+ *
+ * @param[out] *pst_speed - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination
+ */
+void VehicleSensGetMotionSpeedI(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionSpeed_i;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp
new file mode 100755
index 0000000..9c8f5bc
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp
@@ -0,0 +1,103 @@
+/*
+ * @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
+ * VehicleSens_Did_MotionSpeed_n.cpp
+ * @brief
+ * Vehicle Speed Information Data Master Management(Navi information)
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+#include "CommonDefine.h"
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstMotionSpeed_n; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Speed information data master initialization process(Navi information)
+ */
+void VehicleSensInitMotionSpeedN(void) {
+ SENSORMOTION_SPEEDINFO_DAT st_speed;
+
+ memset(&gstMotionSpeed_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstMotionSpeed_n.ul_did = VEHICLE_DID_MOTION_SPEED_NAVI;
+ /** Data size setting */
+ gstMotionSpeed_n.us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT);
+ /** Data content setting */
+ memset(&st_speed, 0x00, sizeof(st_speed));
+ st_speed.getMethod = SENSOR_GET_METHOD_NAVI;
+ st_speed.SyncCnt = 0x00;
+ st_speed.isEnable = SENSORMOTION_STATUS_DISABLE;
+ memcpy(&gstMotionSpeed_n.uc_data[0], &st_speed, sizeof(st_speed));
+}
+
+/**
+ * @brief
+ * Rate information data master SET process(Navi information)
+ *
+ * @param[in] *pst_speed - SENSORMOTION_SPEEDINFO_DAT Pointer to vehicle speed information
+ *
+ * @return VEHICLESENS_EQ : No data change<br>
+ * VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetMotionSpeedN(const SENSORMOTION_SPEEDINFO_DAT *pst_speed) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionSpeed_n;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_MOTION_SPEED_NAVI;
+ pst_master->us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Speed information data master GET processing(Navi information)
+ *
+ * @param[out] *pst_speed - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination
+ */
+void VehicleSensGetMotionSpeedN(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstMotionSpeed_n;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp
new file mode 100755
index 0000000..a9bc0c9
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_Clock_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_CLOCK)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavClock_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-CLOCK vehicle sensor initialization function
+@outline NAV-CLOCK initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavClockG(void) {
+ memset(&gstNavClock_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavClock_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_CLOCK;
+ gstNavClock_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_CLOCK + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavClock_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_CLOCK;
+}
+
+/***************************************************************************
+@brief NAV-CLOCK SET vehicle sensor function
+@outline To update the master data NAV-CLOCK.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavClockG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavClock_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-CLOCK GET
+@outline Master Data provides the NAV-CLOCK
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavClockG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavClock_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp
new file mode 100755
index 0000000..211e940
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_Dop_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_DOP)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavDop_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-DOP vehicle sensor initialization function
+@outline NAV-DOP initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavDopG(void) {
+ memset(&gstNavDop_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavDop_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_DOP;
+ gstNavDop_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_DOP + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavDop_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_DOP;
+}
+
+/***************************************************************************
+@brief NAV-DOP SET vehicle sensor function
+@outline To update the master data NAV-DOP.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavDopG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavDop_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-DOP GET
+@outline Master Data provides the NAV-DOP
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavDopG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavDop_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp
new file mode 100755
index 0000000..17ebc04
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_Posllh_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_POSLLH)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavPosllh_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-POSLLH vehicle sensor initialization function
+@outline NAV-POSLLH initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavPosllhG(void) {
+ memset(&gstNavPosllh_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavPosllh_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_POSLLH;
+ gstNavPosllh_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_POSLLH + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavPosllh_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_POSLLH;
+}
+
+/***************************************************************************
+@brief NAV-POSLLH SET vehicle sensor function
+@outline To update the master data NAV-POSLLH.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavPosllhG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavPosllh_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-POSLLH GET
+@outline Master Data provides the NAV-POSLLH
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavPosllhG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavPosllh_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp
new file mode 100755
index 0000000..f03d48f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_Status_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_STATUS)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavStatus_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-STATUS vehicle sensor initialization function
+@outline NAV-STATUS initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavStatusG(void) {
+ memset(&gstNavStatus_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavStatus_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_STATUS;
+ gstNavStatus_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_STATUS + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavStatus_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_STATUS;
+}
+
+/***************************************************************************
+@brief NAV-STATUS SET vehicle sensor function
+@outline To update the master data NAV-STATUS.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavStatusG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavStatus_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-STATUS GET
+@outline Master Data provides the NAV-STATUS
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavStatusG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavStatus_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp
new file mode 100755
index 0000000..7211ce8
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp
@@ -0,0 +1,108 @@
+/*
+ * @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 VehicleSens_Did_Nav_SvInfo_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_SVINFO)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavSvInfo_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-SVINFO vehicle sensor initialization function
+@outline NAV-SVINFO initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavSvInfoG(void) {
+ memset(&gstNavSvInfo_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavSvInfo_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_SVINFO;
+ /* Initially, the maximum storage size is set.(Common header size(8) + NAV-SVINFO fixed-data-size(8) +
+ *(Maximum number of channels(16) + Size of single channel data(12))) */
+ gstNavSvInfo_g.us_size = (VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE + VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO) +
+ (VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO_CH_MAX * \
+ VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO_ALONE_MAX);
+ gstNavSvInfo_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_SVINFO;
+}
+
+/***************************************************************************
+@brief NAV-SVINFO SET vehicle sensor function
+@outline To update the master data NAV-SVINFO.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavSvInfoG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavSvInfo_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-SVINFO GET
+@outline Master Data provides the NAV-SVINFO
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavSvInfoG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavSvInfo_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp
new file mode 100755
index 0000000..1d959cd
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_TimeGps_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavTimeGps_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-TIMEGPS vehicle sensor initialization function
+@outline NAV-TIMEGPS initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavTimeGpsG(void) {
+ memset(&gstNavTimeGps_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavTimeGps_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS;
+ gstNavTimeGps_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_TIMEGPS + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavTimeGps_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_TIMEGPS;
+}
+
+/***************************************************************************
+@brief NAV-TIMEGPS SET vehicle sensor function
+@outline To update the master data NAV-TIMEGPS.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavTimeGpsG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavTimeGps_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-TIMEGPS GET
+@outline Master Data provides the NAV-TIMEGPS
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavTimeGpsG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavTimeGps_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp
new file mode 100755
index 0000000..8368257
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_TimeUtc_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavTimeUtc_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-TIMEUTC vehicle sensor initialization function
+@outline NAV-TIMEUTC initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavTimeUtcG(void) {
+ memset(&gstNavTimeUtc_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavTimeUtc_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC;
+ gstNavTimeUtc_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_TIMEUTC + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavTimeUtc_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_TIMEUTC;
+}
+
+/***************************************************************************
+@brief NAV-TIMEUTC SET vehicle sensor function
+@outline To update the master data NAV-TIMEUTC.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavTimeUtcG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavTimeUtc_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-TIMEUTC GET
+@outline Master Data provides the NAV-TIMEUTC
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavTimeUtcG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavTimeUtc_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp
new file mode 100755
index 0000000..ad757aa
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp
@@ -0,0 +1,104 @@
+/*
+ * @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 VehicleSens_Did_Nav_Velned_g.cpp
+@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_VELNED)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavVelned_g; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief NAV-VELNED vehicle sensor initialization function
+@outline NAV-VELNED initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitNavVelnedG(void) {
+ memset(&gstNavVelned_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT));
+ gstNavVelned_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_VELNED;
+ gstNavVelned_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_VELNED + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE;
+ gstNavVelned_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_VELNED;
+}
+
+/***************************************************************************
+@brief NAV-VELNED SET vehicle sensor function
+@outline To update the master data NAV-VELNED.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : A pointer to the received data message or the direct line
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetNavVelnedG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavVelned_g;
+
+ /** Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->us_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt;
+ pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag;
+
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size);
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-VELNED GET
+@outline Master Data provides the NAV-VELNED
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetNavVelnedG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master;
+
+ pst_master = &gstNavVelned_g;
+
+ /** 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_rcv_flag = pst_master->uc_rcvflag;
+ pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt;
+ pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp
new file mode 100755
index 0000000..7335ce1
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp
@@ -0,0 +1,94 @@
+/*
+ * @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 VehicleSens_Did_NaviinfoDiagGPS_g.cpp
+@detail Management of GPS Information Master for Diag
+******************************************************************************/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************
+ * Global variable *
+ *************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstNaviinfoDiagGPS_g; // NOLINT(readability/nolint)
+
+/****************************************************************************
+@brief VehicleSensInitNaviinfoDiagGPSg<BR>
+ Initialization of GPS Data Master for Diag
+@outline Initializing GPS Data Master for Diag
+@param[in] none
+@param[out] none
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensInitNaviinfoDiagGPSg(void) {
+ memset(&gstNaviinfoDiagGPS_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT));
+
+ /** Data ID setting */
+ gstNaviinfoDiagGPS_g.ul_did = VEHICLE_DID_NAVIINFO_DIAG_GPS;
+ /** Data size setting */
+ gstNaviinfoDiagGPS_g.us_size = sizeof(NAVIINFO_DIAG_GPS);
+}
+
+/****************************************************************************
+@brief VehicleSensSetNaviinfoDiagGPSg<BR>
+ GPS Information Master SET Processing for Diag
+@outline Update the GPS Data Master for Diag
+@param[in] NAVIINFO_DIAG_GPS* pst_diag_data : GPS information for Diag
+@param[out] none
+@return u_int8
+@retval VEHICLESENS_EQ : No data change
+@retval VEHICLESENS_NEQ : Data change
+*******************************************************************************/
+u_int8 VehicleSensSetNaviinfoDiagGPSg(const NAVIINFO_DIAG_GPS *pst_diag_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = &gstNaviinfoDiagGPS_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_diag_data, sizeof(NAVIINFO_DIAG_GPS));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_NAVIINFO_DIAG_GPS;
+ pst_master->us_size = sizeof(NAVIINFO_DIAG_GPS);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_diag_data, sizeof(NAVIINFO_DIAG_GPS));
+
+ return(uc_ret);
+}
+
+/****************************************************************************
+@brief VehicleSensGetNaviinfoDiagGPSg<BR>
+ GPS Information Master GET Processing for Diag
+@outline Provide a master GPS information for Diag
+@param[in] none
+@param[out] SENSOR_MSG_GPSDATA_DAT *pst_data : Pointer to the data master acquisition destination
+@return none
+@retval none
+*******************************************************************************/
+void VehicleSensGetNaviinfoDiagGPSg(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master;
+
+ pst_master = reinterpret_cast<VEHICLESENS_DATA_MASTER_GPS_FORMAT*>(&gstNaviinfoDiagGPS_g);
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp
new file mode 100755
index 0000000..cb80e6f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp
@@ -0,0 +1,115 @@
+/*
+ * @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
+ * VehicleSens_Did_PulseTime.cpp
+ * @brief
+ * Vehicle sensor data master(VEHICLE_DID_PULSE_TIME)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/**
+ * @brief
+ * Vehicle sensor pulse time GET function
+ *
+ * Provide interpulse time data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetPulseTime(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetPulseTimel(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/**
+ * @brief
+ * Vehicle sensor inter-pulse time (initial delivery) GET function
+ *
+ * Provide interpulse time data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+void VehicleSensGetPulseTimeExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetPulseTimeExtl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/**
+ * @brief
+ * Vehicle sensor pulse time (initial sensor) GET function
+ *
+ * Provide interpulse time data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ */
+
+void VehicleSensGetPulseTimeFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ break;
+ }
+ default:
+ break;
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp
new file mode 100755
index 0000000..04e66b5
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp
@@ -0,0 +1,143 @@
+/*
+ * @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
+ * VehicleSens_Did_PulseTimeExt_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_PULSE_TIME)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER_EXT g_st_pulsetime_ext_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor inter-pulse time initialization function
+ *
+ * Inter-pulse time data master initialization processing
+ */
+void VehicleSensInitPulseTimeExtl(void) {
+ (void)memset(reinterpret_cast<void *>(&g_st_pulsetime_ext_l), 0, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ g_st_pulsetime_ext_l.ul_did = POSHAL_DID_PULSE_TIME;
+ g_st_pulsetime_ext_l.us_size = VEHICLE_DSIZE_PULSE_TIME_EXT_INIT;
+ g_st_pulsetime_ext_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor pulse time SET function
+ *
+ * Update the interpulse time data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+void VehicleSensSetPulseTimeExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_size = 0;
+ u_int16 us_start = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &g_st_pulsetime_ext_l;
+ /* 4byte * (Number of data items + 32 data items) */
+ us_size = static_cast<u_int16>(sizeof(u_int32) * (1 + VEHICLE_SNS_INFO_PULSE_NUM));
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[PulseTime];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[PulseTime] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_PULSE_TIME_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/**
+ * @brief
+ * Vehicle sensor pulse time GET function
+ *
+ * Provide interpulse time data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetPulseTimeExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &g_st_pulsetime_ext_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ /* Size of one data item: 4byte * (Number of data items + 32 data items) */
+ us_size = static_cast<u_int16>(sizeof(u_int32) * (1 + VEHICLE_SNS_INFO_PULSE_NUM));
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[PulseTime];
+ }
+
+ /* Acquire data from the oldest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[PulseTime] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[PulseTime] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp
new file mode 100755
index 0000000..527bb72
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp
@@ -0,0 +1,93 @@
+/*
+ * @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
+ * VehicleSens_Did_PulseTime_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_PULSE_TIME)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstPulseTime_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle sensor inter-pulse time initialization function
+ *
+ * Inter-pulse time data master initialization processing
+ */
+void VehicleSensInitPulseTimel(void) {
+ memset(&gstPulseTime_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstPulseTime_l.ul_did = POSHAL_DID_PULSE_TIME;
+ gstPulseTime_l.us_size = VEHICLE_DSIZE_PULSE_TIME;
+ gstPulseTime_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/**
+ * @brief
+ * Vehicle sensor inter-pulse time initialization function
+ *
+ * Update the interpulse time data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ No data change<br>
+ * VEHICLESENS_NEQ Data change
+ */
+u_int8 VehicleSensSetPulseTimelG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstPulseTime_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle sensor pulse time GET function
+ *
+ * Provide interpulse time data master
+ *
+ * @param[in] Pointer to the data master acquisition destination
+ */
+void VehicleSensGetPulseTimel(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstPulseTime_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp
new file mode 100755
index 0000000..08c5ec7
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp
@@ -0,0 +1,118 @@
+/*
+ * @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_Rev.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_REV)
+ * Module configuration :VehicleSensGetRev() Vehicle Sensor REV GET Functions
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetRev
+* ABSTRACT : Vehicle Sensor REV GET Functions
+* FUNCTION : Provide a REV data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetRev(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetRevl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetRevFst
+* ABSTRACT : Vehicle sensor GET function
+* FUNCTION : Provide a data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetRevFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetRevFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
+
+/**
+ * @brief
+ * Vehicle Sensor REV GET Functions
+ *
+ * Provide a REV data master
+ *
+ * @param[in] *pst_data: Pointer to the data master acquisition destination
+ * @param[in] uc_get_method: Acquisition method(Direct Line or CAN)
+ *
+ * @return none
+ */
+void VehicleSensGetRevExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetRevExtl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp
new file mode 100755
index 0000000..0f4e5e6
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp
@@ -0,0 +1,134 @@
+/*
+ * @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
+ * VehicleSens_Did_RevExt_l.cpp
+ * @brief
+ * Vehicle sensor data master(POSHAL_DID_REV)
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT g_st_revext_l; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * Vehicle Sensor REV Initialization Functions
+ *
+ * REV data master initialization processing
+ *
+ * @param[in] none
+ */
+void VehicleSensInitRevExtl(void) {
+ u_int16 *pus;
+
+ memset(&g_st_revext_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ g_st_revext_l.ul_did = POSHAL_DID_REV;
+ g_st_revext_l.us_size = VEHICLE_DSIZE_REV_EXT_INIT;
+ g_st_revext_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+ pus = reinterpret_cast<u_int16 *>(g_st_revext_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SNS_COUNTER, VEHICLE_DSIZE_REV_EXT);
+}
+
+/**
+ * @brief
+ * Vehicle Sensor REV SET Functions
+ *
+ * Update the REV data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ */
+void VehicleSensSetRevExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+
+ pst_master = &g_st_revext_l;
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[Rev];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_data[us_start] = pst_data->uc_data[0];
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[Rev] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_REV_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + sizeof(u_int8));
+ }
+}
+
+/**
+ * @brief
+ * Vehicle Sensor REV GET Functions
+ *
+ * Provide a REV data master
+ *
+ * @param[in] *pst_data : Pointer to the data master acquisition destination
+ */
+void VehicleSensGetRevExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &g_st_revext_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[Rev];
+ }
+
+ /* Acquire data from the newest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[Rev] + us_cnt < VEHICLE_DKEEP_MAX) {
+ pst_data->uc_data[us_cnt] = pst_master->uc_data[(gstPkgTempExt.start_point[Rev] + us_cnt)];
+ } else {
+ pst_data->uc_data[us_cnt] = pst_master->uc_data[us_loop_cnt];
+ us_loop_cnt++;
+ }
+ } else {
+ pst_data->uc_data[us_cnt] = pst_master->uc_data[us_cnt];
+ }
+ }
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp
new file mode 100755
index 0000000..49d4654
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp
@@ -0,0 +1,171 @@
+/*
+ * @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_RevFst_l.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_REV_FST)
+ * Module configuration :VehicleSensInitRevFstl() Vehicle Sensor REV Initialization Functions
+ * :VehicleSensSetRevFstl() Vehicle Sensor REV SET Functions
+ * :VehicleSensSetRevFstG() Vehicle Sensor REV SET Functions
+ * :VehicleSensGetRevFstl() Vehicle Sensor REV GET Functions
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST gstRevFst_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitRevFstl
+* ABSTRACT : Vehicle Sensor REV Initialization Functions
+* FUNCTION : REV data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitRevFstl(void) {
+ (void)memset(reinterpret_cast<void *>(&gstRevFst_l), 0, sizeof (VEHICLESENS_DATA_MASTER_FST));
+ gstRevFst_l.ul_did = POSHAL_DID_REV_FST;
+ gstRevFst_l.us_size = 0U;
+ gstRevFst_l.uc_rcvflag = 0U;
+ gstRevFst_l.partition_flg = 0;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetRevFstl
+* ABSTRACT : Vehicle Sensor REV SET Functions
+* FUNCTION : Update the REV data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetRevFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstRevFst_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetRevFstG
+* ABSTRACT : Vehicle Sensor REV SET Functions
+* FUNCTION : Update the REV data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetRevFstG(const LSDRV_LSDATA_FST_REV *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstRevFst_l;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ if (partition_max == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data,
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else if (partition_max == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ if (partition_num == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else if (partition_num == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_REV_FST],
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ }
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_REV_FST],
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetRevFstl
+* ABSTRACT : Vehicle Sensor REV GET Functions
+* FUNCTION : Provide a REV data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetRevFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstRevFst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
+
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp
new file mode 100755
index 0000000..8a8178a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp
@@ -0,0 +1,157 @@
+/*
+ * @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_Rev_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_REV)
+ * Module configuration :VehicleSensInitRevl() Vehicle Sensor REV Initialization Functions
+ * :VehicleSensSetRevl() Vehicle Sensor REV SET Functions
+ * :VehicleSensGetRevl() Vehicle Sensor REV GET Functions
+ * :VehicleSensGetRevline() Vehicle Sensor REV GET Functions(_LINE)
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstRev_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitRevl
+* ABSTRACT : Vehicle Sensor REV Initialization Functions
+* FUNCTION : REV data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitRevl(void) {
+ memset(&gstRev_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstRev_l.ul_did = VEHICLE_DID_REV;
+ gstRev_l.us_size = VEHICLE_DSIZE_REV;
+ gstRev_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetRevl
+* ABSTRACT : Vehicle Sensor REV SET Functions
+* FUNCTION : Update the REV data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetRevl(const LSDRV_LSDATA *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstRev_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * Vehicle Sensor REV SET Functions
+ *
+ * Update the REV data master
+ *
+ * @param[in] *pst_data : Pointer to the message data received by the direct line
+ *
+ * @return VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetRevlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstRev_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetRevl
+* ABSTRACT : Vehicle Sensor REV GET Functions
+* FUNCTION : Provide a REV data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetRevl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstRev_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetRevline
+* ABSTRACT : Vehicle Sensor REV GET Functions(For direct lines)
+* FUNCTION : Provide a REV data master(For direct lines)
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetRevline(VEHICLESENS_DATA_MASTER *pst_data) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstRev_l;
+
+ /* Store the data master in the specified destination. */
+ pst_data->ul_did = VEHICLE_DID_REV_LINE;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
+// LCOV_EXCL_STOP
+
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp
new file mode 100755
index 0000000..b8db26c
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp
@@ -0,0 +1,58 @@
+/*
+ * @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
+ * VehicleSens_Did_SettingTime.cpp
+ * @brief
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+
+/**
+ * @brief
+ * GPS setting time information data master GET process
+ *
+ * Provide the GPS setting time information data master
+ *
+ * @param[in] u_int8 uc_get_method : Acquisition method(NAVI)
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ *
+ * @return none
+ * @retval none
+ */
+void VehicleSensGetSettingTime(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in
+ case VEHICLESENS_GETMETHOD_OTHER:
+ {
+ /** Acquiring from Clock */
+ VehicleSensGetSettingTimeclock(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp
new file mode 100755
index 0000000..a415a84
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp
@@ -0,0 +1,116 @@
+/*
+ * @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
+ * VehicleSens_Did_SettingTime_clock.cpp
+ * @brief
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstSettingTime_clock; // NOLINT(readability/nolint)
+
+/**
+ * @brief
+ * GPS setting time information data master initialization process(NAVI information)
+ *
+ * Initialize the GPS setting time information data master
+ *
+ * @param[in] none
+ * @param[out] none
+ * @return none
+ * @retval none
+ */
+void VehicleSensInitSettingTimeclock(void) {
+ POS_DATETIME st_time;
+
+ memset(&gstSettingTime_clock, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstSettingTime_clock.ul_did = VEHICLE_DID_SETTINGTIME;
+
+ /** Data size setting */
+ gstSettingTime_clock.us_size = sizeof(POS_DATETIME);
+
+ /** Data content setting */
+ memset(&st_time, 0x00, sizeof(st_time));
+ memcpy(&gstSettingTime_clock.uc_data[0], &st_time, sizeof(st_time));
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS setting time information data master SET process(NAVI information)
+ *
+ * Update the GPS setting time information data master
+ *
+ * @param[in] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @param[out] none
+ * @return u_int8
+ * @retval VEHICLESENS_EQ : No data change
+ * @retval VEHICLESENS_NEQ : Data change
+ */
+u_int8 VehicleSensSetSettingTimeclock(const POS_DATETIME *pst_rcv_time) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSettingTime_clock;
+
+ /** Compare the data master and generated data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_rcv_time, sizeof(POS_DATETIME));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = VEHICLE_DID_SETTINGTIME;
+ pst_master->us_size = sizeof(POS_DATETIME);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_rcv_time, sizeof(POS_DATETIME));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * GPS setting time information data master GET process(NAVI information)
+ *
+ * Provide the GPS setting time information data master
+ *
+ * @param[in] none
+ * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination
+ * @return none
+ * @retval none
+ */
+void VehicleSensGetSettingTimeclock(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSettingTime_clock;
+
+ /** 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return;
+}
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp
new file mode 100755
index 0000000..6456125
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp
@@ -0,0 +1,90 @@
+/*
+ * @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_SnsCounter.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_SNS_COUNTER)
+ * Module configuration :VehicleSensGetSnsCounter() Vehicle sensor SNS_COUNTER GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSnsCounter
+* ABSTRACT : Vehicle sensor SNS_COUNTER GET function
+* FUNCTION : Provide the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSnsCounter(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSnsCounterl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetSnsCounterExt
+* ABSTRACT : Vehicle sensor SNS_COUNTER GET function
+* FUNCTION : Provide the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSnsCounterExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSnsCounterExtl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+#endif
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp
new file mode 100755
index 0000000..61b7a42
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp
@@ -0,0 +1,155 @@
+/*
+ * @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_SnsCounterExt_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SNS_COUNTER)
+ * Module configuration :VehicleSensInitSnsCounterl() Vehicle sensor SNS_COUNTER initialization function
+ * :VehicleSensSetSnsCounterl() Vehicle sensor SNS_COUNTER SET function
+ * :VehicleSensGetSnsCounterl() Vehicle sensor SNS_COUNTER GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Response */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstSnsCounterExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSnsCounterExtl
+* ABSTRACT : Vehicle sensor SNS_COUNTER initialization function
+* FUNCTION : SNS_COUNTER data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSnsCounterExtl(void) {
+ u_int16 *pus;
+
+ memset(&gstSnsCounterExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstSnsCounterExt_l.ul_did = POSHAL_DID_SNS_COUNTER;
+ gstSnsCounterExt_l.us_size = VEHICLE_DSIZE_SNS_COUNTER_EXT_INIT;
+ pus = reinterpret_cast<u_int16 *>(gstSnsCounterExt_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SNS_COUNTER, VEHICLE_DSIZE_SNS_COUNTER_EXT);
+
+ /* Initializing Initial Delivery Internal Information */
+ memset(&gstPkgTempExt, 0x00, sizeof(VEHICLESENS_PKG_DELIVERY_TEMP_EXT));
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSnsCounterExtl
+* ABSTRACT : Vehicle sensor SNS_COUNTER SET function
+* FUNCTION : Update the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetSnsCounterExtl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSnsCounterExtlG
+* ABSTRACT : Vehicle sensor SNS_COUNTER SET function
+* FUNCTION : Update the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetSnsCounterExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+
+ pst_master = &gstSnsCounterExt_l;
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[SNSCounter];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_data[us_start] = pst_data->uc_data[0];
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[SNSCounter] = us_start;
+
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_SNS_COUNTER_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + sizeof(u_int8));
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSnsCounterExtl
+* ABSTRACT : Vehicle sensor SNS_COUNTER GET function
+* FUNCTION : Provide the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSnsCounterExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstSnsCounterExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[SNSCounter];
+ }
+
+ /* Acquire data from the newest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[SNSCounter] + us_cnt < VEHICLE_DKEEP_MAX) {
+ pst_data->uc_data[us_cnt] = pst_master->uc_data[(gstPkgTempExt.start_point[SNSCounter] + us_cnt)];
+ } else {
+ pst_data->uc_data[us_cnt] = pst_master->uc_data[us_loop_cnt];
+ us_loop_cnt++;
+ }
+ } else {
+ pst_data->uc_data[us_cnt] = pst_master->uc_data[us_cnt];
+ }
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp
new file mode 100755
index 0000000..b81b4b3
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp
@@ -0,0 +1,124 @@
+/*
+ * @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_SnsCounter_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SNS_COUNTER)
+ * Module configuration :VehicleSensInitSnsCounterl() Vehicle sensor SNS_COUNTER initialization function
+ * :VehicleSensSetSnsCounterl() Vehicle sensor SNS_COUNTER SET function
+ * :VehicleSensGetSnsCounterl() Vehicle sensor SNS_COUNTER GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstSnsCounter_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSnsCounterl
+* ABSTRACT : Vehicle sensor SNS_COUNTER initialization function
+* FUNCTION : SNS_COUNTER data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSnsCounterl(void) {
+ memset(&gstSnsCounter_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstSnsCounter_l.ul_did = POSHAL_DID_SNS_COUNTER;
+ gstSnsCounter_l.us_size = VEHICLE_DSIZE_SNS_COUNTER;
+ gstSnsCounter_l.uc_data[0] = VEHICLE_DINIT_SNS_COUNTER;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSnsCounterl
+* ABSTRACT : Vehicle sensor SNS_COUNTER SET function
+* FUNCTION : Update the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSnsCounterl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSnsCounter_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSnsCounterlG
+* ABSTRACT : Vehicle sensor SNS_COUNTER SET function
+* FUNCTION : Update the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSnsCounterlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSnsCounter_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size);
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSnsCounterl
+* ABSTRACT : Vehicle sensor SNS_COUNTER GET function
+* FUNCTION : Provide the SNS_COUNTER data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSnsCounterl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSnsCounter_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp
new file mode 100755
index 0000000..4705774
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp
@@ -0,0 +1,57 @@
+/*
+ * @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_SpeedKmph.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_KMPH)
+ * Module configuration :VehicleSensGetSpeedKmph() Vehicle Sensor SPEED_KMPH GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedKmph
+* ABSTRACT : Vehicle Sensor SPEED_KMPH GET Function
+* FUNCTION : Provide the SPEED_KMPH data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(DIRECT or CAN or NAVI)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedKmph(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSpeedKmphl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp
new file mode 100755
index 0000000..abbb27a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp
@@ -0,0 +1,156 @@
+/*
+ * @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_SpeedKmph_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_KMPH)
+ * Module configuration :VehicleSensInitSpeedKmphl() Vehicle sensor SPEED_KMPH initialization function
+ * :VehicleSensSetSpeedKmphl() Vehicle sensor SPEED_KMPH SET function
+ * :VehicleSensGetSpeedKmphl() Vehicle Sensor SPEED_KMPH GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstSpeedKmph_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSpeedKmphl
+* ABSTRACT : Vehicle sensor SPEED_KMPH initialization function
+* FUNCTION : SPEED_KMPH data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSpeedKmphl(void) {
+ u_int16 *pus;
+
+ memset(&gstSpeedKmph_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+ gstSpeedKmph_l.ul_did = POSHAL_DID_SPEED_KMPH;
+ gstSpeedKmph_l.us_size = VEHICLE_DSIZE_SPEED_KMPH;
+
+ pus = reinterpret_cast<u_int16 *>(gstSpeedKmph_l.uc_data);
+ *pus = VEHICLE_DINIT_SPEED_KMPH;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedKmphl
+* ABSTRACT : Vehicle sensor SPEED_KMPH SET function
+* FUNCTION : Update the SPEED_KMPH data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedKmphl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8: dead code.
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedKmph_l;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data,
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return(uc_ret);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedKmphlG
+* ABSTRACT : Vehicle sensor SPEED_KMPH SET function
+* FUNCTION : Update the SPEED_KMPH data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedKmphlG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ static u_int16 pre_speed[2] = {0, 0};
+ u_int16 cur_speed = 0;
+ memcpy(&cur_speed, &pst_data->uc_data[0], sizeof(u_int16));
+
+ BOOL under2 = TRUE;
+ BOOL eq_speed = TRUE;
+
+ pst_master = &gstSpeedKmph_l;
+
+ /* Transition of 0->1km/h and 1->0km/h requires 3 consecutive matches. Compliance with driving regulations */
+ under2 = ((pre_speed[1] < 2) && (pre_speed[0] < 2) && (cur_speed < 2));
+ eq_speed = ((pre_speed[1] == pre_speed[0]) && (pre_speed[0] == cur_speed));
+
+ if ((under2 == TRUE) && (eq_speed != TRUE) && (pst_master->uc_rcvflag == VEHICLE_RCVFLAG_ON)) {
+ uc_ret = VEHICLESENS_EQ; /* Return without data change */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+
+ } else {
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data,
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ }
+
+ /* For the next comparison,Update Speed */
+ pre_speed[1] = pre_speed[0];
+ pre_speed[0] = cur_speed;
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedKmphl
+* ABSTRACT : Vehicle Sensor SPEED_KMPH GET Function
+* FUNCTION : Provide the SPEED_KMPH data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedKmphl(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedKmph_l;
+
+ /* 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;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp
new file mode 100755
index 0000000..3f4ec8a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp
@@ -0,0 +1,117 @@
+/*
+ * @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_SpeedPulse.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_)
+ * Module configuration :VehicleSensGetSpeedPulse() Vehicle sensor GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulse
+* ABSTRACT : Vehicle sensor GET function
+* FUNCTION : Provide a data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulse(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSpeedPulsel(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulseExt
+* ABSTRACT : Vehicle sensor GET function
+* FUNCTION : Provide a data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulseExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSpeedPulseExtl(pst_data);
+ break;
+ }
+ default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */
+ break;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulseFst
+* ABSTRACT : Vehicle sensor GET function
+* FUNCTION : Provide a data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulseFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ break; // LCOV_EXCL_LINE 8: dead code
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSpeedPulseFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
+
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp
new file mode 100755
index 0000000..86c8f49
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp
@@ -0,0 +1,150 @@
+/*
+ * @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_SpeedPulseExt_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE)
+ * Module configuration :VehicleSensInitSpeedPulseExtl() Vehicle sensor SPEED_PULSE initialization function
+ * :VehicleSensSetSpeedPulseExtlG() Vehicle Sensor SPEED_PULSE SET Function
+ * :VehicleSensGetSpeedPulseExtl() Vehicle Sensor SPEED_PULSE GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/* Ignore->MISRA-C++:2008 Rule 2-7-2 */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_EXT gstSpeedPulseExt_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSpeedPulseExtl
+* ABSTRACT : Vehicle sensor SPEED_PULSE initialization function
+* FUNCTION : SPEED_PULSE data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSpeedPulseExtl(void) {
+ u_int16 *pus;
+
+ memset(&gstSpeedPulseExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT));
+ gstSpeedPulseExt_l.ul_did = POSHAL_DID_SPEED_PULSE;
+ gstSpeedPulseExt_l.us_size = VEHICLE_DSIZE_SPEED_PULSE_EXT_INIT;
+
+ pus = reinterpret_cast<u_int16 *>(gstSpeedPulseExt_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SPEED_PULSE, VEHICLE_DSIZE_SPEED_PULSE_EXT);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulseExtlG
+* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function
+* FUNCTION : Update the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+void VehicleSensSetSpeedPulseExtlG(const LSDRV_LSDATA_G *pst_data) {
+ VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ u_int16 us_start = 0;
+ u_int16 us_size = 0;
+ u_int16 us_cnt = 0;
+
+ pst_master = &gstSpeedPulseExt_l;
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Retrieve the location where the received one is stored */
+ us_start = gstPkgTempExt.start_point[SpeedPulse];
+
+ /* Stored in data master(Order of reception)*/
+ if (us_start >= VEHICLE_DKEEP_MAX) {
+ /* Store the latest one at position 0 */
+ us_start = VEHICLE_DATA_POS_00;
+ /* If you are discarding old data,,Set a flag */
+ gstPkgTempExt.data_break = VEHICLE_SNS_BREAK;
+ }
+ pst_master->ul_did = pst_data->ul_did;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ for (us_cnt = 0; us_cnt < us_size; us_cnt++) {
+ pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]);
+ }
+
+ /* Update next storage start position and latest data storage position */
+ us_start++;
+ gstPkgTempExt.start_point[SpeedPulse] = us_start;
+ /* Update data master size */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Make the size of all extended data masters */
+ pst_master->us_size = VEHICLE_DSIZE_SPEED_PULSE_EXT;
+ } else {
+ /* Add the size of one received data item */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulseExtl
+* ABSTRACT : Vehicle Sensor SPEED_PULSE GET Function
+* FUNCTION : Provide the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulseExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) {
+ const VEHICLESENS_DATA_MASTER_EXT *pst_master;
+ uint16_t us_size = 0;
+ uint16_t us_data_cnt = 0; // Number of data contained
+ uint16_t us_loop_cnt = 0; // 64 over index
+
+ /* Store the data master in the specified destination. */
+ pst_master = &gstSpeedPulseExt_l;
+ pst_data->ul_did = pst_master->ul_did;
+ pst_data->us_size = pst_master->us_size;
+ pst_data->uc_rcvflag = pst_master->uc_rcvflag;
+
+ us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */
+
+ /* Checking whether the number of stored entries is looped */
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ us_data_cnt = VEHICLE_DKEEP_MAX;
+ } else {
+ us_data_cnt = gstPkgTempExt.start_point[SpeedPulse];
+ }
+
+ /* Acquire data from the newest data master */
+ for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) {
+ if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) {
+ /* Get information before loop */
+ if (gstPkgTempExt.start_point[SpeedPulse] + us_cnt < VEHICLE_DKEEP_MAX) {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[(gstPkgTempExt.start_point[SpeedPulse] + us_cnt) * us_size], us_size);
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_loop_cnt * us_size], us_size);
+ us_loop_cnt++;
+ }
+ } else {
+ memcpy(&pst_data->uc_data[us_cnt * us_size],
+ &pst_master->uc_data[us_cnt * us_size], us_size);
+ }
+ }
+}
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp
new file mode 100755
index 0000000..f6ab8df
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp
@@ -0,0 +1,133 @@
+/*
+ * @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 VehicleSens_Did_Nav_Clock_g.cpp
+@detail Master vehicle sensor data(POSHAL_DID_SPEED_PULSE_FLAG)
+*****************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstSpeedPulseFlag; // NOLINT(readability/nolint)
+
+/***************************************************************************
+@brief VehicleSensInitSpeedPulseFlag
+@outline SPEED_PULSE_FLAG initialization process data master
+@type Completion return type
+@param[in] none
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensInitSpeedPulseFlag(void) {
+ (void)memset(reinterpret_cast<void *>(&gstSpeedPulseFlag), 0, sizeof(VEHICLESENS_DATA_MASTER));
+ gstSpeedPulseFlag.ul_did = POSHAL_DID_SPEED_PULSE_FLAG;
+ gstSpeedPulseFlag.us_size = VEHICLE_DSIZE_SPEED_PULSE_FLAG;
+ gstSpeedPulseFlag.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/***************************************************************************
+@brief NAV-CLOCK SET vehicle sensor function
+@outline To update the master data NAV-CLOCK.
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data
+@threshold none
+@return u_int8
+@retval VEHICLESENS_EQ : No data changes
+@retval VEHICLESENS_NEQ : With data changes
+@trace
+*****************************************************************************/
+u_int8 VehicleSensSetSpeedPulseFlag(const LSDRV_LSDATA_G *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedPulseFlag;
+
+ /** 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/***************************************************************************
+@brief Vehicle sensor function NAV-CLOCK GET
+@outline Master Data provides the NAV-CLOCK
+@type Completion return type
+@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master
+@threshold none
+@return void
+@retval none
+@trace
+*****************************************************************************/
+void VehicleSensGetSpeedPulseFlag(VEHICLESENS_DATA_MASTER *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedPulseFlag;
+
+ /** 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulseFlagFst
+* ABSTRACT : Vehicle sensor GET function
+* FUNCTION : Provide a data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* uc_get_method : Acquisition method(Direct Line or CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulseFlagFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_CAN:
+ {
+ /* When acquiring from CAN data */
+ break;
+ }
+ case VEHICLESENS_GETMETHOD_LINE:
+ {
+ /* To acquire from LineSensor */
+ VehicleSensGetSpeedPulseFlagFstl(pst_data);
+ break;
+ }
+ default:
+ break;
+ }
+}
+#endif
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp
new file mode 100755
index 0000000..051c6bb
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp
@@ -0,0 +1,91 @@
+/*
+ * @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_SpeedPulseFlagFst_l.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE_FLAG_FST)
+ * Module configuration :VehicleSensInitSpeedPulseFlagFstl() Vehicle sensor SPEED_PULSE_FLAG initialization function
+ * :VehicleSensSetSpeedPulseFlagFstl() Vehicle Sensor SPEED_PULSE_FLAG SET Function
+ * :VehicleSensSetSpeedPulseFlagFstG() Vehicle Sensor SPEED_PULSE_FLAG SET Function
+ * :VehicleSensGetSpeedPulseFlagFstl() Vehicle Sensor SPEED_PULSE_FLAG GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/* #Polaris_003 START */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Response */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSpeedPulseFlagFstl
+* ABSTRACT : Vehicle sensor SPEED_PULSE_FLAG initialization function
+* FUNCTION : SPEED_PULSE_FLAG data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSpeedPulseFlagFstl(void) {
+ return;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulseFlagFstl
+* ABSTRACT : Vehicle Sensor SPEED_PULSE_FLAG SET Function
+* FUNCTION : Update the SPEED_PULSE_FLAG data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedPulseFlagFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(VEHICLESENS_EQ);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulseFlagFstG
+* ABSTRACT : Vehicle Sensor SPEED_PULSE_FLAG SET Function
+* FUNCTION : Update the SPEED_PULSE_FLAG data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedPulseFlagFstG(const LSDRV_LSDATA_FST_SPEED_PULSE_FLAG *pst_data) {
+ return VEHICLESENS_EQ;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulseFlagFstl
+* ABSTRACT : Vehicle Sensor SPEED_PULSE_FLAG GET Function
+* FUNCTION : Provide the SPEED_PULSE_FLAG data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulseFlagFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return;
+}
+
+#endif
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp
new file mode 100755
index 0000000..26952b3
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp
@@ -0,0 +1,172 @@
+/*
+ * @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_SpeedPulseFst_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE_FST)
+ * Module configuration :VehicleSensInitSpeedPulseFstl() Vehicle sensor SPEED_PULSE initialization function
+ * :VehicleSensSetSpeedPulseFstl() Vehicle Sensor SPEED_PULSE SET Function
+ * :VehicleSensSetSpeedPulseFstG() Vehicle Sensor SPEED_PULSE SET Function
+ * :VehicleSensGetSpeedPulseFstl() Vehicle Sensor SPEED_PULSE GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_FST gstSpeedPulseFst_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSpeedPulseFstl
+* ABSTRACT : Vehicle sensor SPEED_PULSE initialization function
+* FUNCTION : SPEED_PULSE data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSpeedPulseFstl(void) {
+ u_int16 *pus;
+
+ memset(&gstSpeedPulseFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST));
+ gstSpeedPulseFst_l.ul_did = POSHAL_DID_SPEED_PULSE_FST;
+ gstSpeedPulseFst_l.us_size = 0;
+ gstSpeedPulseFst_l.partition_flg = 0;
+ pus = reinterpret_cast<u_int16 *>(gstSpeedPulseFst_l.uc_data);
+ memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SPEED_PULSE, VEHICLE_DSIZE_SPEED_PULSE_FST);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulseFstl
+* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function
+* FUNCTION : Update the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedPulseFstl(const LSDRV_LSDATA_FST *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstSpeedPulseFst_l;
+
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulseFstG
+* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function
+* FUNCTION : Update the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedPulseFstG(const LSDRV_LSDATA_FST_SPEED *pst_data) {
+ static u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ u_int8 partition_max; /* Total number of partitions */
+ u_int8 partition_num; /* Data number */
+
+ pst_master = &gstSpeedPulseFst_l;
+
+ partition_max = pst_data->uc_partition_max;
+ partition_num = pst_data->uc_partition_num;
+
+ if (partition_max == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 0;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else if (partition_max == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ if (partition_num == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ 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;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->partition_flg = 1;
+ memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else if (partition_num == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ /* Compare data master and received data */
+ if (uc_ret == VEHICLESENS_EQ) {
+ uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_SPEED_PULSE_FST],
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ }
+
+ /* Received data is set in the data master. */
+ pst_master->ul_did = pst_data->ul_did;
+ /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->partition_flg = 1;
+ memcpy(&pst_master->uc_data[VEHICLE_DSIZE_SPEED_PULSE_FST],
+ pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+ } else {}
+ } else {}
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulseFstl
+* ABSTRACT : Vehicle Sensor SPEED_PULSE GET Function
+* FUNCTION : Provide the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulseFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) {
+ const VEHICLESENS_DATA_MASTER_FST *pst_master;
+
+ pst_master = &gstSpeedPulseFst_l;
+
+ /* 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;
+ pst_data->partition_flg = pst_master->partition_flg;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */
+}
+
+#endif
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp
new file mode 100755
index 0000000..a3ebc01
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp
@@ -0,0 +1,128 @@
+/*
+ * @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_SpeedPulse_l.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE)
+ * Module configuration :VehicleSensInitSpeedPulsel() Vehicle sensor SPEED_PULSE initialization function
+ * :VehicleSensSetSpeedPulsel() Vehicle Sensor SPEED_PULSE SET Function
+ * :VehicleSensGetSpeedPulsel() Vehicle Sensor SPEED_PULSE GET Function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER gstSpeedPulse_l; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSpeedPulsel
+* ABSTRACT : Vehicle sensor SPEED_PULSE initialization function
+* FUNCTION : SPEED_PULSE data master initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSpeedPulsel(void) {
+ (void)memset(reinterpret_cast<void *>(&gstSpeedPulse_l), 0, sizeof(VEHICLESENS_DATA_MASTER));
+ gstSpeedPulse_l.ul_did = POSHAL_DID_SPEED_PULSE;
+ gstSpeedPulse_l.us_size = VEHICLE_DSIZE_SPEED_PULSE;
+ gstSpeedPulse_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulsel
+* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function
+* FUNCTION : Update the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedPulsel(const LSDRV_LSDATA *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedPulse_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSpeedPulselG
+* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function
+* FUNCTION : Update the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the message data received by the direct line
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSpeedPulselG(const LSDRV_LSDATA_G *pst_data) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedPulse_l;
+
+ /* 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 = pst_data->uc_size;
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ pst_master->uc_snscnt = pst_data->uc_sns_cnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data),
+ (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size));
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSpeedPulsel
+* ABSTRACT : Vehicle Sensor SPEED_PULSE GET Function
+* FUNCTION : Provide the SPEED_PULSE data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetSpeedPulsel(VEHICLESENS_DATA_MASTER *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstSpeedPulse_l;
+
+ /* 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;
+ pst_data->uc_snscnt = pst_master->uc_snscnt;
+ (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data),
+ (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size));
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp
new file mode 100755
index 0000000..e1400f2
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp
@@ -0,0 +1,132 @@
+/*
+ * @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_SysGpsInterruptSignal.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor data master(VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL)
+ * Module configuration :VehicleSensInitSysGpsInterruptSignal() Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL initialization function
+ * :VehicleSensSetSysGpsInterruptSignal() Vehicle Sensor Sys_GPS_INTERRUPT_SIGNAL SET Function
+ * :VehicleSensGetSysGpsInterruptSignal() Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL GET function
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+#define VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY 0
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL gstSysGpsInterruptSignal; // NOLINT(readability/nolint)
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSysGpsInterruptSignal
+* ABSTRACT : Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL initialization function
+* FUNCTION : Sys_GPS_INTERRUPT_SIGNAL data master initialization processing
+* ARGUMENT : None
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void VehicleSensInitSysGpsInterruptSignal(void) {
+ (void)memset(reinterpret_cast<void *>(&(gstSysGpsInterruptSignal)), static_cast<int>(0x00),
+ sizeof(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL));
+ gstSysGpsInterruptSignal.ul_did = VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL;
+ gstSysGpsInterruptSignal.us_size = VEHICLE_DSIZE_SYS_GPS_INTERRUPT_SIGNAL;
+ gstSysGpsInterruptSignal.uc_data = VEHICLE_DINIT_SYS_GPS_INTERRUPT_SIGNAL;
+
+#if VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstSysGpsInterruptSignal.uc_data == 0x%x\r\n", gstSysGpsInterruptSignal.uc_data);
+#endif
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSysGpsInterruptSignal
+* ABSTRACT : Vehicle sensor SYS_GPS_INTERRUPT_SIGNAL SET function
+* FUNCTION : Update the Sys_GPS_INTERRUPT_SIGNAL data master
+* ARGUMENT : *pst_data : Pointer to received message data
+* NOTE :
+* RETURN : VEHICLESENS_EQ : No data change
+* VEHICLESENS_NEQ : Data change
+******************************************************************************/
+u_int8 VehicleSensSetSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int8 uc_ret = VEHICLESENS_EQ;
+ VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstSysGpsInterruptSignal;
+
+ /* Compare data master and received data */
+ uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), (size_t)(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;
+ (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)),
+ (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data));
+
+#if VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] pst_data->ul_did == 0x%x", pst_data->ul_did);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstSysGpsInterruptSignal.ul_did == 0x%x\r\n", gstSysGpsInterruptSignal.ul_did);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] (u_int8)pst_data->ucSize == 0x%x", (u_int8)pst_data->uc_size);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstSysGpsInterruptSignal.us_size == 0x%x\r\n", gstSysGpsInterruptSignal.us_size);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] pst_data->uc_data == 0x%x", pst_data->uc_data);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "#[FACTORY] gstSysGpsInterruptSignal.uc_data == 0x%x\r\n", gstSysGpsInterruptSignal.uc_data);
+#endif
+ }
+
+ return(uc_ret);
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSysGpsInterruptSignal
+* ABSTRACT : Vehicle sensor SYS_GPS_INTERRUPT_SIGNAL GET function
+* FUNCTION : Provide the SYS_GPS_INTERRUPT_SIGNAL data master
+* ARGUMENT : *pst_data : Pointer to the data master acquisition destination
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void VehicleSensGetSysGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ const VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master;
+
+ if (pst_data == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n");
+ } else {
+ pst_master = &gstSysGpsInterruptSignal;
+
+ /* 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<void *>(&(pst_data->uc_data)),
+ (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data));
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp
new file mode 100755
index 0000000..e98d364
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp
@@ -0,0 +1,51 @@
+/*
+ * @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
+ * VehicleSens_Did_WknRollover.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS Rollover Standard Week Number Data Master GET Processing
+ *
+ * @param[out] VEHICLESENS_DATA_MASTER*
+ * @param[in] u_int8
+ */
+void VehicleSensGetWknRollover(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) {
+ switch (uc_get_method) {
+ case VEHICLESENS_GETMETHOD_GPS:
+ {
+ /** To acquire from GPS */
+ VehicleSensGetWknRolloverG(pst_data);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp
new file mode 100755
index 0000000..4a5defe
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp
@@ -0,0 +1,102 @@
+/*
+ * @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
+ * VehicleSens_Did_WknRollover_g.cpp
+ * @brief
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_DataMaster.h"
+
+/*---------------------------------------------------------------------------------*
+ * Global Value *
+ *---------------------------------------------------------------------------------*/
+static VEHICLESENS_DATA_MASTER gstWknRollover_g; // NOLINT(readability/nolint)
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * GPS rollover standard week number data master initialization processing
+ */
+void VehicleSensInitWknRolloverG(void) {
+ SENSOR_WKNROLLOVER st_wkn_rollover;
+
+ memset(&gstWknRollover_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER));
+
+ /** Data ID setting */
+ gstWknRollover_g.ul_did = POSHAL_DID_GPS_WKNROLLOVER;
+ /** Data size setting */
+ gstWknRollover_g.us_size = sizeof(SENSOR_WKNROLLOVER);
+ /** Data content setting */
+ memset(&st_wkn_rollover, 0x00, sizeof(st_wkn_rollover));
+ memcpy(&gstWknRollover_g.uc_data[0], &st_wkn_rollover, sizeof(st_wkn_rollover));
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS Rollover Standard Week Number Data Master SET Process
+ *
+ * @param[in] SENSOR_WKNROLLOVER*
+ *
+ * @return u_int8
+ */
+u_int8 VehicleSensSetWknRolloverG(const SENSOR_WKNROLLOVER *pst_wkn_rollover) {
+ u_int8 uc_ret;
+ VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstWknRollover_g;
+
+ /** With the contents of the current data master,Compare received data */
+ uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_wkn_rollover, sizeof(SENSOR_WKNROLLOVER));
+
+ /** Received data is set in the data master. */
+ pst_master->ul_did = POSHAL_DID_GPS_WKNROLLOVER;
+ pst_master->us_size = sizeof(SENSOR_WKNROLLOVER);
+ pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON;
+ memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data));
+ memcpy(pst_master->uc_data, pst_wkn_rollover, sizeof(SENSOR_WKNROLLOVER));
+
+ return(uc_ret);
+}
+
+/**
+ * @brief
+ * GPS Rollover Standard Week Number Data Master GET Processing
+ *
+ * @param[out] SENSOR_MSG_GPSDATA_DAT*
+ */
+void VehicleSensGetWknRolloverG(SENSOR_MSG_GPSDATA_DAT *pst_data) {
+ const VEHICLESENS_DATA_MASTER *pst_master;
+
+ pst_master = &gstWknRollover_g;
+
+ /* 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_rcv_flag = pst_master->uc_rcvflag;
+ memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp
new file mode 100755
index 0000000..99f2dc3
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp
@@ -0,0 +1,319 @@
+/*
+ * @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_FromAccess.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Functions for accessing vehicle sensor FROM
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_FromAccess.h"
+#include "ClockDataMng.h"
+
+/********************************************************************************
+ * Global variable *
+ ********************************************************************************/
+
+/********************************************************************************
+ * prototype declalation *
+ ********************************************************************************/
+static RET_API VehicleSensReadNV(NV_DATA_VEHICLESENS *p_nv_data);
+
+/********************************************************************************
+ * Definition *
+ ********************************************************************************/
+#define VEHICLESENS_FROM_ACCESS_DEBUG 0
+
+/*******************************************************************************
+* MODULE : VehicleSensFromAccessInitialize
+* ABSTRACT : Initializing process
+* FUNCTION :
+* ARGUMENT : None
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void VehicleSensFromAccessInitialize(void) {
+ /* The result of tag registration for non-volatile memory access is stored in g_nv_access_available, so no confirmation is required. */
+ (void)VehicleSensRegistNvTag();
+
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensRegistNvTag
+* ABSTRACT : Tag registration process
+* FUNCTION : Registering Tag Name to Identify Data Storage Destination
+* ARGUMENT : None
+* NOTE :
+* RETURN : RET_NORMAL :Successful registration
+* : RET_ERROR :Registration failure
+******************************************************************************/
+RET_API VehicleSensRegistNvTag(void) {
+ RET_API lret = RET_NORMAL;
+ return lret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensReadNV
+* ABSTRACT : Get local time Lonlat
+* FUNCTION : Reading local time Lonlat from non-volatile memory
+* ARGUMENT : NV_DATA_VEHICLESENS * p_nv_data : Pointer to data acquired from non-volatile memory
+* NOTE : None
+* RETURN : RET_NORMAL :Read success
+* : RET_ERROR :Failed to read
+******************************************************************************/
+static RET_API VehicleSensReadNV(NV_DATA_VEHICLESENS * p_nv_data) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API lret = RET_NORMAL;
+ FILE *fp;
+ NV_DATA_VEHICLESENS nv_data_tmp;
+ BOOL ret_read = FALSE;
+ BOOL ret_read2 = FALSE;
+
+ u_int32 loop;
+ u_int8 CK_A = 0;
+ u_int8 CK_B = 0;
+ u_int8 *ptr;
+
+ fp = fopen(NV_FILE_VEHICLESENS_TEMP, "rb");
+
+ /* Read File1 */
+ if (fp != NULL) {
+ if ((fread(reinterpret_cast<void *>(p_nv_data), sizeof(u_int8), sizeof(NV_DATA_VEHICLESENS), fp)) == \
+ sizeof(NV_DATA_VEHICLESENS)) {
+ /* Checksum processing */
+ ptr = reinterpret_cast<u_int8 *>(p_nv_data); /* #QAC confirmation Rule11.4 1Byte accesses for checksums */
+ CK_A = 0;
+ CK_B = 0;
+
+ /* The 2Byte portion from the end of the checksum data is excluded because the checksum storage area. */
+ for (loop = 0; loop < (sizeof(NV_DATA_VEHICLESENS) - 2); loop++) {
+ CK_A = static_cast<u_int8>(CK_A + ptr[loop]);
+ CK_B = static_cast<u_int8>(CK_B + CK_A);
+ }
+
+
+ if ((p_nv_data->cka == CK_A) && (p_nv_data->ckb == CK_B)) {
+ ret_read = TRUE;
+
+#if VEHICLESENS_FROM_ACCESS_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read, status, year, month, day, hour, min, sec, lat, lon, "\
+ "timediff, update_counter, cka, ckb ");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d ",
+ p_nv_data->localtime.status,
+ p_nv_data->localtime.year,
+ p_nv_data->localtime.month,
+ p_nv_data->localtime.day,
+ p_nv_data->localtime.hour,
+ p_nv_data->localtime.min,
+ p_nv_data->localtime.sec,
+ p_nv_data->lonlat.latitude,
+ p_nv_data->lonlat.longitude,
+ p_nv_data->timediff,
+ p_nv_data->update_counter,
+ p_nv_data->cka,
+ p_nv_data->ckb);
+#endif /* VEHICLESENS_FROM_ACCESS_DEBUG */
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Checksum1 failed.");
+ ret_read = FALSE;
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fread1 failed.");
+ }
+ fclose(fp);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fopen1 failed.");
+ }
+
+ /* Read File2 */
+ fp = fopen(NV_FILE_VEHICLESENS2_TEMP, "rb");
+
+ if (fp != NULL) {
+ if ((fread(reinterpret_cast<void *>(&nv_data_tmp), sizeof(u_int8), sizeof(NV_DATA_VEHICLESENS), fp)) == \
+ sizeof(NV_DATA_VEHICLESENS)) {
+ /* Checksum processing */
+ ptr = reinterpret_cast<u_int8 *>(&nv_data_tmp); /* #QAC confirmation Rule11.4 1Byte accesses for checksums */
+ CK_A = 0;
+ CK_B = 0;
+
+ /* The 2Byte portion from the end of the checksum data is excluded because the checksum storage area. */
+ for (loop = 0; loop < (sizeof(NV_DATA_VEHICLESENS) - 2); loop++) {
+ CK_A = static_cast<u_int8>(CK_A + ptr[loop]);
+ CK_B = static_cast<u_int8>(CK_B + CK_A);
+ }
+
+
+ if ((nv_data_tmp.cka == CK_A) && (nv_data_tmp.ckb == CK_B)) {
+ ret_read2 = TRUE;
+
+#if VEHICLESENS_FROM_ACCESS_DEBUG
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read2, status, year, month, day, hour, min, sec, lat, lon, "\
+ "timediff, update_counter, cka, ckb ");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read2, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d ",
+ nv_data_tmp.localtime.status,
+ nv_data_tmp.localtime.year,
+ nv_data_tmp.localtime.month,
+ nv_data_tmp.localtime.day,
+ nv_data_tmp.localtime.hour,
+ nv_data_tmp.localtime.min,
+ nv_data_tmp.localtime.sec,
+ nv_data_tmp.lonlat.latitude,
+ nv_data_tmp.lonlat.longitude,
+ nv_data_tmp.timediff,
+ nv_data_tmp.update_counter,
+ nv_data_tmp.cka,
+ nv_data_tmp.ckb);
+#endif /* VEHICLESENS_FROM_ACCESS_DEBUG */
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Checksum2 failed.");
+ ret_read2 = FALSE;
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fread2 failed.");
+ }
+ fclose(fp);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fopen2 failed.");
+ }
+
+
+ /* Check the read results of File 1 and File 2. */
+ if ((ret_read == TRUE) && (ret_read2 == TRUE)) {
+ /* Whether File 1 or File 2 is the most recent file,Check with the update count counter */
+ if (p_nv_data->update_counter < nv_data_tmp.update_counter) {
+ (void)memcpy(reinterpret_cast<void *>(p_nv_data), reinterpret_cast<void *>(&nv_data_tmp), \
+ sizeof(NV_DATA_VEHICLESENS));
+ }
+ lret = RET_NORMAL;
+ } else if (ret_read == TRUE) {
+ /* Use file 1 */
+ lret = RET_NORMAL;
+ } else if (ret_read2 == TRUE) {
+ /* Use file 2 */
+ (void)memcpy(reinterpret_cast<void *>(p_nv_data), reinterpret_cast<void *>(&nv_data_tmp), \
+ sizeof(NV_DATA_VEHICLESENS));
+ lret = RET_NORMAL;
+ } else {
+ /* Read failed for both file 1 and file 2 */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fread failed.");
+ lret = RET_ERROR;
+ }
+
+ return lret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensReadNVLocalTime
+* ABSTRACT : Local time acquisition at shutdown
+* FUNCTION : Read local time at shutdown from non-volatile memory
+* ARGUMENT : LOCALTIME * local_time : Local time at shutdown
+* NOTE : None
+* RETURN : RET_NORMAL :Successful acquisition
+* : RET_ERROR :Failed to acquire
+******************************************************************************/
+RET_API VehicleSensReadNVLocalTime(LOCALTIME * local_time) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API lret;
+ NV_DATA_VEHICLESENS nv_data;
+
+ lret = VehicleSensReadNV(&nv_data);
+
+ if (lret == RET_NORMAL) {
+ (void)memcpy(reinterpret_cast<void *>(local_time), (const void *)(&nv_data.localtime), sizeof(LOCALTIME));
+ }
+
+ return lret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensReadNVLonLat
+* ABSTRACT : Obtain position at shutdown
+* FUNCTION : Read the shutdown position from the non-volatile memory
+* ARGUMENT : LONLAT * lonlat : Shutdown position
+* NOTE : None
+* RETURN : RET_NORMAL :Successful acquisition
+* : RET_ERROR :Failed to acquire
+******************************************************************************/
+RET_API VehicleSensReadNVLonLat(LONLAT * lonlat) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API lret;
+ NV_DATA_VEHICLESENS nv_data;
+
+ lret = VehicleSensReadNV(&nv_data);
+
+ if (lret == RET_NORMAL) {
+ (void)memcpy(reinterpret_cast<void *>(lonlat), (const void *)(&nv_data.lonlat), sizeof(LONLAT));
+ }
+
+ return lret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensReadNVTimeDiff
+* ABSTRACT : Shutdown time difference acquisition
+* FUNCTION : Reading the shutdown time difference from the non-volatile memory
+* ARGUMENT : int32 * time_diff : Shutdown position
+* NOTE : None
+* RETURN : RET_NORMAL :Successful acquisition
+* : RET_ERROR :Failed to acquire
+******************************************************************************/
+RET_API VehicleSensReadNVTimeDiff(int32 * time_diff) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API lret;
+ NV_DATA_VEHICLESENS nv_data;
+
+ lret = VehicleSensReadNV(&nv_data);
+
+ if (lret == RET_NORMAL) {
+ *time_diff = nv_data.timediff;
+ }
+
+ return lret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensStoreLonlat
+* ABSTRACT : Store location data in non-volatile memory
+* FUNCTION :
+* ARGUMENT : LONLAT * plonlat : Position data
+* NOTE :
+* RETURN : None
+******************************************************************************/
+void VehicleSensStoreLonlat(LONLAT * plonlat) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+
+ return;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteNVLocaltime
+* ABSTRACT : Local Time Write
+* FUNCTION : Write local time
+* ARGUMENT : LOCALTIME * local_time : Local time
+* NOTE :
+* RETURN : RET_NORMAL :Successful write
+* : RET_ERROR :Writing failure
+******************************************************************************/
+RET_API VehicleSensWriteNVLocaltime(LOCALTIME * local_time, int32 * time_diff) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API lret = RET_NORMAL;
+
+ return lret;
+}
+
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp
new file mode 100755
index 0000000..4172b1e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp
@@ -0,0 +1,466 @@
+/*
+ * @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_SelectionItemList.cpp
+ * System name :_CWORD107_
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle Sensor Selection Item List
+ * Module configuration :VehicleSensInitSelectionItemList() Vehicle sensor selection item list initialization function
+ * :VehicleSensGetSelectionItemList() Vehicle sensor selection item list acquisition method GET function
+ * :VehicleSensGetSelectionItemListCanId() Vehicle Sensor Selection Items List CANID GET Functions
+ * :VehicleSensSetSelectionItemListCanId() Vehicle Sensor Selection Items List CANID SET Functions
+ * :VehicleSensCommWatchTblInit() Disruption monitoring data management table initialization function
+ * :VehicleSensCommWatchTblSave() Disruption monitoring data management table storage function
+ * :VehicleSensCommWatchTblRun() Disruption monitoring data management table execution function
+ ******************************************************************************/
+
+#include <positioning_hal.h>
+#include <vehicle_service/positioning_base_library.h>
+
+#include "VehicleSens_SelectionItemList.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLESENS_SELECTION_ITEM_LIST g_st_selection_itemlist[VEHICLESENS_SELECTION_ITEM_LIST_LEN];
+static VEHICLE_COMM_WATCH_TBL g_st_comm_watchtbl[VEHICLE_COMM_WATCHTBL_DID_NUM];
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSelectionItemList
+* ABSTRACT : Vehicle sensor selection item list initialization function
+* FUNCTION : Vehicle Sensor Selection Item List Initialization Process
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensInitSelectionItemList(void) {
+ u_int8 uc_get_method;
+
+ VehicleSensCommWatchTblInit();
+
+ /* Setting Acquisition Method (CAN/ Direct Line) for DataID in Vehicle Sensor Selection Item List.
+ BackDoor, Adim, Rev sets the CAN/ direct line obtained from the FROM
+ */
+ memset(&g_st_selection_itemlist, 0x00, sizeof(g_st_selection_itemlist));
+
+ g_st_selection_itemlist[0].ul_did = VEHICLE_DID_HV;
+ g_st_selection_itemlist[0].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[0].uc_get_method = VEHICLESENS_GETMETHOD_CAN;
+ g_st_selection_itemlist[1].ul_did = VEHICLE_DID_VB;
+ g_st_selection_itemlist[1].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[2].ul_did = VEHICLE_DID_IG;
+ g_st_selection_itemlist[2].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[3].ul_did = VEHICLE_DID_MIC;
+ g_st_selection_itemlist[3].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[4].ul_did = VEHICLE_DID_ILL;
+ g_st_selection_itemlist[4].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[5].ul_did = VEHICLE_DID_RHEOSTAT;
+ g_st_selection_itemlist[5].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[6].ul_did = VEHICLE_DID_SYSTEMP;
+ g_st_selection_itemlist[6].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[7].ul_did = POSHAL_DID_SPEED_PULSE;
+ g_st_selection_itemlist[7].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[8].ul_did = POSHAL_DID_SPEED_KMPH;
+ g_st_selection_itemlist[8].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[9].ul_did = POSHAL_DID_GYRO_X;
+ g_st_selection_itemlist[9].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[10].ul_did = POSHAL_DID_GYRO_Y;
+ g_st_selection_itemlist[10].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[11].ul_did = POSHAL_DID_GYRO_Z;
+ g_st_selection_itemlist[11].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[12].ul_did = POSHAL_DID_GSNS_X;
+ g_st_selection_itemlist[12].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[13].ul_did = POSHAL_DID_GSNS_Y;
+ g_st_selection_itemlist[13].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[14].ul_did = POSHAL_DID_GSNS_Z;
+ g_st_selection_itemlist[14].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[15].ul_did = VEHICLE_DID_REV;
+ g_st_selection_itemlist[15].ul_canid = VEHICLESENS_INVALID;
+ uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[15].uc_get_method = uc_get_method;
+ g_st_selection_itemlist[16].ul_did = POSHAL_DID_GPS_ANTENNA;
+ g_st_selection_itemlist[16].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[17].ul_did = POSHAL_DID_SNS_COUNTER;
+ g_st_selection_itemlist[17].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[18].ul_did = VEHICLE_DID_GPS_COUNTER;
+ g_st_selection_itemlist[18].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[19].ul_did = POSHAL_DID_GPS_VERSION;
+ g_st_selection_itemlist[19].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[20].ul_did = VEHICLE_DID_LOCATION;
+ g_st_selection_itemlist[20].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[21].ul_did = VEHICLE_DID_REV_LINE;
+ g_st_selection_itemlist[21].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[22].ul_did = VEHICLE_DID_REV_CAN;
+ g_st_selection_itemlist[22].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[22].uc_get_method = VEHICLESENS_GETMETHOD_CAN;
+ /* ++ GPS _CWORD82_ support */
+ g_st_selection_itemlist[23].ul_did = POSHAL_DID_GPS__CWORD82___CWORD44_GP4;
+ g_st_selection_itemlist[23].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[24].ul_did = VEHICLE_DID_GPS__CWORD82__NMEA;
+ g_st_selection_itemlist[24].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[25].ul_did = POSHAL_DID_GPS__CWORD82__FULLBINARY;
+ g_st_selection_itemlist[25].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ /* -- GPS _CWORD82_ support */
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Response */
+ g_st_selection_itemlist[26].ul_did = POSHAL_DID_GYRO_EXT;
+ g_st_selection_itemlist[26].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[27].ul_did = POSHAL_DID_SPEED_PULSE_FST;
+ g_st_selection_itemlist[27].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[28].ul_did = POSHAL_DID_GYRO_X_FST;
+ g_st_selection_itemlist[28].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[29].ul_did = POSHAL_DID_GYRO_Y_FST;
+ g_st_selection_itemlist[29].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[30].ul_did = POSHAL_DID_GYRO_Z_FST;
+ g_st_selection_itemlist[30].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[31].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_POSLLH;
+ g_st_selection_itemlist[31].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[32].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_STATUS;
+ g_st_selection_itemlist[32].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[33].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC;
+ g_st_selection_itemlist[33].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[34].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_VELNED;
+ g_st_selection_itemlist[34].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[35].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_DOP;
+ g_st_selection_itemlist[35].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[36].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS;
+ g_st_selection_itemlist[36].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[37].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_SVINFO;
+ g_st_selection_itemlist[37].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[38].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_CLOCK;
+ g_st_selection_itemlist[38].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[39].ul_did = VEHICLE_DID_GPS_UBLOX_MON_HW;
+ g_st_selection_itemlist[39].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[40].ul_did = POSHAL_DID_SPEED_PULSE_FLAG;
+ g_st_selection_itemlist[40].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[41].ul_did = VEHICLE_DID_GYRO_TROUBLE;
+ g_st_selection_itemlist[41].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[41].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[42].ul_did = VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL;
+ g_st_selection_itemlist[42].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[42].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[43].ul_did = VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL;
+ g_st_selection_itemlist[43].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[43].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[44].ul_did = VEHICLE_DID_GYRO_CONNECT_STATUS;
+ g_st_selection_itemlist[44].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[44].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[45].ul_did = POSHAL_DID_SPEED_PULSE_FLAG_FST;
+ g_st_selection_itemlist[45].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[46].ul_did = POSHAL_DID_REV_FST;
+ g_st_selection_itemlist[46].ul_canid = VEHICLESENS_INVALID;
+ uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[46].uc_get_method = uc_get_method;
+ g_st_selection_itemlist[47].ul_did = POSHAL_DID_GPS_NMEA;
+ g_st_selection_itemlist[47].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[48].ul_did = POSHAL_DID_GPS_TIME;
+ g_st_selection_itemlist[48].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[48].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[49].ul_did = VEHICLE_DID_NAVIINFO_DIAG_GPS;
+ g_st_selection_itemlist[49].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[49].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[50].ul_did = POSHAL_DID_GYRO_TEMP;
+ g_st_selection_itemlist[50].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[50].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[51].ul_did = POSHAL_DID_GYRO_TEMP_FST;
+ g_st_selection_itemlist[51].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[51].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[52].ul_did = POSHAL_DID_GSNS_X_FST;
+ g_st_selection_itemlist[52].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[52].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[53].ul_did = POSHAL_DID_GSNS_Y_FST;
+ g_st_selection_itemlist[53].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[53].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[54].ul_did = POSHAL_DID_GSNS_Z_FST;
+ g_st_selection_itemlist[54].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[54].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[55].ul_did = VEHICLE_DID_LOCATION_LONLAT;
+ g_st_selection_itemlist[55].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[55].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[56].ul_did = VEHICLE_DID_LOCATION_ALTITUDE;
+ g_st_selection_itemlist[56].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[56].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[57].ul_did = VEHICLE_DID_MOTION_HEADING;
+ g_st_selection_itemlist[57].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[57].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[58].ul_did = VEHICLE_DID_LOCATION_LONLAT_NAVI;
+ g_st_selection_itemlist[58].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[58].uc_get_method = VEHICLESENS_GETMETHOD_NAVI;
+ g_st_selection_itemlist[59].ul_did = VEHICLE_DID_LOCATION_ALTITUDE_NAVI;
+ g_st_selection_itemlist[59].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[59].uc_get_method = VEHICLESENS_GETMETHOD_NAVI;
+ g_st_selection_itemlist[60].ul_did = VEHICLE_DID_MOTION_HEADING_NAVI;
+ g_st_selection_itemlist[60].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[60].uc_get_method = VEHICLESENS_GETMETHOD_NAVI;
+ g_st_selection_itemlist[61].ul_did = VEHICLE_DID_SETTINGTIME;
+ g_st_selection_itemlist[61].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[61].uc_get_method = VEHICLESENS_GETMETHOD_OTHER;
+ g_st_selection_itemlist[62].ul_did = VEHICLE_DID_MOTION_SPEED;
+ g_st_selection_itemlist[62].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[62].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[63].ul_did = VEHICLE_DID_MOTION_SPEED_NAVI;
+ g_st_selection_itemlist[63].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[63].uc_get_method = VEHICLESENS_GETMETHOD_NAVI;
+ g_st_selection_itemlist[64].ul_did = VEHICLE_DID_MOTION_SPEED_INTERNAL;
+ g_st_selection_itemlist[64].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[64].uc_get_method = VEHICLESENS_GETMETHOD_INTERNAL;
+ g_st_selection_itemlist[65].ul_did = POSHAL_DID_PULSE_TIME;
+ g_st_selection_itemlist[65].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[65].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[66].ul_did = POSHAL_DID_GPS_TIME_RAW;
+ g_st_selection_itemlist[66].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[66].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[67].ul_did = POSHAL_DID_GPS_WKNROLLOVER;
+ g_st_selection_itemlist[67].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[67].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[68].ul_did = POSHAL_DID_GPS_CLOCK_DRIFT;
+ g_st_selection_itemlist[68].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[68].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[69].ul_did = POSHAL_DID_GPS_CLOCK_FREQ;
+ g_st_selection_itemlist[69].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[69].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+#else
+ g_st_selection_itemlist[26].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_POSLLH;
+ g_st_selection_itemlist[26].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[27].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_STATUS;
+ g_st_selection_itemlist[27].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[28].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC;
+ g_st_selection_itemlist[28].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[29].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_VELNED;
+ g_st_selection_itemlist[29].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[30].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_DOP;
+ g_st_selection_itemlist[30].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[31].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS;
+ g_st_selection_itemlist[31].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[32].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_SVINFO;
+ g_st_selection_itemlist[32].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[33].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_CLOCK;
+ g_st_selection_itemlist[33].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[34].ul_did = VEHICLE_DID_GPS_UBLOX_MON_HW;
+ g_st_selection_itemlist[34].uc_get_method = VEHICLESENS_GETMETHOD_GPS;
+ g_st_selection_itemlist[35].ul_did = POSHAL_DID_SPEED_PULSE_FLAG;
+ g_st_selection_itemlist[35].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[36].ul_did = VEHICLE_DID_GYRO_TROUBLE;
+ g_st_selection_itemlist[36].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[36].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[37].ul_did = VEHICLE_DID__CWORD56__GPS_INTERRUPT_SIGNAL;
+ g_st_selection_itemlist[37].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[37].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[38].ul_did = VEHICLE_DID__CWORD102__GPS_INTERRUPT_SIGNAL;
+ g_st_selection_itemlist[38].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[38].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+ g_st_selection_itemlist[39].ul_did = VEHICLE_DID_GYRO_CONNECT_STATUS;
+ g_st_selection_itemlist[39].ul_canid = VEHICLESENS_INVALID;
+ g_st_selection_itemlist[39].uc_get_method = VEHICLESENS_GETMETHOD_LINE;
+#endif
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSelectionItemList
+* ABSTRACT : Vehicle sensor_data acquisition method GET function
+* FUNCTION : Provide data acquisition methods
+* ARGUMENT : ul_did Data ID
+* NOTE :
+* RETURN : VEHICLESENS_GETMETHOD_CAN :CAN line
+* VEHICLESENS_GETMETHOD_LINE :Direct Line
+* VEHICLESENS_GETMETHOD_NO_DETECTION :Not downloaded
+* VEHICLESENS_GETMETHOD_GPS :GPS
+* VEHICLESENS_GETMETHOD_NAVI :Navi
+* VEHICLESENS_GETMETHOD_CLOCK :Clock
+* VEHICLESENS_GETMETHOD_OTHER :Others
+******************************************************************************/
+u_int8 VehicleSensGetSelectionItemList(DID ul_did) {
+ int32 i;
+ u_int8 uc_get_method = VEHICLESENS_GETMETHOD_NO_DETECTION;
+ /* Ignore->MISRA-C++:2008 Rule 2-13-3 */ /* Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */
+ if ( (ul_did & VEHICLESENS_BIT31_29) != 0 ) {
+ /* For other than CAN frame data */
+ for (i = 0; i < VEHICLESENS_SELECTION_ITEM_LIST_LEN; i++) {
+ if (g_st_selection_itemlist[i].ul_did == ul_did) {
+ uc_get_method = g_st_selection_itemlist[i].uc_get_method;
+ break;
+ }
+ }
+ } else {
+ /* CAN frame data */
+ uc_get_method = VEHICLESENS_GETMETHOD_CAN;
+ }
+ return uc_get_method;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetSelectionItemListCanId
+* ABSTRACT : Vehicle Sensor Selection Item List_CANID GET Function
+* FUNCTION : Provide CANID
+* ARGUMENT :
+* NOTE :
+* RETURN : ul_canid CANID
+******************************************************************************/
+u_int32 VehicleSensGetSelectionItemListCanId(DID ul_did) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 i;
+ u_int32 ul_canid = VEHICLESENS_INVALID;
+
+ for (i = 0; i < VEHICLESENS_SELECTION_ITEM_LIST_LEN; i++) {
+ if (g_st_selection_itemlist[i].ul_did == ul_did) {
+ if (VEHICLESENS_GETMETHOD_CAN == g_st_selection_itemlist[i].uc_get_method) {
+ /* When the data source type is CAN communication */
+ ul_canid = g_st_selection_itemlist[i].ul_canid;
+ }
+ break;
+ }
+ }
+ return ul_canid;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetSelectionItemListCanId
+* ABSTRACT : Vehicle Sensor Selection Item List_CANID SET Function
+* FUNCTION : Sets when the CANID associated with the specified DID is unconfirmed.
+* ARGUMENT : ul_canid u-int32(CANID)
+* NOTE :
+* RETURN : TRUE :Successful registration(Including when the CANID is fixed)
+* : FALSE :Registration failure
+******************************************************************************/
+BOOL VehicleSensSetSelectionItemListCanId(DID ul_did, u_int32 ul_canid) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL b_ret = TRUE;
+ u_int8 uc_cnt = 0;
+ int32 uc_last_cnt = 0;
+
+ u_int8 uc_effective_flg = VEHICLESENS_EFFECTIVE;
+
+ for (uc_cnt = 0; uc_cnt < VEHICLE_COMM_WATCHTBL_DID_NUM; uc_cnt++) {
+ if (g_st_comm_watchtbl[uc_cnt].ul_did == ul_did) {
+ /* Obtain CANID determination flg */
+ uc_effective_flg = g_st_comm_watchtbl[uc_cnt].uc_effective_flg;
+ break;
+ }
+ }
+
+ if (uc_cnt >= VEHICLE_COMM_WATCHTBL_DID_NUM) {
+ return FALSE;
+ }
+
+ if (VEHICLESENS_EFFECTIVE != uc_effective_flg) {
+ /* When the CANID is undetermined */
+ b_ret = FALSE;
+ for (uc_last_cnt = 0; uc_last_cnt < VEHICLESENS_SELECTION_ITEM_LIST_LEN; uc_last_cnt++) {
+ if (g_st_selection_itemlist[uc_last_cnt].ul_did == ul_did) {
+ /* Updating the CANID of the Vehicle Sensor Selection Items List */
+ g_st_selection_itemlist[uc_last_cnt].ul_canid = ul_canid;
+ /* To fix the CANID */
+ g_st_comm_watchtbl[uc_cnt].uc_effective_flg = VEHICLESENS_EFFECTIVE;
+
+ /* During CANID indoubt,When Vehicle API ""Vehicle Sensor Information Disruption Monitoring"" is called */
+ /* Register for disruption monitoring of pending CAN threads */
+ if (0x00 < g_st_comm_watchtbl[uc_cnt].uc_vehicle_comm_watch_cnt) {
+ VehicleSensCommWatchTblRun(ul_did);
+ }
+ b_ret = TRUE;
+ break;
+ }
+ }
+ }
+ return b_ret;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensCommWatchTblInit
+* ABSTRACT : Disruption monitoring data management table initialization function
+* FUNCTION : Disruption monitoring data management table initialization processing
+* ARGUMENT : void
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensCommWatchTblInit(void) {
+ memset(&g_st_comm_watchtbl, 0x00, sizeof(g_st_comm_watchtbl));
+
+ /* DID initialization */
+ g_st_comm_watchtbl[0].ul_did = VEHICLE_DID_REV;
+ g_st_comm_watchtbl[1].ul_did = VEHICLE_DID_REV_CAN;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensCommWatchTblSave
+* ABSTRACT : Disruption monitoring data management table storage function
+* FUNCTION : When the target CANID is undetermined, save the discontinuation monitoring data...
+* ARGUMENT :
+* NOTE :
+* RETURN : TRUE : To fix the CANID
+* : FALSE : CANID undetermined
+******************************************************************************/
+BOOL VehicleSensCommWatchTblSave(const VEHICLE_MSG_WATCH_STOPPAGE *pst_msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL b_ret = TRUE; /* Function return value */
+ u_int8 uc_cnt = 0; /* Generic counters */
+ u_int8 uc_last_cnt = 0; /* Vehicle Sensor Information Disruption Monitoring Request Count */
+ u_int8 uc_get_method = VEHICLESENS_GETMETHOD_CAN; /* Acquisition method */
+ u_int8 uc_effective_flg = VEHICLESENS_EFFECTIVE; /* CANID determination flg */
+
+
+ uc_get_method = VehicleSensGetSelectionItemList(pst_msg->st_data.ul_did);
+
+ /* If the retrieval method is CAN: Check if the CANID is fixed */
+ if (VEHICLESENS_GETMETHOD_CAN == uc_get_method) {
+ for ( uc_cnt = 0; uc_cnt < VEHICLE_COMM_WATCHTBL_DID_NUM; uc_cnt++ ) {
+ if ( g_st_comm_watchtbl[uc_cnt].ul_did == pst_msg->st_data.ul_did ) {
+ /* Obtain CANID determination flg */
+ uc_effective_flg = g_st_comm_watchtbl[uc_cnt].uc_effective_flg;
+ break;
+ }
+ }
+ }
+
+ if ( VEHICLESENS_EFFECTIVE != uc_effective_flg ) {
+ /* Due to being asked for disruption monitoring of CANID indoubt data,Keep parameters required for disruption monitoring */
+ /* Returns success to the API user,No Disruption Monitoring Registration at this time */
+ /* Ask the CAN thread to monitor for disruption when the CANID is fixed. */
+
+ uc_last_cnt = g_st_comm_watchtbl[uc_cnt].uc_vehicle_comm_watch_cnt;
+ if ( VEHICLE_COMM_WATCHTBL_DAT_NUM > uc_last_cnt ) {
+ /* Destination PNO,Keep Disrupted Monitoring Time */
+ g_st_comm_watchtbl[uc_cnt].st_comm_watch_dat[uc_last_cnt].us_pno = pst_msg->st_data.us_pno;
+ g_st_comm_watchtbl[uc_cnt].st_comm_watch_dat[uc_last_cnt].us_watch_time = pst_msg->st_data.us_watch_time;
+
+ /* Vehicle sensor information disruption monitoring request count is incremented. */
+ uc_last_cnt++;
+ g_st_comm_watchtbl[uc_cnt].uc_vehicle_comm_watch_cnt = uc_last_cnt;
+ }
+ b_ret = FALSE;
+ }
+ return b_ret;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensCommWatchTblRun
+* ABSTRACT : Disruption monitoring data management table execution function
+* FUNCTION : Execute requested disruption monitoring when CANID is unconfirmed
+* ARGUMENT : ul_did DID
+* NOTE :
+* RETURN : TRUE : Normal completion
+* : FALSE : ABENDs
+******************************************************************************/
+BOOL VehicleSensCommWatchTblRun(DID ul_did) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL b_ret = TRUE;
+
+ return b_ret;
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp
new file mode 100755
index 0000000..1fc9954
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp
@@ -0,0 +1,521 @@
+/*
+ * @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_SharedMemory.cpp
+ * System name :PastModel002
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor shared memory management
+ ******************************************************************************/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "VehicleSens_SharedMemory.h"
+#include "Sensor_API.h"
+#include "VehicleSens_DataMaster.h"
+#include "Sensor_API_private.h"
+#include "SensorLocation_API.h"
+#include "SensorLocation_API_private.h"
+
+/********************************************************************************
+ * prototype declalation *
+ ********************************************************************************/
+static void VehicleSensLinkSharedMemory(char *shared_memory_name, void **p_share_addr);
+static RET_API VehicleSensWriteDataGpsInterruptSignal(DID ul_did);
+static RET_API VehicleSensWriteDataGyroConnectStatus(DID ul_did);
+static RET_API VehicleSensWriteDataLocalTime(void);
+static RET_API VehicleSensWriteDataLonLat(void);
+
+/********************************************************************************
+ * Definition *
+ ********************************************************************************/
+
+/*******************************************************************************
+* MODULE : VehicleSensInitSharedMemory
+* ABSTRACT : Shared Memory Initialization
+* FUNCTION : Initialize shared memory
+* ARGUMENT : None
+* NOTE :
+* RETURN : RET_NORMAL :Normal
+* : RET_ERROR :Abnormality
+******************************************************************************/
+RET_API VehicleSensInitSharedMemory(void) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API l_ret; /* Return of the functions */
+
+ /* All shared memory initialization */
+ l_ret = VehicleSensWriteDataGpsInterruptSignal(VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL);
+ if (l_ret == RET_NORMAL) {
+ l_ret = VehicleSensWriteDataGpsInterruptSignal(VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL);
+ }
+ if (l_ret == RET_NORMAL) {
+ l_ret = VehicleSensWriteDataGyroConnectStatus(VEHICLE_DID_GYRO_CONNECT_STATUS);
+ }
+
+ /* Initializes the effective ephemeris count when the shared memory is shut down. */
+ if (l_ret == RET_NORMAL) {
+ l_ret = VehicleSensWriteDataValidEphemerisNum(0); /* Initialized with effective ephemeris number 0 */
+ }
+
+ /* Writes the value read from the non-volatile memory to the shared memory. */
+ /* This process is executed only at startup.,After that, the shared memory will not be overwritten. */
+ if (l_ret == RET_NORMAL) {
+ l_ret = VehicleSensWriteDataLocalTime();
+ }
+
+ if (l_ret == RET_NORMAL) {
+ l_ret = VehicleSensWriteDataLonLat();
+ }
+
+ return l_ret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensLinkSharedMemory
+* ABSTRACT : Shared memory link
+* FUNCTION : Link to shared memory
+* ARGUMENT :
+* NOTE :
+* RETURN : None
+******************************************************************************/
+static void VehicleSensLinkSharedMemory(char *shared_memory_name, void **p_share_addr) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api;
+ void *pv_share_mem; /* Store Shared Memory Address */
+ u_int32 ul_share_mem_size; /* Size of the linked shared memory */
+
+ /* Link to the handle storage area */
+ ret_api = _pb_LinkShareData(shared_memory_name, &pv_share_mem, &ul_share_mem_size);
+
+ if (ret_api == RET_NORMAL) {
+ /* If the link is successful */
+ *p_share_addr = pv_share_mem; /* Set the address */
+ } else {
+ /* If the link fails */
+ *p_share_addr = NULL;
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteDataGpsInterruptSignal
+* ABSTRACT : Writing of data
+* FUNCTION : Writing Data to Shared Memory
+* ARGUMENT : DID : Data ID
+* NOTE :
+* RETURN : RET_NORMAL :Normal
+* : RET_ERROR :Abnormality
+******************************************************************************/
+static RET_API VehicleSensWriteDataGpsInterruptSignal(DID ul_did) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static GPS_INTERRUPT *gpsInterruptSharedAddr = NULL; /* Store Shared Memory Address */
+ static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */
+
+ VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL pst_data;
+
+ RET_API l_ret = RET_NORMAL; /* Return of the functions */
+ RET_API l_ret_api; /* Return of the functions */
+
+
+ /* Get Semaphore ID */
+ if (sem_id == 0) {
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(GPS_INTERRUPT_SIGNAL_SEMAPHO_NAME));
+ }
+
+ if (sem_id != 0) {
+ /* Semaphore ID successfully acquired */
+ l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */
+
+ if (l_ret_api == RET_NORMAL) {
+ /* Semaphore lock successful */
+
+ /* When the shared memory is not linked */
+ if (gpsInterruptSharedAddr == NULL) {
+ /* Link to shared memory */
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ VehicleSensLinkSharedMemory(const_cast<char *>(GPS_INTERRUPT_SIGNAL_SHARE_NAME),
+ reinterpret_cast<void **>(&gpsInterruptSharedAddr));
+ }
+
+ if (gpsInterruptSharedAddr != NULL) {
+ /* The link to shared memory is successful. */
+ switch (ul_did) {
+ case VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL:
+ {
+ /* Get data from data master */
+ VehicleSensGetDataMasterMainGpsInterruptSignal(ul_did, 0, &pst_data);
+
+ /* Writing Data to Shared Memory */
+ gpsInterruptSharedAddr->_CWORD102__interrupt = pst_data.uc_data;
+ break;
+ }
+ case VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL:
+ {
+ /* Get data from data master */
+ VehicleSensGetDataMasterSysGpsInterruptSignal(ul_did, 0, &pst_data);
+
+ /* Writing Data to Shared Memory */
+ gpsInterruptSharedAddr->_CWORD56__interrupt = pst_data.uc_data;
+ break;
+ }
+ default:
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "DID is unknown. \r\n");
+ break;
+ }
+
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "gpsInterruptSharedAddr == NULL \r\n");
+ }
+
+ /* Semaphore unlock */
+ (void)_pb_SemUnlock(sem_id);
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0");
+ }
+
+ return l_ret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteDataGyroConnectStatus
+* ABSTRACT : Writing of data
+* FUNCTION : Writing Data to Shared Memory
+* ARGUMENT : DID : Data ID
+* NOTE :
+* RETURN : RET_NORMAL :Normal
+* : RET_ERROR :Abnormality
+******************************************************************************/
+static RET_API VehicleSensWriteDataGyroConnectStatus(DID ul_did) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static u_int8 *gyroConnectSharedAddr = NULL; /* Store Shared Memory Address */
+ static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */
+
+ VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS pst_data;
+
+ RET_API l_ret = RET_NORMAL; /* Return of the functions */
+ RET_API l_ret_api; /* Return of the functions */
+
+ /* Get Semaphore ID */
+ if (sem_id == 0) {
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(GYRO_CONNECT_STATUS_SEMAPHO_NAME));
+ }
+
+ if (sem_id != 0) {
+ /* Semaphore ID successfully acquired */
+ l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */
+
+ if (l_ret_api == RET_NORMAL) {
+ /* Semaphore lock successful */
+
+ /* When the shared memory is not linked */
+ if (gyroConnectSharedAddr == NULL) {
+ /* Link to shared memory */
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ VehicleSensLinkSharedMemory(const_cast<char *>(GYRO_CONNECT_STATUS_SHARE_NAME),
+ reinterpret_cast<void **>(&gyroConnectSharedAddr));
+ }
+
+ if (gyroConnectSharedAddr != NULL) {
+ /* The link to shared memory is successful. */
+
+ /* Get data from data master */
+ VehicleSensGetDataMasterGyroConnectStatus(ul_did, 0, &pst_data);
+
+ /* Writing Data to Shared Memory */
+ *gyroConnectSharedAddr = pst_data.uc_data;
+
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "gyroConnectSharedAddr == NULL \r\n");
+ }
+
+ /* Semaphore unlock */
+ (void)_pb_SemUnlock(sem_id);
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0");
+ }
+
+ return l_ret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteDataValidEphemerisNum
+* ABSTRACT : Write effective ephemeris number at shutdown
+* FUNCTION : Write effective ephemeris number at shutdown to shared memory
+* ARGUMENT : u_int8 valid_ephemer_isnum : Number of effective ephemeris written to shared memory during shutdown
+* NOTE :
+* RETURN : RET_NORMAL :Normal
+* : RET_ERROR :Abnormality
+******************************************************************************/
+RET_API VehicleSensWriteDataValidEphemerisNum(u_int8 valid_ephemer_isnum) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static u_int8 *shared_addr = NULL; /* Store Shared Memory Address */
+ static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */
+
+ RET_API l_ret; /* Return of the functions */
+ RET_API l_ret_api; /* Return of the functions */
+
+ /* Get Semaphore ID */
+ if (sem_id == 0) {
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(EPHEMERIS_NUM_SEMAPHO_NAME));
+ }
+
+ if (sem_id != 0) {
+ /* Semaphore ID successfully acquired */
+ l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */
+
+ if (l_ret_api == RET_NORMAL) {
+ /* Semaphore lock successful */
+
+ /* When the shared memory is not linked */
+ if (shared_addr == NULL) {
+ /* Link to shared memory */
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ VehicleSensLinkSharedMemory(const_cast<char *>(EPHEMERIS_NUM_SHARE_NAME),
+ reinterpret_cast<void **>(&shared_addr));
+ }
+
+ if (shared_addr != NULL) {
+ *shared_addr = valid_ephemer_isnum;
+ l_ret = RET_NORMAL;
+
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "shared_addr == NULL \r\n");
+ }
+
+ /* Semaphore unlock */
+ l_ret_api = _pb_SemUnlock(sem_id);
+ if (l_ret_api != RET_NORMAL) {
+ /* Semaphore unlock failure */
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemUnlock failed");
+ }
+ } else {
+ /* Semaphore ID acquisition failure */
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0");
+ }
+
+ return l_ret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteDataLocalTime
+* ABSTRACT : Writing Local Time at Shutdown
+* FUNCTION : Write local time on shutdown to shared memory
+* ARGUMENT : None
+* NOTE :
+* RETURN : RET_NORMAL :Acquisition normal
+* : RET_ERROR :Acquisition anomaly
+******************************************************************************/
+static RET_API VehicleSensWriteDataLocalTime(void) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static LOCALTIME *shared_addr = NULL; /* Store Shared Memory Address */
+ static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */
+
+ RET_API l_ret; /* Return of the functions */
+ RET_API l_ret_api; /* Return of the functions */
+
+ LOCALTIME LocalTime;
+
+ /* Get Semaphore ID */
+ if (sem_id == 0) {
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(LOCALTIME_SEMAPHO_NAME));
+ }
+
+ if (sem_id != 0) {
+ /* Semaphore ID successfully acquired */
+ l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */
+
+ if (l_ret_api == RET_NORMAL) {
+ /* Semaphore lock successful */
+
+ /* When the shared memory is not linked */
+ if (shared_addr == NULL) {
+ /* Link to shared memory */
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ VehicleSensLinkSharedMemory(const_cast<char *>(LOCALTIME_SHARE_NAME),
+ reinterpret_cast<void **>(&shared_addr));
+ }
+
+ if (shared_addr != NULL) {
+ /* The link to shared memory is successful. */
+
+ /* Acquires data from the non-volatile memory and writes it to the shared memory. */
+ l_ret_api = VehicleSensReadNVLocalTime(&LocalTime);
+ if (l_ret_api == RET_NORMAL) {
+ *shared_addr = LocalTime;
+ l_ret = RET_NORMAL;
+ } else {
+ /* When data acquisition from non-volatile memory fails,Set an invalid value */
+ (*shared_addr).status = CLOCK_INVALID;
+ (*shared_addr).year = 0xFFFFU; /* invalid */
+ (*shared_addr).month = 255U; /* invalid */
+ (*shared_addr).day = 255U; /* invalid */
+ (*shared_addr).hour = 255U; /* invalid */
+ (*shared_addr).min = 255U; /* invalid */
+ (*shared_addr).sec = 255U; /* invalid */
+ l_ret = RET_NORMAL;
+ }
+
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "shared_addr == NULL \r\n");
+ }
+
+ /* Semaphore unlock */
+ l_ret_api = _pb_SemUnlock(sem_id);
+ if (l_ret_api != RET_NORMAL) {
+ /* Semaphore unlock failure */
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemUnlock failed");
+ }
+ } else {
+ /* Semaphore ID acquisition failure */
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0");
+ }
+
+ return l_ret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteDataLonLat
+* ABSTRACT : Write position at shutdown
+* FUNCTION : Write shutdown position to shared memory
+* ARGUMENT : None
+* NOTE :
+* RETURN : RET_NORMAL :Successful acquisition
+* : RET_ERROR :Failed to acquire
+******************************************************************************/
+static RET_API VehicleSensWriteDataLonLat(void) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static LONLAT *shared_addr = NULL; /* Store Shared Memory Address */
+ static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */
+
+ RET_API l_ret; /* Return of the functions */
+ RET_API l_ret_api; /* Return of the functions */
+
+ LONLAT lonlat; /* Position */
+
+ /* Get Semaphore ID */
+ if (sem_id == 0) {
+ sem_id = _pb_CreateSemaphore(const_cast<char *>(LONLAT_SEMAPHO_NAME));
+ }
+
+ if (sem_id != 0) {
+ /* Semaphore ID successfully acquired */
+ l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */
+
+ if (l_ret_api == RET_NORMAL) {
+ /* Semaphore lock successful */
+
+ /* When the shared memory is not linked */
+ if (shared_addr == NULL) {
+ /* Link to shared memory */
+ /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */
+ VehicleSensLinkSharedMemory(const_cast<char *>(LONLAT_SHARE_NAME),
+ reinterpret_cast<void **>(&shared_addr));
+ }
+
+ if (shared_addr != NULL) {
+ /* The link to shared memory is successful. */
+
+ /* Acquires data from the non-volatile memory and writes it to the shared memory. */
+ l_ret_api = VehicleSensReadNVLonLat(&lonlat);
+ if (l_ret_api == RET_NORMAL) {
+ *shared_addr = lonlat;
+ l_ret = RET_NORMAL;
+ } else {
+ /* When data acquisition from non-volatile memory fails */
+ (*shared_addr).latitude = SENSORLOCATION_LATITUDE_INIT_VALUE;
+ (*shared_addr).longitude = SENSORLOCATION_LONGITUDE_INIT_VALUE;
+ l_ret = RET_NORMAL;
+ }
+
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "shared_addr == NULL \r\n");
+ }
+
+ /* Semaphore unlock */
+ l_ret_api = _pb_SemUnlock(sem_id);
+ if (l_ret_api != RET_NORMAL) {
+ /* Semaphore unlock failure */
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemUnlock failed");
+ }
+ } else {
+ /* Semaphore ID acquisition failure */
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+ } else {
+ l_ret = RET_ERROR;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0");
+ }
+
+ return l_ret;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWriteSharedMemory
+* ABSTRACT : Write Shared Memory
+* FUNCTION : Write Shared Memory
+* ARGUMENT : DID : Data ID
+* RETURN : None
+* NOTE :
+******************************************************************************/
+void VehicleSensWriteSharedMemory(DID ul_did) {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ switch (ul_did) {
+ case VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL:
+ case VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL:
+ {
+ (void)VehicleSensWriteDataGpsInterruptSignal(ul_did);
+ break;
+ }
+ case VEHICLE_DID_GYRO_CONNECT_STATUS:
+ {
+ (void)VehicleSensWriteDataGyroConnectStatus(ul_did);
+ break;
+ }
+ default:
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DID is unknown. \r\n");
+ break;
+ }
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp
new file mode 100755
index 0000000..8dc3922
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp
@@ -0,0 +1,2144 @@
+/*
+ * @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_Thread.cpp
+ * System name :GPF
+ * Subsystem name :Vehicle sensor process
+ * Program name :Vehicle sensor thread
+ * Module configuration :VehicleSensThread() Vehicle Sensor Thread Domain Functions
+ * :VehicleSensThreadInit() Vehicle sensor thread initials
+ * :VehicleSensDeliveryEntry() Vehicle sensor information delivery registration
+ * :VehicleSensGetVehicleData() Vehicle sensor information acquisition
+ * :VehicleSensWatchStopPage() Vehicle sensor interruption monitoring
+ * :VehicleSensPkgDeliveryEntry() Vehicle sensor information package delivery registration
+ * :VehicleSensGetVehiclePkgData() Vehicle sensor information package data acquisition
+ * :VehicleSensLineSensDataDelivery() LineSensor Vehicle Signal Notification
+ * :VehicleSensGpsDataDelivery() GPS data notification
+ * :VehicleSens_CanDataDelivery() CAN data delivery notice
+ * :VehicleSensDataMasterSetN() Data master set notification process(Callback function)
+ * :VehicleSensSetVehicleData() GPS command request processing
+ ******************************************************************************/
+#include "VehicleSens_Thread.h"
+#include <vehicle_service/positioning_base_library.h>
+#include <other_service/VP_GetEnv.h>
+#include "POS_private.h"
+#include "positioning_common.h"
+#include "SensorLog.h"
+#include "VehicleUtility.h"
+#include "VehicleSensor_Thread.h"
+
+#include "VehicleIf.h"
+
+/*************************************************/
+/* Global variable */
+/*************************************************/
+static VEHICLE_MSG_BUF g_wait_for_resp_msg; /* Message waiting to receive a response */
+static PFUNC_DMASTER_SET_N g_wait_for_resp_set_n; /* Response waiting data master set */
+static BOOL g_sent_fst_pkg_delivery_ext; /* Initial expansion package data delivery status */
+
+static VEHICLESENS_VEHICLE_SPEED_INFO g_vehicle_speed_info;
+
+uint32_t gPseudoSecClockCounter = 0u;
+
+/*************************************************/
+/* Function prototype */
+/*************************************************/
+static void VehicleSensInitDataDisrptMonitor(void);
+static void VehicleSensDataDisrptMonitorProc(DID did);
+static void VehicleSensRcvMsgTout(TimerToutMsg* rcv_msg);
+
+static void VehilceSens_InitVehicleSpeed(void);
+static void VehicleSens_StoreVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_DAT* pVehicleSpeed);
+static void VehicleSens_LoadVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_INFO* pVehicleSpeedInfo);
+static RET_API VehicleSens_CatNmeaSentenceFieldWithDelimiter(char* str1, const size_t size, const char* str2, const size_t n);
+static RET_API VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(char* str1, const size_t size, const char* str2, const size_t n);
+static inline RET_API VehicleSens_GeneratePASCDFieldId(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldTimestamp(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldSensorType(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldTransmissionState(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldSlipDetect(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldSampleCount(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldTimeOffsetNSpeed(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldChecksum(char* pascd, size_t size);
+static inline RET_API VehicleSens_GeneratePASCDFieldCRLF(char* pascd, size_t size);
+static RET_API VehicleSens_DeriveTransmissionStateFor_CWORD27_(VEHICLESENS_TRANSMISSION_PKG* pPkg);
+
+
+/*******************************************************************************
+* MODULE : VehicleSensThread
+* ABSTRACT : Vehicle Sensor Thread Domain Functions
+* FUNCTION : Main processing
+* ARGUMENT : lpv_para :
+* NOTE :
+* RETURN :
+******************************************************************************/
+EFrameworkunifiedStatus VehicleSensThread(HANDLE h_app) {
+ RET_API ret_api = RET_NORMAL; /* Return Values of System API Functions */
+ T_APIMSG_MSGBUF_HEADER *p; /* Message header */
+ RET_API ret_val; /* Return value of initialization processing */
+ VEHICLE_MSG_DELIVERY_ENTRY delivery_entry;
+
+ static u_int8 msg_buf[MAX_MSG_BUF_SIZE]; /* message buffer */
+
+ void* p_msg_buf = &msg_buf;
+ LSDRV_MSG_LSDATA_G** p_lsdrv_msg;
+ VEHICLE_MSG_BUF** p_vehicle_msg;
+ POS_MSGINFO *p_pos_msg;
+
+
+
+ p_lsdrv_msg = reinterpret_cast<LSDRV_MSG_LSDATA_G**>(&p_msg_buf);
+ p_vehicle_msg = reinterpret_cast<VEHICLE_MSG_BUF**>(&p_msg_buf);
+
+ VehicleUtilityInitTimer();
+ (void)PosSetupThread(h_app, ETID_POS_MAIN);
+
+ memset(&(delivery_entry), 0, sizeof(VEHICLE_MSG_DELIVERY_ENTRY));
+
+ /* Thread initialization process */
+ ret_val = VehicleSensThreadInit();
+
+ gPseudoSecClockCounter = 0u;
+
+ if (RET_NORMAL == ret_val) { // LCOV_EXCL_BR_LINE 6: always be RET_NORMAL
+ while (1) {
+ /* Message reception processing */
+ p_msg_buf = &msg_buf;
+ ret_api = _pb_RcvMsg(PNO_VEHICLE_SENSOR, sizeof(msg_buf), &p_msg_buf, RM_WAIT);
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "[ret_api = 0x%x]",
+ ret_api);
+
+ /* When the message is received successfully */
+ if (ret_api == RET_RCVMSG) {
+ p = reinterpret_cast<T_APIMSG_MSGBUF_HEADER *>(p_msg_buf);
+
+ switch (p->hdr.cid) { // LCOV_EXCL_BR_LINE 200: some DID is not used
+ case CID_VEHICLEIF_DELIVERY_ENTRY:
+ {
+ memcpy(&(delivery_entry), &(p_msg_buf), sizeof(VEHICLE_MSG_DELIVERY_ENTRY));
+
+ /* Sort by received DID */
+ switch (delivery_entry.data.did) { // LCOV_EXCL_BR_LINE 200: DR DID is not used
+ case VEHICLE_DID_DR_ALTITUDE :
+ case VEHICLE_DID_DR_LATITUDE :
+ case VEHICLE_DID_DR_SPEED :
+ case VEHICLE_DID_DR_HEADING :
+ case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL :
+ case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL :
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensDrDeliveryEntry((const VEHICLE_MSG_DELIVERY_ENTRY *)p_msg_buf);
+ // LCOV_EXCL_STOP
+ }
+ break;
+ default:
+ /* Vehicle sensor information delivery registration */
+ VehicleSensDeliveryEntry((const VEHICLE_MSG_DELIVERY_ENTRY *)p_msg_buf);
+ break;
+ }
+ break;
+ }
+ case CID_VEHICLEIF_GET_VEHICLE_DATA:
+ {
+ /* Vehicle sensor information acquisition */
+ VehicleSensGetVehicleData((const VEHICLE_MSG_GET_VEHICLE_DATA *)p_msg_buf);
+ break;
+ }
+ case CID_LINESENS_VEHICLE_DATA:
+ {
+ /* LineSensor Vehicle Signal Notification */
+ VehicleSensLineSensDataDelivery((const LSDRV_MSG_LSDATA *)p_msg_buf,
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN);
+ break;
+ }
+ case CID_LINESENS_VEHICLE_DATA_G:
+ {
+ /* Data disruption monitoring process */
+ VehicleSensDataDisrptMonitorProc(
+ (reinterpret_cast<LSDRV_MSG_LSDATA_G*>(*p_lsdrv_msg))->st_para.st_data[0].ul_did);
+ VehicleSensLineSensDataDeliveryG((const LSDRV_MSG_LSDATA_G *)p_msg_buf,
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN);
+ break;
+ }
+ case CID_LINESENS_VEHICLE_DATA_GYRO_TROUBLE:
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Gyro Failure Status Notification */
+ VehicleSensLineSensDataDeliveryGyroTrouble((const LSDRV_MSG_LSDATA_GYRO_TROUBLE *)p_msg_buf,
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_LINESENS_VEHICLE_DATA_SYS_GPS_INTERRUPT_SIGNAL:
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* SYS GPS interrupt notification */
+ VehicleSensLineSensDataDeliverySysGpsInterruptSignal(
+ (const LSDRV_MSG_LSDATA_GPS_INTERRUPT_SIGNAL *)p_msg_buf,
+ (PFUNC_DMASTER_SET_SHARED_MEMORY)VehicleSensDataMasterSetSharedMemory);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_LINESENS_VEHICLE_DATA_GYRO_CONNECT_STATUS:
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Gyro Failure Status Notification */
+ VehicleSensLineSensDataDeliveryGyroConnectStatus(
+ (const LSDRV_MSG_LSDATA_GYRO_CONNECT_STATUS *)p_msg_buf,
+ (PFUNC_DMASTER_SET_SHARED_MEMORY)VehicleSensDataMasterSetSharedMemory);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_LINESENS_VEHICLE_DATA_GPS_ANTENNA_STATUS:
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* GPS antenna failure status notification */
+ VehicleSensLineSensDataDeliveryGpsAntennaStatus(
+ (const LSDRV_MSG_LSDATA_GPS_ANTENNA_STATUS *)p_msg_buf,
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT:
+ {
+ /* Vehicle Sensor Information Extended Package Delivery Registration */
+ VehicleSensPkgDeliveryEntryExt((const SENSOR_MSG_DELIVERY_ENTRY *)p_msg_buf);
+ break;
+ }
+ case CID_LINESENS_VEHICLE_DATA_FST:
+ {
+ /* LineSensor Vehicle Initial Sensor Signal Notification */
+ VehicleSensLineSensDataDeliveryFstG((const LSDRV_MSG_LSDATA_FST *)p_msg_buf,
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN);
+ break;
+ }
+ case CID_GPS_DATA:
+ {
+ /* GPS information notification */
+ VehicleSensGpsDataDelivery(reinterpret_cast<SENSOR_MSG_GPSDATA *>(p_msg_buf),
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN,
+ (PFUNC_DMASTER_SET_SHARED_MEMORY)VehicleSensDataMasterSetSharedMemory);
+ break;
+ }
+ case CID_POSIF_SET_DATA:
+ {
+ p_pos_msg =
+ reinterpret_cast<POS_MSGINFO*>((reinterpret_cast<VEHICLE_MSG_BUF*>(*p_vehicle_msg))->data);
+ /* Data disruption monitoring process */
+ VehicleSensDataDisrptMonitorProc(p_pos_msg->did);
+
+ /* Data Setting Notification */
+ VehicleSensCommonDataDelivery((const VEHICLE_MSG_BUF *)p_msg_buf,
+ (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN);
+ break;
+ }
+ case CID_GPS_RETTIMESETTING:
+ {
+ /* GPS time setting result notification */
+ VehicleSensGpsTimeDelivery((const VEHICLE_MSG_BUF *)p_msg_buf);
+ break;
+ }
+ case CID_DEAD_RECKONING_GPS_DATA : /* GPS data distribution for DR */
+ case CID_DEAD_RECKONING_SENS_DATA : /* Sensor Data Delivery for DR */
+ case CID_DEAD_RECKONING_SENS_FST_DATA : /* Initial Sensor Data Delivery for DR */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensDrRcvMsg((const DEAD_RECKONING_RCVDATA *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_VEHICLEIF_GET_DR_DATA :
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Vehicle sensor information acquisition */
+ DeadReckoningGetDRData((const DEADRECKONING_MSG_GET_DR_DATA *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_DR_MAP_MATCHING_DATA : /* Map matching information */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DeadReckoningSetMapMatchingData((const DR_MSG_MAP_MATCHING_DATA *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_DR_CLEAR_BACKUP_DATA : /* Clear backup data */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DeadReckoningClearBackupData((const DR_MSG_CLEAR_BACKUP_DATA*)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_VEHICLEDEBUG_LOG_GET : /* Log acquisition request */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensGetLog((const VEHICLEDEBUG_MSG_BUF *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_VEHICLEDEBUG_LOG_SET : /* Log Setting Request */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensSetLog((const VEHICLEDEBUG_MSG_BUF *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CANINPUT_CID_LOCALTIME_NOTIFICATION : /* CAN information acquisition */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensWriteLocalTime((const CANINPUT_MSG_INFO*)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_EPH_NUM_NOTIFICATION : /* Set effective ephemeris count at shutdown */
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VehicleSensSetEphNumSharedMemory((const SENSOR_MSG_GPSDATA *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_SENSORIF__CWORD82__REQUEST:
+ {
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Requests to send GPS _CWORD82_ commands */
+ VehicleSensSetVehicleData((const VEHICLE_MSG_SEND *)p_msg_buf);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case CID_THREAD_STOP_REQ:
+ {
+ /* Thread stop processing */
+ VehicleSensThreadStopProcess();
+ break;
+ }
+ case CID_TIMER_TOUT:
+ {
+ /* Timeout notification reception processing */
+ VehicleSensRcvMsgTout(reinterpret_cast<TimerToutMsg*>(p_msg_buf));
+ break;
+ }
+ default:
+ break;
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "ret_api != RET_RCVMSG\r\n");
+ }
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleSens: VehicleSens_MainThread Initial Error!! :%d", ret_val);
+ _pb_Exit();
+ }
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensThreadInit
+* ABSTRACT : Vehicle sensor thread initials
+* FUNCTION : Initial process
+* ARGUMENT : void
+* NOTE :
+* RETURN : CAN data delivery registration result
+******************************************************************************/
+RET_API VehicleSensThreadInit(void) {
+ RET_API ret_val = RET_NORMAL;
+
+ /* Initialization of Vehicle Selection Item List Table */
+ VehicleSensInitSelectionItemList();
+
+ /* Vehicle sensor data master initialization */
+ VehicleSensInitDataMaster();
+
+ /* Initialization of shipping destination management table */
+ VehicleSensInitDeliveryCtrlTbl();
+
+ /* Initialization of shipping destination management table management information */
+ VehicleSensInitDeliveryCtrlTblMng();
+
+ /* Initialization of package delivery management table */
+ VehicleSensInitPkgDeliveryTblMng();
+
+ /* Initialization of non-volatile access function block */
+ VehicleSensFromAccessInitialize();
+
+ /* Clear message information waiting to receive a response */
+ (void)memset(&g_wait_for_resp_msg, 0x00, sizeof(VEHICLE_MSG_BUF));
+ g_wait_for_resp_set_n = NULL;
+ g_sent_fst_pkg_delivery_ext = FALSE; /* Initial expansion package data undelivered */
+
+ VehilceSens_InitVehicleSpeed(); /* for PASCD */
+
+ /* Start of data interruption monitoring */
+ VehicleSensInitDataDisrptMonitor();
+ return ret_val;
+}
+
+/*******************************************************************************
+ * MODULE : VehicleSensDeliveryEntry
+ * ABSTRACT : Vehicle sensor information delivery registration
+ * FUNCTION :
+ * ARGUMENT : *msg : message buffer
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensDeliveryEntry(const VEHICLE_MSG_DELIVERY_ENTRY *msg) {
+ int32 event_val;
+ EventID event_id;
+
+ /* Call the process of creating the delivery destination management table */
+ event_val = static_cast<int32>(VehicleSensEntryDeliveryCtrl(msg));
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(msg->data.pno);
+
+ /* Publish Events */
+ (void)_pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val);
+
+ if (VEHICLE_RET_NORMAL == event_val) {
+ /* Successful delivery registration */
+ /* Deliver data for the first time */
+ VehicleSensFirstDelivery((PNO)(msg->data.pno), (DID)(msg->data.did));
+ }
+
+ /* Event deletion */
+ (void)VehicleDeleteEvent(event_id);
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensGetVehicleData
+* ABSTRACT : Vehicle sensor information acquisition
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetVehicleData(const VEHICLE_MSG_GET_VEHICLE_DATA *msg) {
+ void *share_top; /* Start address of shared memory */
+ u_int32 share_size; /* Size of shared memory area */
+ u_int8 get_method; /* Data collection way */
+ VEHICLESENS_DATA_MASTER master; /* Data master */
+ RET_API ret_api;
+ int32 ret_val;
+ int32 event_val;
+ EventID event_id;
+ SENSOR_MSG_GPSDATA_DAT gps_master; /* GPS Data Master */
+
+ /* Check the DID */
+ ret_val = VehicleSensCheckDid(msg->data.did);
+ if (VEHICLESENS_INVALID != ret_val) { // LCOV_EXCL_BR_LINE 6:did always valid
+ /* DID normal */
+
+ /* Link to shared memory */
+ ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME), &share_top, &share_size);
+ if (RET_NORMAL == ret_api) {
+ /* Acquire the specified data from the data master. */
+ get_method = VehicleSensGetSelectionItemList(msg->data.did);
+ if ((VEHICLESENS_GETMETHOD_GPS == get_method) &&
+ ((msg->data.did != VEHICLE_DID_LOCATION_LONLAT) &&
+ (msg->data.did != VEHICLE_DID_LOCATION_ALTITUDE) &&
+ (msg->data.did != VEHICLE_DID_MOTION_HEADING))) {
+ /* _CWORD71_ processing speed(Memset modification) */
+ /* Retrieval of the data master fails.,Initialize size to 0 to prevent unauthorized writes */
+ gps_master.us_size = 0;
+ VehicleSensGetGpsDataMaster(msg->data.did, get_method, &gps_master);
+ /* Check the data size */
+ if (msg->data.size < gps_master.us_size) {
+ /* Shared memory error(Insufficient storage size) */
+ event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ } else {
+ /* Write data master to shared memory */
+ PosSetShareData(share_top,
+ msg->data.offset, (const void *)&gps_master.uc_data, gps_master.us_size);
+
+ /* Set Successful Completion */
+ event_val = VEHICLE_RET_NORMAL;
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED,
+ msg->data.did, msg->data.pno,
+ reinterpret_cast<uint8_t *>(&(gps_master.uc_data[0])),
+ gps_master.us_size, SENSLOG_RES_SUCCESS);
+ }
+ } else {
+ (void)memset(reinterpret_cast<void *>(&master), 0, sizeof(VEHICLESENS_DATA_MASTER));
+ VehicleSensGetDataMaster(msg->data.did, get_method, &master);
+
+ /* Check the data size */
+ if (msg->data.size < master.us_size) {
+ /* Shared memory error(Insufficient storage size) */
+ event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ } else {
+ /* Write data master to shared memory */
+ PosSetShareData(share_top,
+ msg->data.offset, (const void *)master.uc_data, master.us_size);
+
+ /* Set Successful Completion */
+ event_val = VEHICLE_RET_NORMAL;
+ SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED,
+ msg->data.did, msg->data.pno,
+ reinterpret_cast<uint8_t *>(&(master.uc_data[0])),
+ master.us_size, SENSLOG_RES_SUCCESS);
+ }
+ }
+ } else {
+ /* Shared memory error */
+ event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY;
+ }
+ } else {
+ /* DID error */
+ event_val = VEHICLE_RET_ERROR_DID;
+ }
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(msg->data.pno);
+
+ /* Publish Events */
+ ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val);
+ if (RET_NORMAL != ret_api) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent ERROR!! [ret_api = %d]", ret_api);
+ }
+
+ /* Event deletion */
+ (void)VehicleDeleteEvent(event_id);
+
+ return;
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensWatchStopPage
+* ABSTRACT : Vehicle sensor interruption monitoring
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensWatchStopPage(const VEHICLE_MSG_WATCH_STOPPAGE *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Not used(Delete Used Functions After Investigation) */
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensPkgDeliveryEntry
+* ABSTRACT : Vehicle sensor information package delivery registration
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensPkgDeliveryEntry(const SENSOR_MSG_DELIVERY_ENTRY *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 event_val;
+ EventID event_id;
+
+ /* Call the process of creating the delivery destination management table */
+ event_val = static_cast<int32>(VehicleSensEntryPkgDeliveryCtrl(msg , VEHICLESENS_EXT_OFF));
+ /* #Polaris_003 */
+
+ /* Event Generation */
+ event_id = PosCreateEvent(msg->data.pno);
+
+ /* Publish Events */
+ (void)_pb_SetEvent(msg->data.event_id, SAPI_EVSET_ABSOLUTE, event_val);
+
+ if (VEHICLE_RET_NORMAL == event_val) {
+ /* Successful delivery registration */
+ /* Deliver package data for the first time */
+ VehicleSensFirstPkgDelivery(&msg->data);
+ }
+
+ /* Event deletion */
+ (void)PosDeleteEvent(event_id);
+}
+// LCOV_EXCL_STOP
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensPkgDeliveryEntryExt
+* ABSTRACT : Vehicle Sensor Information Extended Package Delivery Registration
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensPkgDeliveryEntryExt(const SENSOR_MSG_DELIVERY_ENTRY *msg) {
+ int32 event_val;
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ /* Call the process of creating the delivery destination management table */
+ event_val = static_cast<int32>(VehicleSensEntryPkgDeliveryCtrl(msg , VEHICLESENS_EXT_ON));
+
+ /* Event Generation */
+ (void)PosCreateEvent(msg->data.pno);
+
+ /* Publish Events */
+ (void)_pb_SetEvent(msg->data.event_id, SAPI_EVSET_ABSOLUTE, event_val);
+
+ if (VEHICLE_RET_NORMAL == event_val) {
+ /* Successful delivery registration */
+ /* Provide initial expansion package data delivery */
+ VehicleSensFirstPkgDeliveryExt(&msg->data);
+
+ /* Initial expansion package data delivered */
+ g_sent_fst_pkg_delivery_ext = TRUE;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__,
+ "FirstPkgDeliveryExt call.[%d]",
+ g_sent_fst_pkg_delivery_ext); /* TODO */
+ }
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+}
+
+#else
+/*******************************************************************************
+* MODULE : VehicleSensPkgDeliveryEntryError
+* ABSTRACT : Vehicle Sensor Information Extended Package Delivery Registration
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensPkgDeliveryEntryError(const SENSOR_MSG_DELIVERY_ENTRY *msg) {
+ RET_API ret_api;
+ EventID event_id;
+
+ /* Event Generation */
+ event_id = PosCreateEvent(msg->data.pno);
+
+ /* Publish Event Set DID Error */
+ ret_api = _pb_SetEvent(msg->data.event_id, SAPI_EVSET_ABSOLUTE, VEHICLE_RET_ERROR_DID);
+}
+
+#endif
+
+/*******************************************************************************
+* MODULE : VehicleSensGetVehiclePkgData
+* ABSTRACT : Vehicle sensor information package data acquisition
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGetVehiclePkgData(const SENSOR_MSG_GET_SENSOR_DATA *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDelivery
+* ABSTRACT : LineSensor Vehicle Signal Notification
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDelivery(const LSDRV_MSG_LSDATA *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) {
+ int32 i;
+ BOOL sens_ext;
+
+ sens_ext = TRUE;
+
+ for (i = 0; i < msg->st_para.uc_data_num; i++) {
+ /* Setting Vehicle Signal Data from LineSensor as Data Master */
+ VehicleSensSetDataMasterLineSens((const LSDRV_LSDATA *) & (msg->st_para.st_data[i]),
+ p_datamaster_set_n, sens_ext);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliveryG
+* ABSTRACT : LineSensor Vehicle Signal Notification
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliveryG(const LSDRV_MSG_LSDATA_G *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) {
+ int32 i;
+ BOOL sens_ext;
+
+ sens_ext = TRUE;
+ if (g_sent_fst_pkg_delivery_ext == TRUE) {
+ /* Initial Expansion Package Data Delivery,Without storing extended data */
+ sens_ext = FALSE;
+ }
+
+ for (i = 0; i < msg->st_para.uc_data_num; i++) {
+ /* Setting Vehicle Signal Data from LineSensor as Data Master */
+ VehicleSensSetDataMasterLineSensG((const LSDRV_LSDATA_G *) & (msg->st_para.st_data[i]),
+ p_datamaster_set_n, sens_ext);
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliveryGyroTrouble
+* ABSTRACT : Gyro Failure Status Notification
+* FUNCTION : Notify of a gyro failure condition
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliveryGyroTrouble(const LSDRV_MSG_LSDATA_GYRO_TROUBLE *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Setting Gyro Failure Status Data from LineSensor to Data Master */
+ VehicleSensSetDataMasterGyroTrouble((const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *)&(msg->st_para),
+ p_datamaster_set_n);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliverySysGpsInterruptSignal
+* ABSTRACT : SYS GPS interrupt notification
+* FUNCTION : Notify SYS GPS interrupt signals
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_sharedmemory : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliverySysGpsInterruptSignal(const LSDRV_MSG_LSDATA_GPS_INTERRUPT_SIGNAL *msg, PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory) { // LCOV_EXCL_START 8 :dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Sets the SYS GPS interrupt data from the LineSensor to the data master. */
+ VehicleSensSetDataMasterSysGpsInterruptSignal((const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *)&(msg->st_para),
+ p_datamaster_set_sharedmemory);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliveryGyroConnectStatus
+* ABSTRACT : Gyro Connection Status Notification
+* FUNCTION : Notify the state of the gyro connection
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_sharedmemory : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliveryGyroConnectStatus(const LSDRV_MSG_LSDATA_GYRO_CONNECT_STATUS *msg, PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Setting Gyro Connection Status Data from LineSensor to Data Master */
+ VehicleSensSetDataMasterGyroConnectStatus((const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *)&(msg->st_para),
+ p_datamaster_set_sharedmemory);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliveryGpsAntennaStatus
+* ABSTRACT : GPS Antenna Connection Status Notification
+* FUNCTION : Notify the GPS antenna connection status
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliveryGpsAntennaStatus(const LSDRV_MSG_LSDATA_GPS_ANTENNA_STATUS *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Setting GPS Antenna Connection Status Data from LineSensor as Data Master */
+ VehicleSensSetDataMasterGpsAntennaStatus((const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *)&(msg->st_para),
+ p_datamaster_set_n);
+}
+// LCOV_EXCL_STOP
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliveryFst
+* ABSTRACT : LineSensor Vehicle Signal Notification(Initial Sensor)
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliveryFst(const LSDRV_MSG_LSDATA_FST *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+#endif
+
+#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */
+/*******************************************************************************
+* MODULE : VehicleSensLineSensDataDeliveryFstG
+* ABSTRACT : LineSensor Vehicle Signal Notification(Initial Sensor)
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : Data Master Set Notification(Callback function)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensLineSensDataDeliveryFstG(const LSDRV_MSG_LSDATA_FST *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) {
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+");
+
+ if (msg == NULL) { // LCOV_EXCL_BR_LINE 6:msg cannot be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "msg == NULL\r\n"); // LCOV_EXCL_LINE 8: dead code
+ } else {
+ /* Set Vehicle Signal Data from LineSensor (Initial Sensor) as Data Master */
+ VehicleSensSetDataMasterLineSensFstG((const LSDRV_MSG_LSDATA_DAT_FST *) & (msg->st_para),
+ p_datamaster_set_n);
+ }
+
+ /* Internal debug log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-");
+}
+#endif
+
+/*******************************************************************************
+* MODULE : VehicleSensGpsDataDelivery
+* ABSTRACT : GPS data notification
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* : p_datamaster_set_n : For Data Master Set Notification(Callback function) delivery
+* : p_datamaster_set_sharedmemory : Data Master Set Notification (Callback Function) Shared Memory Write
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensGpsDataDelivery(SENSOR_MSG_GPSDATA *msg,
+ PFUNC_DMASTER_SET_N p_datamaster_set_n,
+ PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory) {
+ /* Setting GPS Data as Data Master */
+ if (msg->st_para.ul_did == VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) { // LCOV_EXCL_BR_LINE 6:DID is not used
+ // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* [PastModel002 Specifications] GPS->_CWORD102_ interrupt or not is obtained from GPS */
+ VehicleSensSetDataMasterMainGpsInterruptSignal((const SENSOR_MSG_GPSDATA_DAT *)&(msg->st_para),
+ p_datamaster_set_sharedmemory);
+ // LCOV_EXCL_STOP
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "VehicleSensGpsDataDelivery VehicleSensSetDataMasterGps() -->");
+ VehicleSensSetDataMasterGps(reinterpret_cast<SENSOR_MSG_GPSDATA_DAT *>(&(msg->st_para)),
+ p_datamaster_set_n);
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__,
+ "VehicleSensGpsDataDelivery VehicleSensSetDataMasterGps() <--");
+ }
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensDataMasterSetN
+* ABSTRACT : Data master set notification process(Callback function)
+* FUNCTION : Call the data delivery process
+* ARGUMENT : did : Data ID
+* : chg_type : Change type(no change/with change)
+* : get_method : Acquisition method(Direct Line/CAN)
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensDataMasterSetN(DID did, u_int8 chg_type, u_int8 get_method) {
+
+ u_int8 chgType;
+
+ chgType = chg_type;
+
+ switch (did) {
+ case POSHAL_DID_SPEED_KMPH:
+ {
+ if (ChkUnitType(UNIT_TYPE_GRADE1) == TRUE) {
+ /* For creating PASCD Sentence of NMEA */
+
+ int ret;
+ VEHICLESENS_VEHICLE_SPEED_DAT stVehicleSpeed;
+
+ ret = clock_gettime(CLOCK_MONOTONIC, &(stVehicleSpeed.ts));
+ if (ret != 0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "clock_gettime error:%m");
+ } else {
+ VEHICLESENS_DATA_MASTER stData;
+ SENSORMOTION_SPEEDINFO_DAT* pSpdInfo;
+
+ VehicleSensGetMotionSpeed(&stData, VEHICLESENS_GETMETHOD_INTERNAL); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ pSpdInfo = (SENSORMOTION_SPEEDINFO_DAT*)(stData.uc_data);
+
+ stVehicleSpeed.speed = pSpdInfo->Speed;
+
+ VehicleSens_StoreVehicleSpeed(&stVehicleSpeed); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ }
+ }
+
+ break;
+ }
+ case POSHAL_DID_GPS_NMEA:
+ {
+ VehilceSens_InitVehicleSpeed();
+
+ break;
+ }
+ default:
+ break;
+ }
+
+ /* Call the data delivery process */
+ VehicleSensDeliveryProc( did, chgType, get_method );
+}
+
+/*******************************************************************************
+* MODULE : VehicleSensDataMasterSetSharedMemory
+* ABSTRACT : Data master set notification process(Callback function)
+* FUNCTION : Call Write Shared Memory
+* ARGUMENT : did : Data ID
+* : chg_type : Whether or not data is updated
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensDataMasterSetSharedMemory(DID did, u_int8 chg_type) { // LCOV_EXCL_START 8: dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When there is no change, the shared memory write process is not called. */
+ if (chg_type == VEHICLESENS_NEQ) {
+ VehicleSensWriteSharedMemory(did);
+ }
+}
+// LCOV_EXCL_STOP
+
+/* ++ GPS _CWORD82_ support */
+/*******************************************************************************
+* MODULE : VehicleSensSetVehicleData
+* ABSTRACT : GPS command request processing
+* FUNCTION : Transfer a GPS command request
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetVehicleData(const VEHICLE_MSG_SEND *msg) {
+ u_int16 size; /* Data length setting */
+ u_int16 all_len; /* Sent message length */
+ u_int16 mode; /* Mode information */
+ RID req_id = 0; /* Resources ID */
+
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+ TG_GPS_SND_DATA data; /* Message body */
+ u_int8 snd_buf[(sizeof(T_APIMSG_MSGBUF_HEADER) + sizeof(TG_GPS_SND_DATA))];
+
+ /* Message header generation */
+ size = sizeof(data);
+ header.signo = 0; /* Signal information */
+ header.hdr.sndpno = PNO_VEHICLE_SENSOR; /* Source thread number */
+ header.hdr.respno = 0; /* Destination process No. */
+ header.hdr.cid = CID_GPS__CWORD82__REQUEST; /* Command ID */
+ header.hdr.msgbodysize = size; /* Message data length setting */
+ header.hdr.rid = req_id; /* Resource ID Setting */
+ header.hdr.reserve = 0; /* Reserved Area Clear */
+
+ /* Message body generating */
+ data.us_size = msg->data.size;
+ memcpy(&(data.ub_data[0]), &(msg->data.data[0]), msg->data.size);
+
+ /* Reserved Area Clear */
+ data.reserve[0] = 0;
+ data.reserve[1] = 0;
+ data.reserve[2] = 0;
+ data.reserve[3] = 0;
+
+ /* Message generation */
+ (void)memcpy(&snd_buf[0], &header, sizeof(header));
+ (void)memcpy(&snd_buf[sizeof(header)], &data, sizeof(data));
+ all_len = static_cast<u_int16>(size + sizeof(header));
+ mode = 0;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, "VehicleSensSetVehicleData NMEA = %s", data.ub_data);
+ (void)_pb_SndMsg(PNO_NAVI_GPS_MAIN, all_len, reinterpret_cast<void *>(&snd_buf[0]), mode);
+}
+
+/*******************************************************************************
+ * MODULE : VehicleSensDrDeliveryEntry
+ * ABSTRACT : Sensor Internal Information Delivery Registration for DR
+ * FUNCTION :
+ * ARGUMENT : *msg : message buffer
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensDrDeliveryEntry(const VEHICLE_MSG_DELIVERY_ENTRY *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 event_val;
+ EventID event_id;
+
+ /* Call the process of creating the delivery destination management table */
+ event_val = static_cast<int32>(DeadReckoningEntryDeliveryCtrl((const DEADRECKONING_MSG_DELIVERY_ENTRY*)msg));
+ /* #QAC confirmation Rule11.4 Member reference to suppress address reference error in data R/W */
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(msg->data.pno);
+
+ /* Publish Events */
+ (void)_pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val);
+
+ if (VEHICLE_RET_NORMAL == event_val) {
+ /* Successful delivery registration */
+ /* Deliver data for the first time */
+ DeadReckoningFirstDelivery((PNO)(msg->data.pno), (DID)(msg->data.did));
+ }
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : VehicleSensGetLog
+ * ABSTRACT : Log acquisition request
+ * FUNCTION :
+ * ARGUMENT : *msg : message buffer
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensGetLog(const VEHICLEDEBUG_MSG_BUF *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DeadReckoningGetLocationLogStatus(msg->hdr.hdr.sndpno);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : VehicleSensSetLog
+ * ABSTRACT : Log Setting Request
+ * FUNCTION :
+ * ARGUMENT : *msg : message buffer
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensSetLog(const VEHICLEDEBUG_MSG_BUF* msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : VehicleSensWriteLocalTime
+ * ABSTRACT : Set LOCALTIME to non-volatile
+ * FUNCTION :
+ * ARGUMENT : *msg : message buffer
+ * NOTE :
+ * RETURN : void
+ ******************************************************************************/
+void VehicleSensWriteLocalTime(const CANINPUT_MSG_INFO *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ LOCALTIME localtime = {0};
+ int32 time_diff;
+ RET_API ret_write_api;
+ static u_int8 cnt = 0U; /* For update cycle count */
+ if (msg != NULL) {
+ memset(&time_diff, 0x00, sizeof(time_diff)); /* Coverity CID:18813 compliant */
+
+ /* Determine that the 1s cycle (cnt == 1) has elapsed for 1 second. */
+ cnt++;
+
+ /* When 5 seconds or more have elapsed since the last update */
+ /* Saving Time Information in Non-volatile Memory */
+ if (cnt >= NV_UPDATE_CYCLE_LOCALTIME) {
+ /* Non-volatile write */
+ ret_write_api = VehicleSensWriteNVLocaltime(&localtime, &time_diff);
+ if (ret_write_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "NV write error.");
+ }
+ cnt = 0U;
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT NULL");
+ }
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensSetEphNumSharedMemory
+* ABSTRACT : Write effective ephemeris number to shared memory
+* FUNCTION :
+* ARGUMENT : *msg : message buffer
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensSetEphNumSharedMemory(const SENSOR_MSG_GPSDATA *msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api;
+ u_int8 ephemeris_num;
+
+ if (msg != NULL) {
+ ephemeris_num = msg->st_para.uc_data[0];
+
+ ret_api = VehicleSensWriteDataValidEphemerisNum(ephemeris_num);
+
+ if (ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Share Memory write error.");
+ }
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+* MODULE : VehicleSensDrRcvMsg
+* ABSTRACT : Data delivery for DR,Write location information to shared memory
+* FUNCTION :
+* ARGUMENT : const EPHEMERIS_NUM_DATA_DAT * : Incoming message
+* NOTE :
+* RETURN : void
+******************************************************************************/
+void VehicleSensDrRcvMsg(const DEAD_RECKONING_RCVDATA * msg) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DEAD_RECKONING_LONLAT_INFO lonlat_info;
+
+ if (msg != NULL) {
+ DeadReckoningRcvMsg(msg, &lonlat_info);
+
+ /* Process for storing location information in non-volatile memory during shutdown */
+ /* With a refresh interval of 1 second,Save only when location information is valid data */
+ if (lonlat_info.calc_called == TRUE) {
+ static u_int8 cnt = 0U; /* For update cycle count */
+
+ /* Sensor data is 100ms cycle,Determine that (cnt == 10) has elapsed for 1 second */
+ /* Cnt increments to 10 */
+ if (cnt < NV_UPDATE_CYCLE_LONLAT) {
+ cnt++;
+ }
+
+ /* When 1 second or more has elapsed since the last update and the location information is valid, */
+ /* Saving Location Information in Non-Volatile Memory */
+ if ((cnt >= NV_UPDATE_CYCLE_LONLAT) && (lonlat_info.available == static_cast<u_int8>(TRUE))) {
+ VehicleSensStoreLonlat(&(lonlat_info.lonlat));
+ cnt = 0U;
+ }
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT NULL");
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Data setting process
+ *
+ * Setting Specified Data to Data Master
+ *
+ * @param[in] const VEHICLE_MSG_BUF *msg : message buffer
+ * @param[out] PFUNC_DMASTER_SET_N p_datamaster_set_n : Data Master Set Notification(Callback function)
+ * @return none
+ * @retval none
+ */
+void VehicleSensCommonDataDelivery(const VEHICLE_MSG_BUF *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) {
+ const POS_MSGINFO *pstPosMsg = (const POS_MSGINFO *) & (msg->data[0]);
+
+ /* Individual processing for each data ID */
+ switch (pstPosMsg->did) {
+ case VEHICLE_DID_SETTINGTIME:
+ {
+ /* By checking the evacuation message information,Determine whether the GPS time has already been set and requested */
+ if (NULL == g_wait_for_resp_set_n) {
+ /* GPS time settable */
+ /* GPS time setting data transmission */
+ VehicleSensGpsTimeSndMsg(pstPosMsg);
+
+ /* Save message information(Used when a response is received.)*/
+ (void)memcpy(&g_wait_for_resp_msg, msg, sizeof(VEHICLE_MSG_BUF));
+ g_wait_for_resp_set_n = p_datamaster_set_n;
+ } else {
+ /* GPS time setting process is already in progress:Reply BUSY to requesting processes */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "SetGpsTime already.");
+ }
+ break;
+ }
+ default:
+ /* Set the specified data in the data master */
+ VehicleSensSetDataMasterData((const POS_MSGINFO *)msg->data, p_datamaster_set_n);
+ break;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS time setting data transmission process
+ *
+ * Send the specified data to the GPS thread
+ *
+ * @param[in] const POS_MSGINFO *pos_msg : message buffer
+ * @return none
+ * @retval none
+ */
+void VehicleSensGpsTimeSndMsg(const POS_MSGINFO *pos_msg) {
+ RET_API ret_api = RET_NORMAL; /* System API return value */
+ u_int16 size = 0; /* Data length setting */
+ u_int16 all_len = 0; /* Sent message length */
+ u_int16 mode = 0; /* Mode information */
+ RID req_id = 0; /* Resources ID */
+ T_APIMSG_MSGBUF_HEADER header; /* Message header */
+ TG_GPS_SND_DATA data; /* Message body */
+ u_int8 snd_buf[(sizeof(T_APIMSG_MSGBUF_HEADER) + sizeof(TG_GPS_SND_DATA))];
+
+ memset(&header, 0x00, sizeof(T_APIMSG_MSGBUF_HEADER));
+ memset(&data, 0x00, sizeof(TG_GPS_SND_DATA));
+
+ /* Message header generation */
+ size = sizeof(data);
+ header.signo = 0; /* Signal information */
+ header.hdr.sndpno = PNO_VEHICLE_SENSOR; /* Source thread number */
+ header.hdr.respno = 0; /* Destination process No. */
+ header.hdr.cid = CID_GPS_TIMESETTING; /* Command ID */
+ header.hdr.msgbodysize = size; /* Message data length setting */
+ header.hdr.rid = req_id; /* Resource ID Setting */
+
+ /* Message body generating */
+ data.us_size = pos_msg->size;
+ memcpy(&(data.ub_data[0]), &(pos_msg->data[0]), pos_msg->size);
+
+ /* Messaging */
+ (void)memcpy(&snd_buf[0], &header, sizeof(header));
+ (void)memcpy(&snd_buf[sizeof(header)], &data, sizeof(data));
+ all_len = static_cast<u_int16>(size + sizeof(header));
+ mode = 0;
+ ret_api = _pb_SndMsg(PNO_NAVI_GPS_MAIN, all_len, reinterpret_cast<void *>(&snd_buf[0]), mode);
+ if (RET_NORMAL != ret_api) {
+ /* Message transmission processing failed */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "send Message failed.");
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * GPS time setting result notification process
+ *
+ * Setting Specified Data to Data Master
+ *
+ * @param[in] const VEHICLE_MSG_BUF *msg : message buffer
+ * @return none
+ * @retval none
+ */
+void VehicleSensGpsTimeDelivery(const VEHICLE_MSG_BUF *msg) {
+ int32 event_val = POS_RET_ERROR_INNER; /* Event value */
+ const TG_GPS_RET_TIMESET_MSG *gps_ret_time; /* GPS time setting response message */
+
+ /* Determine the GPS time setting result */
+ gps_ret_time = (const TG_GPS_RET_TIMESET_MSG *)msg;
+
+ if (GPS_SENDOK == gps_ret_time->status) {
+ event_val = POS_RET_NORMAL;
+ } else {
+ event_val = POS_RET_ERROR_TIMEOUT;
+ }
+
+ /* Set the specified data in the data master */
+ if (POS_RET_NORMAL == event_val) {
+ VehicleSensSetDataMasterData((const POS_MSGINFO *)&g_wait_for_resp_msg.data, g_wait_for_resp_set_n);
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
+ "SetGpsTime Result[%d] EventVal[%d]",
+ static_cast<uint32_t>(gps_ret_time->status), static_cast<uint32_t>(event_val));
+
+ /* Clear saved message information */
+ (void)memset(&g_wait_for_resp_msg, 0x00, sizeof(VEHICLE_MSG_BUF));
+ g_wait_for_resp_set_n = NULL;
+
+ return;
+}
+
+/**
+ * @brief
+ * Specified process No. event transmission processing
+ *
+ * Send an event to the specified process No.
+ *
+ * @param[in] uint16_t snd_pno : Destination process number
+ * @param[in] int32_t event_val : Sent event value
+ * @return RET_API
+ * @retval RET_NORMAL Normal completion<br>
+ * RET_ERROR Event generation failure<br>
+ * RET_ERRPARAM Configuration mode error<br>
+ * RET_EV_NONE Specified event does not exist<br>
+ * RET_EV_MAX The set event value exceeds the maximum value<br>
+ * RET_EV_MIN The set event value is below the minimum value.
+ */
+RET_API VehicleSensSendEvent(uint16_t snd_pno, int32_t event_val) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_val = RET_ERROR; /* Return value */
+ EventID event_id = 0; /* Event ID */
+
+ /* Event Generation */
+ event_id = VehicleCreateEvent(snd_pno);
+ if (0 != event_id) {
+ /* Event publishing(Release Event Wait) */
+ ret_val = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val);
+ if (RET_NORMAL != ret_val) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "set Event failed.");
+ }
+
+ /* Event deletion */
+ (void)VehicleDeleteEvent(event_id);
+ } else {
+ /* Event generation failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "create Event failed.");
+ }
+
+ return ret_val;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Pos_Main thread stop processing
+ */
+void VehicleSensThreadStopProcess(void) {
+ /* Exit Process Implementation Point >>> */
+
+
+ /* <<< Exit Process Implementation Point */
+
+ /* Thread stop processing */
+ PosTeardownThread(ETID_POS_MAIN);
+
+ /* don't arrive here */
+ return;
+}
+
+/**
+ * @brief
+ * Initialization of data interruption monitoring process<br>
+ * 1.Initial data reception monitoring timer issuance
+ */
+static void VehicleSensInitDataDisrptMonitor(void) {
+
+ /* Initial sensor data reception monitoring timer */
+ VehicleUtilitySetTimer(SNS_FST_TIMER);
+
+ return;
+}
+
+/**
+ * @brief
+ * Data disruption monitoring process<br>
+ * 1.Stop timer for monitoring initial data reception<br>
+ * 2.Stop timer for periodic data reception monitoring<br>
+ * 3.Periodic data reception monitoring timer issuance
+ *
+ * @param[in] did Data type
+ */
+static void VehicleSensDataDisrptMonitorProc(DID did) {
+ static BOOL is_rcv_sns_data = FALSE;
+
+ switch (did) {
+ case POSHAL_DID_GYRO_X:
+ case POSHAL_DID_GYRO_Y:
+ case POSHAL_DID_GYRO_Z:
+ case POSHAL_DID_GSNS_X:
+ case POSHAL_DID_GSNS_Y:
+ case POSHAL_DID_GSNS_Z:
+ case POSHAL_DID_SPEED_PULSE:
+ case POSHAL_DID_REV:
+ case POSHAL_DID_GPS_ANTENNA:
+ case POSHAL_DID_GYRO_EXT:
+ case POSHAL_DID_GYRO_TEMP:
+ case POSHAL_DID_PULSE_TIME:
+ case POSHAL_DID_SNS_COUNTER:
+ {
+ if (is_rcv_sns_data == FALSE) {
+ /* Initial sensor data reception monitoring timer */
+ VehicleUtilityStopTimer(SNS_FST_TIMER);
+ is_rcv_sns_data = TRUE;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "is_rcv_sns_data=TRUE");
+ }
+
+ /* Cyclic sensor data reception monitoring timer stopped */
+ VehicleUtilityStopTimer(SNS_CYCLE_TIMER);
+ /* Cyclic sensor data reception monitoring timer setting */
+ VehicleUtilitySetTimer(SNS_CYCLE_TIMER);
+ /* Sensor data interruption log output timer */
+ VehicleUtilityStopTimer(SNS_DISRPT_TIMER);
+
+ break;
+ }
+ default:
+ {
+ /* nop */
+ }
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timeout message reception processing
+ *
+ * @param[in] rcv_msg Incoming message
+ */
+static void VehicleSensRcvMsgTout(TimerToutMsg* rcv_msg) {
+ uint8_t tim_kind = static_cast<uint8_t>(rcv_msg->TimerSeq >> 8);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+ ### TIMEOUT ### Seq=0x%04x", rcv_msg->TimerSeq);
+ switch (tim_kind) {
+ case SNS_FST_TIMER:
+ case SNS_CYCLE_TIMER:
+ case SNS_DISRPT_TIMER:
+ {
+ /* Sensor data interruption log output timer setting */
+ VehicleUtilityStopTimer(SNS_DISRPT_TIMER);
+ VehicleUtilitySetTimer(SNS_DISRPT_TIMER);
+ break;
+ }
+ default:
+ {
+ /* nop */
+ }
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return;
+}
+
+
+/**
+ * @brief
+ * Initialize Vehilce Speed Information
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can initialize the buffer of Vehicle Speed Information.
+ */
+static void VehilceSens_InitVehicleSpeed(void) {
+ (void)memset(&g_vehicle_speed_info, 0x00, sizeof(g_vehicle_speed_info));
+ return;
+}
+
+/**
+ * @brief
+ * Store Vehilce Speed Data
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can store Vehicle Speed Information for a cycle.
+ *
+ * @param[in] VEHICLESENS_VEHICLE_SPEED_DAT* pVehicleSpeed : Speed [m/s] and TimeSpec
+ */
+static void VehicleSens_StoreVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_DAT* pVehicleSpeed) {
+ VEHICLESENS_VEHICLE_SPEED_INFO* pInfo = &g_vehicle_speed_info;
+
+
+// if (pInfo->sampleCount < VEHICLESENS_NMEA_PASCD_SAMPLECOUNT_MAX) {
+ if (pInfo->sampleCount == 0) {
+ (void)memcpy((pInfo->listSpd) + (pInfo->sampleCount), pVehicleSpeed, sizeof(VEHICLESENS_VEHICLE_SPEED_DAT));
+ pInfo->sampleCount++;
+
+ } else if (pInfo->sampleCount < VEHICLESENS_NMEA_PASCD_SAMPLECOUNT_MAX) {
+ (void)_pb_memcpy((pInfo->listSpd) + (pInfo->sampleCount), pVehicleSpeed, sizeof(VEHICLESENS_VEHICLE_SPEED_DAT));
+
+ VEHICLESENS_VEHICLE_SPEED_DAT* pS0 = &(pInfo->listSpd[0]);
+ VEHICLESENS_VEHICLE_SPEED_DAT* pS = &(pInfo->listSpd[pInfo->sampleCount]);
+ uint32_t ts_i; /* Interger Part of timestamp [s] */
+ if (pS->ts.tv_nsec - pS0->ts.tv_nsec >= 0) { // LCOV_EXCL_BR_LINE 200: can not less than zero
+ ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec) % VEHICLESENS_NMEA_PASCD_TS_MAX;
+ } else {
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec - 1) % VEHICLESENS_NMEA_PASCD_TS_MAX; // LCOV_EXCL_LINE 8: invalid
+ }
+ if (ts_i == 0) { /* Offset is 0 to 1 second */
+ pInfo->sampleCount++;
+ }
+
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "WARNING: Num of stored datas is over 50. (%ld.%ld spd = %d)",
+ pVehicleSpeed->ts.tv_sec, pVehicleSpeed->ts.tv_nsec, pVehicleSpeed->speed );
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Load Vehicle Speed Information (Vehicle Speed Data x 50(max))
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can load Vehicle Speed Informations from the last initialization.
+ *
+ * @param[in] VEHICLESENS_VEHICLE_SPEED_INFO* pVehicleSpeedInfo : Speeds [m/s] and TimeSpecs
+ */
+static void VehicleSens_LoadVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_INFO* pVehicleSpeedInfo) {
+ (void)memcpy(pVehicleSpeedInfo, &g_vehicle_speed_info, sizeof(g_vehicle_speed_info));
+ return;
+}
+
+/**
+ * @brief
+ * Concatenate NMEA Sentence Fields with Delimiter
+ *
+ * @details This is for creating NMEA Sentence. <br>
+ * You can concatenate the two strings given as arguments 'str1' and 'str2'. <br>
+ * And at the time, it puts the delimiter between 'str1' and 'str2' automaticaly.
+ *
+ * @param[in] char* str1 : destination
+ * @param[in] const size_t size : buffer size of destination
+ * @param[in] const char* str2 : source
+ * @param[in] const size_t n : copy size of source
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static RET_API VehicleSens_CatNmeaSentenceFieldWithDelimiter(char* str1, const size_t size,
+ const char* str2, const size_t n) {
+ RET_API ret_api = RET_NORMAL;
+
+ size_t len1 = strlen(str1);
+ size_t len2 = strlen(str2);
+ size_t len3 = strlen(VEHICLESENS_NMEA_FIELDDELIMITER);
+ size_t sn = n;
+
+ if (sn > len2) { // LCOV_EXCL_BR_LINE 200: can not exceed size
+ sn = len2;
+ }
+
+ if (len1 + len3 + sn <= size - 1) {
+ (void)strncat(str1, VEHICLESENS_NMEA_FIELDDELIMITER, len3); /* Add Delimiter (,) */
+ (void)strncat(str1, str2, sn);
+ } else {
+ ret_api = RET_ERROR;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: Buffer size is too small to connatenate. len1:%d len2:%d len3:%d n:%d", len1, len2, len3, n);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Concatenate NMEA Sentence Fields without Delimiter
+ *
+ * @details This is for creating NMEA Sentence. <br>
+ * You can concatenate the two strings given as arguments 'str1' and 'str2'.
+ *
+ * @param[in] char* str1 : destination
+ * @param[in] const size_t size : buffer size of destination
+ * @param[in] const char* str2 : source
+ * @param[in] const size_t n : copy size of source
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static RET_API VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(char* str1, const size_t size,
+ const char* str2, const size_t n) {
+ RET_API ret_api = RET_NORMAL;
+
+ size_t len1 = strlen(str1);
+ size_t len2 = strlen(str2);
+ size_t sn = n;
+
+ if (sn > len2) { // LCOV_EXCL_BR_LINE 200: can not exceed size
+ sn = len2;
+ }
+
+ if (len1 + sn <= size - 1) {
+ (void)strncat(str1, str2, sn);
+ } else {
+ ret_api = RET_ERROR;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: Buffer size is too small to connatenate. len1:%d len2:%d n:%d", len1, len2, n);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate ID Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate ID Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldId(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_PASCD_ID, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate Timestamp Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate Timestamp Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldTimestamp(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ VEHICLESENS_VEHICLE_SPEED_INFO stVehicleSpeedInfo;
+
+ uint32_t ts_i; /* Interger Part of timestamp [s] */
+ uint32_t ts_f; /* Fractional Part of timestamp [ms] */
+ char ts_ci[32]; /* ts_i in charactor */
+ char ts_cf[32]; /* ts_f in charactor */
+
+ VehicleSens_LoadVehicleSpeed(&stVehicleSpeedInfo);
+
+
+#if 1 /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */
+ ts_i = gPseudoSecClockCounter; /* Synchronize: GPS NMEA */
+ ts_f = 0u;
+ gPseudoSecClockCounter += 1u; /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */
+ if (gPseudoSecClockCounter >= VEHICLESENS_NMEA_PASCD_TS_MAX) {
+ gPseudoSecClockCounter = 0u;
+ }
+#else /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */
+
+ ts_i = stVehicleSpeedInfo.listSpd[0].ts.tv_sec % VEHICLESENS_NMEA_PASCD_TS_MAX;
+ ts_f = stVehicleSpeedInfo.listSpd[0].ts.tv_nsec;
+
+#endif /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */
+
+ (void)snprintf(ts_ci, sizeof(ts_ci), "%d", ts_i);
+ (void)snprintf(ts_cf, sizeof(ts_cf), "%06d", ts_f);
+
+ /* Integer Part */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, ts_ci, VEHICLESENS_NMEA_PASCD_TS_INT_LEN_MAX);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ }
+
+ /* Decimal Point */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_DECIMALPOINT, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ }
+
+ /* Fractional Part */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size,
+ ts_cf, VEHICLESENS_NMEA_PASCD_TS_FRA_LEN_MAX);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate SensorType Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate SensorType Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldSensorType(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, VEHICLESENS_NMEA_PASCD_SENSORTYPE_C, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate TransmissionState Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate TransmissionState Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldTransmissionState(char* pascd, size_t size) {
+ RET_API ret_api = RET_NORMAL;
+ EFrameworkunifiedStatus eStatus;
+
+ uint8_t ucType; /* type of transmission */
+ uint8_t ucShift;
+
+#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */
+ uint8_t ucPkb; /* state of parking brake */
+#endif /* For Plus _CWORD27_ Gear Data Support 180115 */
+
+ BOOL bIsAvailable;
+
+ /* Get Type of Transmission */
+
+// eStatus = VehicleIf_GetTypeOfTransmission(&ucType, &bIsAvailable);
+ eStatus = VehicleIf_GetTypeOfTransmission(&ucType, &ucPkb, &bIsAvailable);
+ if ((bIsAvailable != true) || (eStatus != eFrameworkunifiedStatusOK)) {
+ if (bIsAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleIf_GetTypeOfTransmission:%d", eStatus);
+ }
+ ret_api = RET_ERROR;
+ }
+
+ if (ret_api != RET_ERROR) {
+ /* Get Shift Position */
+ eStatus = VehicleIf_GetShiftPosition(&ucShift, &bIsAvailable);
+ if ((bIsAvailable != true) || (eStatus != eFrameworkunifiedStatusOK)) {
+ if (bIsAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleIf_GetShiftPosition:%d", eStatus);
+ }
+ ret_api = RET_ERROR;
+ }
+ }
+
+ if (ret_api != RET_ERROR) {
+ VEHICLESENS_TRANSMISSION_PKG tsmPkg;
+
+ tsmPkg.type = ucType;
+ tsmPkg.shift = ucShift;
+
+#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */
+ tsmPkg.pkb = ucPkb;
+#endif /* For Plus _CWORD27_ Gear Data Support 180115 */
+
+
+ ret_api = VehicleSens_DeriveTransmissionStateFor_CWORD27_(&tsmPkg);
+ if (ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSensDeriveTransmissionStateFor_CWORD27_:%d", ret_api);
+ } else {
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, tsmPkg.state, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate SlipDetect Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate SlipDetect Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldSlipDetect(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, VEHICLESNES_NMEA_PASCD_NOSLIP, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate SampleCount Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate SampleCount Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldSampleCount(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ VEHICLESENS_VEHICLE_SPEED_INFO stVehicleSpeedInfo;
+ char cSampleCount[32];
+
+ VehicleSens_LoadVehicleSpeed(&stVehicleSpeedInfo);
+ (void)snprintf(cSampleCount, sizeof(cSampleCount), "%d", stVehicleSpeedInfo.sampleCount);
+
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, cSampleCount, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate TimeOffset and Speed Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate TimeOffset and Speed Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldTimeOffsetNSpeed(char* pascd, size_t size) {
+ RET_API ret_api = RET_ERROR;
+
+ VEHICLESENS_VEHICLE_SPEED_INFO stVehicleSpeedInfo;
+ VEHICLESENS_VEHICLE_SPEED_DAT *pS0 = &(stVehicleSpeedInfo.listSpd[0]);
+
+ int32_t i;
+
+ VehicleSens_LoadVehicleSpeed(&stVehicleSpeedInfo);
+
+ for (i = 0; i < stVehicleSpeedInfo.sampleCount; i++) {
+ VEHICLESENS_VEHICLE_SPEED_DAT *pS = &(stVehicleSpeedInfo.listSpd[i]);
+
+ /* timeoffset */
+ uint32_t ts_i; /* Interger Part of timestamp [s] */
+ uint32_t ts_f; /* Fractional Part of timestamp [us] */
+ char ts_ci[32]; /* ts_i in charactor */
+ char ts_cf[32]; /* ts_f in charactor */
+
+ if (pS->ts.tv_nsec - pS0->ts.tv_nsec >= 0) { // LCOV_EXCL_BR_LINE 200: can not less than zero
+ ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec) % VEHICLESENS_NMEA_PASCD_TS_MAX;
+ ts_f = (pS->ts.tv_nsec - pS0->ts.tv_nsec) / 1000; /* [ns] -> [us] */
+ } else {
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec - 1) % VEHICLESENS_NMEA_PASCD_TS_MAX;
+ ts_f = (1000000000 + pS->ts.tv_nsec - pS0->ts.tv_nsec) / 1000; /* [ns] -> [us] */
+ // LCOV_EXCL_STOP
+ }
+
+ (void)snprintf(ts_ci, sizeof(ts_ci), "%d", ts_i);
+ (void)snprintf(ts_cf, sizeof(ts_cf), "%06d", ts_f);
+
+ /* Integer Part */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, ts_ci, size);
+ if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ break;
+ // LCOV_EXCL_STOP
+ }
+
+ /* Decimal Point */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_DECIMALPOINT, size);
+ if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ break;
+ // LCOV_EXCL_STOP
+ }
+
+ /* Fractional Part */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size,
+ ts_cf, VEHICLESENS_NMEA_PASCD_TO_FRA_LEN_MAX);
+ if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ break;
+ // LCOV_EXCL_STOP
+ }
+
+ /* speed */
+ uint16_t spd_i; /* Interger Part of speed [m/s] */
+ uint16_t spd_f; /* Fractional Part of speed [mm/s] */
+ char spd_ci[32]; /* spd_i in charactor */
+ char spd_cf[32]; /* spd_f in charactor */
+
+ spd_i = pS->speed / 100; /* [0.01m/s] -> [m/s] */
+ spd_f = (pS->speed % 100) * 10; /* [0.01m/s] -> [mm/s] */
+
+ (void)snprintf(spd_ci, sizeof(spd_ci), "%d", spd_i);
+ (void)snprintf(spd_cf, sizeof(spd_cf), "%03d", spd_f);
+
+ /* Integer Part */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, spd_ci, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ break;
+ }
+
+ /* Decimal Point */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_DECIMALPOINT, size);
+ if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ break;
+ // LCOV_EXCL_STOP
+ }
+
+ /* Fractional Part */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size,
+ spd_cf, VEHICLESENS_NMEA_PASCD_SPD_FRA_LEN_MAX);
+ if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ break;
+ // LCOV_EXCL_STOP
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate Checksum Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate Checksum Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldChecksum(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ size_t length;
+ uint8_t chk = 0;
+ char cChk[3];
+ uint16_t i = 0;
+
+ length = strnlen(pascd, size);
+
+ /* Calculate Checksum (start with the 2th Bype except '$') */
+ for (i = 1; i < length; i++) {
+ chk ^= pascd[i];
+ }
+ (void)snprintf(cChk, sizeof(cChk), "%02X", chk);
+
+ /* Set Astarisk before Checksum */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_ASTARISK, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api);
+ }
+
+ /* Set Checksum */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, cChk, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Generate CR & LF Field of PASCD Sentence
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can generate CRLF Field of PASCD Sentence and <br>
+ * concatenate it with the string given as argument 'pascd'. <br>
+ * It should be called in the specific order.
+ *
+ * @param[in/out] char* pascd : buffer pointer for PASCD Sentence
+ * @param[in] size_t size : buffer size
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static inline RET_API VehicleSens_GeneratePASCDFieldCRLF(char* pascd, size_t size) {
+ RET_API ret_api;
+
+ /* Set Carriage Return */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_CR, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ /* Set Line Feed */
+ ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_LF, size);
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Derive Transmission State For _CWORD27_
+ *
+ * @details This is for creating PASCD Sentence of NMEA. <br>
+ * You can derive transmissionState from the transmission type and <br>
+ * the shift positiong from Vehicle Service.
+ *
+ * @param[in/out] VEHICLESENS_TRANSMISSION_PKG* pPkg : source data set for Transmission State
+ *
+ * @return RET_NORMAL : success
+ * @return RET_ERROR : failed
+ */
+static RET_API VehicleSens_DeriveTransmissionStateFor_CWORD27_(VEHICLESENS_TRANSMISSION_PKG* pPkg) {
+ RET_API ret_api = RET_NORMAL;
+ uint32_t i;
+
+ static const VEHICLESENS_TRANSMISSION_PKG TmsLut[VEHICLEIF_TRANSMISSION_TYPE_NUM * VEHICLEIF_SHIFT_POSITION_NUM] = {
+
+// /* Transmission Type : MT */
+// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_U, VEHICLESENS_NMEA_PASCD_TMS_D },
+// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_R, VEHICLESENS_NMEA_PASCD_TMS_R },
+// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_P, VEHICLESENS_NMEA_PASCD_TMS_D },
+// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_N, VEHICLESENS_NMEA_PASCD_TMS_D },
+// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_D, VEHICLESENS_NMEA_PASCD_TMS_D },
+// /* Tranmission Type : AT */
+// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_U, VEHICLESENS_NMEA_PASCD_TMS_U },
+// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_R, VEHICLESENS_NMEA_PASCD_TMS_R },
+// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_P, VEHICLESENS_NMEA_PASCD_TMS_P },
+// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_N, VEHICLESENS_NMEA_PASCD_TMS_U },
+// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_D, VEHICLESENS_NMEA_PASCD_TMS_D },
+// /* Transmission Type : UNKNOWN */
+// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_U, VEHICLESENS_NMEA_PASCD_TMS_U },
+// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_R, VEHICLESENS_NMEA_PASCD_TMS_U },
+// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_P, VEHICLESENS_NMEA_PASCD_TMS_U },
+// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_N, VEHICLESENS_NMEA_PASCD_TMS_U },
+// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_D, VEHICLESENS_NMEA_PASCD_TMS_U },
+ /* Transmission Type : MT */
+ { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_R },
+ { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ /* Tranmission Type : AT */
+#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */
+ { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U },
+#else /* For Plus _CWORD27_ Gear Data Support 180115 */
+ { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+#endif /* For Plus _CWORD27_ Gear Data Support 180115 */
+ { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_R },
+ { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_P },
+ { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_N }, /* However, the Vehicle does not notify you by Phase3. */
+ { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ /* Transmission Type : UNKNOWN */
+#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U },
+#else /* For Plus _CWORD27_ Gear Data Support 180115 */
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+ { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D },
+#endif /* For Plus _CWORD27_ Gear Data Support 180115 */
+
+ };
+
+ for (i = 0; i < VEHICLEIF_TRANSMISSION_TYPE_NUM * VEHICLEIF_SHIFT_POSITION_NUM; i++) {
+ if ((pPkg->type == TmsLut[i].type) && (pPkg->shift == TmsLut[i].shift)) {
+ strncpy(pPkg->state, TmsLut[i].state, sizeof(pPkg->state));
+ break;
+ }
+ }
+
+
+#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */
+ if ((pPkg->type == VEHICLEIF_TRANSMISSION_TYPE_MT) && (pPkg->pkb == VEHICLEIF_PKB_ON)) {
+ strncpy(pPkg->state, VEHICLESENS_NMEA_PASCD_TMS_P, sizeof(VEHICLESENS_NMEA_PASCD_TMS_P));
+ }
+#endif /* For Plus _CWORD27_ Gear Data Support 180115 */
+
+
+ if (i == VEHICLEIF_TRANSMISSION_TYPE_NUM * VEHICLEIF_SHIFT_POSITION_NUM) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FORBIDDEN ERROR: Can't find Transmission State. type:%d shift:%d", pPkg->type, pPkg->shift);
+ ret_api = RET_ERROR;
+ }
+
+ return ret_api;
+}
diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp
new file mode 100755
index 0000000..0201326
--- /dev/null
+++ b/vehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp
@@ -0,0 +1,455 @@
+/*
+ * @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 VehicleUtility.cpp
+@detail Common processing function of Vehicle
+*****************************************************************************/
+
+#include "VehicleUtility.h"
+#include <vehicle_service/positioning_base_library.h>
+
+#include "gps_hal.h"
+#include "positioning_common.h"
+
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+/** Timer management table */
+static VEHICLEUTILITY_TIM_MNG g_st_tim_mng;
+
+/** Timer setting information table */
+static const VEHICLEUTILITY_TIM_INFO g_tim_info[TIM_NUM] = {
+ /* GSP-related */
+ {TIMVAL_GPS_STARTUP, PNO_NAVI_GPS_MAIN}, /* Start confirmation monitoring timer */
+ {TIMVAL_GPS_RCVCYCLDAT, PNO_NAVI_GPS_MAIN}, /* Periodic reception data monitoring timer */
+ {TIMVAL_GPS_RCVACK, PNO_NAVI_GPS_MAIN}, /* ACK reception monitoring timer */
+ {TIMVAL_GPS_NAVIFST, PNO_NAVI_GPS_MAIN}, /* Initial Navigation Monitoring Timer */
+ {TIMVAL_GPS_NAVICYCLE, PNO_NAVI_GPS_MAIN}, /* Navi monitoring timer */
+ {TIMVAL_GPS_NAVIDISRPT, PNO_NAVI_GPS_MAIN}, /* Navigation Monitoring Disruption Log Output Timer */
+ {TIMVAL_GPS_DIAGCLKGUARD, PNO_NAVI_GPS_MAIN}, /* Diag provision time guard monitoring timer */
+ {TIMVAL_GPS_NMEADATAGUARD, PNO_NAVI_GPS_MAIN}, /* NMEA data-providing guard monitoring timer */
+ {TIMVAL_GPS_RECOVERY, PNO_NAVI_GPS_MAIN}, /* GPS recovery timer */
+ {TIMVAL_GPS_RECEIVERERR, PNO_NAVI_GPS_MAIN}, /* GPS receiver anomaly detection timer */
+ /* Sensor Related Extensions */
+ {TIMVAL_SNS_RCVFSTDAT, PNO_VEHICLE_SENSOR}, /* Initial cyclic sensor data reception monitoring timer */
+ {TIMVAL_SNS_RCVCYCLDAT, PNO_VEHICLE_SENSOR}, /* Cyclic sensor data reception monitoring timer */
+ {TIMVAL_SNS_RCVDISRPT, PNO_VEHICLE_SENSOR}, /* Cyclic sensor data interruption log output timer */
+};
+
+/*---------------------------------------------------------------------------------*
+ * Prototype *
+ *---------------------------------------------------------------------------------*/
+static uint16_t VehicleUtilityTimeMakSeqNo(VEHICLEUTILITY_TIM_KIND tim_kind);
+
+/***************************************************************************
+@brief send message function for Vehicle domain.
+@outline send message function with put error diag function if error occurred.
+@type Completion return type
+@param[in] PNO pno : PNO
+@param[in] u_int16 size : size of message data
+@param[in] void* msgbuf : message data
+@param[in] u_int16 mode : mode
+@threshold
+@return RET_API
+@retval RET_NORMAL : Normal end
+@retval RET_ERROR : Abnormal end
+*****************************************************************************/
+RET_API VehicleUtilitySndMsg(PNO pno, u_int16 size, void *msgbuf, u_int16 mode) {
+ RET_API ret_api;
+ if (msgbuf != NULL) { // LCOV_EXCL_BR_LINE 6: msgbuf cannot be null
+ ret_api = _pb_SndMsg(pno, size, msgbuf, mode);
+ /* RET_ERROR: Execute _pb_Exit() after dialog registration */
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR [ret_api:%d]", ret_api);
+ }
+ } else {
+ ret_api = RET_ERRPARAM;
+ }
+
+ return ret_api;
+}
+
+/***************************************************************************
+@brief send message function for Vehicle domain.
+@outline receive message function with put error diag function if error occurred.
+@type Completion return type
+@param[in] PNO pno : PNO
+@param[in] u_int16 size : size of message data
+@param[in] void* msgbuf : message data
+@param[in] u_int16 mode : mode
+@threshold
+@return RET_API
+@retval RET_NORMAL : Normal end
+@retval RET_ERROR : Abnormal end
+*****************************************************************************/
+RET_API VehicleUtilityRcvMsg(PNO pno, u_int16 size, void **msgbuf, u_int16 mode)
+{
+ RET_API ret_api;
+
+ if (msgbuf != NULL) { // LCOV_EXCL_BR_LINE 6: msgbuf cannot be null
+ ret_api = _pb_RcvMsg(pno, size, msgbuf, mode);
+ /* For RET_ERROR Sys_Exit() after dialog registration */
+ if (ret_api == RET_ERROR) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_RcvMsg ERROR [ret_api:%d]", ret_api);
+ }
+ } else {
+ ret_api = RET_ERRPARAM;
+ }
+
+ return ret_api;
+}
+
+/***************************************************************************
+@brief Diagcode submit for Vehicle domain.
+@outline submit the DiagCode for Vehicle domain.
+@type Completion return type
+@param[in] u_int32 err_id : Diag Code
+@param[in] u_int16 positioning_code : Positioning Code
+@param[in] void* msgbuf : message data
+@return void
+*****************************************************************************/
+void VehicleUtilityDiagCodePut(u_int32 err_id, u_int16 positioning_code) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Timer function initialization processing
+ *
+ */
+void VehicleUtilityInitTimer(void) {
+ VEHICLEUTILITY_TIM_MNG *pst_tim_mng;
+ u_int32 i;
+
+ pst_tim_mng = &g_st_tim_mng;
+
+ /* Initialize timer management table */
+ memset(pst_tim_mng, 0x00, sizeof(VEHICLEUTILITY_TIM_MNG));
+
+ for (i = 0; i < TIM_NUM; i++) {
+ pst_tim_mng->sts[i].flag = TIMER_OFF;
+ pst_tim_mng->sts[i].cnt = 0;
+ }
+}
+
+/**
+ * @brief
+ * Timer start processing<br>
+ *
+ * Starts a timer of the specified type<br>
+ * 1.Increment total number of timer start<br>
+ * 2.Timer Sequence Number Creation<br>
+ * 3.Get timeout value<br>
+ * 4.Timer start<br>
+ *
+ * @param[in] Tim_kind Timer type
+ *
+ * @return TRUE Normal completion<br>
+ * FALSE abend<br>
+ */
+BOOL VehicleUtilitySetTimer(VEHICLEUTILITY_TIM_KIND tim_kind) {
+ VEHICLEUTILITY_TIM_MNG *pst_tim_mng;
+ const uint32_t *p_time_val;
+ const PNO *p_pno;
+ RET_API api_ret; /* Timer API return value */
+ u_int16 seq_no;
+ BOOL ret = TRUE;
+
+ pst_tim_mng = &g_st_tim_mng;
+
+ p_time_val = &(g_tim_info[tim_kind].timer_val); /* Timer set value */
+ p_pno = &(g_tim_info[tim_kind].pno); /* Notify party PNO */
+
+ if (pst_tim_mng->sts[tim_kind].flag == TIMER_ON) {
+ /*-----------------------------------------------------------------------*/
+ /* When the same timer has already started */
+ /* Terminate without starting the timer because the timer is set multiple times. */
+ /*-----------------------------------------------------------------------*/
+ ret = FALSE;
+ } else {
+ /*-----------------------------------------------------------------------*/
+ /* Count up the timer counter of the corresponding timer by 1. */
+ /*-----------------------------------------------------------------------*/
+ if (pst_tim_mng->sts[tim_kind].cnt >= TIM_CNTMAX) {
+ /*-----------------------------------------------------------------------*/
+ /* When the count reaches the maximum number,Count again from 1 */
+ /*-----------------------------------------------------------------------*/
+ pst_tim_mng->sts[tim_kind].cnt = TIM_CNTMIN;
+ } else {
+ /*-----------------------------------------------------------------------*/
+ /* If the count has not reached the maximum,Count up */
+ /*-----------------------------------------------------------------------*/
+ pst_tim_mng->sts[tim_kind].cnt++;
+ }
+
+ /*-----------------------------------------------------------------------*/
+ /* Creating Timer Sequence Numbers */
+ /*-----------------------------------------------------------------------*/
+ seq_no = VehicleUtilityTimeMakSeqNo(tim_kind);
+
+ /*-----------------------------------------------------------------------*/
+ /* Start the timer */
+ /*-----------------------------------------------------------------------*/
+ api_ret = _pb_ReqTimerStart(*p_pno, seq_no, TIMER_TYPE_USN, (u_int32)*p_time_val);
+ if (api_ret != RET_NORMAL) {
+ ret = FALSE;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "_pb_ReqTimerStart ERROR!! [api_ret=%d]", api_ret);
+ } else {
+ /*-----------------------------------------------------------------------*/
+ /* Successful timer start */
+ /* Set the start/stop flag of the corresponding timer to start (MCSUB_ON) */
+ /*-----------------------------------------------------------------------*/
+ pst_tim_mng->sts[tim_kind].flag = TIMER_ON;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Timer stop processing<br>
+ *
+ * Stops a timer of the specified type<br>
+ * 1.Get the sequence number of the specified type<br>
+ * 2.Timer stop<br>
+ *
+ * @param[in] Tim_kind Timer type
+ * @param[in] pno Process number
+ *
+ * @return TRUE Normal completion<br>
+ * FALSE abend<br>
+ */
+BOOL VehicleUtilityStopTimer(VEHICLEUTILITY_TIM_KIND tim_kind) {
+ VEHICLEUTILITY_TIM_MNG *pst_tim_mng;
+ const PNO *p_pno;
+ BOOL ret = TRUE;
+ RET_API api_ret;
+ u_int16 seq_no;
+
+ pst_tim_mng = &g_st_tim_mng;
+
+ p_pno = &(g_tim_info[tim_kind].pno); /* Notify party PNO */
+
+ /* Check timer start/stop flag */
+ if (pst_tim_mng->sts[tim_kind].flag == TIMER_OFF) {
+ /* If it is already stopped, do nothing. */
+ ret = FALSE;
+ } else {
+ /*-----------------------------------------------------------------------*/
+ /* Creating Timer Sequence Numbers */
+ /*-----------------------------------------------------------------------*/
+ seq_no = VehicleUtilityTimeMakSeqNo(tim_kind);
+
+ /*-----------------------------------------------------------------------*/
+ /* Set the corresponding timer to stop */
+ /*-----------------------------------------------------------------------*/
+ api_ret = _pb_TimerStop(*p_pno, seq_no, TIMER_TYPE_USN);
+ if (api_ret != RET_NORMAL) {
+ ret = FALSE;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_TimerStop ERROR!! [api_ret=%d]", api_ret);
+ }
+
+ /*-----------------------------------------------------------------------*/
+ /* Set the start/stop flag of the corresponding timer to stop (MCSUB_OFF) */
+ /* Set the ID of the corresponding timer to invalid (DEV_TED_INVALID) */
+ /*-----------------------------------------------------------------------*/
+ pst_tim_mng->sts[tim_kind].flag = TIMER_OFF;
+ }
+ return ret;
+}
+
+/**
+ * @brief
+ * Timer Sequence Number Determination<br>
+ *
+ * Determine whether the timer sequence number corresponds to the one being managed
+ *
+ * @param[in] seqno Timer Sequence Number
+ *
+ * @return TRUE Normal completion(No problem)<br>
+ * FALSE abend(Unusual number)<br>
+ */
+BOOL VehicleUtilityTimeJdgKnd(uint16_t seqno) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VEHICLEUTILITY_TIM_MNG *pst_tim_mng;
+ BOOL ret;
+ u_int8 timekind;
+ u_int8 count;
+
+ pst_tim_mng = &g_st_tim_mng;
+
+ timekind = (u_int8)((seqno & 0xff00) >> 8);
+ count = (u_int8)(seqno & 0x00ff);
+
+ /* Timer type is unexpected */
+ if (timekind >= TIM_NUM) {
+ ret = FALSE;
+ } else {
+ if ((pst_tim_mng->sts[timekind].cnt == count) &&
+ (pst_tim_mng->sts[timekind].flag == TIMER_ON)) {
+ /* The counter matches and the counter start/stop flag is "Start". */
+ ret = TRUE;
+ } else {
+ /* Not applicable due to differences */
+ ret = FALSE;
+ }
+ }
+
+ return ret;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Timer Sequence Number Creation<br>
+ *
+ * Creating a Sequence Number for a Timer<br>
+ * 1. The upper 1 byte is the timer type.,So that the lower 1 times is the total number of timer starts
+ * Create a sequence number.
+ *
+ * @param[in] Tim_kind Timer type
+ *
+ * @return Timer Sequence Number
+ */
+static uint16_t VehicleUtilityTimeMakSeqNo(VEHICLEUTILITY_TIM_KIND tim_kind) {
+ VEHICLEUTILITY_TIM_MNG *pst_tim_mng;
+ u_int16 seq_no; /* Timer Sequence Number */
+
+ pst_tim_mng = &g_st_tim_mng;
+
+ /*------------------------------------------------------------------------*/
+ /* Definition of Sequence Number */
+ /* |------------------- Sequence number(2Byte) -----------------------| */
+ /* 15 8 7 0 */
+ /* +-------------------------------+-----------------------------------+ */
+ /* | Timer type(1Byte) | Counter(1Byte)(0x01 ? 0xFF) | */
+ /* +-------------------------------+-----------------------------------+ */
+ /* For the timer type,0x00 ? (Number of timers-1) */
+ /* For counters,0x01 ? 0xFF(Do not use 0x00.) */
+ /* (Counters are counted up each time a timer is started. */
+ /* Count up when counter is 0xFF, */
+ /* Be counted up from the 0x01) */
+ /*------------------------------------------------------------------------*/
+ seq_no = static_cast<u_int16>(((u_int16)tim_kind << 8) | (pst_tim_mng->sts[tim_kind].cnt));
+
+ return seq_no;
+}
+
+/**
+ * @brief
+ * External pin status request
+ */
+void LineSensDrvExtTermStsReq(void) {
+ T_APIMSG_MSGBUF_HEADER st_snd_msg;
+ RET_API lret;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ memset(&st_snd_msg, 0x00, sizeof(st_snd_msg));
+
+ st_snd_msg.hdr.sndpno = PNO_LINE_SENS_DRV;
+ st_snd_msg.hdr.respno = 0x0000;
+ st_snd_msg.hdr.cid = CID_EXTTERM_REQ;
+ st_snd_msg.hdr.msgbodysize = 0x00; /* No data */
+ st_snd_msg.hdr.rid = 0x00;
+
+ /* Messaging */
+ lret = _pb_SndMsg(PNO_LINE_SENS_DRV, sizeof(T_APIMSG_MSGBUF_HEADER), &st_snd_msg, 0);
+ if (lret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR!! lret=%d", lret);
+ lret = RET_ERROR;
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return;
+}
+
+
+/**
+ * @brief
+ * Backup data read request send processing<BR>
+ *
+ * @return RET_NORMAL Normal completion
+ * @return RET_ERROR ABENDs
+ */
+RET_API DEVGpsSndBackupDataLoadReq(void) {
+ RET_API lret;
+ T_APIMSG_MSGBUF_HEADER st_snd_msg;
+
+ /** Create GPS Data Notification Message */
+ (void)memset(&st_snd_msg, 0x00, sizeof(st_snd_msg)); /* QAC 3200 */
+ /** Message header */
+ st_snd_msg.hdr.sndpno = 0x0000;
+ st_snd_msg.hdr.respno = 0x0000;
+ st_snd_msg.hdr.cid = CID_GPS_BACKUPDATA_LOAD;
+ st_snd_msg.hdr.msgbodysize = 0x00;
+ st_snd_msg.hdr.rid = 0x00;
+
+ /* Messaging */
+ lret = _pb_SndMsg(PNO_NAVI_GPS_MAIN, sizeof(st_snd_msg), &st_snd_msg, 0);
+ if (lret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR!! [lret=%d]", lret);
+ lret = RET_ERROR;
+ }
+
+ return(lret);
+}
+
+/**
+ * @brief
+ * Acquisition of GPS-format error count information (dump)
+ *
+ * @param[out] p_buf Dump information
+ */
+void DEVGpsGetDebugGpsFormatFailCnt(void* p_buf) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (p_buf != NULL) {
+ snprintf(reinterpret_cast<char *>(p_buf), \
+ 512, "GPS Format Fail Count is not supported.\n"); // NOLINT(readability/nolint)
+ }
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Initial sensor data reception flag acquisition
+ */
+u_int8 LineSensDrvGetSysRecvFlag(void) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 0;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Get GPS Rollover Standard Week Number
+ *
+ * @return GPS rollover base week number
+ */
+uint16_t DEVGpsGetWknRollover(void) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 0;
+}
+// LCOV_EXCL_STOP
+
+/* end of file */
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp
new file mode 100755
index 0000000..da5dba2
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp
@@ -0,0 +1,211 @@
+/*
+ * @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
+ * BackupMgrIf.cpp
+ * @brief
+ * BackupMgr service-to-service interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "BackupMgrIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+
+// static BOOL g_backup_mgr_availability = FALSE;
+BOOL g_backup_mgr_availability = FALSE;
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+
+/**
+ * @brief
+ * BackupMgr Services IF Availability Change Notification Registration
+ *
+ * @param[in] fp_on_cmd Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus BackupMgrIfNotifyOnBackupMgrAvailability(CbFuncPtr fp_on_cmd) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ /* NS_BackupMgr/Availability Changing notification registration */
+ estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_BackupMgr_Availability, (CbFuncPtr)fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ if (eFrameworkunifiedStatusOK != estatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * BackupMgr Services IF-Availability Settings
+ *
+ * @param[in] b_is_available Available state
+ * @return none
+ */
+void BackupMgrIfSetAvailability(BOOL b_is_available) {
+ g_backup_mgr_availability = b_is_available;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \
+ "g_backup_mgr_availability=%d", g_backup_mgr_availability);
+
+ return;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * @brief
+ * BackupMgr Services IF-Availability Acquisition
+ *
+ * @param[in] none
+ * @return gb_BackupMgrAvailability
+ */
+
+BOOL BackupMgrIf_GetAvailability(void)
+{
+ return g_backup_mgr_availability;
+}
+#ifdef __cplusplus
+}
+#endif
+
+/**
+ * @brief
+ * Import BackupMgr Services IFs
+ *
+ * @param[in] tag_id
+ * @param[in] ui_offset
+ * @param[in] *pv_buf
+ * @param[in] ui_size
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus BackupMgrIfBackupDataRd(PCSTR tag_id, uint32_t ui_offset, void *pv_buf, \
+ uint32_t ui_size, BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ int32_t lret;
+
+ if (BackupMgrIf_GetAvailability() == TRUE) {
+ lret = Backup_DataRd(tag_id, ui_offset, pv_buf, ui_size);
+ if (lret == BKUP_RET_NORMAL) {
+ /* 8Byte fixed outputs */
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, \
+ "Backup_DataRd Done [tag_id=%s, pv_buf(Hex):%02x %02x %02x %02x %02x %02x %02x %02x, offset=%d, size=%d]",
+ tag_id,
+ *(reinterpret_cast<int8_t*>(pv_buf)),
+ *((reinterpret_cast<int8_t*>(pv_buf))+1),
+ *((reinterpret_cast<int8_t*>(pv_buf))+2),
+ *((reinterpret_cast<int8_t*>(pv_buf))+3),
+ *((reinterpret_cast<int8_t*>(pv_buf))+4),
+ *((reinterpret_cast<int8_t*>(pv_buf))+5),
+ *((reinterpret_cast<int8_t*>(pv_buf))+6),
+ *((reinterpret_cast<int8_t*>(pv_buf))+7),
+ ui_offset, ui_size);
+
+ estatus = eFrameworkunifiedStatusOK;
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "Backup_DataRd ERROR!! [lret=%d, tag_id=%s, ui_offset=%d, pv_buf=%p, ui_size=%d]", \
+ lret, tag_id, ui_offset, pv_buf, ui_size);
+ }
+ } else {
+ /* nop */
+ }
+
+ *pb_is_available = BackupMgrIf_GetAvailability();
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * BackupMgr Services IF Write
+ *
+ * @param[in] tag_id
+ * @param[in] *pv_buf
+ * @param[in] ui_offset
+ * @param[in] ui_size
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus BackupMgrIfBackupDataWt(PCSTR tag_id, void *pv_buf, uint32_t ui_offset, \
+ uint32_t ui_size, BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ int32_t lret;
+
+ if (BackupMgrIf_GetAvailability() == TRUE) {
+ lret = Backup_DataWt(tag_id, pv_buf, ui_offset, ui_size);
+ if (lret == BKUP_RET_NORMAL) {
+ /* 8Byte fixed outputs */
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__,
+ "Backup_DataWt Done [tag_id=%s, pv_buf(Hex):%02x %02x %02x %02x %02x %02x %02x %02x, offset=%d, size=%d]",
+ tag_id,
+ *(reinterpret_cast<int8_t*>(pv_buf)),
+ *((reinterpret_cast<int8_t*>(pv_buf))+1),
+ *((reinterpret_cast<int8_t*>(pv_buf))+2),
+ *((reinterpret_cast<int8_t*>(pv_buf))+3),
+ *((reinterpret_cast<int8_t*>(pv_buf))+4),
+ *((reinterpret_cast<int8_t*>(pv_buf))+5),
+ *((reinterpret_cast<int8_t*>(pv_buf))+6),
+ *((reinterpret_cast<int8_t*>(pv_buf))+7),
+ ui_offset, ui_size);
+
+ estatus = eFrameworkunifiedStatusOK;
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "Backup_DataWt ERROR!! [lret=%d, tag_id=%s, pv_buf=%p, ui_offset=%d, ui_size=%d]", \
+ lret, tag_id, pv_buf, ui_offset, ui_size);
+ }
+ } else {
+ /* nop */
+ }
+
+ *pb_is_available = BackupMgrIf_GetAvailability();
+
+ return estatus;
+}
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp
new file mode 100755
index 0000000..52fd4cf
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp
@@ -0,0 +1,138 @@
+/*
+ * @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
+ * ClockIf.cpp
+ * @brief
+ * Clock service-to-service interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "ClockIf.h"
+#include <stub/clock_notifications.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static BOOL g_clock_availability = FALSE;
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Clock Services IF Availability Change Notification Registration
+ *
+ * @param[in] fp_on_cmd Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus ClockIfNotifyOnClockAvailability(CbFuncPtr fp_on_cmd) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ /* Clock/Availability Changing notification registration */
+ estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_Clock_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * Clock Services IF-Availability Settings
+ *
+ * @param[in] b_is_available Available state
+ * @return none
+ */
+void ClockIfSetAvailability(BOOL b_is_available) {
+ g_clock_availability = b_is_available;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "g_clock_availability=%d", g_clock_availability);
+
+ return;
+}
+
+/**
+ * @brief
+ * Clock Services IF GPS Time
+ *
+ * @param[in] *gps_time GPS time
+ * @param[out] *b_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus ClockIfDtimeSetGpsTime(const SENSOR_MSG_GPSTIME *pst_gps_time, BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+ T_DTIME_MSG_GPSTIME st_dtime_gpstime;
+
+ if (g_clock_availability == TRUE) {
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ st_dtime_gpstime.utc.year = pst_gps_time->utc.year;
+ st_dtime_gpstime.utc.month = pst_gps_time->utc.month;
+ st_dtime_gpstime.utc.date = pst_gps_time->utc.date;
+ st_dtime_gpstime.utc.hour = pst_gps_time->utc.hour;
+ st_dtime_gpstime.utc.minute = pst_gps_time->utc.minute;
+ st_dtime_gpstime.utc.second = pst_gps_time->utc.second;
+ st_dtime_gpstime.tdsts = pst_gps_time->tdsts;
+
+ /* Set GPS time for Clock services */
+ estatus = DTime_setGpsTime(happ, &st_dtime_gpstime);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "DTime_setGpsTime ERROR!! [ret=%d, y=%d, m=%d, d=%d, h=%d, n=%d, s=%d, sts=%d]", \
+ estatus, st_dtime_gpstime.utc.year, st_dtime_gpstime.utc.month, st_dtime_gpstime.utc.date, \
+ st_dtime_gpstime.utc.hour, st_dtime_gpstime.utc.minute, st_dtime_gpstime.utc.second, \
+ st_dtime_gpstime.tdsts);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+ } else {
+ /* nop */
+ }
+
+ *pb_is_available = g_clock_availability;
+
+ return estatus;
+}
+
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp
new file mode 100755
index 0000000..b776ff0
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp
@@ -0,0 +1,147 @@
+/*
+ * @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
+ * CommUsbIf.cpp
+ * @brief
+ * CommUSB service-to-service interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "CommUsbIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static BOOL g_comm_usb_availability = FALSE;
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Registering CommUSB Services IF Callback Functions
+ *
+ * @param[in] *p_msg_handler Callback function table
+ * @param[in] Ui_handler_count Number of callback functions
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus CommUsbIfAttachCallbacksToDispatcher( // NOLINT(readability/nolint)
+ _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler,
+ unsigned int ui_handler_count) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ estatus = FrameworkunifiedAttachCallbacksToDispatcher(happ, "NS_ANY_SRC", p_msg_handler, ui_handler_count);
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedAttachCallbacksToDispatcher ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * Remove CommUSB Services IF Callback Functions
+ *
+ * @param[in] *p_msg_handler CID table
+ * @param[in] ui_handler_count Number of CIDs
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus CommUsbIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ estatus = FrameworkunifiedDetachCallbacksFromDispatcher(happ, "NS_ANY_SRC", pui_cmd_array, ui_command_count, NULL);
+ /* In the event of failure */
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "PositioningDetachCallbacksToDispatcher Failed in FrameworkunifiedOnStop [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * CommUSB Services IF Availability Change Notification Registration
+ *
+ * @param[in] fp_on_cmd Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus CommUsbIfNotifyOnCommUSBAvailability(CbFuncPtr fp_on_cmd) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* PS_CommUSB/Availability Changing notification registration */
+ estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_CommUSB_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * CommUSB Services IF-Availability Settings
+ *
+ * @param[in] pb_is_available
+ * @return none
+ */
+void CommUsbIfSetAvailability(BOOL b_is_available) {
+ g_comm_usb_availability = b_is_available;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "g_comm_usb_availability=%d", g_comm_usb_availability);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp
new file mode 100755
index 0000000..800429f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp
@@ -0,0 +1,279 @@
+/*
+ * @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
+ * DevDetectSrvIf.cpp
+ * @brief
+ * DevDetectSrv service-to-service interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "DevDetectSrvIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static BOOL g_dev_detect_srv_availability = FALSE;
+
+/** Device insertion detection */
+DeviceDetectionServiceIf g_if_ss_dev;
+
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * DevDetectSrv Services IF-Availability Settings
+ *
+ * @param[in] b_is_available Available state
+ * @return none
+ */
+void DevDetectSrvIfSetAvailability(BOOL b_is_available) {
+ g_dev_detect_srv_availability = b_is_available;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \
+ "g_dev_detect_srv_availability=%d", g_dev_detect_srv_availability);
+
+ return;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF-Initialization
+ *
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfInitialize(void) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ BOOL bret;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ bret = g_if_ss_dev.Initialize(happ);
+ if (bret == TRUE) {
+ estatus = eFrameworkunifiedStatusOK;
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "g_if_ss_dev::Initialize ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF Availability Change Notification Registration
+ *
+ * @param[in] fp_call_back_fn Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfNotifyOnDeviceDetectionAvailability(CbFuncPtr fp_call_back_fn) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ estatus = g_if_ss_dev.NotifyOnDeviceDetectionAvailability(fp_call_back_fn);
+ if (eFrameworkunifiedStatusOK != estatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf Availability ERROR!! [estatus = %d]", estatus);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF OpenSessionRequest Complete Answer Receive Callback Registration
+ *
+ * @param[in] fp_call_back_fn Callback function
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfNotifyOnOpenSessionAck(CbFuncPtr fp_call_back_fn, BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.NotifyOnOpenSessionAck(fp_call_back_fn);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF CloseSessionRequest Complete Answer Receive Callback Registration
+ *
+ * @param[in] fp_call_back_fn Callback function
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfNotifyOnCloseSessionAck(CbFuncPtr fp_call_back_fn, BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.NotifyOnCloseSessionAck(fp_call_back_fn);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Service IF Service and Session Generation
+ *
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfOpenSessionRequest(BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.OpenSessionRequest();
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF-Session Id Retention
+ *
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfDecodeOpenSessionResponse(BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.DecodeOpenSessionResponse();
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF-Device Event Receive Callback Registration
+ *
+ * @param[in] fe_dev_detect_event
+ * @param[in] fp_call_back_fn
+ * @param[in] p_file_path
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfRegisterForDeviceDetectionEvent(SS_DeviceDetectionServerEvents fe_dev_detect_event, \
+ CbFuncPtr fp_call_back_fn, PCSTR p_file_path, BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.RegisterForDeviceDetectionEvent(fe_dev_detect_event, fp_call_back_fn, p_file_path);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Services IF DeviceDetectionServiceIf Callback Release
+ *
+ * @param[in] fe_dev_detect_event
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfUnRegisterForDeviceDetectionEvent(SS_DeviceDetectionServerEvents fe_dev_detect_event, \
+ BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.UnRegisterForDeviceDetectionEvent(fe_dev_detect_event);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * DevDetectSrv Service IF Service and Destroy Sessions
+ *
+ * @param[out] pb_is_available Available state
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus DevDetectSrvIfCloseSessionRequest(BOOL* pb_is_available) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+
+ if (g_dev_detect_srv_availability == TRUE) {
+ estatus = g_if_ss_dev.CloseSessionRequest();
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE");
+ }
+
+ *pb_is_available = g_dev_detect_srv_availability;
+
+ return estatus;
+}
+
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp
new file mode 100755
index 0000000..195555e
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp
@@ -0,0 +1,64 @@
+/*
+ * @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
+ * DiagSrvIf.cpp
+ * @brief
+ * DiagSrv service-to-service interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "DiagSrvIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static BOOL g_registration_permission = FALSE; /* Whether or not the dialog code can be registered */
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * DiagSrv Services IF Registration Enable Status Setting
+ *
+ * @param[in] b_is_true
+ * @return none
+ */
+void DiagSrvIfSetRegistrationPermission(BOOL b_is_true) {
+ g_registration_permission = b_is_true;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \
+ "g_registration_permission=%d", g_registration_permission);
+
+ return;
+}
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/Makefile b/vehicleservice/positioning/server/src/ServiceInterface/Makefile
new file mode 100755
index 0000000..fba98e8
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/Makefile
@@ -0,0 +1,54 @@
+#
+# @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.
+#
+
+######### installed library(*.a) #############
+INST_LIBS = libPOS_ServiceInterface
+
+######### compiled sources #############
+libPOS_ServiceInterface_SRCS += BackupMgrIf.cpp
+libPOS_ServiceInterface_SRCS += ClockIf.cpp
+libPOS_ServiceInterface_SRCS += CommUsbIf.cpp
+libPOS_ServiceInterface_SRCS += DevDetectSrvIf.cpp
+libPOS_ServiceInterface_SRCS += DiagSrvIf.cpp
+libPOS_ServiceInterface_SRCS += PSMShadowIf.cpp
+libPOS_ServiceInterface_SRCS += VehicleIf.cpp
+
+######### add include path #############
+CPPFLAGS += -I../../include/common/
+CPPFLAGS += -I../../include/nsfw/
+CPPFLAGS += -I../../include/ServiceInterface
+
+CPPFLAGS += -I../../../client/include
+
+#CPPFLAGS += -I../../../../diag_code/library/include
+
+######### add compile option #############
+CPPFLAGS += -DLINUX
+
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### add library path #############
+LDFLAGS +=
+
+include ../../../../vehicle_service.mk
+
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp
new file mode 100755
index 0000000..99d9a52
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp
@@ -0,0 +1,102 @@
+/*
+ * @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
+ * PSMShadowIf.cpp
+ * @brief
+ * PSMShadow service-to-service interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "PSMShadowIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * PSMShadow Services IF Availability Change Notification Registration
+ *
+ * @param[in] fp_on_cmd Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus PSMShadowIfNotifyOnPSMShadowAvailability(CbFuncPtr fp_on_cmd) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ /* PS_PSMShadow/Availability Changing notification registration */
+ estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_PSMShadowService_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * Register PSMShadow services IF start completion notification
+ *
+ * @param[in] fp_on_cmd Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus PSMShadowIfNotifyOnPSMShadowInitComp(CbFuncPtr fp_on_cmd) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (happ != NULL) {
+ /* PS_PSMShadow startup completion notice */
+ estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_PSM_INITCOMP, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp
new file mode 100755
index 0000000..0ef5e15
--- /dev/null
+++ b/vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp
@@ -0,0 +1,364 @@
+/*
+ * @copyright Copyright (c) 2018-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
+ * VehilceIf.cpp
+ * @brief
+ * Vehicle Service Interface
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include <stub/Vehicle_Sensor_Common_API.h>
+#include <stub/Vehicle_API.h>
+#include <stub/vehicle_notifications.h>
+
+#include "VehicleIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static BOOL gb_vehicleAvailability = FALSE;
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Registering Vehicle Services IF Callback Functions
+ *
+ * @param[in] *p_msg_handler Callback function table
+ * @param[in] Ui_handler_count Number of callback functions
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus VehicleIfAttachCallbacksToDispatcher( // NOLINT(readability/nolint)
+ _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler,
+ unsigned int ui_handler_count) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (NULL != happ) {
+ estatus = FrameworkunifiedAttachCallbacksToDispatcher(happ, "NS_ANY_SRC", p_msg_handler, ui_handler_count);
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedAttachCallbacksToDispatcher ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * Vehicle IF: Set Availability Status
+ *
+ * @details This function sets status of Vehicle/Availablity stored in local. <br>
+ * Only when the status is true, Vehicle I/F is called by wrappers.
+ *
+ * @param[in] BOOL bIsAvailable : Availability Status
+ */
+void VehicleIf_SetAvailability(BOOL bIsAvailable)
+{
+ gb_vehicleAvailability = bIsAvailable;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "gb_vehicleAvailability=%d", gb_vehicleAvailability);
+
+ return;
+}
+
+/**
+ * @brief
+ * Remove Vehicle Services IF Callback Functions
+ *
+ * @param[in] *p_msg_handler CID table
+ * @param[in] ui_handler_count Number of CIDs
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus VehicleIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (NULL != happ) {
+ estatus = FrameworkunifiedDetachCallbacksFromDispatcher(happ, "NS_ANY_SRC", pui_cmd_array, ui_command_count, NULL);
+ /* In the event of failure */
+ if (eFrameworkunifiedStatusOK != estatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningDetachCallbacksToDispatcher Failed in FrameworkunifiedOnStop [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * Vehicle IF: Get Type of Transmission
+ *
+ * @details This function is wrapper function of Vehicle I/F. <br>
+ * You can get the type of transmission of the vehicle.
+ *
+ * @param[out] uint8_t* pType : Type of Transmission
+ * @param[out] BOOL* bIsAvailable : Availability Status
+ *
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+
+//EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, BOOL* pbIsAvailable)
+EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, uint8_t* pPkb, BOOL* pbIsAvailable)
+{
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail;
+ VEHICLE_RET_API ret;
+ HANDLE hApp;
+ uint8_t ucVartrm;
+
+#if 1 /* Plus _CWORD27_ Gear Data Support 180115 */
+ uint8_t ucPkb;
+#endif /* Plus _CWORD27_ Gear Data Support 180115 */
+
+
+ if (gb_vehicleAvailability == TRUE)
+ {
+ hApp = _pb_GetAppHandle();
+ if (hApp != NULL)
+ {
+ ret = Vehicle_GetVehicleData(hApp, VEHICLE_DID_VARTRM1, &ucVartrm, sizeof(ucVartrm));
+ if (ret < VEHICLE_RET_NORMAL)
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: Vehicle_GetVehicleData:%d", ret);
+ }
+ else
+ {
+ eStatus = eFrameworkunifiedStatusOK;
+
+ switch (ucVartrm)
+ {
+ case VEHICLE_SNS_VARTRM1_AT:
+ case VEHICLE_SNS_VARTRM1_CVT:
+ case VEHICLE_SNS_VARTRM1_HV_AT:
+ {
+ *pType = VEHICLEIF_TRANSMISSION_TYPE_AT;
+ break;
+ }
+ case VEHICLE_SNS_VARTRM1_MT:
+ case VEHICLE_SNS_VARTRM1_MMT:
+ case VEHICLE_SNS_VARTRM1_SMT:
+ {
+ *pType = VEHICLEIF_TRANSMISSION_TYPE_MT;
+ break;
+ }
+ case VEHICLE_SNS_VARTRM1_UNCERTAINTY:
+ {
+ *pType = VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN;
+ break;
+ }
+ default:
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: Type of transmission is unknown. (%d)", ucVartrm);
+
+ *pType = VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN;
+ break;
+ }
+ }
+ }
+
+#if 1 /* Plus _CWORD27_ Gear Data Support 180115 */
+ ret = Vehicle_GetVehicleData(hApp, VEHICLE_DID_PKB, &ucPkb, sizeof(ucPkb));
+ if (ret < VEHICLE_RET_NORMAL)
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: Vehicle_GetVehicleData:%d", ret);
+ }
+ else
+ {
+ eStatus = eFrameworkunifiedStatusOK;
+
+ switch (ucPkb)
+ {
+ case VEHICLE_SNS_OFF: // R-state
+ //case VEHICLE_SNS_ANTI: // Antilock(Vehicle undefined)
+ {
+ *pPkb = VEHICLEIF_PKB_OFF;
+ break;
+ }
+ case VEHICLE_SNS_ON: // Lock state
+ {
+ *pPkb = VEHICLEIF_PKB_ON;
+ break;
+ }
+ default:
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "ERROR: State of parking brake is unknown. (%d)", ucPkb);
+
+ *pPkb = VEHICLEIF_PKB_OFF;
+ break;
+ }
+ }
+ }
+#endif /* Plus _CWORD27_ Gear Data Support 180115 */
+
+ }
+ else
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: _pb_GetAppHandle hApp:%p", hApp);
+ }
+ }
+ else
+ {
+ /* nop */
+ }
+
+ *pbIsAvailable = gb_vehicleAvailability;
+
+ return eStatus;
+}
+
+/**
+ * @brief
+ * Vehicle Services IF Availability Change Notification Registration
+ *
+ * @param[in] fp_on_cmd Callback function
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus VehicleIfNotifyOnVehicleAvailability(CbFuncPtr fp_on_cmd) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+
+ happ = _pb_GetAppHandle();
+ if (NULL != happ) {
+ /* Vehicle/Availability Changing notification registration */
+ estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_Vehicle_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length)
+ if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus);
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+
+ return estatus;
+}
+
+/**
+ * @brief
+ * Vehicle IF: Get Shift Position
+ *
+ * @details This function is wrapper function of Vehicle I/F. <br>
+ * You can get the shift position of the vehicle.
+ *
+ * @param[out] uint8_t* pShift : Shift Position
+ * @param[out] BOOL* bIsAvailable : Availability Status
+ *
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+EFrameworkunifiedStatus VehicleIf_GetShiftPosition(uint8_t* pShift, BOOL* pbIsAvailable)
+{
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail;
+ VEHICLE_RET_API ret;
+ HANDLE hApp;
+
+ if (gb_vehicleAvailability == TRUE)
+ {
+ hApp = _pb_GetAppHandle();
+ if (hApp != NULL)
+ {
+ ret = Vehicle_GetVehicleData(hApp, VEHICLE_DID_SHIFT, pShift, sizeof(*pShift));
+ if (ret < VEHICLE_RET_NORMAL)
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: Vehicle_GetVehicleData:%d", ret);
+ }
+ else
+ {
+ eStatus = eFrameworkunifiedStatusOK;
+ }
+ }
+ else
+ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: _pb_GetAppHandle hApp:%p", hApp);
+ }
+ }
+ else
+ {
+ /* nop */
+ }
+
+ *pbIsAvailable = gb_vehicleAvailability;
+
+ return eStatus;
+}
+
+
+/**
+ * @brief
+ * Vehicle services IF Info data-delivery registry
+ *
+ * @param[in] ul_did
+ * @return eFrameworkunifiedStatusOK
+ * @return eFrameworkunifiedStatusFail
+ */
+
+EFrameworkunifiedStatus VehicleIfDeliveryEntry(uint32_t ul_did) {
+ EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail;
+ HANDLE happ;
+ VEHICLE_RET_API iret;
+
+ if (TRUE == gb_vehicleAvailability) {
+ happ = _pb_GetAppHandle();
+ if (NULL != happ) {
+ /* Sensor data delivery registration */
+ iret = Vehicle_DeliveryEntry(happ, (PCSTR)POS_THREAD_NAME, ul_did,
+ VEHICLE_DELIVERY_REGIST, VEHICLE_DELIVERY_TIMING_UPDATE);
+ if (VEHICLE_RET_NORMAL != iret) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "Vehicle_DeliveryEntry ERROR!! [iret=%d]", iret);
+ } else {
+ estatus = eFrameworkunifiedStatusOK;
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ);
+ }
+ } else {
+ /* nop */
+ }
+ return estatus;
+}
+
diff --git a/vehicleservice/positioning/server/src/nsfw/Makefile b/vehicleservice/positioning/server/src/nsfw/Makefile
new file mode 100755
index 0000000..403e29f
--- /dev/null
+++ b/vehicleservice/positioning/server/src/nsfw/Makefile
@@ -0,0 +1,89 @@
+#
+# @copyright Copyright (c) 2017-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.
+#
+
+######### installed program #############
+INST_PROGS = Positioning
+
+######### compiled sources #############
+Positioning_SRCS += ps_main.cpp
+Positioning_SRCS += positioning_application.cpp
+
+ifeq ($(ARCH),arm64)
+LDLIBS += -Wl,-Bdynamic -lpositioning_hal
+else
+LDLIBS += -Wl,-Bdynamic -lpositioning_hal
+endif #($(ARCH),arm64)
+
+######### add include path #############
+CPPFLAGS += -I../../../client/include
+CPPFLAGS += -I../../include/common/
+CPPFLAGS += -I../../include/Sensor/
+CPPFLAGS += -I../../include/ServiceInterface/
+CPPFLAGS += -I../../include/nsfw/
+#CPPFLAGS += -I../../../../diag_code/library/include
+
+######### add compile option #############
+CPPFLAGS += -DLINUX
+CPPFLAGS += -DIMPL_AGL_APPLICATION_CALLBACKS_PRE_BACKGROUND
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### linked library(static) #############
+LDLIBS += -Wl,-Bstatic -lPOS_Sensor
+LDLIBS += -Wl,-Bstatic -lPOS_ServiceInterface
+
+# LDLIBS += -Wl,-Bstatic -lVehicle_API
+
+######### linked library (dynamic) #############
+ifeq (arm64, $(ARCH))
+LDLIBS += -Wl,-Bdynamic -lpositioning_hal
+LDLIBS += -Wl,-Bdynamic -lVehicle_API
+endif
+LDLIBS += -Wl,-Bdynamic -lClock_API
+#LDLIBS += -Wl,-Bdynamic -lMM_DREC_API
+#LDLIBS += -Wl,-Bdynamic -lextension
+LDLIBS += -Wl,-Bdynamic -lPOS_base_API
+LDLIBS += -Wl,-Bdynamic -lPOS_common_API
+LDLIBS += -Wl,-Bdynamic -lPOS_gps_API
+LDLIBS += -Wl,-Bdynamic -lPOS_sensor_API
+LDLIBS += -Wl,-Bdynamic -lz
+LDLIBS += -Wl,-Bdynamic -lSS_SystemIfUnified
+LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
+LDLIBS += -Wl,-Bdynamic -lns_backup
+LDLIBS += -Wl,-Bdynamic -lssver
+LDLIBS += -Wl,-Bdynamic -lstdc++
+#LDLIBS += -Wl,-Bdynamic -lDiagCodeAPI
+LDLIBS += -Wl,-Bdynamic -lDTime_Api
+LDLIBS += -Wl,-Bdynamic -lVehicle_API
+LDLIBS += -Wl,-Bdynamic -lvp
+LDLIBS += -Wl,-Bdynamic -lev
+LDLIBS += -Wl,-Bdynamic -lCommUSB
+
+######### add library path #############
+LDFLAGS += -L../../positioning_hal
+LDFLAGS += -L../Sensor
+LDFLAGS += -L../ServiceInterface
+LDFLAGS += -L../../../client/src/POS_common_API
+LDFLAGS += -L../../../client/src/POS_gps_API
+LDFLAGS += -L../../../client/src/POS_sensor_API
+
+include ../../../../vehicle_service.mk
diff --git a/vehicleservice/positioning/server/src/nsfw/positioning_application.cpp b/vehicleservice/positioning/server/src/nsfw/positioning_application.cpp
new file mode 100755
index 0000000..d23daad
--- /dev/null
+++ b/vehicleservice/positioning/server/src/nsfw/positioning_application.cpp
@@ -0,0 +1,2593 @@
+/*
+ * @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
+ * positioning_application.cpp
+ * @brief
+ * Module : POSITIONING
+ * Implements Vehicle service functionality
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_application.h>
+#include <native_service/frameworkunified_framework_if.h>
+#include <native_service/frameworkunified_multithreading.h>
+#include <native_service/frameworkunified_service_protocol.h>
+#include <native_service/frameworkunified_types.h>
+#include <native_service/ns_message_center_if.h>
+#include <peripheral_service/ps_services.h>
+#include <vehicle_service/POS_sensor_API.h>
+#include <vehicle_service/POS_gps_API.h>
+#include <system_service/ss_sm_client_if.h>
+#include <vehicle_service/positioning_base_library.h>
+#include <stub/vehicle_notifications.h>
+#include <peripheral_service/communication_notifications.h>
+#include <other_service/VP_GetEnv.h>
+#include <cstdlib>
+#include <iostream>
+
+#include "SensorLog.h"
+#include "positioning_common.h"
+#include "POS_private.h"
+#include "Gps_API_private.h"
+#include "POS_common_private.h"
+#include "Vehicle_API.h"
+#include "Vehicle_API_private.h"
+#include "Sensor_API_private.h"
+#include "Naviinfo_API.h"
+#include "VehicleSensor_Thread.h"
+#include "ClockGPS_Process_Proto.h"
+#include "VehicleSens_Common.h"
+#include "VehicleSens_DataMaster.h"
+#include "VehicleSens_DeliveryCtrl.h"
+#include "VehicleUtility.h"
+#include "BackupMgrIf.h"
+#include "ClockIf.h"
+#include "CommUsbIf.h"
+#include "DevDetectSrvIf.h"
+#include "DiagSrvIf.h"
+#include "PSMShadowIf.h"
+#include "VehicleIf.h"
+#include "positioning_hal.h"
+#include "gps_hal.h"
+#include "CommonDefine.h"
+
+#include "VehicleIf.h"
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+#define DATMOD_RETRY (3) /* Number of shared memory generation retries */
+#define DATMOD_PREINIT (0) /* Shared Memory State Before Initialization */
+#define PRIM_NAME_MAX (32) /* Maximum Name Size */
+
+/* Mask for managing various notification reception conditions */
+#define NTFY_MSK_NONE (0x00)
+/* Service availability notification */
+#define NTFY_MSK_COMMUNICATION_AVAILABILITY (0x01)
+#define NTFY_MSK_PS_COMMUSB_AVAILABILITY (0x02)
+#define NTFY_MSK_PS_PSMSHADOW_AVAILABILITY (0x04)
+#define NTFY_MSK_CLOCK_AVAILABILITY (0x08)
+#define NTFY_MSK_NS_BACKUPMGR_AVAILABILITY (0x10)
+#define NTFY_MSK_SS_DEVDETSRV_AVAILABILITY (0x20)
+#define NTFY_MSK_VS_VEHICLE_AVAILABILITY (0x40)
+/* Other Notices */
+#define NTFY_MSK_PS_PSMSHADOW_INIT_COMP (0x01) /* PSMShadow startup completion notice */
+
+/* Thread state */
+#define THREAD_STS_NOEXIST (0x00)
+#define THREAD_STS_CREATING (0x01)
+#define THREAD_STS_CREATED (0x02)
+
+#define POS_SNDMSG_DTSIZE_1 1 /* SndMSG data size 1Byte */
+#define POS_SNDMSG_DTSIZE_2 2 /* SndMSG data size 2Byte */
+#define POS_SNDMSG_DTSIZE_20 20 /* SndMSG data size of 20 bytes */
+#define POS_SNDMSG_DTSIZE_132 132 /* SndMSG data size: 132 bytes */
+
+/* PositioningLogFlag */
+#define POSITIONINGLOG_FLAG_NAVI 9
+
+/* Definition for thinning out sensor log at anomaly */
+#define POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM 3
+#define POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM 4
+#define POSITIONINGLOG_SYS_3_ABNORMAL_DATA_NUM 4
+#define POSITIONINGLOG_SYS_4_ABNORMAL_DATA_NUM 129
+#define POSITIONINGLOG_SYS_ABNORMAL_DATA_NUM (POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM + \
+ POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM + \
+ POSITIONINGLOG_SYS_3_ABNORMAL_DATA_NUM + \
+ POSITIONINGLOG_SYS_4_ABNORMAL_DATA_NUM)
+#define POSITIONINGLOG_SYS_1_ABNORMAL_DATA_OFFSET 11
+#define POSITIONINGLOG_SYS_2_ABNORMAL_DATA_OFFSET 32
+#define POSITIONINGLOG_SYS_3_ABNORMAL_DATA_OFFSET 54
+#define POSITIONINGLOG_SYS_4_ABNORMAL_DATA_OFFSET 114
+#define POSITIONINGLOG_SYS_1_ABNORMAL_SET_DATA_OFFSET 0
+#define POSITIONINGLOG_SYS_2_ABNORMAL_SET_DATA_OFFSET POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM
+#define POSITIONINGLOG_SYS_3_ABNORMAL_SET_DATA_OFFSET (POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM + POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM)
+#define POSITIONINGLOG_SYS_4_ABNORMAL_SET_DATA_OFFSET (POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM + \
+ POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM + \
+ POSITIONINGLOG_SYS_3_ABNORMAL_DATA_NUM)
+#define POSITIONINGLOG_SYS_OPC_OFFSET 9
+#define POSITIONINGLOG_SYS_PULSE_TIME_NUM_OFFSET 114
+#define POSITIONINGLOG_SYS_NORMAL_DATA 0xC1
+#define POSITIONINGLOG_SYS_FST_DATA 0xF4
+#define _pb_strcat(pdest, psrc, size) (strncat(pdest, psrc, size) , (0))
+
+// Vehicle sensor information notification message
+typedef struct {
+ uint32_t did; // Data ID corresponding to vehicle sensor information
+ uint16_t size; // Data size of vehicle sensor information
+ uint8_t rcv_flag; // Vehicle sensor information reception flag
+ uint8_t reserve; // Reserved
+ uint8_t data[VEHICLE_VSINFO_DSIZE]; // Vehicle sensor information
+} VEHICLE_UNIT_MSG_VSINFO_DAT;
+
+// Vehicle sensor information notification message
+typedef struct {
+ VEHICLE_UNIT_MSG_VSINFO_DAT data; // Message data
+} VEHICLE_UNIT_MSG_VSINFO;
+/*---------------------------------------------------------------------------------*
+ * Structre *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Structure to create shared data
+*/
+typedef struct {
+ char share_data_name[PRIM_NAME_MAX]; /**< Shared data name */
+ u_int32 data_size; /**< Shared data size */
+} ST_SHAREDATA;
+
+/*!
+ @brief Thread management information
+*/
+typedef struct {
+ EnumTID_POS id; /**< Thread ID */
+ const int8_t* p_name; /**< Thread name */
+ PNO pno; /**< Process number */
+ CbFuncPtr routine; /**< Start Routine */
+ uint8_t msk_available; /**< Dependent services Availability */
+ uint8_t msk_ntfy; /**< Dependency notification */
+ uint8_t msk_thread; /**< Dependent threads */
+ BOOL is_depended; /**< Positioning/Availability->TRUE change dependency */
+ uint8_t status; /**< Thread activation state */
+ uint8_t order; /**< Boot Sequence(Performance) */
+ uint8_t reserve[2];
+} ST_THREAD_CREATE_INFO;
+
+
+/* GPS fix count information */
+typedef struct {
+ uint32_t ul3d; /* 3D */
+ uint32_t ul2d; /* 2D */
+ uint32_t ul_else; /* Not fix */
+ uint8_t dummy[4]; /* Dummy */
+} ST_GPS_FIX_CNT;
+
+/*!
+ @brief Structure that stores the time set by the time setting or the time updated(For GRADE1)
+*/
+typedef struct {
+ u_int16 year; /* Year */
+ u_int8 month; /* Month */
+ u_int8 date; /* Day */
+ u_int8 hour; /* Hour */
+ u_int8 minute;/* Minutes */
+ u_int8 second;/* Minutes */
+ u_int8 flag; /* Whether or not the time is set */
+} ST_GPS_SET_TIME;
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+static EFrameworkunifiedStatus PositioningOnStartImpl(const HANDLE hApp, const EPWR_SC_WAKEUP_TYPE wakeupType,
+ const ESMDataResetModeInfo dataResetMode);
+static EFrameworkunifiedStatus PosNotifyCommunicationAvailability(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyCommUSBAvailability(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyPSMShadowAvailability(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyPSMShadowInitComp(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyClockAvailability(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyNSBackupMgrAvailability(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyDevDetectSrvAvailability(HANDLE h_app);
+static EFrameworkunifiedStatus PosNotifyVehicleAvailability(HANDLE h_app);
+
+static EFrameworkunifiedStatus PosStopThreadDummy(HANDLE h_app);
+static void PosCreateSharedMemory(void);
+static void PosCreateThread(HANDLE h_app);
+static void PosStopThread(void);
+static void PosBackupDataInit(void);
+
+/* Message Dispatching Functions */
+static EFrameworkunifiedStatus PosThreadCreateComp(HANDLE h_app);
+static EFrameworkunifiedStatus PosThreadStopComp(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifRegisterListenerPkgSensorData(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifRegisterListenerSensorData(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifReqGpsSetting(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifSetGpsInfo(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifGetGpsInfo(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifSetData(HANDLE h_app);
+static EFrameworkunifiedStatus PosPosifReqGpsReset(HANDLE h_app);
+static EFrameworkunifiedStatus PosVehicleInfoRcv(HANDLE h_app);
+static uint32_t PosGetMsg(HANDLE h_app, void** p_buf, uint32_t size);
+static RET_API PosSndMsg(PNO pno, CID cid, void* p_msg_body, uint32_t size);
+static void PosOutputDebugDumpLog(uint8_t* p_buf);
+
+/* Function scan for device insertion detection */
+static EFrameworkunifiedStatus PosOnDevDetectOpenSessionAck(HANDLE h_app);
+static EFrameworkunifiedStatus PosOnDevDetectCloseSessionAck(HANDLE h_app);
+static EFrameworkunifiedStatus PosOnDevDetectEvent(HANDLE h_app);
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+/* Thread name */
+static const int8_t kThreadNamePosMain[15] = "POS_Main";
+static const int8_t kThreadNamePosSens[15] = "POS_Sens";
+static const int8_t kThreadNamePosGps[15] = "POS_Gps";
+static const int8_t kThreadNamePosGpsRecv[15] = "POS_Gps_Recv";
+static const int8_t kThreadNamePosGpsRollover[15] = "POS_Gps_Rolovr";
+
+/** Shared memory generation table */
+static ST_SHAREDATA g_sharedata_tbl[] = {
+ /* Shared data name to be generated, Shared data size */
+ { {VEHICLE_SHARE_NAME}, 512 * 11 }, /* Vehicle sensor information acquisition */
+#if 0 /* Less than 0.1 SBU,Not used in _CWORD71_ */
+ { {"SENSOR_SHARE_MEMORY"}, 512 * 11 }, /* Vehicle sensor information Pkg acquisition */
+ { {"GPS_INT_SIGNAL_SHARE_MEMORY"}, 4 }, /* GPS Interrupt Signal Acquisition */
+ { {"LOG_SETTING_SHARE_MEMORY"}, 36 }, /* DR feature log acquisition */
+ { {"GYRO_CONNECT_STTS_SHARE_MEMORY"}, 4 }, /* Get Gyro Connection Status */
+ { {"EPHEMERIS_NUM_SHARE_MEMORY"}, 4 }, /* For acquiring effective ephemeris count at shutdown */
+ { {"LOCALTIME_SHARE_MEMORY"}, 12 }, /* Local time acquisition at shutdown */
+ { {"LONLAT_SHARE_MEMORY"}, 8 }, /* Location acquisition at shutdown */
+#endif
+ { {'\0'}, 0 } /* Termination */
+};
+
+/** Sub-thread creation table
+ (1) Thread ID (Locally defined Enumeration)
+ (2) Thread name
+ (3) Process number
+ (4) Start Routine
+ (5) Dependent Availability
+ (6) Dependency notification
+ (7) Dependent threads * If there are dependent threads, do not create them until those threads are created.
+ (8) Positioning/Availability->TRUE depending on change
+ (9) Thread activation state (THREAD_STS_NOEXIST:Not started,THREAD_STS_CREATING:Starting,THREAD_STS_CREATED:Completion of the activation)
+ (10) Boot Sequence(Performance) (0,1,2, ... Note : 0 = Initial value(Not started)) Time of termination,Be destroyed in the reverse order of startup
+ */
+static ST_THREAD_CREATE_INFO g_pos_thread_create_info_Grade1[] = { // LCOV_EXCL_BR_LINE 11: unexpected branch
+ { /* Pos_main */
+ ETID_POS_MAIN, /* (1) */
+ kThreadNamePosMain, /* (2) */
+ PNO_VEHICLE_SENSOR, /* (3) */
+ &VehicleSensThread, /* (4) */
+ (NTFY_MSK_NONE), /* (5) */
+ (NTFY_MSK_NONE), /* (6) */
+ 0, /* (7) */
+ TRUE, /* (8) */
+ THREAD_STS_NOEXIST, /* (9) */
+ 0 /* (10) */
+ },
+ { /* Pos_sens */
+ ETID_POS_SENS, /* (1) */
+ kThreadNamePosSens, /* (2) */
+ PNO_LINE_SENS_DRV, /* (3) */
+ &StartLineSensorThreadPositioning, /* (4) */
+ (NTFY_MSK_PS_PSMSHADOW_AVAILABILITY), /* (5) */
+ (NTFY_MSK_NONE), /* (6) */
+ THREAD_STS_MSK_POS_MAIN, /* (7) */
+ FALSE, /* (8) */
+ THREAD_STS_NOEXIST, /* (9) */
+ 0 /* (10) */
+ },
+ { /* Pos_gps */
+ ETID_POS_GPS, /* (1) */
+ kThreadNamePosGps, /* (2) */
+ PNO_NAVI_GPS_MAIN, /* (3) */
+ &StartGpsMainThreadPositioning, /* (4) */
+ (NTFY_MSK_NONE), /* (5) */
+ (NTFY_MSK_NONE), /* (6) */
+ THREAD_STS_MSK_POS_MAIN, /* (7) */
+ TRUE, /* (8) */
+ THREAD_STS_NOEXIST, /* (9) */
+ 0 /* (10) */
+ },
+ { /* Pos_gps_recv */
+ ETID_POS_GPS_RECV, /* (1) */
+ kThreadNamePosGpsRecv, /* (2) */
+ PNO_NAVI_GPS_RCV, /* (3) */
+ &StartGpsRecvThreadPositioning, /* (4) */
+ (NTFY_MSK_NONE), /* (5) */
+ (NTFY_MSK_NONE), /* (6) */
+ THREAD_STS_MSK_POS_GPS, /* (7) */
+ FALSE, /* (8) */
+ THREAD_STS_NOEXIST, /* (9) */
+ 0 /* (10) */
+ },
+ { /* Pos_gps_rollover */
+ ETID_POS_GPS_ROLLOVER, /* (1) */
+ kThreadNamePosGpsRollover, /* (2) */
+ PNO_CLK_GPS, /* (3) */
+ &StartGpsRolloverThreadPositioning, /* (4) */
+ (NTFY_MSK_NS_BACKUPMGR_AVAILABILITY), /* (5) */
+ (NTFY_MSK_NONE), /* (6) */
+ THREAD_STS_MSK_POS_GPS, /* (7) */
+ FALSE, /* (8) */
+ THREAD_STS_NOEXIST, /* (9) */
+ 0 /* (10) */
+ },
+ { /* Termination */
+ ETID_POS_MAX, NULL, 0, NULL, NTFY_MSK_NONE, NTFY_MSK_NONE, 0, FALSE, THREAD_STS_NOEXIST, 0
+ },
+};
+
+/* State Management Variables */
+static bool g_start_flg = false; /** Start Processed Flag */
+static EnumExeSts_POS g_exe_sts; /** Positioning running status */
+static EnumSetupMode_POS g_setup_mode; /** Thread activation mode */
+static uint8_t g_last_thread_sts; /** Latest internal thread activation state */
+static uint8_t g_last_srv_sts; /** Latest service availability */
+static uint8_t g_last_ntfy_sts; /** Receive state of latest notification */
+static uint8_t g_last_num_of_thread; /** Number of Current Startup Threads */
+
+/** Sub-thread creation table */
+static ST_THREAD_CREATE_INFO* g_pos_thread_create_info;
+
+/** Interprocess message receive buffer */
+static uint8_t g_rcv_msg_buf[MAX_MSG_BUF_SIZE];
+
+/** Dispatcher Registration Callback Table */
+static const FrameworkunifiedProtocolCallbackHandler kPositioningPcbhs[] = { // LCOV_EXCL_BR_LINE 11: unexpected branch
+ {CID_THREAD_CREATE_COMP, &PosThreadCreateComp }, /* Thread start completion notification */
+ {CID_THREAD_STOP_COMP, &PosThreadStopComp }, /* Thread stop completion notice */
+ {CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT, &PosPosifRegisterListenerPkgSensorData},
+ {CID_VEHICLEIF_DELIVERY_ENTRY, &PosPosifRegisterListenerSensorData },
+ {CID_SENSORIF__CWORD82__REQUEST, &PosPosifReqGpsSetting },
+ {CID_NAVIINFO_DELIVER, &PosPosifSetGpsInfo },
+ {CID_VEHICLEIF_GET_VEHICLE_DATA, &PosPosifGetGpsInfo },
+ {CID_POSIF_SET_DATA, &PosPosifSetData },
+ {CID_GPS_REQRESET, &PosPosifReqGpsReset },
+};
+
+static const FrameworkunifiedProtocolCallbackHandler kPositioningPcbhsVehicle[] = { // LCOV_EXCL_BR_LINE 11: unexpected branch
+ {CID_VEHICLESENS_VEHICLE_INFO, &PosVehicleInfoRcv},
+};
+
+/** Dispatcher unregister command ID table */
+static uint32_t g_positioning_cids[] = {
+ CID_THREAD_CREATE_COMP,
+ CID_THREAD_STOP_COMP,
+ CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT,
+ CID_VEHICLEIF_DELIVERY_ENTRY,
+ CID_SENSORIF__CWORD82__REQUEST,
+ CID_NAVIINFO_DELIVER,
+ CID_VEHICLEIF_GET_VEHICLE_DATA,
+ CID_POSIF_SET_DATA,
+ CID_GPS_REQRESET,
+};
+
+static uint32_t g_positioning_cids_vehicle[] = {
+ CID_VEHICLESENS_VEHICLE_INFO,
+};
+
+
+
+/** Stop request flag for GPS reception thread */
+BOOL g_thread_stop_req;
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * FrameworkunifiedOnInitialization<br>
+ * Sends message to Notification Service
+ *
+ * Mm 21 API perform initialization.<br>
+ * Generatings shared memories used by Vehicle function block..<br>
+ * Creates a sub-thread of the Vehicle feature block..
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ * eFrameworkunifiedStatusFail ABENDs
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnInitialization(HANDLE h_app) {
+ RET_API ret_api;
+ EFrameworkunifiedStatus e_status = eFrameworkunifiedStatusOK;
+ uint8_t* p_last_srv_sts = &g_last_srv_sts;
+ uint8_t* p_last_thread_sts = &g_last_thread_sts;
+ uint8_t* p_last_ntfy_sts = &g_last_ntfy_sts;
+ ST_THREAD_CREATE_INFO** pp_thr_cre_info = &g_pos_thread_create_info;
+ uint8_t* p_last_num_thr = &g_last_num_of_thread;
+ BOOL* p_thr_stop_req = &g_thread_stop_req;
+ EnumExeSts_POS* p_exe_sts = &g_exe_sts;
+ EnumSetupMode_POS* pe_mode = &g_setup_mode;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ /* Global variable initialization */
+ *p_last_srv_sts = 0;
+ *p_last_thread_sts = 0;
+ *p_last_ntfy_sts = 0;
+ *pp_thr_cre_info = g_pos_thread_create_info_Grade1;
+ *p_last_num_thr = 0;
+ *p_thr_stop_req = FALSE;
+ *p_exe_sts = EPOS_EXE_STS_STOP;
+ *pe_mode = EPOS_SETUP_MODE_NORMAL;
+
+ /* null check */
+ if (h_app == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "h_app is NULL");
+ e_status = eFrameworkunifiedStatusFail;
+ } else {
+ /* Positioning Base API initialization */
+ ret_api = _pb_Setup_CWORD64_API(h_app);
+ if (ret_api != RET_NORMAL) { // LCOV_EXCL_BR_LINE 4: can not return error
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_Setup_CWORD64_API ERROR!! [ret_api = %d]",
+ ret_api);
+
+ e_status = eFrameworkunifiedStatusFail;
+ // LCOV_EXCL_STOP
+ } else {
+ /* Availability at Positioning startup,Set internal thread activation state */
+ if (ChkUnitType(UNIT_TYPE_GRADE1) == true) { /* GRADE1 environment */
+ *pp_thr_cre_info = g_pos_thread_create_info_Grade1;
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__,
+ "*pp_thr_cre_info = g_pos_thread_create_info_Grade1");
+ } else if (ChkUnitType(UNIT_TYPE_GRADE2) == true) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "_pb_ChkUnitType UNKNOWN!!");
+ }
+
+ /* Shared Memory Creation */
+ PosCreateSharedMemory();
+
+ if (e_status == eFrameworkunifiedStatusOK) {
+ /* Register callback functions for Positioning internals */
+ e_status = FrameworkunifiedAttachCallbacksToDispatcher(h_app,
+ "NS_ANY_SRC",
+ kPositioningPcbhs,
+ _countof(kPositioningPcbhs)); // LCOV_EXCL_BR_LINE 4:nsfw error
+ if (e_status != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedAttachCallbacksToDispatcher ERROR!! [e_status = %d]", e_status);
+ }
+
+ (void)VehicleIfAttachCallbacksToDispatcher(kPositioningPcbhsVehicle,
+ _countof(kPositioningPcbhsVehicle));
+ }
+
+ if (e_status == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* Positioning/Availability registration */
+ e_status = FrameworkunifiedRegisterServiceAvailabilityNotification(h_app, POS_AVAILABILITY);
+ if (eFrameworkunifiedStatusOK != e_status) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedRegisterServiceAvailabilityNotification ERROR!! [e_status = %d]", e_status);
+ }
+ }
+
+ if (e_status == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* Positioning/Availability -> FALSE */
+ e_status = FrameworkunifiedPublishServiceAvailability(h_app, FALSE);
+ if (eFrameworkunifiedStatusOK != e_status) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedPublishServiceAvailability ERROR!! [e_status = %d]", e_status);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Positioning/Availability -> FALSE");
+ }
+ }
+
+ /* Communication/Availability Changing notification registration */
+ FrameworkunifiedSubscribeNotificationWithCallback(h_app, NTFY_Communication_Availability, &PosNotifyCommunicationAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+
+ /* PS_CommUSB/Availability Changing notification registration */
+ (void)CommUsbIfNotifyOnCommUSBAvailability(&PosNotifyCommUSBAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+
+ /* PS_PSMShadow/Availability Changing notification registration */
+ (void)PSMShadowIfNotifyOnPSMShadowAvailability(&PosNotifyPSMShadowAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+ /* PS_PSMShadow Startup completion notification registration */
+ (void)PSMShadowIfNotifyOnPSMShadowInitComp(&PosNotifyPSMShadowInitComp); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+
+ /* Clock/Availability Changing notification registration */
+ (void)ClockIfNotifyOnClockAvailability(&PosNotifyClockAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+
+ /* NS_BackupMgr/Availability Changing notification registration */
+ (void)BackupMgrIfNotifyOnBackupMgrAvailability(&PosNotifyNSBackupMgrAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+
+ /* Regist Vehilce Availability Notification */
+ (void)VehicleIfNotifyOnVehicleAvailability(&PosNotifyVehicleAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+
+ /* DeviceDetectionServiceIf initialization */
+ if (DevDetectSrvIfInitialize() == eFrameworkunifiedStatusOK) {
+ /* SS_DevDetectSrv/Availability Changing notification registration */
+ (void)DevDetectSrvIfNotifyOnDeviceDetectionAvailability(&PosNotifyDevDetectSrvAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length)
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return e_status;
+}
+
+/**
+ * @brief
+ * PositioningOnStartImpl
+ */
+static EFrameworkunifiedStatus PositioningOnStartImpl(const HANDLE hApp, const EPWR_SC_WAKEUP_TYPE wakeupType,
+ const ESMDataResetModeInfo dataResetMode) {
+ EnumExeSts_POS* p_exe_sts = &g_exe_sts;
+ EnumSetupMode_POS* pe_mode = &g_setup_mode;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ if (g_start_flg == false) {
+ g_start_flg = true;
+
+ /* Running */
+ *p_exe_sts = EPOS_EXE_STS_RUNNING;
+
+ /* Cold start */
+ if (wakeupType == epsstCOLDSTART) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "wakeupType:COLDSTART");
+
+ *p_exe_sts = EPOS_EXE_STS_RUNNING_COLDSTART;
+
+ /* Initialize GPS time setting information */
+ PosBackupDataInit();
+ } else { /* Time of warm start */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "wakeupType:WARMSTART");
+ }
+
+ /* Time of factory initialization */
+ if (dataResetMode == e_SS_SM_DATA_RESET_MODE_FACTORY) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "dataResetMode:FACTORYRESET");
+
+ /* Set thread start mode to ""data reset start"" */
+ *pe_mode = EPOS_SETUP_MODE_DATA_RESET;
+
+ /* Initialize GPS time setting information */
+ PosBackupDataInit();
+ }
+
+ PosCreateThread(hApp);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnStart
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnStart(HANDLE hApp) {
+ EFrameworkunifiedStatus ret = eFrameworkunifiedStatusFail;
+ uint32_t size;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ size = PosGetMsg(hApp, reinterpret_cast<void**>(&g_rcv_msg_buf), MAX_MSG_BUF_SIZE);
+ if (size != 0) {
+ T_SS_SM_START_DataStructType* p_start_data;
+ p_start_data = reinterpret_cast<T_SS_SM_START_DataStructType*>(g_rcv_msg_buf);
+
+ ret = PositioningOnStartImpl(hApp, p_start_data->wakeupType, p_start_data->dataResetMode);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return ret;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnStop
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ * eFrameworkunifiedStatusFail ABENDs
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnStop(HANDLE h_app) {
+ EFrameworkunifiedStatus e_status;
+ EnumExeSts_POS* p_exe_sts = &g_exe_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ /* null check */
+ if (h_app == NULL) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "h_app is NULL");
+ // LCOV_EXCL_STOP
+ } else {
+ *p_exe_sts = EPOS_EXE_STS_STOP;
+
+ e_status = FrameworkunifiedPublishServiceAvailability(h_app, FALSE);
+ if (eFrameworkunifiedStatusOK != e_status) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedPublishServiceAvailability ERROR!! [e_status = %d]",
+ e_status);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Positioning/Availability -> FALSE");
+ }
+
+ PosStopThread();
+
+ g_start_flg = false;
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ /* Return end response to SM at timing after completion of internal thread stop */
+ return eFrameworkunifiedStatusFail;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnPreStart
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnPreStart(HANDLE hApp) {
+ EFrameworkunifiedStatus ret = eFrameworkunifiedStatusFail;
+ uint32_t size;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ size = PosGetMsg(hApp, reinterpret_cast<void**>(&g_rcv_msg_buf), MAX_MSG_BUF_SIZE);
+ if (size != 0) {
+ T_SS_SM_START_DataStructType* p_start_data;
+ p_start_data = reinterpret_cast<T_SS_SM_START_DataStructType*>(g_rcv_msg_buf);
+
+ ret = PositioningOnStartImpl(hApp, p_start_data->wakeupType, p_start_data->dataResetMode);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return ret;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnPreStop
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnPreStop(HANDLE hApp) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnBackgroundStart
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnBackgroundStart(HANDLE hApp) {
+ EFrameworkunifiedStatus ret = eFrameworkunifiedStatusFail;
+ uint32_t size;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ size = PosGetMsg(hApp, reinterpret_cast<void**>(&g_rcv_msg_buf), MAX_MSG_BUF_SIZE);
+ if (size != 0) {
+ T_SS_SM_START_DataStructType* p_start_data;
+ p_start_data = reinterpret_cast<T_SS_SM_START_DataStructType*>(g_rcv_msg_buf);
+
+ ret = PositioningOnStartImpl(hApp, p_start_data->wakeupType, p_start_data->dataResetMode);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return ret;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnBackgroundStop
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnBackgroundStop(HANDLE hApp) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * FrameworkunifiedOnDestroy (Not mounted)
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ * eFrameworkunifiedStatusFail ABENDs
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnDestroy(HANDLE h_app) { // LCOV_EXCL_START 14 Resident process, not called by NSFW
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * FrameworkunifiedOnDebugDump
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ * eFrameworkunifiedStatusFail ABENDs
+ */
+EFrameworkunifiedStatus FrameworkunifiedOnDebugDump(HANDLE h_app) { // LCOV_EXCL_START 7: debug code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ static uint8_t buf_tmp[256];
+ static uint8_t buf_proc[128];
+ static uint8_t buf_thread[512];
+ static uint8_t buf_message[4][DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_mutex[3][DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_timer[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_event[9][DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_memory[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_other[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_nand[256];
+ static uint8_t buf_ram[256];
+ static uint8_t buf_gps_format_fail[512];
+ static uint8_t buf_antenna[256];
+ static uint8_t buf_gps_info[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_navi_info[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_deli_ctrl_tbl[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_deli_ctrl_tbl_mng[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_pkg_deli_tbl_mng[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_deli_pno_tbl[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_sys[128];
+ int32_t i;
+ ST_THREAD_CREATE_INFO* p_thr_cre_info = g_pos_thread_create_info;
+ ST_GPS_FIX_CNT st_gps_fix_cnt;
+ ST_GPS_SET_TIME st_gps_set_time;
+ uint8_t len_msg = 4;
+ uint8_t len_mtx = 3;
+ uint8_t len_evt = 9;
+ EFrameworkunifiedStatus e_status;
+ BOOL b_is_available;
+ UNIT_TYPE e_type = UNIT_TYPE_NONE;
+ u_int8 sys_recv_flg;
+ uint16_t wkn_rollover;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ memset(&buf_proc[0], 0x00, sizeof(buf_proc));
+ memset(&buf_thread[0], 0x00, sizeof(buf_thread));
+ memset(&buf_nand[0], 0x00, sizeof(buf_nand));
+ memset(&buf_ram[0], 0x00, sizeof(buf_ram));
+ memset(&buf_gps_format_fail[0], 0x00, sizeof(buf_gps_format_fail));
+ memset(&buf_antenna[0], 0x00, sizeof(buf_antenna));
+ memset(&buf_gps_info[0], 0x00, sizeof(buf_gps_info));
+ memset(&buf_navi_info[0], 0x00, sizeof(buf_navi_info));
+ memset(&buf_deli_ctrl_tbl[0], 0x00, sizeof(buf_deli_ctrl_tbl));
+ memset(&buf_deli_ctrl_tbl_mng[0], 0x00, sizeof(buf_deli_ctrl_tbl_mng));
+ memset(&buf_pkg_deli_tbl_mng[0], 0x00, sizeof(buf_pkg_deli_tbl_mng));
+ memset(&buf_deli_pno_tbl[0], 0x00, sizeof(buf_deli_pno_tbl));
+ memset(&buf_sys[0], 0x00, sizeof(buf_sys));
+
+ for (i = 0; i < len_msg; i++) {
+ memset(&buf_message[i][0], 0x00, sizeof(buf_message[i]));
+ }
+ for (i = 0; i < len_mtx; i++) {
+ memset(&buf_mutex[i][0], 0x00, sizeof(buf_mutex[i]));
+ }
+ memset(&buf_timer[0], 0x00, sizeof(buf_timer));
+ for (i = 0; i < len_evt; i++) {
+ memset(&buf_event[i][0], 0x00, sizeof(buf_event[i]));
+ }
+ memset(&buf_memory[0], 0x00, sizeof(buf_memory));
+ memset(&buf_other[0], 0x00, sizeof(buf_other));
+ e_type = GetEnvSupportInfo();
+
+ /* Availability status of related processes */
+ snprintf(reinterpret_cast<char *>(&buf_proc[0]), sizeof(buf_proc),
+ "Availability\n thread:0x%02x, srv:0x%02x, ntfy:0x%02x",
+ g_last_thread_sts, /* Latest internal thread activation state */
+ g_last_srv_sts, /* Latest service availability */
+ g_last_ntfy_sts); /* Receive state of latest notification */
+
+ /* Internal thread activation state */
+ snprintf(reinterpret_cast<char *>(&buf_thread[0]), sizeof(buf_thread), "Thread");
+ for (i = 0; i < ETID_POS_MAX; i++) {
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n [%d]id:%d, pno:0x%04x, name:%16s, sts:0x%02x, order:%d",
+ i,
+ p_thr_cre_info->id, /* Thread ID */
+ p_thr_cre_info->pno, /* Process number */
+ p_thr_cre_info->p_name, /* Thread name */
+ p_thr_cre_info->status, /* Thread activation state */
+ p_thr_cre_info->order); /* Boot Sequence */
+ _pb_strcat(reinterpret_cast<char *>(&buf_thread[0]), reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp));
+ p_thr_cre_info++;
+ }
+
+ /* BASE API control data */
+ /* Message */
+ (void)_pb_GetDebugMsgMngTbl(&buf_message[0][0], &len_msg);
+ /* Mutex */
+ (void)_pb_GetDebugMutexMngTbl(&buf_mutex[0][0], &len_mtx);
+ /* Timer */
+ (void)_pb_GetDebugTimerMngTbl(&buf_timer[0]);
+ /* Event */
+ (void)_pb_GetDebugEventMngTbl(&buf_event[0][0], &len_evt);
+ /* Shared Memory */
+ (void)_pb_GetDebugMemoryMngTbl(&buf_memory[0]);
+ /* Other */
+ (void)_pb_GetDebugOtherMngTbl(&buf_other[0]);
+
+ /* NAND data */
+ snprintf(reinterpret_cast<char *>(&buf_nand[0]), sizeof(buf_nand), "NAND");
+ /* GPS fix count */
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ memset(&st_gps_fix_cnt, 0x00, sizeof(st_gps_fix_cnt));
+
+ e_status = BackupMgrIfBackupDataRd(D_BK_ID_POS_GPS_FIX_CNT,
+ 0,
+ &st_gps_fix_cnt,
+ sizeof(st_gps_fix_cnt), &b_is_available);
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n %20s rd:0x%08x av:%d, 3d:%d, 2d:%d, else:%d, dmy:0x%02x%02x%02x%02x",
+ "GPS_FIX_CNT",
+ e_status,
+ b_is_available,
+ st_gps_fix_cnt.ul3d,
+ st_gps_fix_cnt.ul2d,
+ st_gps_fix_cnt.ul_else,
+ st_gps_fix_cnt.dummy[0], st_gps_fix_cnt.dummy[1], st_gps_fix_cnt.dummy[2], st_gps_fix_cnt.dummy[3]);
+ _pb_strcat(reinterpret_cast<char *>(&buf_nand[0]), reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp));
+
+ /* Data of the backup RAM */
+ snprintf(reinterpret_cast<char *>(&buf_ram[0]), sizeof(buf_ram), "BackupRAM");
+ /* Set GPS date and time(Information) */
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ (void)memset( reinterpret_cast<void *>(&st_gps_set_time), 0, (size_t)sizeof(st_gps_set_time) );
+
+ e_status = BackupMgrIfBackupDataRd(D_BK_ID_POS_GPS_TIME_SET_INFO,
+ 0,
+ &st_gps_set_time,
+ sizeof(st_gps_set_time),
+ &b_is_available);
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n %20s rd:0x%08x av:%d, %d/%d/%d %d:%d:%d flag:0x%02x",
+ "GPS_TIME_SET_INFO",
+ e_status,
+ b_is_available,
+ st_gps_set_time.year,
+ st_gps_set_time.month,
+ st_gps_set_time.date,
+ st_gps_set_time.hour,
+ st_gps_set_time.minute,
+ st_gps_set_time.second,
+ st_gps_set_time.flag);
+ _pb_strcat(reinterpret_cast<char *>(&buf_ram[0]), reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp));
+
+ if (e_type == UNIT_TYPE_GRADE1) {
+ /* GPS format anomaly counter */ /* There is no lock control. */
+ (void)DEVGpsGetDebugGpsFormatFailCnt(&buf_gps_format_fail[0]);
+
+ /* GPS antenna connection status */ /* There is no lock control. */
+ VEHICLESENS_DATA_MASTER st_sns_data = {0};
+ (void)VehicleSensGetGpsAntenna(&st_sns_data, VEHICLESENS_GETMETHOD_LINE);
+ snprintf(reinterpret_cast<char *>(&buf_antenna[0]), sizeof(buf_antenna),
+ "Antenna\n sts:0x%02x",
+ st_sns_data.uc_data[0]);
+
+ /* GPS position time */ /* There is no lock control. */
+ (void)VehicleSensGetDebugPosDate(&buf_gps_info[0], VEHICLESENS_GETMETHOD_GPS);
+ }
+
+ if (e_type == UNIT_TYPE_GRADE1) {
+ /* Navigation position time */ /* There is no lock control. */
+ (void)VehicleSensGetDebugPosDate(&buf_navi_info[0], VEHICLESENS_GETMETHOD_NAVI);
+ }
+
+ /* Delivery table */ /* There is no lock control. */
+ (void)VehicleSensGetDebugDeliveryCtrlTbl(&buf_deli_ctrl_tbl[0]);
+ (void)VehicleSensGetDebugDeliveryCtrlTblMng(&buf_deli_ctrl_tbl_mng[0]);
+ (void)VehicleSensGetDebugPkgDeliveryTblMng(&buf_pkg_deli_tbl_mng[0]);
+ (void)VehicleSensGetDebugDeliveryPnoTbl(&buf_deli_pno_tbl[0]);
+
+ /* Initial Sensor Data Status from Sys */
+ sys_recv_flg = LineSensDrvGetSysRecvFlag();
+ snprintf(reinterpret_cast<char *>(&buf_sys[0]), sizeof(buf_sys),
+ "Rx 1st Sensor Data %d\n", sys_recv_flg);
+
+ /* Dump Information Out */
+ PosOutputDebugDumpLog(&buf_proc[0]);
+ PosOutputDebugDumpLog(&buf_thread[0]);
+ for (i = 0; i < len_msg; i++) {
+ PosOutputDebugDumpLog(&buf_message[i][0]);
+ }
+ for (i = 0; i < len_mtx; i++) {
+ PosOutputDebugDumpLog(&buf_mutex[i][0]);
+ }
+ PosOutputDebugDumpLog(&buf_timer[0]);
+ for (i = 0; i < len_evt; i++) {
+ PosOutputDebugDumpLog(&buf_event[i][0]);
+ }
+ PosOutputDebugDumpLog(&buf_memory[0]);
+ PosOutputDebugDumpLog(&buf_other[0]);
+ PosOutputDebugDumpLog(&buf_nand[0]);
+ PosOutputDebugDumpLog(&buf_ram[0]);
+ if (e_type == UNIT_TYPE_GRADE1) {
+ PosOutputDebugDumpLog(&buf_gps_format_fail[0]);
+ PosOutputDebugDumpLog(&buf_antenna[0]);
+ PosOutputDebugDumpLog(&buf_gps_info[0]);
+ }
+ if (e_type == UNIT_TYPE_GRADE1) {
+ PosOutputDebugDumpLog(&buf_navi_info[0]);
+ }
+ PosOutputDebugDumpLog(&buf_deli_ctrl_tbl[0]);
+ PosOutputDebugDumpLog(&buf_deli_ctrl_tbl_mng[0]);
+ PosOutputDebugDumpLog(&buf_pkg_deli_tbl_mng[0]);
+ PosOutputDebugDumpLog(&buf_deli_pno_tbl[0]);
+ PosOutputDebugDumpLog(&buf_sys[0]);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * FrameworkunifiedCreateStateMachine (Not mounted)
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ * eFrameworkunifiedStatusFail ABENDs
+ */
+EFrameworkunifiedStatus FrameworkunifiedCreateStateMachine(HANDLE h_app) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+// LCOV_EXCL_STOP
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * @brief
+ * Common processing after thread startup
+ *
+ * Thread naming,Create Message Queue,Thread activation response
+ *
+ * @param[in] h_app Application handle
+ * @param[in] e_tid Thread ID
+ *
+ * @return Thread activation mode
+ */
+EnumSetupMode_POS PosSetupThread(HANDLE h_app, EnumTID_POS e_tid) {
+ RET_API ret;
+ ST_THREAD_CREATE_INFO* p_thr_cre_info = g_pos_thread_create_info;
+ ST_THREAD_CREATE_INFO* p_info;
+ ST_THREAD_SETUP_INFO st_setup_info;
+ ST_THREAD_SETUP_INFO* pst_setup_info = &st_setup_info;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ p_info = p_thr_cre_info + e_tid;
+
+ /* Application handle setting */
+ _pb_SetAppHandle(h_app);
+
+ /* Create Message Queue */
+ _pb_CreateMsg(p_info->pno);
+
+ /* Get Thread Startup Information */
+ pst_setup_info->e_mode = EPOS_SETUP_MODE_NORMAL;
+ (void)PosGetMsg(h_app, reinterpret_cast<void**>(&pst_setup_info), sizeof(ST_THREAD_SETUP_INFO));
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "[e_mode = %d]", pst_setup_info->e_mode);
+
+ /* Issue thread creation completion notice */
+ ret = _pb_SndMsg_Ext(POS_THREAD_NAME, CID_THREAD_CREATE_COMP, sizeof(EnumTID_POS), (const void*)&e_tid, 0);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg_Ext ERROR!! [ret = %d]", ret);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return pst_setup_info->e_mode;
+}
+
+/**
+ * @brief
+ * Common Processing at Thread Stop
+ *
+ * Thread stop response,Thread destruction
+ *
+ * @param[in] e_tid Thread ID
+ */
+void PosTeardownThread(EnumTID_POS e_tid) {
+ RET_API ret;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ /* Issue thread stop completion notice */
+ ret = _pb_SndMsg_Ext(POS_THREAD_NAME, CID_THREAD_STOP_COMP, sizeof(EnumTID_POS), (const void*)&e_tid, 0);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg_Ext ERROR!! [ret = %d]", ret);
+ }
+
+ /* Thread destruction */
+ _pb_ExitThread((DWORD)0);
+
+ /* don't arrive here */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return; // LCOV_EXCL_LINE 8 : cannot reach here
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**
+ * @brief
+ * FrameworkunifiedCreateChildThread dummy functions
+ *
+ * @param[in] Application handle
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosStopThreadDummy(HANDLE h_app) { // LCOV_EXCL_START 8 : dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+// LCOV_EXCL_STOP
+
+/*---------------------------------------------------------------------------------*
+ * Local Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Communication services Availability notification callback functions
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosNotifyCommunicationAvailability(HANDLE h_app) {
+ BOOL isAvailable;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ isAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+ if (isAvailable == TRUE) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Communication/Availability -> TRUE");
+
+ *pLastSrvSts |= NTFY_MSK_COMMUNICATION_AVAILABILITY;
+
+ PosCreateThread(h_app);
+
+ /* Sensor Log Initial Processing(First)*/
+ SensLogInitialize(NULL);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Communication/Availability -> FALSE");
+
+ *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_COMMUNICATION_AVAILABILITY);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * CommUSB services Availability notification callback functions
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosNotifyCommUSBAvailability(HANDLE h_app) {
+ BOOL isAvailable;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ isAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+ if (isAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_CommUSB/Availability -> TRUE");
+
+ *pLastSrvSts |= NTFY_MSK_PS_COMMUSB_AVAILABILITY;
+
+ PosCreateThread(h_app);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_CommUSB/Availability -> FALSE");
+
+ *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_PS_COMMUSB_AVAILABILITY);
+ }
+
+ /* Update CommUSB I/F availability */
+ CommUsbIfSetAvailability(isAvailable);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * PSMShadow services Availability notification callback functions
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosNotifyPSMShadowAvailability(HANDLE h_app) {
+ BOOL isAvailable;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ isAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+ if (isAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_PSMShadow/Availability -> TRUE");
+
+ *pLastSrvSts |= NTFY_MSK_PS_PSMSHADOW_AVAILABILITY;
+
+ PosCreateThread(h_app);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_PSMShadow/Availability -> FALSE");
+
+ *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_PS_PSMSHADOW_AVAILABILITY);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * PSMShadow services Callback function for notifying completion of startup
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosNotifyPSMShadowInitComp(HANDLE h_app) {
+ uint8_t* pLastNtfySts = &g_last_ntfy_sts;
+ ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ *pLastNtfySts |= NTFY_MSK_PS_PSMSHADOW_INIT_COMP;
+
+ /* When the Pos_Sens thread is started */
+ if (((pThrCreInfo + ETID_POS_SENS)->status) == THREAD_STS_CREATED) {
+ /* External pin status request */
+ LineSensDrvExtTermStsReq();
+ }
+
+ PosCreateThread(h_app);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Clock Services Availability Notification Callback Functions
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosNotifyClockAvailability(HANDLE h_app) {
+ BOOL isAvailable;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ isAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+ if (isAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Clock/Availability -> TRUE");
+
+ *pLastSrvSts |= NTFY_MSK_CLOCK_AVAILABILITY;
+
+ PosCreateThread(h_app);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Clock/Availability -> FALSE");
+
+ *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_CLOCK_AVAILABILITY);
+ }
+
+ /* Update Clock I/F availability */
+ ClockIfSetAvailability(isAvailable);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * NS_BackupMgr service Availability notification callback function
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosNotifyNSBackupMgrAvailability(HANDLE h_app) {
+ EnumExeSts_POS* pExeSts = &g_exe_sts;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+ ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info;
+ EnumSetupMode_POS* peMode = &g_setup_mode;
+ BOOL bIsAvailable;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ bIsAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+
+ /* Update BackupMgr I/F availability */
+ BackupMgrIfSetAvailability(bIsAvailable);
+
+ if (bIsAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NS_BackupMgr/Availability -> TRUE");
+
+ *pLastSrvSts |= NTFY_MSK_NS_BACKUPMGR_AVAILABILITY;
+
+ /* Executing after cold start or during factory initialization*/
+ if ((*pExeSts == EPOS_EXE_STS_RUNNING_COLDSTART) ||
+ (*peMode == EPOS_SETUP_MODE_DATA_RESET)) {
+ /* Backup RAM initialization */
+ PosBackupDataInit();
+ }
+
+ /* When the GPS management thread is started */
+ if (((pThrCreInfo + ETID_POS_GPS)->status) == THREAD_STS_CREATED) {
+ if ((*pExeSts == EPOS_EXE_STS_RUNNING_COLDSTART) ||
+ (*peMode == EPOS_SETUP_MODE_DATA_RESET)) {
+ // GPS reset request.
+ SENSOR_INTERNAL_MSG_BUF msg_buf = {};
+ T_APIMSG_MSGBUF_HEADER *msg_hdr = &msg_buf.hdr;
+ msg_hdr->hdr.cid = CID_GPS_REQRESET;
+ msg_hdr->hdr.msgbodysize = sizeof(POS_RESETINFO);
+ POS_RESETINFO *msg_data = reinterpret_cast<POS_RESETINFO *>(&msg_buf.data);
+ msg_data->mode = GPS_RST_COLDSTART;
+
+ RET_API ret = _pb_SndMsg(PNO_NAVI_GPS_MAIN, sizeof(msg_buf), &msg_buf, 0);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "_pb_SndMsg ERROR!! [ret=%d]", ret);
+ }
+ }
+
+ /* Backup data read request to GSP management thread */
+ (void)DEVGpsSndBackupDataLoadReq();
+ }
+ /* Enable Diag Code Writing */
+ DiagSrvIfSetRegistrationPermission(TRUE);
+
+ PosCreateThread(h_app);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NS_BackupMgr/Availability -> FALSE");
+
+ *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_NS_BACKUPMGR_AVAILABILITY);
+ /* Write prohibited dialog code */
+ DiagSrvIfSetRegistrationPermission(FALSE);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * SS_DevDetectSrv service Availability Callback Functions
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosNotifyDevDetectSrvAvailability(HANDLE h_app) {
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
+ BOOL isAvailable;
+ BOOL bDummy;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ isAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+
+ /* Update DevDetectSrv I/F availability */
+ DevDetectSrvIfSetAvailability(isAvailable);
+
+ if (isAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SS_DevDetectSrv/Availability -> TRUE");
+ *pLastSrvSts |= NTFY_MSK_SS_DEVDETSRV_AVAILABILITY;
+
+ eStatus = DevDetectSrvIfOpenSessionRequest(&bDummy);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf OpenSession ERROR!! [eStatus = %d]", eStatus);
+ } else {
+ eStatus = DevDetectSrvIfNotifyOnOpenSessionAck(&PosOnDevDetectOpenSessionAck, &bDummy);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf NotifyOnOpenSessionAck ERROR!! [eStatus = %d]", eStatus);
+ }
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SS_DevDetectSrv/Availability -> FALSE");
+ *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_SS_DEVDETSRV_AVAILABILITY);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+
+/**
+ * @brief
+ * Vehicle Availability notification callback functions
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ *
+ */
+static EFrameworkunifiedStatus PosNotifyVehicleAvailability(HANDLE h_app) {
+ BOOL isAvailable;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ isAvailable = FrameworkunifiedIsServiceAvailable(h_app);
+
+ /* Update Vechile I/F Abailability */
+ VehicleIf_SetAvailability(isAvailable);
+
+ if (isAvailable == TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Vehicle/Availability -> TRUE");
+
+ *pLastSrvSts |= NTFY_MSK_VS_VEHICLE_AVAILABILITY;
+
+ if (eFrameworkunifiedStatusFail == VehicleIfDeliveryEntry(VEHICLE_DID_SPEED)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleIfDeliveryEntry SPEED ERROR");
+ }
+
+ if (eFrameworkunifiedStatusFail == VehicleIfDeliveryEntry(VEHICLE_DID_REV)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleIfDeliveryEntry REV ERROR");
+ }
+
+ if (eFrameworkunifiedStatusFail == VehicleIfDeliveryEntry(VEHICLE_DID_SPEED_PULSE_VEHICLE)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleIfDeliveryEntry SPEED PULSE ERROR");
+ }
+
+ PosCreateThread(h_app);
+
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Vehicle/Availability -> FALSE");
+
+ *pLastSrvSts &= ~NTFY_MSK_VS_VEHICLE_AVAILABILITY;
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Shared Memory Creation for Positioning Function
+ *
+ * @return RET_NORMAL Normal completion
+ * RET_ERROR ABENDs
+ */
+static void PosCreateSharedMemory(void) {
+ RET_API ret_api = RET_NORMAL;
+ void *mod_exec_dmy; /* Module data pointer(dummy) */
+ int retry; /* Retry counter */
+ ST_SHAREDATA *p_shm_tbl;
+
+ /* Configure Shared Data Generating Tables */
+ p_shm_tbl = g_sharedata_tbl;
+
+ while ( *(p_shm_tbl->share_data_name) != '\0' ) {
+ for ( retry = 0; retry < DATMOD_RETRY; retry++ ) {
+ /* Shared Memory Generation */
+ ret_api = _pb_CreateShareData(p_shm_tbl->share_data_name, p_shm_tbl->data_size, &mod_exec_dmy);
+ if (ret_api == RET_NORMAL) { /* If successful */
+ /* Set the shared memory status flag to ""Before initialization (0)"" */
+ *reinterpret_cast<u_int32 *>(mod_exec_dmy) = DATMOD_PREINIT;
+
+ break;
+ } else { /* In the event of failure */
+ /* Error Handling */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_CreateShareData ERROR [ret_api:%d]",
+ ret_api);
+ }
+ }
+
+ if (retry >= DATMOD_RETRY) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateShareData failed more %d times.",
+ DATMOD_RETRY);
+
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ /* Next shared memory generation */
+ p_shm_tbl++;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Positioning in-process thread creation
+ *
+ * @param[in] hApp application handles
+ */
+static void PosCreateThread(HANDLE h_app) {
+ HANDLE threadHandle;
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
+ EnumSetupMode_POS* peMode = &g_setup_mode;
+ int32_t i;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+ uint8_t* pLastThreadSts = &g_last_thread_sts;
+ uint8_t* pLastNtfySts = &g_last_ntfy_sts;
+ EnumExeSts_POS* pExeSts = &g_exe_sts;
+ ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ for (i = 0; i < ETID_POS_MAX; i++) {
+ if ((pThrCreInfo->status == THREAD_STS_NOEXIST) && (pThrCreInfo->routine != NULL)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__,
+ "i=%d, mskThread=0x%02x, *pLastThreadSts=0x%02x,"\
+ "mskAvailable=0x%02x, *pLastSrvSts=0x%02x, mskNtfy=0x%02x, *pLastNtfySts=0x%02x",
+ i,
+ pThrCreInfo->msk_thread,
+ *pLastThreadSts,
+ pThrCreInfo->msk_available,
+ *pLastSrvSts,
+ pThrCreInfo->msk_ntfy,
+ *pLastNtfySts);
+
+ if ((*pExeSts != EPOS_EXE_STS_STOP)
+ && ((((pThrCreInfo->msk_thread) & (*pLastThreadSts)) == pThrCreInfo->msk_thread)
+ || (pThrCreInfo->msk_thread == 0))
+ && ((((pThrCreInfo->msk_available) & (*pLastSrvSts)) == pThrCreInfo->msk_available)
+ || (pThrCreInfo->msk_available == NTFY_MSK_NONE))
+ && ((((pThrCreInfo->msk_ntfy) & (*pLastNtfySts)) == pThrCreInfo->msk_ntfy)
+ || (pThrCreInfo->msk_ntfy == NTFY_MSK_NONE))) {
+ if (pThrCreInfo->pno == PNO_LINE_SENS_DRV || \
+ pThrCreInfo->pno == PNO_NAVI_GPS_MAIN || \
+ pThrCreInfo->pno == PNO_NAVI_GPS_RCV ||
+ pThrCreInfo->pno == PNO_CLK_GPS) {
+ (pThrCreInfo->routine)(h_app);
+ } else {
+ /* Thread creation */
+ threadHandle = FrameworkunifiedCreateChildThread(h_app,
+ (PCSTR)(pThrCreInfo->p_name),
+ pThrCreInfo->routine,
+ &PosStopThreadDummy);
+ if (threadHandle == NULL) { /* If the thread creation fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedCreateChildThread ERROR!! [tHandle=%p]",
+ threadHandle);
+ _pb_Exit();
+ /* don't arrive here. */
+ } else {
+ /* Thread activation (Notify the startup mode) */
+ eStatus = FrameworkunifiedStartChildThread(h_app,
+ threadHandle,
+ sizeof(EnumSetupMode_POS),
+ reinterpret_cast<void*>(peMode));
+ if (eStatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedStartChildThread ERROR!! [eStatus=%d, name=%s]",
+ eStatus,
+ pThrCreInfo->p_name);
+ } else {
+ pThrCreInfo->status = THREAD_STS_CREATING;
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "name=%s", pThrCreInfo->p_name);
+ }
+ }
+ }
+ }
+ }
+
+ pThrCreInfo++;
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return;
+}
+
+
+/**
+ * @brief
+ * Termination of Positioning in-process threads
+ */
+static void PosStopThread(void) {
+ RET_API ret;
+ ST_THREAD_CREATE_INFO* p_thr_cre_info = g_pos_thread_create_info;
+ BOOL *p_thr_stop_req = &g_thread_stop_req;
+ uint8_t uc_msg = 0;
+ uint8_t uc_order = 0;
+ PNO us_pno = 0;
+ int32_t i;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ for (i = 0; i < ETID_POS_MAX; i++) {
+ if (uc_order < p_thr_cre_info->order) {
+ uc_order = p_thr_cre_info->order;
+ us_pno = p_thr_cre_info->pno;
+ }
+ p_thr_cre_info++;
+ }
+
+ if (uc_order != 0) {
+ /* Send Thread Termination Request */
+ if (us_pno == PNO_NAVI_GPS_RCV) {
+ /* Pos_gps_recv Only thread flag control */
+ *p_thr_stop_req = TRUE;
+ } else {
+ ret = PosSndMsg(us_pno, CID_THREAD_STOP_REQ, &uc_msg, sizeof(uc_msg));
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PosSndMsg ERROR!! [ret = %d]",
+ ret);
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Backup RAM initialization
+ */
+static void PosBackupDataInit(void) {
+ UNIT_TYPE e_type = UNIT_TYPE_NONE;
+ EFrameworkunifiedStatus e_status;
+ BOOL b_is_available;
+ ST_GPS_SET_TIME st_gps_set_time;
+
+ (void)memset( reinterpret_cast<void *>(&st_gps_set_time), 0, (size_t)sizeof(st_gps_set_time) );
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ e_type = GetEnvSupportInfo();
+ if (e_type == UNIT_TYPE_GRADE1) {
+ /* Set GPS date and time */
+ e_status = BackupMgrIfBackupDataWt(D_BK_ID_POS_GPS_TIME_SET_INFO,
+ &st_gps_set_time,
+ 0,
+ sizeof(st_gps_set_time),
+ &b_is_available);
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "D_BK_ID_POS_GPS_TIME_SET_INFO:W:Clear");
+ if (e_status != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "BackupMgrIfBackupDataWt ERROR!! [e_status=%d, b_is_available=%d]",
+ e_status,
+ b_is_available);
+ }
+ } else if (e_type == UNIT_TYPE_GRADE2) {
+ /*
+ * Note.
+ * This feature branches processing depending on the unit type.
+ */
+ } else {
+ /* No processing */
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher()
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosThreadCreateComp(HANDLE h_app) {
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ uint8_t* pLastThreadSts = &g_last_thread_sts;
+ ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info;
+ uint8_t* pLastNumThr = &g_last_num_of_thread;
+ uint8_t* pLastSrvSts = &g_last_srv_sts;
+ uint8_t* pLastNtfySts = &g_last_ntfy_sts;
+ EnumTID_POS eTid;
+ int32_t i;
+ static BOOL isSetAvailable = FALSE;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ (*pLastNumThr)++;
+
+ eTid = *(reinterpret_cast<EnumTID_POS*>(pRcvMsg));
+
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X]",
+ (pThrCreInfo + eTid)->p_name,
+ CID_THREAD_CREATE_COMP);
+
+ /* Thread Management Variable Updates */
+ *pLastThreadSts = static_cast<uint8_t>(*pLastThreadSts | (0x1u << eTid));
+ (pThrCreInfo + eTid)->status = THREAD_STS_CREATED;
+ (pThrCreInfo + eTid)->order = *pLastNumThr;
+
+ /* Individual processing of started threads */
+ switch (eTid) {
+ case ETID_POS_SENS: /* When sensor driver thread startup is completed */
+ {
+ /* When PSMShadow startup completion notice has been received */
+ if (((NTFY_MSK_PS_PSMSHADOW_INIT_COMP) & (*pLastNtfySts)) == NTFY_MSK_PS_PSMSHADOW_INIT_COMP) {
+ /* External pin status request */
+ LineSensDrvExtTermStsReq();
+ }
+ break;
+ }
+ case ETID_POS_GPS: /* When the GPS management thread has started */
+ {
+ /* NSBackupMgr/Availability=When TRUE notification has been received */
+ if (((NTFY_MSK_NS_BACKUPMGR_AVAILABILITY) & (*pLastSrvSts)) == NTFY_MSK_NS_BACKUPMGR_AVAILABILITY) {
+ /* Backup data read request to GSP management thread */
+ (void)DEVGpsSndBackupDataLoadReq();
+ }
+ break;
+ }
+ default: /* Other thread startup completion time */
+ break;
+ }
+
+ PosCreateThread(h_app);
+
+ for (i = 0; i < ETID_POS_MAX; i++) {
+ if ((pThrCreInfo->is_depended == TRUE) && (pThrCreInfo->status != THREAD_STS_CREATED)) {
+ break; /* Positioning/Availability->TRUE condition does not meet */
+ }
+ pThrCreInfo++;
+ }
+
+ if ((i == ETID_POS_MAX) && (isSetAvailable == FALSE)) {
+ /* Positionig/Availability -> TRUE */
+ eStatus = FrameworkunifiedPublishServiceAvailability(h_app, TRUE);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedPublishServiceAvailability ERROR!! [eStatus = %d]",
+ eStatus);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Positioning/Availability -> TRUE");
+ isSetAvailable = TRUE;
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher()
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosThreadStopComp(HANDLE h_app) {
+ EFrameworkunifiedStatus eStatus;
+ BOOL bIsAvailable;
+
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ uint8_t* pLastThreadSts = &g_last_thread_sts;
+ ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info;
+ uint8_t* pLastNumThr = &g_last_num_of_thread;
+ BOOL *pThrStopReq = &g_thread_stop_req;
+ EnumTID_POS eTid;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ (*pLastNumThr)--;
+
+ eTid = *(reinterpret_cast<EnumTID_POS*>(pRcvMsg));
+
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X]",
+ (pThrCreInfo + eTid)->p_name,
+ CID_THREAD_STOP_COMP);
+
+ *pLastThreadSts = static_cast<uint8_t>(*pLastThreadSts & ~(0x1u << eTid));
+
+ (pThrCreInfo + eTid)->status = THREAD_STS_NOEXIST;
+ (pThrCreInfo + eTid)->order = 0;
+
+ if ((pThrCreInfo + eTid)->pno == PNO_NAVI_GPS_RCV) {
+ *pThrStopReq = FALSE;
+ }
+ }
+
+ PosStopThread();
+
+ /* When all threads have stopped */
+ if (*pLastThreadSts == 0) {
+ /* Unregister callback function */
+ eStatus = FrameworkunifiedDetachCallbacksFromDispatcher(h_app,
+ "NS_ANY_SRC",
+ (const PUI_32)g_positioning_cids,
+ _countof(g_positioning_cids), NULL);
+ if (eStatus != eFrameworkunifiedStatusOK) { /* In the event of failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "PositioningDetachCallbacksToDispatcher Failed in FrameworkunifiedOnStop [eStatus:%d]",
+ eStatus);
+ }
+
+ /* Sensor log stop processing */
+ SensLogTerminate();
+
+ /* DeviceDetectionServiceIf termination process */
+ eStatus = DevDetectSrvIfUnRegisterForDeviceDetectionEvent(SS_DEV_DETECT_ANY_USB_EV, &bIsAvailable);
+ if (eStatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf UnRegisterEvent ERROR!! [sts:%d, ava:%d]",
+ eStatus,
+ bIsAvailable);
+ } else {
+ eStatus = DevDetectSrvIfCloseSessionRequest(&bIsAvailable);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf CloseSession ERROR!! [sts=%d, ava:%d]",
+ eStatus,
+ bIsAvailable);
+ }
+ }
+
+ (void)VehicleIfDetachCallbacksFromDispatcher((const PUI_32)g_positioning_cids_vehicle,
+ _countof(g_positioning_cids_vehicle));
+
+ /* Releasing Base API Resources */
+ _pb_Teardown_CWORD64_API();
+
+ /* Stop processing completion response */
+ SendInterfaceunifiedOnStopResponseToSystemManager(eFrameworkunifiedStatusOK);
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(POS_RegisterListenerPkgSensData)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifRegisterListenerPkgSensorData(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ EventID ulEventId;
+ PCSTR pName;
+ static const PCSTR pNone = "-";
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ pName = _pb_CnvPno2Name((reinterpret_cast<SENSOR_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno);
+ if (pName == NULL) {
+ pName = pNone;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X",
+ pName,
+ CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT);
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ /* Event Generation */
+ ulEventId = PosCreateEvent((reinterpret_cast<SENSOR_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno);
+ if (ulEventId != 0) {
+ /* Event publishing */
+ ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, SENSOR_RET_ERROR_INNER);
+ if (ret != RET_NORMAL) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent ERROR!! [ret = %d]", ret);
+ }
+ /* Event deletion */
+ (void)PosDeleteEvent(ulEventId);
+ } else {
+ /* Event generation failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosCreateEvent ERROR!!");
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(POS_RegisterListenerSensData)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifRegisterListenerSensorData(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ EventID ulEventId;
+ PCSTR pName;
+ static const PCSTR pNone = "-";
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ pName = _pb_CnvPno2Name((reinterpret_cast<VEHICLE_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno);
+ if (pName == NULL) {
+ pName = pNone;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X]",
+ pName,
+ CID_VEHICLEIF_DELIVERY_ENTRY);
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_VEHICLEIF_DELIVERY_ENTRY, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ /* Event Generation */
+ ulEventId = VehicleCreateEvent((reinterpret_cast<VEHICLE_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno);
+ if (ulEventId != 0) {
+ /* Event publishing */
+ ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, SENSOR_RET_ERROR_INNER);
+ if (ret != RET_NORMAL) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent ERROR!! [ret = %d]", ret);
+ }
+ /* Event deletion */
+ (void)VehicleDeleteEvent(ulEventId);
+ } else {
+ /* Event generation failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!");
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(POS_ReqGPSSetting)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifReqGpsSetting(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ uint8_t ucResult = SENSLOG_RES_FAIL;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:-][CID:0x%X]",
+ CID_SENSORIF__CWORD82__REQUEST);
+ ucResult = SENSLOG_RES_SUCCESS;
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_SENSORIF__CWORD82__REQUEST, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ }
+ }
+
+ SensLogWriteInputData(SENSLOG_DATA_I_GPSSET, 0, 0, pRcvMsg, static_cast<uint16_t>(size),
+ ucResult, SENSLOG_ON, SENSLOG_ON);
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(POS_SetGPSInfo)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifSetGpsInfo(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ uint8_t ucResult = SENSLOG_RES_FAIL;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:-][CID:0x%X]",
+ CID_NAVIINFO_DELIVER);
+ ucResult = SENSLOG_RES_SUCCESS;
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_NAVI_GPS_MAIN, CID_NAVIINFO_DELIVER, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ }
+ }
+ SensLogWriteInputData(SENSLOG_DATA_I_GPSINF, 0, 0, pRcvMsg, static_cast<uint16_t>(size),
+ ucResult, SENSLOG_ON, SENSLOG_ON);
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(POS_GetGPSInfo)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifGetGpsInfo(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ EventID ulEventId;
+ PCSTR pName;
+ static const PCSTR pNone = "-";
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ pName = _pb_CnvPno2Name((reinterpret_cast<VEHICLE_MSG_GET_VEHICLE_DATA_DAT*>(pRcvMsg))->pno);
+ if (pName == NULL) {
+ pName = pNone;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X]",
+ pName,
+ CID_VEHICLEIF_GET_VEHICLE_DATA);
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_VEHICLEIF_GET_VEHICLE_DATA, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ /* Event Generation */
+ ulEventId = VehicleCreateEvent((reinterpret_cast<VEHICLE_MSG_GET_VEHICLE_DATA_DAT*>(pRcvMsg))->pno);
+ if (ulEventId != 0) {
+ /* Event publishing */
+ ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, POS_RET_ERROR_INNER);
+ if (ret != RET_NORMAL) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_SetEvent ERROR!! [ret = %d]",
+ ret);
+ }
+ /* Event deletion */
+ (void)VehicleDeleteEvent(ulEventId);
+ } else {
+ /* Event generation failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!");
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(CID_POSIF_SET_DATA)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifSetData(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ EventID ulEventId;
+ PCSTR pName;
+ static const PCSTR pNone = "-";
+ uint8_t ucResult = SENSLOG_RES_FAIL;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ ucResult = SENSLOG_RES_SUCCESS;
+
+ pName = _pb_CnvPno2Name((reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->pno);
+ if (pName == NULL) {
+ pName = pNone;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X][DID:0x%X]",
+ pName,
+ CID_POSIF_SET_DATA,
+ (reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->did);
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_POSIF_SET_DATA, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ if ((reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->did == VEHICLE_DID_SETTINGTIME) {
+ /* GPS time setting(When waiting for completion of an event, an event is issued. */
+ /* Event Generation */
+ ulEventId = VehicleCreateEvent((reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->pno);
+ if (ulEventId != 0) {
+ /* Event publishing */
+ ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, POS_RET_ERROR_INNER);
+ if (ret != RET_NORMAL) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_SetEvent ERROR!! [ret = %d]",
+ ret);
+ }
+ /* Event deletion */
+ (void)VehicleDeleteEvent(ulEventId);
+ } else {
+ /* Event generation failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!");
+ }
+ }
+ }
+ }
+ SensLogWriteInputData(SENSLOG_DATA_I_UNSPECIFIED,
+ (reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->did,
+ 0,
+ pRcvMsg,
+ static_cast<uint16_t>(size),
+ ucResult,
+ SENSLOG_ON,
+ SENSLOG_ON);
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(CID_GPS_REQRESET)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosPosifReqGpsReset(HANDLE h_app) {
+ RET_API ret;
+ uint8_t* pRcvMsg;
+ uint32_t size;
+ EventID ulEventId;
+ PCSTR pName;
+ static const PCSTR pNone = "-";
+ uint8_t ucResult = SENSLOG_RES_FAIL;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+");
+
+ pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ ucResult = SENSLOG_RES_SUCCESS;
+
+ pName = _pb_CnvPno2Name((reinterpret_cast<POS_RESETINFO*>(pRcvMsg))->snd_pno);
+ if (pName == NULL) {
+ pName = pNone;
+ }
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__,
+ "Get message = [Sender:%s][CID:0x%X]",
+ pName,
+ CID_GPS_REQRESET);
+
+ /* Send Messages to Internal Thread */
+ ret = PosSndMsg(PNO_NAVI_GPS_MAIN, CID_GPS_REQRESET, pRcvMsg, size);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+
+ /* Event Generation */
+ ulEventId = VehicleCreateEvent((reinterpret_cast<POS_RESETINFO*>(pRcvMsg))->snd_pno);
+ if (0 != ulEventId) {
+ /* Event publishing */
+ ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, POS_RET_ERROR_INNER);
+ if (ret != RET_NORMAL) {
+ /* Event issuance failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_SetEvent ERROR!! [ret = %d]",
+ ret);
+ }
+ /* Event deletion */
+ (void)VehicleDeleteEvent(ulEventId);
+ } else {
+ /* Event generation failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!");
+ }
+ }
+ }
+
+ SensLogWriteInputData(SENSLOG_DATA_I_GPSRST, 0, 0, pRcvMsg, static_cast<uint16_t>(size),
+ ucResult, SENSLOG_ON, SENSLOG_ON);
+ FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Callback function for registering the dispatcher(CID_VEHICLESENS_VEHICLE_INFO)
+ *
+ * Send a message to an internal thread.
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus PosVehicleInfoRcv(HANDLE h_app) {
+ LSDRV_MSG_LSDATA_DAT_G line_sns_data;
+ RET_API ret = RET_NORMAL;
+
+ memset(&line_sns_data, 0, sizeof(line_sns_data));
+ LSDRV_MSG_LSDATA_DAT_G *p_line_sns_data = &line_sns_data;
+ VEHICLE_UNIT_MSG_VSINFO *p_vehicle_msg = NULL;
+ uint32_t size = 0;
+ uint16_t us_speed = 0;
+
+ uint8_t* pRcvMsg = g_rcv_msg_buf;
+
+ size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE);
+ if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ memset(p_line_sns_data, 0x00, sizeof(line_sns_data));
+ p_vehicle_msg = (reinterpret_cast<VEHICLE_UNIT_MSG_VSINFO*>(pRcvMsg));
+ switch (p_vehicle_msg->data.did) {
+ // SPEED info
+ case VEHICLE_DID_SPEED:
+ {
+ p_line_sns_data->uc_data_num = LSDRV_KINDS_MAX;
+ p_line_sns_data->st_data[LSDRV_SPEED_KMPH].ul_did = POSHAL_DID_SPEED_KMPH;
+ p_line_sns_data->st_data[LSDRV_SPEED_KMPH].uc_size = POS_SNDMSG_DTSIZE_2;
+ p_line_sns_data->st_data[LSDRV_SPEED_KMPH].uc_sns_cnt = 0;
+
+ char p_env_variable[VP_MAX_LENGTH];
+
+ VP_GetEnv("VP__CWORD31__SPEED", p_env_variable);
+ if (0 == strcmp(p_env_variable, "direct")) {
+ int16_t speed = 0;
+ // To obtain the vehicle speed from Direct lanes,1 to 2 bytes of received data
+ memcpy(&speed, &p_vehicle_msg->data.data[0], sizeof(speed));
+ us_speed = static_cast<uint16_t>(abs(speed));
+ // Unit conversion [km/h] -> [0.01km/h]
+ us_speed = static_cast<uint16_t>(us_speed * 100);
+ } else if (0 == strcmp(p_env_variable, "CAN")) {
+ UINT16 speed = 0;
+ // To obtain the vehicle speed from CAN,2 to 3 bytes of received data
+ memcpy(&speed, &p_vehicle_msg->data.data[1], sizeof(speed));
+ us_speed = static_cast<uint16_t>(abs(speed));
+ // Unit conversion [km/h] -> [0.01km/h]
+ us_speed = static_cast<uint16_t>(us_speed * 100);
+ } else {
+ // In case of invalid value, the vehicle speed is acquired by CAN.
+ UINT16 speed = 0;
+ memcpy(&speed, &p_vehicle_msg->data.data[1], sizeof(speed));
+ us_speed = static_cast<uint16_t>(abs(speed));
+ // Unit conversion [km/h] -> [0.01km/h]
+ us_speed = static_cast<uint16_t>(us_speed * 100);
+ }
+
+ memcpy(&p_line_sns_data->st_data[LSDRV_SPEED_KMPH].uc_data[0], &us_speed, sizeof(us_speed));
+
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_LINESENS_VEHICLE_DATA_G,
+ reinterpret_cast<void*>(p_line_sns_data), sizeof(line_sns_data));
+
+ break;
+ }
+ // REV information
+ case VEHICLE_DID_REV:
+ {
+ p_line_sns_data->uc_data_num = LSDRV_KINDS_MAX;
+ p_line_sns_data->st_data[LSDRV_REV].ul_did = VEHICLE_DID_REV;
+ p_line_sns_data->st_data[LSDRV_REV].uc_size = POS_SNDMSG_DTSIZE_1;
+ p_line_sns_data->st_data[LSDRV_REV].uc_sns_cnt = 0;
+ p_line_sns_data->st_data[LSDRV_REV].uc_data[0] = p_vehicle_msg->data.data[0];
+
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_LINESENS_VEHICLE_DATA_G,
+ reinterpret_cast<void*>(p_line_sns_data), sizeof(line_sns_data));
+ break;
+ }
+
+ // Speed Pulse information
+ case VEHICLE_DID_SPEED_PULSE_VEHICLE:
+ {
+ p_line_sns_data->uc_data_num = LSDRV_KINDS_MAX;
+ p_line_sns_data->st_data[LSDRV_SPEED_PULSE].ul_did = POSHAL_DID_SPEED_PULSE;
+ p_line_sns_data->st_data[LSDRV_SPEED_PULSE].uc_size = sizeof(float);
+ p_line_sns_data->st_data[LSDRV_SPEED_PULSE].uc_sns_cnt = 0;
+
+ memcpy(&p_line_sns_data->st_data[LSDRV_SPEED_PULSE].uc_data[0],
+ &p_vehicle_msg->data.data[0], sizeof(float));
+
+ p_line_sns_data->st_data[LSDRV_PULSE_TIME].ul_did = POSHAL_DID_PULSE_TIME;
+ p_line_sns_data->st_data[LSDRV_PULSE_TIME].uc_size = sizeof(float);
+ p_line_sns_data->st_data[LSDRV_PULSE_TIME].uc_sns_cnt = 0;
+
+ memcpy(&p_line_sns_data->st_data[LSDRV_PULSE_TIME].uc_data[0],
+ &p_vehicle_msg->data.data[sizeof(float)], sizeof(float));
+
+ ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_LINESENS_VEHICLE_DATA_G,
+ reinterpret_cast<void*>(p_line_sns_data), sizeof(line_sns_data));
+
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret);
+ }
+ }
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * Get Message
+ *
+ * Get messages received by the dispatcher
+ *
+ * @param[in] h_app Application handle
+ * @param[out] p_buf Pointer to receive data storage buffer
+ * @param[in] Sizes of size receive data storage buffers
+ *
+ * @return Received data size(0:Receiving error)
+ */
+static uint32_t PosGetMsg(HANDLE h_app, void** p_buf, uint32_t size) {
+ EFrameworkunifiedStatus eStatus;
+ uint32_t ulSize = 0;
+ void* pRcvBuf;
+
+ /* null check */
+ if ((h_app == NULL) || (p_buf == NULL)) { // LCOV_EXCL_BR_LINE 200: can not NULL
+ // LCOV_EXCL_START 8: invalid
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "Argument ERROR!! [h_app = %p, p_buf = %p]",
+ h_app,
+ p_buf);
+ // LCOV_EXCL_STOP
+ } else {
+ /* Check the size of received data */
+ ulSize = FrameworkunifiedGetMsgLength(h_app);
+ if (ulSize > size) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "Message size ERROR!! [ulSize = %d, maxsize = %d]",
+ ulSize,
+ size);
+ ulSize = 0;
+ } else {
+ /* Obtain data */
+ eStatus = FrameworkunifiedGetDataPointer(h_app, &pRcvBuf);
+ if (eStatus == eFrameworkunifiedStatusOK) {
+ *p_buf = pRcvBuf;
+ } else if (eStatus == eFrameworkunifiedStatusInvldBufSize) {
+ eStatus = FrameworkunifiedGetMsgDataOfSize(h_app, *p_buf, ulSize);
+ /* When acquisition fails */
+ if (eStatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedGetMsgDataOfSize ERROR [eStatus:%d]",
+ eStatus);
+ ulSize = 0;
+ }
+ } else {
+ /* When acquisition fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedGetDataPointer ERROR [eStatus:%d]",
+ eStatus);
+ ulSize = 0;
+ }
+ }
+ }
+
+ return ulSize;
+}
+
+/**
+ * @brief
+ * Sending Messages for Internal Threads
+ *
+ * Adds a header to the message received by the dispatcher and sends it to the internal thread..
+ *
+ * @param[in] pno PNO
+ * @param[in] cid Command ID
+ * @param[in] p_msg_body Sent message body
+ * @param[in] size Send message size
+ *
+ * @return RET_NORAML Normal completion
+ * RET_ERROR ABENDs
+ */
+static RET_API PosSndMsg(PNO pno, CID cid, void* p_msg_body, uint32_t size) {
+ RET_API ret = RET_NORMAL;
+ T_APIMSG_MSGBUF_HEADER* p;
+ static u_int8 sndMsgBuf[MAX_MSG_BUF_SIZE + sizeof(T_APIMSG_MSGBUF_HEADER)];
+
+ if ((p_msg_body == NULL) || (size > MAX_MSG_BUF_SIZE)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!! [p_msg_body = %p, size = %d]", p_msg_body, size);
+ ret = RET_ERROR;
+ } else {
+ p = reinterpret_cast<T_APIMSG_MSGBUF_HEADER*>(sndMsgBuf);
+
+ /* Message header addition */
+ p->hdr.cid = cid;
+ p->hdr.msgbodysize = static_cast<uint16_t>(size);
+
+ /* Copy of the data section */
+ memcpy((p + 1), p_msg_body, size);
+
+ /* Send a message to an internal thread */
+ ret = _pb_SndMsg(pno, static_cast<uint16_t>(size + sizeof(T_APIMSG_MSGBUF_HEADER)), p, 0);
+ /* When transmission fails */
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR [ret = %d]", ret);
+ ret = RET_ERROR;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * SS_DevDetectSrv service OpenSessionAck Callback Functions
+ *
+ * @param none
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosOnDevDetectOpenSessionAck(HANDLE h_app) {
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
+ BOOL bIsAvailable;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ eStatus = DevDetectSrvIfDecodeOpenSessionResponse(&bIsAvailable);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf OpenSession ERROR!! [sts=%d, ava=%d]", eStatus, bIsAvailable);
+ } else {
+ eStatus = DevDetectSrvIfRegisterForDeviceDetectionEvent(SS_DEV_DETECT_ANY_USB_EV,
+ &PosOnDevDetectEvent,
+ NULL,
+ &bIsAvailable);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf RegisterEvent ERROR!! [sts=%d, ava=%d]", eStatus, bIsAvailable);
+ } else {
+ eStatus = DevDetectSrvIfNotifyOnCloseSessionAck(&PosOnDevDetectCloseSessionAck, &bIsAvailable);
+ if (eFrameworkunifiedStatusOK != eStatus) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "DeviceDetectionServiceIf CloseSessionAck ERROR!! [sts=%d, ava=%d]",
+ eStatus,
+ bIsAvailable);
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * SS_DevDetectSrv service CloseSessionAck Callback Functions
+ *
+ * @param none
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosOnDevDetectCloseSessionAck(HANDLE h_app) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+");
+
+ /* Sensor log stop processing */
+ SensLogTerminate();
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-");
+ return eFrameworkunifiedStatusOK;
+}
+
+/**
+ * @brief
+ * SS_DevDetectSrv service Event Callback Functions
+ *
+ * @param none
+ *
+ * @return eFrameworkunifiedStatusOK successful completion
+ */
+static EFrameworkunifiedStatus PosOnDevDetectEvent(HANDLE h_app) {
+ SS_MediaDetectInfo stMedia;
+ EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
+ uint32_t ulSize = 0;
+ uint8_t mode;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+");
+
+ /* Check the size of received data */
+ ulSize = FrameworkunifiedGetMsgLength(h_app);
+ if (ulSize > sizeof(SS_MediaDetectInfo)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Message size ERROR!! [ulSize = %d, maxsize = %ld]",
+ ulSize, sizeof(SS_MediaDetectInfo));
+ ulSize = 0;
+ } else {
+ /* Obtain data */
+ eStatus = FrameworkunifiedGetMsgDataOfSize(h_app, &stMedia, ulSize);
+ /* When acquisition fails */
+ if (eStatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "FrameworkunifiedGetMsgDataOfSize ERROR [eStatus:%d]", eStatus);
+ ulSize = 0;
+ } else {
+ if (eUSB == stMedia.dev_type) {
+ if (TRUE == stMedia.bIsDeviceAvailable) {
+ /* Mount detection */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__,
+ "USB mounted sts=[%d] path=[%s] fusedav=[%d]",
+ stMedia.bIsDeviceAvailable, stMedia.deviceMountpath, stMedia.bIsFuseDav);
+
+ /* NOTE: bIsFuseDav -> From the _CWORD80_'s point of view, */
+ /* TRUE(With a USB flash drive inserted into the _CWORD84_,Be synchronized on the FuseDav)*/
+ /* FALSE(USB memory is inserted into the _CWORD80_.) */
+
+ if (stMedia.bIsFuseDav == FALSE) {
+ /* Inserted into your USB port */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SensLog Initialize start.");
+ /* Get Debug/Release setting */
+ eStatus = NsLogGetFrameworkunifiedLogFlag(POSITIONINGLOG_FLAG_NAVI, &mode);
+ /* When acquisition fails */
+ if (eStatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "NsLogGetFrameworkunifiedLogFlag ERROR [eStatus:%d]", eStatus);
+ } else {
+ if (mode == FRAMEWORKUNIFIEDLOG_FLAG_MODE_DEBUG) {
+ /* Sensor Log Initial Processing(Normal)*/
+ SensLogInitialize(reinterpret_cast<uint8_t *>(stMedia.deviceMountpath));
+ }
+ }
+ } else {
+ /* TODO: Mounts (FuseDav synchronized) that are not inserted into your device's USB port are not supported. */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Don't output SensLog.");
+ }
+ } else {
+ /* Unmount detection */
+ if (stMedia.bIsFuseDav == FALSE) {
+ /* When it is unmounted to its own USB */
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__,
+ "USB umounted sts=[%d] fusedav=[%d]",
+ stMedia.bIsDeviceAvailable, stMedia.bIsFuseDav);
+
+ /* Sensor log stop processing */
+ SensLogTerminate();
+ }
+ }
+ }
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-");
+ return eStatus;
+}
+
+/**
+ * @brief Debug dump log output function
+ *
+ * @param[in] *p_buf Pointer to the output string
+ */
+static void PosOutputDebugDumpLog(uint8_t* p_buf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SSDEBUGDUMP("%s\n", p_buf);
+ MilliSecSleep(1);
+ return;
+}
+// LCOV_EXCL_STOP
+
diff --git a/vehicleservice/positioning/server/src/nsfw/ps_main.cpp b/vehicleservice/positioning/server/src/nsfw/ps_main.cpp
new file mode 100755
index 0000000..de2732a
--- /dev/null
+++ b/vehicleservice/positioning/server/src/nsfw/ps_main.cpp
@@ -0,0 +1,59 @@
+/*
+ * @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.
+ */
+#include <native_service/frameworkunified_dispatcher.h>
+#include <native_service/frameworkunified_application.h>
+#include <peripheral_service/ps_services.h>
+#include <native_service/ns_version_if.h>
+#include <system_service/ss_system_if.h>
+#include <vehicle_service/positioning_base_library.h>
+#include <cstdlib>
+#include <iostream>
+#include "vehicle_version.h"
+
+const CHAR kAppName[PS_APPNAME_MAX] = "Positioning";
+
+CFrameworkunifiedVersion g_FrameworkunifiedVersion(MAJORNO, // NOLINT(readability/nolint)
+ MINORNO, // NOLINT(readability/nolint)
+ REVISION);
+
+/* FRAMEWORKUNIFIEDLOGPARAM : g_FrameworkunifiedLogParams : definition for LOG */
+FRAMEWORKUNIFIEDLOGPARAM g_FrameworkunifiedLogParams = { // NOLINT(readability/nolint)
+ FRAMEWORKUNIFIEDLOGOPTIONS,
+ {
+ ZONE_TEXT_10, ZONE_TEXT_11, ZONE_TEXT_12,
+ ZONE_TEXT_13, ZONE_TEXT_14, ZONE_TEXT_15,
+ ZONE_TEXT_16, ZONE_TEXT_17, ZONE_TEXT_18,
+ ZONE_TEXT_19, ZONE_TEXT_20, ZONE_TEXT_21,
+ ZONE_TEXT_22, ZONE_TEXT_23, ZONE_TEXT_24,
+ ZONE_TEXT_25, ZONE_TEXT_26, ZONE_TEXT_27,
+ ZONE_TEXT_28, ZONE_TEXT_29, ZONE_TEXT_30,
+ ZONE_TEXT_31,
+ ZONE_POS_SYS_IN, ZONE_POS_GPS_IN, ZONE_POS_CMD_IN, ZONE_POS_NAV_IN
+ },
+ FRAMEWORKUNIFIEDLOGZONES
+};
+
+/* Function : main */
+int main(int argc, char *argv[]) {
+ EFrameworkunifiedStatus e_status = eFrameworkunifiedStatusOK;
+ FrameworkunifiedDefaultCallbackHandler cb_funcs;
+ FRAMEWORKUNIFIED_MAKE_DEFAULT_CALLBACK(cb_funcs);
+
+ FRAMEWORKUNIFIED_SET_ZONES();
+ e_status = FrameworkunifiedDispatcher(kAppName, &cb_funcs);
+
+ return e_status;
+} // LCOV_EXCL_BR_LINE 10:The final line
diff --git a/vehicleservice/positioning_base_library/LICENSE b/vehicleservice/positioning_base_library/LICENSE
new file mode 100755
index 0000000..f433b1a
--- /dev/null
+++ b/vehicleservice/positioning_base_library/LICENSE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/vehicleservice/positioning_base_library/Makefile.client b/vehicleservice/positioning_base_library/Makefile.client
new file mode 100755
index 0000000..c3aaab5
--- /dev/null
+++ b/vehicleservice/positioning_base_library/Makefile.client
@@ -0,0 +1,20 @@
+#
+# @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.
+#
+
+######### subdirectories #########
+SUBDIRS += library
+
+include ../vehicle_service.mk
diff --git a/vehicleservice/positioning_base_library/library/Makefile b/vehicleservice/positioning_base_library/library/Makefile
new file mode 100755
index 0000000..c0aec5b
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/Makefile
@@ -0,0 +1,87 @@
+#
+# @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.
+#
+
+######### installed shared library(*.so) #############
+INST_SHLIBS = libPOS_base_API
+
+######### install headers(*.h) #############
+VPATH += ./include/$(COMPONENT_NAME)
+INST_HEADERS += std_types.h
+INST_HEADERS += sys_timerapi.h
+INST_HEADERS += WPF_STD.h
+INST_HEADERS += pos_message_header.h
+INST_HEADERS += positioning_base_library.h
+INST_HEADERS += positioning_positioningbaselibrarylog.h
+
+######### compiled sources #############
+VPATH += src
+libPOS_base_API_SRCS += _pbTimer.cpp
+libPOS_base_API_SRCS += _pbCSection.cpp
+libPOS_base_API_SRCS += _pbMutex.cpp
+libPOS_base_API_SRCS += _pbSem.cpp
+libPOS_base_API_SRCS += _pbDram.cpp
+libPOS_base_API_SRCS += _pbFsys.cpp
+libPOS_base_API_SRCS += _pbMem.cpp
+libPOS_base_API_SRCS += _pbSram.cpp
+libPOS_base_API_SRCS += _pbOSCtrl.cpp
+libPOS_base_API_SRCS += _pbSerial.cpp
+libPOS_base_API_SRCS += _pbWaitforsingleobject.cpp
+libPOS_base_API_SRCS += _pbOther.cpp
+libPOS_base_API_SRCS += _pbProcMng.cpp
+libPOS_base_API_SRCS += _pbCommon.cpp
+libPOS_base_API_SRCS += _CWORD64_api.cpp
+libPOS_base_API_SRCS += _pbMisc.cpp
+libPOS_base_API_SRCS += _pbEvent.cpp
+libPOS_base_API_SRCS += _pbMsg.cpp
+libPOS_base_API_SRCS += _pbSum.cpp
+libPOS_base_API_SRCS += MsgBapi.cpp
+libPOS_base_API_SRCS += memcpy_64p_sync.cpp
+libPOS_base_API_SRCS += memset_64p_sync.cpp
+
+######### add include path #############
+CPPFLAGS += -I./include
+CPPFLAGS += -I./
+
+######### add compile option #############
+CPPFLAGS += -DLINUX -fPIC
+CPPFLAGS += -D_CWORD64_API_DOES_NOT_USE_UNICODE
+
+LDFLAGS += -Wl,--no-undefined
+LDFLAGS += -Wl,--no-as-needed
+CPPFLAGS += -Werror=implicit-function-declaration
+CPPFLAGS += -Werror=format-security
+CPPFLAGS += -Wconversion
+CPPFLAGS += -Wint-to-pointer-cast
+CPPFLAGS += -Wpointer-arith
+CPPFLAGS += -Wformat
+
+######### linked library (dynamic) #############
+LDLIBS += -Wl,-Bdynamic -lvp
+LDLIBS += -Wl,-Bdynamic -lrt
+LDLIBS += -Wl,-Bdynamic -lcommon
+LDLIBS += -Wl,-Bdynamic -lstdc++
+LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
+LDLIBS += -Wl,-Bdynamic -lev
+
+######### add library path #############
+LDFLAGS += -shared
+
+INSTALL = install
+CREATE_DIR = $(DESTDIR)/nv/BS/vs/positioning_base_library/rwdata
+install-data:
+ $(INSTALL) -d -m 775 $(CREATE_DIR)
+
+include ../../vehicle_service.mk
diff --git a/vehicleservice/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h b/vehicleservice/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h
new file mode 100755
index 0000000..141c8d8
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/DEV_TimerEntryDrv_if.h
@@ -0,0 +1,76 @@
+/*
+ * @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 : DEV_TimerEntryDrv_if.h
+ * System name : Integrated PF
+ * Subsystem name : Timer registry drivers
+ * Title : APIs for Timer registry drivers
+ ****************************************************************************/
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_DEV_TIMERENTRYDRV_IF_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_DEV_TIMERENTRYDRV_IF_H_
+
+#include <vehicle_service/positioning_base_library.h>
+
+/*-----------------------------------------------------------------------------
+ * Constant definition
+ *----------------------------------------------------------------------------*/
+/* Return value */
+#define DEV_TED_INVALID (u_int32)0 /* Timer start failure */
+#define DEV_TED_STOP_NG (u_int32)0 /* Timer stop failure */
+#define DEV_TED_STOP_OK (u_int32)1 /* Timer stop success */
+
+/* Definitions for event Handle names */
+#define DEV_TED_EVTNAME_MAX (u_int32)32 /* _CWORD64_ Events HANDLE Name */
+
+/*-----------------------------------------------------------------------------
+ * Structure Definition
+ *----------------------------------------------------------------------------*/
+/* Structures for timer setting instructions (_CWORD64_ messages) */
+typedef struct {
+ int32 set_time; /* Count time */
+ PNO pno; /* _CWORD64_ Messages Destination PNOs */
+ u_int32 ext_data; /* Extended Info for _CWORD64_ Messages */
+} stTED_SetTime__CWORD64_msg;
+
+/* Structures for timer setting directives (Windows events) */
+typedef struct {
+ int32 set_time; /* Count time */
+ char evob_name[DEV_TED_EVTNAME_MAX]; /* _CWORD64_ Events HANDLE Name */
+ int32 ext_data; /* _CWORD64_ Events Extended Info */
+} stTED_SetTime__CWORD64_evt;
+
+/* Structures for sending _CWORD64_ messages */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER header; /* _CWORD64_ Message header */
+ u_int32 timer_id; /* Timer IDs for _CWORD64_ messages */
+ u_int32 us_data; /* Extended Info for _CWORD64_ Messages */
+} stTimer_CWORD64_msg;
+
+/* Structures for timer setting directives (Windows events) */
+typedef struct {
+ int32 set_time; /* Count time */
+ wchar_t evob_name[DEV_TED_EVTNAME_MAX]; /* _CWORD64_ Events HANDLE Name */
+} stTED_SetTime_winevt;
+/*
+ API Function Prototype
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+u_int32 DEVSetTimer_CWORD64_msg(stTED_SetTime__CWORD64_msg *p_set_data);
+u_int32 DEVSetTimer_CWORD64_event(stTED_SetTime__CWORD64_evt *p_set_data);
+u_int32 DEVStopTimer(u_int32 time_id);
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_DEV_TIMERENTRYDRV_IF_H_
+
diff --git a/vehicleservice/positioning_base_library/library/include/TimerEntryDrv_If.h b/vehicleservice/positioning_base_library/library/include/TimerEntryDrv_If.h
new file mode 100755
index 0000000..d20d6f0
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/TimerEntryDrv_If.h
@@ -0,0 +1,111 @@
+/*
+ * @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 : TimerDrv_If.h
+ * System name : Integrated PF
+ * Process name : Timer registry driversI/F
+ * Overview : Timer registry drivers I/F Header file
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TIMERENTRYDRV_IF_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TIMERENTRYDRV_IF_H_
+
+#include <vehicle_service/positioning_base_library.h>
+#include "DEV_TimerEntryDrv_if.h"
+
+/*
+ Constant definition
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#define TED_DRV_NAME "TED" /* Channel names of drivers registered in the Timer */
+/* The channel name cannot be a leading slash. Location is under /dev/name/local */
+
+/*-----------------------------------------------------------------------------
+ * CTRL CODE definitions
+ *----------------------------------------------------------------------------*/
+/* IOCTRL internal-processing sort codes */
+#define TED_IOCTRL_TIMREQ __DIOTF(_DCMD_MISC, 1, stTedApidt) /* Timer start */
+#define TED_IOCTRL_STPREQ __DIOT(_DCMD_MISC, 2, stTedApidt) /* Timer stop */
+
+#define TED_IF_SETTIME_MIN (int32)1 /* Minimum count time(1ms) */
+
+#define TED_IF_SETPNO_NG (PNO)0 /* PNO invalid value for _CWORD64_ messages */
+#define TED_IF_MMEVENT_INVALID_ID 0 /* Invalid _CWORD64_ EventID */
+
+#define TED_IF_RET__CWORD64_MSG (u_int16)1 /* How Users Are Notified on Timeouts: _CWORD64_ Messages */
+#define TED_IF_RET_WINEVT (u_int16)2 /* How Users Are Notified on Timeouts: Windows Events */
+
+/* Timer type */
+#define TED_IF_TIMERTYPE_CYCLE 1 /* Fixed period Timer Specified in [10ms] */
+#define TED_IF_TIMERTYPE_SINGLE 2 /* Single occurrence Timer Specified in [10ms] */
+
+/* API type(Distinguishing between API Functions Used at Timer Startup) */
+#define TED_IF_APITYPE_SYS 1 /* Timer start by _pb_ReqTimerStart() */
+#define TED_IF_APITYPE_DEV 2 /* Timer start by DEV_SetTimer_XXX() */
+
+/*
+ Data type definition
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* Timer registration data by user(Timer register driver IF -> timer register driver) */
+typedef struct {
+ int32 time_rem; /* User's remaining timer count time(count value in 10 [msec] units) */
+ u_int32 timer_id; /* User's timer ID */
+ u_int32 ret_data; /* User's extended information */
+ PNO ret_pno; /* User's _CWORD64_ message-destination process number */
+ u_int16 fin_mode; /* User Timeout Notification Method */
+ char wev_ob_name[DEV_TED_EVTNAME_MAX]; /* Event name(32 characters) */
+ u_int32 timer_seq; /* Timer Sequence Number */
+ u_int8 time_type; /* Timer type(Fixed period/single occurrence) */
+ u_int8 api_type; /* API type(_pb_ReqTimerStart/DEV_SetTimer) */
+ u_int8 reserve[2];
+} stTedApidt;
+typedef stTedApidt *PTED_IFDT;
+
+/* Timer Start/Stop Messages Structures, */
+typedef struct {
+ int32 time_rem; /* User's remaining timer count time(count value in 10 [msec] units) */
+ u_int32 timer_id; /* User's timer ID */
+ u_int32 ret_data; /* User's extended information */
+ PNO ret_pno; /* User's _CWORD64_ message-destination process number */
+ u_int16 fin_mode; /* User Timeout Notification Method */
+ char wev_ob_name[DEV_TED_EVTNAME_MAX]; /* Event name(32 characters) */
+ u_int32 timer_seq; /* Timer Sequence Number */
+ u_int8 time_type; /* Timer type(Fixed period/single occurrence) */
+ u_int8 api_type; /* API type(_pb_ReqTimerStart/DEV_SetTimer) */
+ u_int8 reserve[2];
+} TIMERUSERDATA;
+
+/* Structures for sending _CWORD64_ message timer START */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER header; /* _CWORD64_ Message header */
+ /* Extended Info for _CWORD64_ Messages */
+ TIMERUSERDATA st_us_data;
+} stTimerStart_CWORD64_msg;
+
+/* Structures for sending _CWORD64_ message timer STOP */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER header; /* _CWORD64_ Message header */
+ /* Extended Info for _CWORD64_ Messages */
+ TIMERUSERDATA st_us_data;
+} stTimerStop_CWORD64_msg;
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TIMERENTRYDRV_IF_H_
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : TimerEntryDrv_If.h
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
diff --git a/vehicleservice/positioning_base_library/library/include/WPF_STD_private.h b/vehicleservice/positioning_base_library/library/include/WPF_STD_private.h
new file mode 100755
index 0000000..87f57cd
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/WPF_STD_private.h
@@ -0,0 +1,295 @@
+/*
+ * @copyright Copyright (c) 2019-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 WPF_STD_private.h
+ * @brief Header file for system standard definitions
+ */
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_WPF_STD_PRIVATE_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_WPF_STD_PRIVATE_H_
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+
+/* _CWORD64_ non-OS managed areas */
+#define SDRAM__CWORD64__NOTOS_AREA 0x00000000
+#define SDRAM__CWORD64__NOTOS_AREA_SIZE 0x0
+
+#define BLVER_SIZE 0x00000008 /* BootLoader version information area size */
+#define FROM_FIX_VER_SIZE BLVER_SIZE /* Mask(BootLoder)Version size */
+
+/* Start address of the _CWORD64_ non-OS management area */
+#define TOP_ADDR_NOTOS SDRAM__CWORD64__NOTOS_AREA
+/* Size of the non-OS management area */
+#define NOTOS_SISE SDRAM__CWORD64__NOTOS_AREA_SIZE
+
+/* Reserved(32KB)Unavailable */
+#define SRAMDRAM_RESERVE2_SIZE 0x00008000
+
+#define WINAPI
+
+#define STATUS_WAIT_0 ((DWORD)0x00000000L)
+#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080L)
+#define STATUS_TIMEOUT ((DWORD)0x00000102L)
+#define WAIT_TIMEOUT STATUS_TIMEOUT
+#define WAIT_OBJECT_0 ((STATUS_WAIT_0) + 0)
+#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0) + 0)
+#define WAIT_FAILED ((DWORD)0xFFFFFFFF)
+
+#define SHARED_MEMORY_DIRECTORY ("/tmp/shm/navigation/")
+
+#define _pb_strcmp(pleft, pright)((strcmp(pleft, pright) == 0) ?(0) :(-1))
+
+/* For heap allocation method control */
+#define HEAP_ZERO_MEMORY (0x00000008)
+
+#define EV_RXCHAR 0x0001
+#define EV_ERROR 0x0080
+
+#define EV_DSR 0x0010
+
+/* Systems API External Public Functions Prototype Definitions */
+#define VUP_DISC_PATHNAME _T("/Z01") /* VUP DISC paths */
+#define VUP_USB_PATHNAME _T("/U") /* VUP USB paths */
+#define VUP_PATHNAME_SYSTEM _T("/agl/system") /* Storage path name */
+#define VUP_FNAME_TOP _T("/NA_D0_") /* VUPFile name(front) */
+#define VUP_FNAME_BTM _T(".bin") /* VUPFile name(rear) */
+#define VUP_FNAME_FORCEVUP _T("/forcevup.dat") /* Forced VUP file name */
+
+#define FROM_VARI_VER_SIZE 8
+#define WRITE_FLAG_ON 0x01 /* Write permission status for the file */
+#define FSNOACCESS 0x00 /* File system access disabled state */
+#define VUP_GETNAME_MEDIA_DISC 0x01 /* VUP media:disc */
+
+/* Function Code(Normal completion) */
+#define RET_RCVMSG 1 /* Receive only message */
+#define RET_RCVSIG 2 /* Receive only signal */
+#define RET_RCVBOTH 3 /* Receive both messages and signals */
+#define RET_NOMSG 4 /* No received message */
+/* User-side signal handling return values */
+#define RET_QUE 5 /* Queue a signal */
+#define RET_NOTQUE 6 /* Do not queue signals */
+#define RET_PROCDOWN 7 /* Detect DOWN of children */
+#define RET_SLEEP 100
+
+/* Error code system */
+#define RET_OSERROR (-127) /* OS System call error */
+/* Actual error in _sys_GetOSErrorCode() */
+/* Code can be retrieved */
+#define RET_ERRNOTRDY (-3) /* Specified port ID and semaphore ID are not created.*/
+#define RET_ERRPROC (-4) /* Error in API processing */
+#define RET_ERRTIMEOUT (-5) /* Timeout with Processing Not Complete */
+/* (D type API only) */
+#define RET_ERRMSGFULL (-6) /* Message table full */
+#define RET_ERROVERFLW (-7) /* Receive message is larger than the receive buffer size */
+#define RET_ERRINIT (-8)
+#define RET_ERRREGQUE (-9)
+
+#define RET_EV_NONE (-20) /* No specified event */
+#define RET_EV_MAX (-21) /* Event value exceeds the specified maximum value */
+#define RET_EV_MIN (-22) /* The event value is less than the specified minimum value. */
+
+#define SAPI_EVSET_RELATE 2
+
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+typedef struct FileTime {
+ DWORD dw_low_date_time;
+ DWORD dw_high_date_time;
+} FILETIME;
+typedef FILETIME *PFILETIME;
+typedef FILETIME *LPFILETIME;
+
+typedef struct Overlapped {
+ ULONG_PTR internal;
+ ULONG_PTR internal_high;
+ union {
+ struct {
+ DWORD offset;
+ DWORD offset_high;
+ };
+
+ PVOID pointer;
+ };
+
+ HANDLE h_event;
+} OVERLAPPED;
+typedef OVERLAPPED *LPOVERLAPPED;
+
+typedef struct ComStat {
+ DWORD f_cts_hold : 1;
+ DWORD f_dsr_hold : 1;
+ DWORD f_rlsd_hold : 1;
+ DWORD f_x_off_hold : 1;
+ DWORD f_x_off_sent : 1;
+ DWORD f_eof : 1;
+ DWORD f_txim : 1;
+ DWORD f_reserved : 25;
+ DWORD cb_in_que;
+ DWORD cb_out_que;
+} COMSTAT;
+typedef COMSTAT *LPCOMSTAT;
+
+typedef struct Dcb {
+ DWORD dcb_length; /* sizeof(DCB) */
+ DWORD baud_rate; /* Baudrate at which running */
+ DWORD f_binary: 1; /* Binary Mode (skip EOF check) */
+ DWORD f_parity: 1; /* Enable parity checking */
+ DWORD f_out_x_cts_flow: 1; /* CTS handshaking on output */
+ DWORD f_out_x_dsr_flow: 1; /* DSR handshaking on output */
+ DWORD f_dtr_control: 2; /* DTR Flow control */
+ DWORD f_dsr_sensitivity: 1; /* DSR Sensitivity */
+ DWORD f_tx_continue_on_x_off: 1; /* Continue TX when Xoff sent */
+ DWORD f_out_x: 1; /* Enable output X-ON/X-OFF */
+ DWORD f_in_x: 1; /* Enable input X-ON/X-OFF */
+ DWORD f_error_char: 1; /* Enable Err Replacement */
+ DWORD f_null: 1; /* Enable Null stripping */
+ DWORD f_rts_control: 2; /* Rts Flow control */
+ DWORD f_abort_on_error: 1; /* Abort all reads and writes on Error */
+ DWORD f_dummy2: 17; /* Reserved */
+ WORD w_reserved; /* Not currently used */
+ WORD x_on_lim; /* Transmit X-ON threshold */
+ WORD x_off_lim; /* Transmit X-OFF threshold */
+ BYTE byte_size; /* Number of bits/byte, 4-8 */
+ BYTE parity; /* 0-4=None,Odd,Even,Mark,Space */
+ BYTE stop_bits; /* 0,1,2 = 1, 1.5, 2 */
+ char x_on_char; /* Tx and Rx X-ON character */
+ char x_off_char; /* Tx and Rx X-OFF character */
+ char error_char; /* Error replacement char */
+ char eof_char; /* End of Input character */
+ char evt_char; /* Received Event character */
+ WORD w_reserved1; /* Fill for now. */
+} DCB;
+typedef DCB *LPDCB;
+
+typedef struct CommTimeouts {
+ DWORD read_interval_timeout; /* Maximum time between read chars. */
+ DWORD read_total_timeout_multiplier; /* Multiplier of characters. */
+ DWORD read_total_timeout_constant; /* Constant in milliseconds. */
+ DWORD write_total_timeout_multiplier; /* Multiplier of characters. */
+ DWORD write_total_timeout_constant; /* Constant in milliseconds. */
+} COMMTIMEOUTS;
+typedef COMMTIMEOUTS *LPCOMMTIMEOUTS;
+
+typedef struct {
+ DWORD size; /* Allocated shared memory size */
+ DWORD phy_addr; /* Physical address */
+ HANDLE h_map; /* +8: Handle of file mapping object. */
+ void* p_memory; /* Shared Memory Mapped Address */
+ DWORD owner; /* +16: Owner flag. */
+ HANDLE h_heap; /* +20: Handle of heap for oneself. */
+} SHARED_MEMORY;
+
+typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(
+ LPVOID lpThreadParameter
+);
+typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
+
+/* Program version storage */
+typedef struct {
+ u_int8 mask_ver[ FROM_FIX_VER_SIZE ]; /* BootLoader programming versions */
+ u_int8 flash_ver1[ FROM_VARI_VER_SIZE ]; /* NK1 programming versions */
+ u_int8 flash_ver2[ FROM_VARI_VER_SIZE ]; /* NK2 programming versions */
+ u_int8 flash_ver3[ FROM_VARI_VER_SIZE ]; /* NK3 programming versions */
+} T_SYS_PRGVER;
+
+/* Device information storage */
+typedef struct {
+ u_int8 _CWORD31__no[ _CWORD31__NO_SIZE ]; /* _CWORD31_ product number */
+ u_int8 reserve1[ RESERVE1_SIZE ]; /* RESERVE1 */
+ u_int8 helpnet_id[ HELPNET_ID_SIZE ]; /* HELPNET ID */
+ u_int8 reserve2[ RESERVE2_SIZE ]; /* RESERVE2 */
+ u_int8 date[ DATE_SIZE ]; /* Manufacturing date and time */
+} T_SYS_DEVINFO;
+
+/* Structure for storing display information */
+typedef struct {
+ int i_width_size; /* Width */
+ int i_height_size; /* Height */
+} DISPLAY_INFO;
+
+/* System error notification message structure */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER bhead; /* Message buffer header */
+ PNO pno; /* Process No. */
+ u_int8 dummy[2]; /* Dummy */
+ int32 errcode; /* Error code */
+} T_SYS_SYSTEMERROR;
+
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+/* Configuration Functions (_pbCommon.cpp) */
+void PbReset(void); /* Soft reset process */
+
+/* Message Sending/Receiving Functions (_pbMsg.cpp) */
+RET_API PbDeleteMsg(PNO pno);
+
+/* SRAM Control Functions (_pbSram.cpp) */
+RET_API PbSramFil32(u_int8 id, u_int32 off, u_int8 pat, u_int32 size);
+RET_API PbSramRd32(u_int8 id, u_int32 off, void *pbuf, u_int32 size);
+RET_API PbSramSz32(u_int8 id, u_int32 *psize);
+
+/* DRAM Control Functions (_pbDram.cpp) */
+RET_API PbDramWt32(u_int8 id, void *pbuf, u_int32 off, u_int32 size);
+
+/* Semaphore(_pbSem.cpp) */
+RET_API PbDeleteSemaphore(SemID sem_id);
+DWORD PbDeleteMutex(HANDLE h_mutex);
+DWORD PbMutexLock(HANDLE h_mutex, DWORD timeout);
+BOOL PbMutexUnlock(HANDLE h_mutex);
+
+/* Shared Memory Access Functions(_pbMem.cpp) */
+RET_API PbDeleteShareData(char* area_name);
+/* Accessing Physical Memory Area Allocation Data */
+RET_API PbAccessPhysicalMem(u_int32 addr, void **mem_ptr, u_int32 size, u_int32 mode);
+/* Releases access to the physical memory area allocation data. */
+RET_API PbFreePhysicalMem(u_int32 addr, void *mem_ptr, u_int32 size);
+
+LPVOID PbProcessHeapAlloc(DWORD dw_flags, SIZE_T dw_bytes); /* Allocating Memory from the Process Heap */
+BOOL PbProcessHeapFree(DWORD dw_flags, LPVOID lp_mem); /* Free Memory Allocated from Process Heap */
+
+/* Functions Related to Analysis Support Functions(_pbOther.cpp) */
+uint32_t PbGetTid(void);
+uint32_t PbGetLocalTid(void);
+
+/* Other Functions(_pbMisc.cpp) */
+RET_API PbMilliSecSleep(u_int32 ul_mill_time); /* Sleeping of the calling process */
+
+/* TODO As defined in _pbCSection--> */
+VOID PbDeleteCriticalSection(LPCRITICAL_SECTION lp_critical_section);
+VOID PbEnterCriticalSection(LPCRITICAL_SECTION lp_critical_section);
+VOID PbInitializeCriticalSection(LPCRITICAL_SECTION lp_critical_section);
+VOID PbLeaveCriticalSection(LPCRITICAL_SECTION lp_critical_section);
+
+BOOL PbSystemTimeToFileTime(CONST SYSTEMTIME *lp_system_time, LPFILETIME lp_file_time);
+
+
+/* Memory copy Bus release support */
+void* Memset64pSync(void* dest, int c, size_t count);
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_WPF_STD_PRIVATE_H_
+
diff --git a/vehicleservice/positioning_base_library/library/include/_pbCommon.h b/vehicleservice/positioning_base_library/library/include/_pbCommon.h
new file mode 100755
index 0000000..8cd1591
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/_pbCommon.h
@@ -0,0 +1,36 @@
+/*
+ * @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 : _sysCommon.h
+ * System name : System API
+ * Subsystem name : Common system
+ * Title : Internal header for system API infrastructure management
+ ****************************************************************************/
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBCOMMON_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBCOMMON_H_
+
+#define PBCOM_CONFIGFILE "config" /* Configuration file */
+#define PBCOM_CONFIGSIZE_MAX (1024) /* Configuration file maximum size */
+#define PBCOM_API_NORMAL (0) /* API processing result normal */
+#define PBCOM_API_ERROR (-1) /* API processing result error */
+#define PBCOM_UNICODE_NUL (0x00) /* NULL character codes */
+#define PBCOM_UNICODE_LF (0x0A) /* Line feed character code */
+#define PBCOM_UTOIMAX_NUM (8) /* Maximum font size */
+#define PBCOM_CONFIG_INDEX_SCRWIDTH "[ScreenWidth]" /* Data information "Screen width" */
+#define PBCOM_CONFIG_INDEX_SCRHEIGHT "[ScreenHeight]" /* Data information "Screen Height" */
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBCOMMON_H_
diff --git a/vehicleservice/positioning_base_library/library/include/_pbEvent_Internal.h b/vehicleservice/positioning_base_library/library/include/_pbEvent_Internal.h
new file mode 100755
index 0000000..d0b6d44
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/_pbEvent_Internal.h
@@ -0,0 +1,128 @@
+/*
+ * @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.
+ */
+
+/*******************************************************************************
+* $Header:: $
+* $Revision:: $
+*******************************************************************************/
+
+/****************************************************************************
+ * File name : _pbEvent_Internal.h
+ * System name : GPF
+ * Subsystem name : _CWORD64_API Events Feature
+ * Title : Internal definition file for event function
+ ****************************************************************************/
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_
+
+#include <other_service/ev_lib.h>
+
+/*
+ Constant definition
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define MAX_PB_EVENTS 16
+#define MAX_EVENT_NAME_LEN 32
+#define MIN_EVENT_VAL 0x80000000 /* Minimum event value(-2147483648) */
+#define MAX_EVENT_VAL 0x7FFFFFFF /* Maximum event value( 2147483647) */
+#define EVENT_BIT_ZERO 0x00000000 /* Event value All Bit Zero Definition */
+#define MAX_PB_EVENT_WAIT_THREADS 1 /* Values other than 1 are not designed while the EV library is being used. */
+#define EVSET_ABSOLUTE 1 /* Absolute setting */
+#define EVSET_RELATE 2 /* Relative value setting */
+#define EVSET_AND 3 /* AND value setting */
+#define EVSET_OR 4 /* OR setting */
+#define EVWAIT_VAL 1 /* Waiting mode for an event by specifying a range */
+#define EVWAIT_ALLCLR 2 /* Mode to wait for an event when the specified bit is cleared */
+#define EVWAIT_ANYSET 3 /* Mode to wait for an event with a specified set of bits */
+
+#define _CWORD64_EVENT_MAXOPEN_IN_PROCESS 0x7FFFFFFF /* Maximum number of open events in the same process */
+#define _CWORD64_EVENT_MAXOPEN_IN_SYSTEM 0x7FFFFFFF /* Maximum number of the same event open in the system */
+
+#define MAX_EVENT_PROC_NUM (32) /* EVENT Max Processes Used */
+
+/*
+ Structure Definition
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/*****************************************************************************
+ * TAG : WAITING_CONDITION
+ * ABSTRACT : Event Status Settings
+******************************************************************************/
+typedef struct {
+ u_int8 uc_use_flag; /* Table Usage Flags(TRUE:Use FALSE:Not used) */
+ u_int8 uc_waiting; /* Event Waiting Flag */
+ /* TRUE Waiting for event */
+ /* FALSE Release Event Wait */
+ u_int16 us_mode; /* Waiting mode */
+ /* EVWAIT_VAL Wait for Value Range */
+ /* EVWAIT_ALLCLR Wait for specified bit to be cleared */
+ /* EVWAIT_ANYSET Waiting for setting the specified bit */
+ u_int32 ul_mask; /* Mask value when waiting for specified bit */
+ int32 l_min_val; /* Minimum value of condition when waiting for value range */
+ int32 l_max_val; /* Maximum value of condition when waiting for value range */
+ int32 l_last_val; /* Events at WaitEvent Return */
+ EV_ID flag_id[MAX_EVENT_PROC_NUM]; /* Event flags(CLS event library) */
+} WAITING_CONDITION; /* Total 28 Bytes. */
+
+/*****************************************************************************
+ * TAG : WAITING_CONDITION
+ * ABSTRACT : Event information storage area
+******************************************************************************/
+typedef struct {
+ TCHAR event_name[MAX_EVENT_NAME_LEN]; /* Maximum number of characters + NULL area */
+ int32 l_event_val;
+ WAITING_CONDITION st_condition[MAX_PB_EVENT_WAIT_THREADS];
+ int32 l_process_ref;
+ int32 l_reset_data;
+ u_int8 uc_manual_reset;
+ u_int8 uc_reserve[3];
+ char name_of_mutex[NAME_MAX];
+ /* TODO: Members for the following EV library use:Structurely strange, but borrowed shared space.Correction is required. */
+ u_int8 proc_cnt;
+} PB_EVENT;
+
+/*****************************************************************************
+ * TAG : PB_EVENT_OPEN_HANDLE
+ * ABSTRACT : Generated event management information
+******************************************************************************/
+typedef struct {
+ HANDLE h_heap;
+ PB_EVENT* p_sys_event;
+ DWORD index;
+ int32 l_thread_ref;
+} PB_EVENT_OPEN_HANDLE;
+
+/*****************************************************************************
+ * TAG : PB_EVENT_INSTANCE
+ * ABSTRACT : Event management table
+******************************************************************************/
+typedef struct {
+ PB_EVENT_OPEN_HANDLE* p_handle_table[MAX_PB_EVENTS];
+ HANDLE h_shared_memory;
+ SemID id_event_table_sem;
+ PB_EVENT* p_event_table;
+} PB_EVENT_INSTANCE;
+
+/*
+ Prototype declaration
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBEVENT_INTERNAL_H_
diff --git a/vehicleservice/positioning_base_library/library/include/_pbInternalProc.h b/vehicleservice/positioning_base_library/library/include/_pbInternalProc.h
new file mode 100755
index 0000000..03bcd03
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/_pbInternalProc.h
@@ -0,0 +1,41 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBINTERNALPROC_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBINTERNALPROC_H_
+
+#define POSITIONINGBASELIBRARY_NON_FD (-1) //!< \~english invalid fd
+#define POSITIONINGBASELIBRARY_MAP_NON_INIT (0) //!< \~english init flag for mmap
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ int32 InitMutexObject(pthread_mutex_t *p_st_mutex);
+
+ HANDLE CreateSharedMemory(TCHAR* name, DWORD size);
+ HANDLE OpenSharedMemory(TCHAR* name, DWORD size);
+ void DeleteAllSharedMemory(void);
+ void* GetSharedMemoryPtr(HANDLE h_shm);
+ void CloseSharedMemory(HANDLE h_shm);
+ void DeleteSharedMemory(TCHAR* name);
+ HANDLE OpenSharedMemoryAtPhysical(DWORD physical_address, DWORD size, DWORD protect);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBINTERNALPROC_H_
diff --git a/vehicleservice/positioning_base_library/library/include/_pbSerial.h b/vehicleservice/positioning_base_library/library/include/_pbSerial.h
new file mode 100755
index 0000000..1bedfe8
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/_pbSerial.h
@@ -0,0 +1,32 @@
+/*
+ * @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.
+ */
+
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBSERIAL_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBSERIAL_H_
+
+#include <vehicle_service/positioning_base_library.h>
+
+/* Prototype */
+BOOL SerialTableInit(void); /* Initialization process for each process */
+BOOL SerialTableTerm(void); /* Termination process for each process */
+BOOL SerialObjectTimeoutAdd(HANDLE h_obj, DWORD dw_read_timeout, DWORD dw_write_timeout); /* Timeout registration process */
+BOOL SerialObjectTimeoutGet(HANDLE h_obj, DWORD*, DWORD*); /* Timeout acquisition processing */
+BOOL SerialObjectWaitmaskAdd(HANDLE h_obj, DWORD dw_mask); /* Mask registration process */
+BOOL SerialObjectWaitmaskGet(HANDLE h_obj, DWORD*); /* Mask acquisition processing */
+BOOL SerialObjectDel(HANDLE h_obj); /* Deletion process */
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBSERIAL_H_
diff --git a/vehicleservice/positioning_base_library/library/include/_pbWaitforsingleobject.h b/vehicleservice/positioning_base_library/library/include/_pbWaitforsingleobject.h
new file mode 100755
index 0000000..e4f8eb1
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/_pbWaitforsingleobject.h
@@ -0,0 +1,40 @@
+/*
+ * @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.
+ */
+
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBWAITFORSINGLEOBJECT_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBWAITFORSINGLEOBJECT_H_
+
+#include <vehicle_service/positioning_base_library.h>
+
+typedef enum {
+ PB_HANDLE_INVAL = 0,
+ PB_HANDLE_MUTEX,
+ PB_HANDLE_PROC_SEMAPHORE,
+ PB_HANDLE_EVENT,
+ PB_HANDLE_THREAD,
+ PB_HANDLE_PROCESS,
+
+ PB_HANDLE_KIND_MAX /* Maximum value range check */
+} HANDLE_KIND;
+
+/* Prototype */
+BOOL WaitObjectInit(void); /* Initialization process for each process */
+BOOL WaitObjectTerm(void); /* Termination process for each process */
+BOOL WaitObjectAdd(HANDLE h_obj, HANDLE_KIND l_kind); /* Registration process */
+BOOL WaitObjectDel(HANDLE h_obj); /* Deletion process */
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE__PBWAITFORSINGLEOBJECT_H_
diff --git a/vehicleservice/positioning_base_library/library/include/sysup.h b/vehicleservice/positioning_base_library/library/include/sysup.h
new file mode 100755
index 0000000..eafca8e
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/sysup.h
@@ -0,0 +1,24 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_H_
+
+#define SYS_RESET (int32)1 /* Make reset */
+#define SYS_ONLY_RESET (int)2 /* Reset only */
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_H_
+
diff --git a/vehicleservice/positioning_base_library/library/include/sysup_addr.h b/vehicleservice/positioning_base_library/library/include/sysup_addr.h
new file mode 100755
index 0000000..9e73bf0
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/sysup_addr.h
@@ -0,0 +1,227 @@
+/*
+ * @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 : sysup_addr.h
+* System name : Integrated PF
+* Subsystem name : Common system
+* Title : Boot-Related Address Definition Header Files
+************************************************************************/
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_ADDR_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_ADDR_H_
+
+/*****************************************************
+ *
+ * Initial management area address space definition
+ * A: Address, S: Size
+ ****************************************************/
+/* Note : Don't forget to change sysup_addr.inc at the same time! */
+
+/* SDRAM startup identification table (1) A Offset from the beginning 0x0 */
+#define ADDR_SYSUP_DRAM1 ((SDRAM_INITIAL_AREA & ADDR_MASK) | ADDR_P2) // NOLINT(runtime/references)
+/* SDRAM startup identification table (1) S */
+#define SIZE_SYSUP_DRAM1 0x00000004
+
+/* SDRAM Start Identification Table A Offset from the beginning 0x4 */
+#define ADDR_SYSUP_DRAM_FIX (ADDR_SYSUP_DRAM1 + SIZE_SYSUP_DRAM1)
+/* SDRAM Start Identification Table S */
+#define SIZE_SYSUP_DRAM_FIX 0x00000004
+
+/* Startup Status Table A Offset from the beginning 0x8 */
+#define ADDR_SYSUP_STS (ADDR_SYSUP_DRAM_FIX + SIZE_SYSUP_DRAM_FIX)
+/* Startup Status Table S */
+#define SIZE_SYSUP_STS 0x00000002
+
+#define ADDR_SYS_DUMMY1 (ADDR_SYSUP_STS + SIZE_SYSUP_STS) /* Dummy1 A Offset from the beginning 0xa */
+#define SIZE_SYS_DUMMY1 0x00000002 /* Dummy1 S */
+
+#define ADDR_UPMODE (ADDR_SYS_DUMMY1 + SIZE_SYS_DUMMY1) /* Boot Mode Save Table A Offset from the beginning 0xc */
+#define SIZE_UPMODE 0x00000004 /* Boot Mode Save Table S */
+
+#define ADDR_SYSUP_STS_GINI (ADDR_UPMODE + SIZE_UPMODE) /* System startup status table A Offset from the beginning 0x10 */
+#define SIZE_SYSUP_STS_GINI 0x00000002 /* System startup status table S */
+
+/* Fork Failures Recording Table A Offset from the beginning 0x12 */
+#define ADDR_SYSUP_RST_CNT (ADDR_SYSUP_STS_GINI + SIZE_SYSUP_STS_GINI)
+/* Fork Failures Recording Table S */
+#define SIZE_SYSUP_RST_CNT 0x00000002
+
+/* System anomaly process No. table A Offset from the beginning 0x14 */
+#define ADDR_SYS_ERR_PNO (ADDR_SYSUP_RST_CNT + SIZE_SYSUP_RST_CNT)
+/* System anomaly process No. table S */
+#define SIZE_SYS_ERR_PNO 0x00000004
+
+/* System error reset cause table A Offset from the beginning 0x18 */
+#define ADDR_SYS_ERR_RST (ADDR_SYS_ERR_PNO + SIZE_SYS_ERR_PNO)
+/* System error reset cause table S */
+#define SIZE_SYS_ERR_RST 0x00000004
+
+/* System startup failure table A Offset from the beginning 0x1c */
+#define ADDR_SYSUP_ERR_STS (ADDR_SYS_ERR_RST + SIZE_SYS_ERR_RST)
+/* System startup failure table S */
+#define SIZE_SYSUP_ERR_STS 0x00000004
+
+/* Navigation activation state table A Offset from the beginning 0x20 */
+#define ADDR_NAVIUP_STS (ADDR_SYSUP_ERR_STS + SIZE_SYSUP_ERR_STS)
+/* Navigation activation state table S */
+#define SIZE_NAVIUP_STS 0x00000002
+
+/* Navigation fork Failed Count Recording Table A Offset from the beginning 0x22*/
+#define ADDR_NAVIUP_RST_CNT (ADDR_NAVIUP_STS + SIZE_NAVIUP_STS)
+/* Navigation fork Failed Count Recording Table S */
+#define SIZE_NAVIUP_RST_CNT 0x00000002
+
+/* Navigation error process No. table A Offset from the beginning 0x24 */
+#define ADDR_NAVI_ERR_PNO (ADDR_NAVIUP_RST_CNT + SIZE_NAVIUP_RST_CNT)
+/* Navigation error process No. table S */
+#define SIZE_NAVI_ERR_PNO 0x00000004
+
+/* Navigation Error Cause Table A Offset from the beginning 0x28 */
+#define ADDR_NAVI_ERR (ADDR_NAVI_ERR_PNO + SIZE_NAVI_ERR_PNO)
+/* Navigation Error Cause Table S */
+#define SIZE_NAVI_ERR 0x00000004
+
+#define ADDR_NAVIUP_ERR_STS (ADDR_NAVI_ERR + SIZE_NAVI_ERR) /* Navigation start failure table A Offset from the beginning 0x2c */
+#define SIZE_NAVIUP_ERR_STS 0x00000004 /* Navigation start failure table S */
+
+/* SDRAM startup identification table (2) A Offset from the beginning 0x30 */
+#define ADDR_SYSUP_DRAM2 (ADDR_NAVIUP_ERR_STS + SIZE_NAVIUP_ERR_STS)
+/* SDRAM startup identification table (2) S */
+#define SIZE_SYSUP_DRAM2 0x00000004
+
+/* SDRAM Backup Status Table A Offset from the beginning 0x34 */
+#define ADDR_SYS_BUP_STS (ADDR_SYSUP_DRAM2 + SIZE_SYSUP_DRAM2)
+/* SDRAM Backup Status Table S */
+#define SIZE_SYS_BUP_STS 0x00000004
+
+/* NAVI-SYS communication error recording table A Offset from the beginning 0x38 */
+#define ADDR_SYSCOM_STS (ADDR_SYS_BUP_STS + SIZE_SYS_BUP_STS)
+/* NAVI-SYS communication error recording table S */
+#define SIZE_SYSCOM_STS 0x00000004
+
+/* SDRAM Power Supply Fault Detection Table A Offset from the beginning 0x3c */
+#define ADDR_SYS_PW_STS (ADDR_SYSCOM_STS + SIZE_SYSCOM_STS)
+/* SDRAM Power Supply Fault Detection Table S */
+#define SIZE_SYS_PW_STS 0x00000004
+
+/* Hard WDT generation table A Offset from the beginning 0x40 */
+#define ADDR_HWDT_STS (ADDR_SYS_PW_STS + SIZE_SYS_PW_STS)
+/* Hard WDT generation table S */
+#define SIZE_HWDT_STS 0x00000004
+
+/* SDRAM Labels Destruct Status Detection Table A Offset from the beginning 0x44 */
+#define ADDR_DRAMLABEL_STS (ADDR_HWDT_STS + SIZE_HWDT_STS)
+/* SDRAM Labels Destruct Status Detection Table S */
+#define SIZE_DRAMLABEL_STS 0x00000004
+
+#define ADDR_SSB_MNG (ADDR_DRAMLABEL_STS + SIZE_DRAMLABEL_STS) /* SSB management table A Offset from the beginning 0x48 */
+#define SIZE_SSB_MNG 0x00000004 /* SSB management table S */
+
+#define ADDR_NMI_END (ADDR_SSB_MNG + SIZE_SSB_MNG) /* NMI completion flag A Offset from the beginning 0x4c */
+#define SIZE_NMI_END 0x00000004 /* NMI completion flag S */
+
+/* Opening indication determination table A Offset from the beginning 0x50 */
+#define ADDR_OPDSP_CHK (ADDR_NMI_END + SIZE_NMI_END)
+/* Opening indication determination table S */
+#define SIZE_OPDSP_CHK 0x00000004
+
+#define ADDR_SYS_FROM_STS (ADDR_OPDSP_CHK + SIZE_OPDSP_CHK) /* FROM destruction status table A Offset from the beginning 0x54 */
+#define SIZE_SYS_FROM_STS 0x00000004 /* FROM destruction status table S */
+
+/* BootLoader status A Offset from the beginning 0x58 */
+#define ADDR_BOOT_STS (ADDR_SYS_FROM_STS + SIZE_SYS_FROM_STS)
+/* BootLoader status S */
+#define SIZE_BOOT_STS 0x00000004
+
+/* BootLoader Exceptions Recording Table A Offset from the beginning 0x5c */
+#define ADDR_BOOTEXP_LOG (ADDR_BOOT_STS + SIZE_BOOT_STS)
+/* BootLoader Exceptions Recording Table S */
+#define SIZE_BOOTEXP_LOG 0x00000004
+
+/* SDRAM startup identification table (3) A Offset from the beginning0x60 */
+#define ADDR_SYSUP_DRAM3 (ADDR_BOOTEXP_LOG + SIZE_BOOTEXP_LOG)
+/* SDRAM startup identification table (3) S */
+#define SIZE_SYSUP_DRAM3 0x00000004
+
+/* Error Logging Table in BootLoader Drivers A Offset from the beginning 0x64 */
+#define ADDR_BOOTERR_LOG (ADDR_SYSUP_DRAM3 + SIZE_SYSUP_DRAM3)
+/* Error Logging Table in BootLoader Drivers S */
+#define SIZE_BOOTERR_LOG 0x00000004
+
+/* EPC register values at the time of exceptions in the BootLoader A Offset from the beginning 0x68 */
+#define ADDR_BOOT_EPC (ADDR_BOOTERR_LOG + SIZE_BOOTERR_LOG)
+/* EPC register values at the time of exceptions in the BootLoader S */
+#define SIZE_BOOT_EPC 0x00000004
+
+/* Status register when exceptions occur in the BootLoader A Offset from the beginning 0x6c */
+#define ADDR_BOOT_SR (ADDR_BOOT_EPC + SIZE_BOOT_EPC)
+/* Status register when exceptions occur in the BootLoader S */
+#define SIZE_BOOT_SR 0x00000004
+
+/* Cause Register Values When Internal BootLoader Exceptions Occur A Offset from the beginning 0x70 */
+#define ADDR_BOOT_CAUSE (ADDR_BOOT_SR + SIZE_BOOT_SR)
+/* Cause Register Values When Internal BootLoader Exceptions Occur S */
+#define SIZE_BOOT_CAUSE 0x00000004
+
+/* NMI completion flag(Copying) A Offset from the beginning 0x74 */
+#define ADDR_NMI_END_CPY (ADDR_BOOT_CAUSE + SIZE_BOOT_CAUSE)
+/* NMI completion flag(Copying) S */
+#define SIZE_NMI_END_CPY 0x00000004
+
+/* Target Type A Offset from the beginning 0x78 */
+#define ADDR_TARGET (ADDR_NMI_END_CPY + SIZE_NMI_END_CPY)
+/* Target Type S */
+#define SIZE_TARGET 0x00000004
+
+#define ADDR_SYS_NR_RST (ADDR_TARGET + SIZE_TARGET) /* Normal reset factor table A 0x7c */
+#define SIZE_SYS_NR_RST 0x00000004 /* Normal reset factor table S */
+
+#define ADDR_NK_LOAD_STS (ADDR_SYS_NR_RST + SIZE_SYS_NR_RST) /* NK Load Status Table A 0x80 */
+#define SIZE_NK_LOAD_STS 0x00000004 /* NK Load Status Table S */
+
+#define ADDR_CRC_RETRY (ADDR_NK_LOAD_STS + SIZE_NK_LOAD_STS) /* CRC retry count table A 0x84 */
+#define SIZE_CRC_RETRY 0x00000004 /* CRC retry count table S */
+
+#define ADDR_BOOT_VBR (ADDR_CRC_RETRY + SIZE_CRC_RETRY) /* VBR-saved table in BootLoaderr A 0x88 */
+#define SIZE_BOOT_VBR 0x00000004 /* VBR-saved table in BootLoaderr S */
+
+#define ADDR_MONI_TYPE (ADDR_BOOT_VBR + SIZE_BOOT_VBR) /* Monitor Type Table A 0x8C */
+#define SIZE_MONI_TYPE 0x00000004 /* Monitor Type Table S */
+
+#define ADDR_B_FLAG (ADDR_MONI_TYPE + SIZE_MONI_TYPE) /* B genuine flag A 0x90 */
+#define SIZE_B_FLAG 0x00000010 /* B genuine flag S */
+
+#define ADDR_RGBCABLE_TYPE (ADDR_B_FLAG + SIZE_B_FLAG) /* Connection RGB Cable Type Table A 0xA0 */
+#define SIZE_RGBCABLE_TYPE 0x0000004 /* Connection RGB Cable Type Table S */
+
+#define ADDR_RESET_LABEL (ADDR_RGBCABLE_TYPE + SIZE_RGBCABLE_TYPE) /* Normal reset label area A 0xA4 */
+#define SIZE_RESET_LABEL 0x00000010 /* Normal reset label area S */
+
+#define ADDR_NK_VUP_FLAG (ADDR_RESET_LABEL + SIZE_RESET_LABEL) /* NK version upgrade flag A 0xB4 */
+#define SIZE_NK_VUP_FLAG 0x00000004 /* NK version upgrade flag S */
+
+#define ADDR_TRANS_VUP (ADDR_NK_VUP_FLAG + SIZE_NK_VUP_FLAG) /* VUP migration flag A */
+#define SIZE_TRANS_VUP 0x00000004 /* VUP migration flag S */
+
+#define ADDR_PRG_SPAR_BOOT (ADDR_TRANS_VUP + SIZE_TRANS_VUP) /* Preliminary program start occurrence flag A */
+#define SIZE_ADDR_PRG_SPAR_BOOT 0x00000004 /* Preliminary program start occurrence flag S */
+
+#define ADDR_BOOT_ERR (ADDR_PRG_SPAR_BOOT + SIZE_ADDR_PRG_SPAR_BOOT) /* OS Pre-boot Error Information Storage Table A */
+#define SIZE_BOOT_ERR 0x00000004 /* OS Pre-boot Error Information Storage Table S */
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_SYSUP_ADDR_H_
+
diff --git a/vehicleservice/positioning_base_library/library/include/tchar.h b/vehicleservice/positioning_base_library/library/include/tchar.h
new file mode 100755
index 0000000..ee45e4d
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/tchar.h
@@ -0,0 +1,256 @@
+/*
+ * @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.
+ */
+
+
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define _T(x) __TEXT(x)
+
+#ifdef UNICODE
+ /* ++++++++++++++++++++ UNICODE ++++++++++++++++++++ */
+
+#define _TEOF WEOF
+
+#define _tmain wmain
+
+#ifdef UNDER_CE
+# define _tWinMain WinMain
+#else
+# define _tWinMain wWinMain
+#endif
+
+ /* Formatted i/o */
+#define _tprintf wprintf
+#define _ftprintf fwprintf
+#define _stprintf swprintf
+#define _sntprintf _snwprintf
+#define _vtprintf vwprintf
+#define _vftprintf vfwprintf
+#define _vstprintf vswprintf
+#define _vsntprintf _vsnwprintf
+#define _tscanf wscanf
+#define _ftscanf fwscanf
+#define _stscanf swscanf
+
+ /* Unformatted i/o */
+#define _fgettc fgetwc
+#define _fgetts fgetws
+#define _fputtc fputwc
+#define _fputts fputws
+#define _gettc getwc
+#define _gettchar getwchar
+#define _getts _getws
+#define _puttc putwc
+#define _puttchar putwchar
+#define _putts _putws
+#define _ungettc ungetwc
+
+#define _tfopen _wfopen
+#define _tfreopen _wfreopen
+
+ /* String conversion functions */
+#define _tcstod wcstod
+#define _tcstol wcstol
+#define _tcstoul wcstoul
+
+#define _itot _itow
+#define _ltot _ltow
+#define _ultot _ultow
+#define _ttoi _wtoi
+#define _ttol _wtol
+#define _ttoi64 _wtoi64
+
+ /* String functions */
+#define _tcscat wcscat
+#define _tcschr wcschr
+#define _tcscmp wcscmp
+#define _tcscpy wcscpy
+#define _tcscspn wcscspn
+#define _tcslen wcslen
+#define _tcsclen wcslen
+
+#define _tcsncat wcsncat
+#define _tcsnccat wcsncat
+#define _tcsnccmp wcsncmp
+#define _tcsncmp wcsncmp
+#define _tcsncpy wcsncpy
+#define _tcsnccpy wcsncpy
+#define _tcspbrk wcspbrk
+#define _tcsrchr wcsrchr
+#define _tcsspn wcsspn
+#define _tcsstr wcsstr
+#define _tcstok wcstok
+#define _tcsdup _wcsdup
+#define _tcsicmp _wcsicmp
+#define _tcsncicmp _wcsnicmp
+#define _tcsnicmp _wcsnicmp
+#define _tcsnset _wcsnset
+#define _tcsncset _wcsnset
+#define _tcsrev _wcsrev
+#define _tcsset _wcsset
+
+#define _tcslwr _wcslwr
+#define _tcsupr _wcsupr
+
+#define _istalpha iswalpha
+#define _istupper iswupper
+#define _istlower iswlower
+#define _istdigit iswdigit
+#define _istxdigit iswxdigit
+#define _istspace iswspace
+#define _istpunct iswpunct
+#define _istalnum iswalnum
+#define _istprint iswprint
+#define _istgraph iswgraph
+#define _istcntrl iswcntrl
+#define _istascii iswascii
+
+#define _totupper towupper
+#define _totlower towlower
+
+#define _istlegal(_c) (1)
+#define _istlead(_c) (0)
+#define _istleadbyte(_c) (0)
+
+#else /* ndef UNICODE */
+
+ /* ++++++++++++++++++++ SBCS (MBCS in Not supported) ++++++++++++++++++++ */
+
+#define _TEOF EOF
+
+ /* Program */
+#define _tmain main
+#define _tWinMain WinMain
+
+ /* Formatted i/o */
+#define _tprintf printf
+#define _ftprintf fprintf
+#define _stprintf sprintf
+#define _sntprintf _snprintf
+#define _vtprintf vprintf
+#define _vftprintf vfprintf
+#define _vstprintf vsprintf
+#define _vsntprintf _vsnprintf
+#define _tscanf scanf
+#define _ftscanf fscanf
+#define _stscanf sscanf
+
+ /* Unformatted i/o */
+#define _fgettc fgetc
+#define _fgetts fgets
+#define _fputtc fputc
+#define _fputts fputs
+#define _gettc getc
+#define _gettchar getchar
+#define _getts gets
+#define _puttc putc
+#define _puttchar putchar
+#define _putts puts
+#define _ungettc ungetc
+
+#define _tfopen _wfopen
+#define _tfreopen _wfreopen
+
+#ifndef UNDER_CE
+
+#define _tcstod strtod
+#define _tcstol strtol
+#define _tcstoul strtoul
+#endif
+
+#define _itot _itoa
+#define _ltot _ltoa
+#define _ultot _ultoa
+#define _ttoi atoi
+#define _ttol atol
+
+#ifndef UNDER_CE
+#define _ttoi64 atoi64
+#endif
+
+ /* String functions */
+#define _tcscat strcat
+#define _tcschr strchr
+#define _tcscmp strcmp
+#define _tcscpy strcpy
+#define _tcscspn strcspn
+#define _tcslen strlen
+#define _tcsclen strlen
+
+#define _tcsncat strncat
+#define _tcsnccat strncat
+#define _tcsnccmp strncmp
+#define _tcsncmp strncmp
+#define _tcsncpy strncpy
+#define _tcsnccpy strncpy
+
+#ifndef UNDER_CE
+
+#define _tcspbrk strpbrk
+#define _tcsrchr strrchr
+#define _tcsspn strspn
+#endif
+
+#define _tcsstr strstr
+#define _tcstok strtok
+
+#ifndef UNDER_CE
+
+#define _tcsdup _strdup
+#define _tcsicmp _stricmp
+#define _tcsncicmp _strnicmp
+#define _tcsnicmp _strnicmp
+#define _tcsnset _strnset
+#define _tcsncset _strnset
+#define _tcsrev _strrev
+#define _tcsset _strset
+#define _tcslwr _strlwr
+#define _tcsupr _strupr
+#endif
+
+#ifndef UNDER_CE
+
+#define _istalpha isalpha
+#define _istupper isupper
+#define _istlower islower
+#define _istdigit isdigit
+#define _istxdigit isxdigit
+#define _istspace isspace
+#define _istpunct ispunct
+#define _istalnum isalnum
+#define _istprint isprint
+#define _istgraph isgraph
+#define _istcntrl iscntrl
+#define _istascii isascii
+#define _totupper toupper
+#define _totlower tolower
+#endif
+
+#endif /* UNICODE */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_
diff --git a/vehicleservice/positioning_base_library/library/include/vehicle_service/WPF_STD.h b/vehicleservice/positioning_base_library/library/include/vehicle_service/WPF_STD.h
new file mode 100755
index 0000000..085640a
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/vehicle_service/WPF_STD.h
@@ -0,0 +1,1653 @@
+/*
+ * @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.
+ */
+
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_
+
+/**
+ * @file WPF_STD.h
+ * @brief Header file for system standard definitions
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning_base_library
+ * @ingroup vehicle_service
+ * @{
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Incluce *
+ *---------------------------------------------------------------------------------*/
+#include <string.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <wchar.h>
+#include <sys/prctl.h>
+#include <sys/stat.h>
+#include <native_service/wpf_legacy.h>
+#include <vehicle_service/std_types.h>
+#include <vehicle_service/pos_message_header.h>
+#include <vehicle_service/sys_timerapi.h>
+#include <vehicle_service/positioning_positioningbaselibrarylog.h>
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+#define POS_THREAD_NAME "Positioning" //!< \~english Positioning thread name
+
+#ifdef UNICODE
+#define __TEXT(quote) L##quote
+#else /* UNICODE */
+#define __TEXT(quote) (quote) /* r_winnt */
+#endif /* UNICODE */
+
+#define D_LTEXT(x) __TEXT(x)
+#define LTEXT(x) D_LTEXT(x)
+
+#define DEBUG_DUMP_MAX_SIZE 4096
+//!< \~english FrameworkunifiedOnDebugDump max size
+
+/* Sensor Log Type */
+#define POS_SENSLOG_TYPE_NONE 0 //!< \~english sensor log type NONE
+#define POS_SENSLOG_TYPE_SYS 1 //!< \~english sensor log type SYS
+#define POS_SENSLOG_TYPE_GPS 2 //!< \~english sensor log type GPS
+#define POS_SENSLOG_TYPE_NAV 3 //!< \~english sensor log type NAV
+#define POS_SENSLOG_TYPE_CMD 4 //!< \~english sensor log type CMD
+
+#define POS_SENSLOG_GET_ZONE(typ) \
+ (((typ) == (POS_SENSLOG_TYPE_SYS))?(ZONE_POS_SYS_IN):\
+ ((typ) == (POS_SENSLOG_TYPE_GPS))?(ZONE_POS_GPS_IN):\
+ ((typ) == (POS_SENSLOG_TYPE_NAV))?(ZONE_POS_NAV_IN):\
+ ((typ) == (POS_SENSLOG_TYPE_CMD))?(ZONE_POS_CMD_IN):\
+ (0))
+//!< \~english get sensor log zone code
+
+#define POS_WRITE_SENSLOG(zone, data, len) (((zone) != (0))?((void)((FRAMEWORKUNIFIEDLOG_DATA(zone, data, len)))):((void)(0)))
+//!< \~english write sensor log output
+#define POS_SENSLOG(typ, data, len) (POS_WRITE_SENSLOG(POS_SENSLOG_GET_ZONE(typ), data, len))
+
+/* HW configuration type */
+/*
+ * Note.
+ * This feature needs to be defined by the vendor.
+ */
+#define UNIT_TYPE_NONE 0x00000000UL //!< \~english type none
+#define UNIT_TYPE_UNKNOWN 0x00000001UL //!< \~english type unknown
+#define UNIT_TYPE_GRADE1 0x00000002UL //!< \~english type Grade1
+#define UNIT_TYPE_GRADE2 0x00000004UL //!< \~english type Grade2
+
+#define MAX_NAME_LEN 32 //!< \~english name max length
+#define _CWORD31__NO_SIZE 16 //!< \~english _CWORD31_ No size
+#define RESERVE1_SIZE 16 //!< \~english reserve 1
+#define HELPNET_ID_SIZE 21 //!< \~english helpnet ID size
+#define RESERVE2_SIZE 11 //!< \~english reserve 2
+#define DATE_SIZE 32 //!< \~english make time size
+#define SERIAL_NO_SIZE 3 //!< \~english serial No size
+#define PRODUCT_NAME_SIZE 1 //!< \~english product name size
+
+#define _pb_memcpy memcpy
+#define _pb_memset memset
+
+/* RET_API define */
+#define RET_NORMAL 0 //!< \~english normal return
+#define RET_ERROR (-1) //!< \~english error return
+#define RET_ERRPARAM (-2) //!< \~english parameter error
+
+#define SAPI_EVSET_ABSOLUTE 1 //!< \~english absolute vale set
+#define SAPI_EVWAIT_VAL 1 //!< \~english event wait value set
+
+/* sys common commandID definition */
+#define CID_GPS_BASE (CID)0xF030
+//!< \~english GPS
+
+#define CID_TIMER_BASE (CID)0xF040
+//!< \~english timer management
+
+#define CID_INITIAL_BASE (CID)0xF100
+//!< \~english initial
+
+/* ResourceManager/CID definition */
+#define CID_GPS_SERIAL0 (CID)0x0100
+//!< \~english GPS reset request func definition
+
+#define CID_GPS_REQRESET (CID)(CID_GPS_BASE | CID_GPS_SERIAL0)
+//!< \~english GPS reset request CID
+
+
+/* sys common commandID detail definition */
+#define CID_COM_SERIAL4 (CID)0x0004
+//!< \~english serial command ID 4
+
+#define CID_COM_SERIAL6 (CID)0x0006
+//!< \~english serial command ID 6
+
+#define CID_COM_SERIAL7 (CID)0x0007
+//!< \~english serial command ID 7
+
+/* initial CID definition */
+#define CID_INI_SYSTEMERR (CID)(CID_INITIAL_BASE | CID_COM_SERIAL6)
+//!< \~english system abnormality notify
+
+#define CID_INI_INTERNAL_ACCOFF_START (CID)(CID_INITIAL_BASE | CID_COM_SERIAL7)
+//!< \~english internal ACC-OFF start Indication
+
+/* timer control CID definition */
+#define CID_TIMER_TOUT (CID)(CID_TIMER_BASE | CID_COM_SERIAL4)
+//!< \~english timeout notify
+
+
+/* PNO definition */
+#define PNO_NONE 0x0000 //!< \~english initial value
+
+#define PNO__CWORD88___CWORD23_ 0x0100
+//!< \~english _CWORD23_ primary thread
+#define PNO_GINI_MAIN 0x0300
+//!< \~english G initial
+#define PNO_CLK_GPS 0x0316
+//!< \~english clock GPS thread
+#define PNO_VEHICLE_SENSOR 0x0363
+//!< \~english vehicle sensor thread
+#define PNO_LINE_SENS_DRV 0x0364
+//!< \~english line sensor driver thread
+#define PNO_NAVI_GPS_MAIN 0x0440
+//!< \~english GPS communication manager thread
+#define PNO_NAVI_GPS_RCV 0x0441
+//!< \~english GPS receive thread
+#define PNO__CWORD83_ 0x0900
+//!< \~english _CWORD83_(Intersystem Communication Message)thread
+
+#define SYS_PNO_MIN PNO__CWORD88___CWORD23_
+//!< \~english minimum PNO.(normal process)
+#define SYS_PNO_MAX PNO__CWORD83_
+//!< \~english maximum PNO.(normal process)
+
+/*---------------------------------------------------------------------------------*
+ * Typedef declaration *
+ *---------------------------------------------------------------------------------*/
+typedef u_int32 EventID;
+typedef int32 RET_API; //!< \~english _CWORD64_API return code
+typedef u_int32 event_id;
+typedef event_id SemID; //!< \~english semaphore ID
+typedef u_int16 CID; //!< \~english command ID
+
+typedef uint32_t UNIT_TYPE; //!< \~english unit type data type define
+typedef int32 ANA_RET_API;
+
+typedef char TCHAR;
+
+/**
+ * @enum _RcvMsgMode
+ * \~english mode of receive message
+ */
+typedef enum {
+ RM_WAIT, //!< \~english wait until received message
+ RM_CHECKRCV //!< \~english do not wait message, return
+} _RcvMsgMode;
+
+/**
+ * @enum
+ * \~english definition of event reset mode
+ */
+enum {
+ _CWORD64_EVENT_MANUALRESET_OFF = 0, //!< \~english manual reset off
+ _CWORD64_EVENT_MANUALRESET_ON, //!< \~english manual reset on
+ _CWORD64_EVENT_MANUALRESET_MAX //!< \~english manual reset max value
+};
+
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @struct _SECURITY_ATTRIBUTES
+ * \~english security attribute
+ */
+typedef struct _SECURITY_ATTRIBUTES {
+ DWORD nLength; //!< \~english length
+ LPVOID lpSecurityDescriptor; //!< \~english data pointer
+ BOOL bInheritHandle; //!< \~english inherited handle
+} SECURITY_ATTRIBUTES;
+typedef SECURITY_ATTRIBUTES *PSECURITY_ATTRIBUTES; //!< \~english security attribute
+typedef SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES; //!< \~english security attribute
+
+/*---------------------------------------------------------------------------------*
+ * Prototype Declaration *
+ *---------------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Create event by specified name
+///
+/// \~english @param [in] ucManualReset
+/// - u_int8 manual reset mode
+/// \~english @param [in] lInitData
+/// - int32 event value
+/// \~english @param [in] cpEventName
+/// - char* event name
+///
+/// \~english @par
+/// - manual reset mode(ucManualReset)
+/// - _CWORD64_EVENT_MANUALRESET_OFF manual reset OFF
+/// - _CWORD64_EVENT_MANUALRESET_ON manual reset ON
+///
+/// \~english @retval 0 event create failed
+/// \~english @retval not 0 created event ID
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter cpEventName is NULL
+/// - The parameter ucManualReset is more than or equal _CWORD64_EVENT_MANUALRESET_MAX
+/// - The string of parameter cpEventName has no text
+/// - The string length of parameter cpEventName is longer than MAX_EVENT_NAME_LEN
+/// - The event is created in same process, but the count of thread reference to the event is reach to the max
+/// - The event is created in system, but the count of process reference to the event is reach to the max
+/// - Memory allocate failed for creating event table
+/// - During create the event table, the event flag register failed
+/// - The event table is full
+///
+/// \~english @par Detail
+/// - Call this API to create event and return the created event ID.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+EventID _pb_CreateEvent(u_int8 ucManualReset, int32 lInitData, char *cpEventName);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Wait for the event specified by ID
+///
+/// \~english @param [in] eventID
+/// - EventID event ID
+/// \~english @param [in] lWaitMode
+/// - int32 event wait mode
+/// \~english @param [in] lMinVal
+/// - int32 event wait min value
+/// \~english @param [in] lMaxVal
+/// - int32 event wait max value
+/// \~english @param [out] plEventVal
+/// - int32* event wait value output pointer
+/// \~english @param [in] ulMillSecTime
+/// - u_int32 timeout time(ms)
+///
+/// \~english @par
+/// - event wait mode(lWaitMode)
+/// - SAPI_EVWAIT_VAL
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_EV_NONE parameter error or specified event not exist
+/// \~english @retval RET_ERRTIMEOUT timeout
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter plEventVal is NULL
+/// - The parameter eventID is more than MAX_PB_EVENTS
+/// - The specified event has not been registered in event table
+/// - The count of threads which is waiting this event is reach max
+/// - The parameter ulMillSecTime is 0
+/// - The parameter ulMillSecTime is INFINITE, and wait event flag failed
+/// - The parameter ulMillSecTime is not INFINITE, and timeout
+/// - The parameter ulMillSecTime is not INFINITE, and get event flag failed
+///
+/// \~english @par Detail
+/// - Call this API to wait event.
+/// - This API will return after timeout or this event been set.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_WaitEvent(EventID eventID, int32 lWaitMode, int32 lMinVal,
+ int32 lMaxVal, int32* plEventVal, u_int32 ulMillSecTime);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Set the value of event specified by ID
+///
+/// \~english @param [in] eventID
+/// - EventID event ID
+/// \~english @param [in] lSetMode
+/// - int32 event value set mode
+/// \~english @param [in] iVal
+/// - int32 event value
+///
+/// \~english @par
+/// - event value set mode(lSetMode)
+/// - SAPI_EVSET_ABSOLUTE absolute value set(set parameter value)
+/// - SAPI_EVSET_RELATE offset set(offset of current value set)
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_EV_NONE specified event not exist
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter eventID is more than MAX_PB_EVENTS
+/// - The specified event has not been registered in event table
+/// - The parameter lSetMode is neither SAPI_EVSET_ABSOLUTE nor SAPI_EVSET_RELATE
+///
+/// \~english @par Detail
+/// - Call this API to set event value.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_SetEvent(EventID eventID, int32 lSetMode, int32 lval);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Destroy the event specified by ID
+///
+/// \~english @param [in] eventID
+/// - EventID event ID
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERROR event flag destroy failed
+/// \~english @retval RET_EV_NONE specified event not exist
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter eventID is more than MAX_PB_EVENTS
+/// - The specified event has not been registered in event table
+/// - Event flag destroy failed
+///
+/// \~english @par Detail
+/// - Call this API to destroy specified event.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_DeleteEvent(EventID eventID);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Initialization before call Base API(every process used Base API should call this API firstly).
+///
+/// \~english @param [in] hApp
+/// - HANDLE app Handle
+///
+/// \~english @retval RET_NORMAL normal return
+///
+/// \~english @par Precondition
+/// - The creation/initialization(FrameworkunifiedCreateDispatcherWithoutLoop and etc.) of the dispatcher for App are completed.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to initialize Base API.
+/// - Every process used Base API should call this API firstly.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_Setup_CWORD64_API(HANDLE hApp);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Terminate current thread.
+///
+/// \~english @param [in] dwExitCode
+/// - DWORD exit code(not used)
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - None
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to terminate current thread.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+VOID _pb_ExitThread(DWORD dwExitCode);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Create the message queue
+///
+/// \~english @param [in] eventID
+/// - EventID process No
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter pno is 0
+/// - The name length of thread called this API is longer than MAX_QUEUE_NAME_SIZE
+///
+/// \~english @par Detail
+/// - Call this API to create the message queue.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_CreateMsg(PNO pno);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Send message in process
+///
+/// \~english @param [in] pno
+/// - PNO process No
+/// \~english @param [in] size
+/// - u_int16 message size
+/// \~english @param [in] msgbuf
+/// - void* message buffer
+/// \~english @param [in] mode
+/// - u_int16 not used
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter msgbuf is NULL
+/// - The parameter pno is 0
+/// - The message queue specified by parameter pno has not been created
+/// - Get sender Handle failed
+/// - Send message failed
+///
+/// \~english @par Detail
+/// - Call this API to send message in process.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_SndMsg(PNO pno, u_int16 size, void* msgbuf, u_int16 mode);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Send message between process
+///
+/// \~english @param [in] name
+/// - PCSTR destination process name
+/// \~english @param [in] cid
+/// - CID command ID
+/// \~english @param [in] size
+/// - u_int16 message size
+/// \~english @param [in] msgbuf
+/// - const void* message buffer
+/// \~english @param [in] mode
+/// - u_int16 not used
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter name is NULL
+/// - The parameter msgbuf is NULL
+/// - The length of parameter name is longer than MAX_QUEUE_NAME_SIZE
+/// - Get sender Handle failed
+/// - Send message failed
+///
+/// \~english @par Detail
+/// - Call this API to send message between process.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_SndMsg_Ext(PCSTR name, CID cid, u_int16 size, const void* msgbuf, u_int16 mode);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Create semaphore by specified name
+///
+/// \~english @param [in] semName
+/// - char* semaphore name
+///
+/// \~english @retval 0 semaphore create failed
+/// \~english @retval not 0 created semaphore ID
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter semName is NULL
+/// - The string of parameter semName has no text
+/// - The string length of parameter semName is longer than MAX_SEMAPHORE_NAME_LEN
+/// - Memory allocate failed for creating semaphore table
+/// - The semaphore table is full
+///
+/// \~english @par Detail
+/// - Call this API to create semaphore and return the created semaphore ID.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+SemID _pb_CreateSemaphore(char* semName);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Semaphore lock
+///
+/// \~english @param [in] semID
+/// - SemID semaphore ID
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_OSERROR error return
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter semName is 0
+/// - The parameter semName is more than MAX_PB_SEMAPHORES
+/// - The specified semaphore has not been registered in semaphore table
+/// - The specified semaphore's mutex has not been created
+/// - The specified semaphore's mutex lock failed
+///
+/// \~english @par Detail
+/// - Call this API to get semaphore.
+/// - This API will return after got semaphore.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_SemLock(SemID semID);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Semaphore unlock
+///
+/// \~english @param [in] semID
+/// - SemID semaphore ID
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_OSERROR error return
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter semName is 0
+/// - The parameter semName is more than MAX_PB_SEMAPHORES
+/// - The specified semaphore has not been registered in semaphore table
+/// - The specified semaphore's mutex has not been created
+/// - The specified semaphore's mutex release failed
+///
+/// \~english @par Detail
+/// - Call this API to relesae semaphore.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_SemUnlock(SemID semID);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Create Share Data
+///
+/// \~english @param [in] area_name
+/// - char* share data name
+/// \~english @param [in] size
+/// - u_int32 data size
+/// \~english @param [out] mem_ptr
+/// - void** share memory pointer
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERROR error return
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter area_name is NULL
+/// - The parameter mem_ptr is NULL
+/// - The string of parameter area_name has no text
+/// - The string length of parameter area_name is longer than MAX_AREA_NAME_LEN
+/// - The parameter size is 0
+/// - The specified share data has already been created
+/// - Memory allocate failed for creating share data
+/// - The specified share data file create failed
+///
+/// \~english @par Detail
+/// - Call this API to create share data.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_CreateShareData(char* area_name, u_int32 size, void** mem_ptr);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Link Share Data
+///
+/// \~english @param [in] area_name
+/// - char* share data name
+/// \~english @param [out] mem_ptr
+/// - void** share memory pointer
+/// \~english @param [in] size
+/// - u_int32* data size
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERROR error return
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter area_name is NULL
+/// - The parameter mem_ptr is NULL
+/// - The string of parameter area_name has no text
+/// - The string length of parameter area_name is longer than MAX_AREA_NAME_LEN
+/// - The parameter size is NULL
+/// - Memory allocate failed for linking share data
+/// - The specified share data file open failed
+///
+/// \~english @par Detail
+/// - Call this API to link share data.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_LinkShareData(char* area_name, void** mem_ptr, u_int32* size);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Start timer
+///
+/// \~english @param [in] SndPno
+/// - PNO source process No
+/// \~english @param [in] TimerSeq
+/// - u_int16 timer sequence No
+/// \~english @param [in] TimerType
+/// - u_int8 timer type
+/// \~english @param [in] TimeOut
+/// - u_int32 timeout time
+///
+/// \~english @par
+/// - timer type(TimerType)
+/// - TIMER_TYPE_SYN fixed term timer
+/// - TIMER_TYPE_USN asynchronous timer
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - Initialization of positioning_base_library has not been done in current process
+/// - The parameter TimerType is neither TIMER_TYPE_SYN nor TIMER_TYPE_USN
+/// - The parameter TimeOut is 0
+/// - The same timer has already been started
+/// - Timer start failed
+///
+/// \~english @par Detail
+/// - Call this API to start timer.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_ReqTimerStart(PNO SndPno, u_int16 TimerSeq, u_int8 TimeType, u_int32 TimeOut);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Stop timer
+///
+/// \~english @param [in] SndPno
+/// - PNO source process No
+/// \~english @param [in] TimerSeq
+/// - u_int16 timer sequence No
+/// \~english @param [in] TimerType
+/// - u_int8 timer type
+///
+/// \~english @par
+/// - timer type(TimerType)
+/// - TIMER_TYPE_SYN fixed term timer
+/// - TIMER_TYPE_USN asynchronous timer
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERROR error return
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - Initialization of positioning_base_library has not been done in current process
+/// - Timer stop failed
+///
+/// \~english @par Detail
+/// - Call this API to stop timer.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_TimerStop(PNO SndPno, u_int16 TimerSeq, u_int8 TimeType);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Create mutex
+///
+/// \~english @param [in] lpMutexAttributes
+/// - LPSECURITY_ATTRIBUTES not used
+/// \~english @param [in] bInitialOwner
+/// - BOOL not used
+/// \~english @param [in] lpName
+/// - LPCTSTR mutex name
+///
+/// \~english @retval NULL error return
+/// \~english @retval Except NULL created mutex Handle
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter lpName is NULL
+/// - The string length of pamareter lpName is longer than NAME_MAX
+/// - Mutex lock map failed
+///
+/// \~english @par Detail
+/// - Call this API to create mutex.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+HANDLE _pb_CreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCTSTR lpName);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get message management table dump info.
+///
+/// \~english @param [out] pBuf
+/// - void* output buffer
+/// \~english @param [in/out] pLen
+/// - uint8_t* output buffer size
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get message management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_GetDebugMsgMngTbl(void* pBuf, uint8_t* pLen);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get mutex management table dump info.
+///
+/// \~english @param [out] pBuf
+/// - void* output buffer
+/// \~english @param [in/out] pLen
+/// - uint8_t* output buffer size
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get mutex management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_GetDebugMutexMngTbl(void* pBuf, uint8_t* pLen);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get timer management table dump info.
+///
+/// \~english @param [out] pBuf
+/// - void* output buffer
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get timer management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_GetDebugTimerMngTbl(void* pBuf);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get event management table dump info.
+///
+/// \~english @param [out] pBuf
+/// - void* output buffer
+/// \~english @param [in/out] pLen
+/// - uint8_t* output buffer size
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get event management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_GetDebugEventMngTbl(void* pBuf, uint8_t* pLen);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get memory management table dump info.
+///
+/// \~english @param [out] pBuf
+/// - void* output buffer
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get memory management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_GetDebugMemoryMngTbl(void* pBuf);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get common info management table dump info.
+///
+/// \~english @param [out] pBuf
+/// - void* output buffer
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get common info management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_GetDebugOtherMngTbl(void* pBuf);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get current app Handle.
+///
+/// \~english @param None
+///
+/// \~english @retval 0 get Handle failed
+/// \~english @retval not 0 Handle
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - Current app Handle has not been registered
+///
+/// \~english @par Detail
+/// - Call this API to get current app Handle.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+HANDLE _pb_GetAppHandle(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Set current app Handle.
+///
+/// \~english @param [in] hApp
+/// - HANDLE app Handle
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get common info management table dump info.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_SetAppHandle(HANDLE hApp);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Base API stop process(every process used Base API should call this API before stop).
+///
+/// \~english @param None
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to stop Base API.
+/// - Every process used Base API should call this API before stop.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_Teardown_CWORD64_API(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Terminate current process.
+///
+/// \~english @param [in] pFunc
+/// - char* source function
+/// \~english @param [in] line
+/// - int source line
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - None
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to terminate current process.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_Exit_d(const char* pFunc, int line);
+#define _pb_Exit() _pb_Exit_d(__func__, __LINE__)
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Receive message.
+///
+/// \~english @param [in] pno
+/// - PNO process No
+/// \~english @param [in] size
+/// - u_int16 message size
+/// \~english @param [out] msgbuf
+/// - void* message buffer
+/// \~english @param [in] mode
+/// - u_int16 not used
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter msgbuf is NULL
+/// - The parameter pno is 0
+/// - The message queue specified by parameter pno has not been created
+/// - Receive message failed
+/// - Receive message successrully, but the received message size is longer than parameter size
+/// - Get received message data failed
+///
+/// \~english @par Detail
+/// - Call this API to receive message of specified pno.
+/// - This API will return after received message.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_RcvMsg(PNO pno, u_int16 size, void** msgbuf, u_int16 mode);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get send buffer for message transferring in process
+///
+/// \~english @param [in] pno
+/// - PNO process No
+/// \~english @param [out] pSndBuf
+/// - void** send buffer
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter pno is 0
+/// - The message queue specified by parameter pno has not been created
+/// - Get sender Handle failed
+/// - Get send buffer failed
+///
+/// \~english @par Detail
+/// - Call this API to get send buffer for message transferring in process.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_GetZcSndBuf(PNO pno, void** pSndBuf);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Send message in process
+///
+/// \~english @param [in] pno
+/// - PNO process No
+/// \~english @param [in] size
+/// - u_int16 message size
+/// \~english @param [in] mode
+/// - u_int16 not used
+///
+/// \~english @retval RET_NORMAL normal return
+/// \~english @retval RET_ERRPARAM parameter error
+/// \~english @retval RET_ERROR other error
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter pno is 0
+/// - The message queue specified by parameter pno has not been created
+/// - Get sender Handle failed
+/// - Get send buffer failed
+/// - Set send buffer failed
+/// - Send message failed
+///
+/// \~english @par Detail
+/// - Call this API to send message in process.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+RET_API _pb_ZcSndMsg(PNO pno, u_int16 size, u_int16 mode);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Convert process name to pno
+///
+/// \~english @param [in] name
+/// - PCSTR process name
+///
+/// \~english @retval 0 convert failed
+/// \~english @retval not 0 converted PNO
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter name is NULL
+/// - The size of parameter name is longer than THREAD_NAME_LEN_MAX
+///
+/// \~english @par Detail
+/// - Call this API to convert process name to pno.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+PNO _pb_CnvName2Pno(PCSTR name);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Convert pno to process name
+///
+/// \~english @param [in] pno
+/// - PNO process No
+///
+/// \~english @retval NULL convert failed
+/// \~english @retval not NULL converted process name
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Failure condition
+/// - The parameter pno has not been registered(not the return pno of _pb_CnvName2Pno).
+///
+/// \~english @par Detail
+/// - Call this API to convert pno to process name.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Sync
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+PCSTR _pb_CnvPno2Name(PNO pno);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get message resource
+///
+/// \~english @param None
+///
+/// \~english @retval TRUE normal return
+/// \~english @retval FALSE error(lack of resource)
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get message resource.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+BOOL _pb_GetMsgResource(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get mutex resource
+///
+/// \~english @param None
+///
+/// \~english @retval TRUE normal return
+/// \~english @retval FALSE error(lack of resource)
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get mutex resource.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+BOOL _pb_GetMutexResource(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Get common resource
+///
+/// \~english @param None
+///
+/// \~english @retval TRUE normal return
+/// \~english @retval FALSE error(lack of resource)
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to get common resource.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+BOOL _pb_GetOtherResource(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Release message resource
+///
+/// \~english @param None
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to release message resource.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_ReleaseMsgResource(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Release mutex resource
+///
+/// \~english @param None
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to release mutex resource.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_ReleaseMutexResource(void);
+
+////////////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup positioning_base_library
+/// \~english @par Brief
+/// - Release common resource
+///
+/// \~english @param None
+///
+/// \~english @retval None
+///
+/// \~english @par Precondition
+/// - positioning_base_library initialization are completed \n
+/// (_pb_Setup_CWORD64_API has already been called) in current process.
+///
+/// \~english @par changes of the internal status
+/// - There is no changes of the internal status by this API
+///
+/// \~english @par Detail
+/// - Call this API to release common resource.
+/// \n
+///
+/// \~english @par Classification
+/// - Public
+///
+/// \~english @par Type
+/// - Fire and Forget
+///
+////////////////////////////////////////////////////////////////////////////////////////////
+void _pb_ReleaseOtherResource(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @}*/ // end of positioning_base_library
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_WPF_STD_H_
diff --git a/vehicleservice/positioning_base_library/library/include/vehicle_service/pos_message_header.h b/vehicleservice/positioning_base_library/library/include/vehicle_service/pos_message_header.h
new file mode 100755
index 0000000..b6af335
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/vehicle_service/pos_message_header.h
@@ -0,0 +1,77 @@
+/*
+ * @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.
+ */
+
+#ifndef _POS_MESSAGE_HEADER_ // NOLINT(build/header_guard)
+#define _POS_MESSAGE_HEADER_
+
+/**
+ * @file pos_message_header.h
+ * @brief Header file for message data definitions
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning_base_library
+ * @ingroup vehicle_service
+ * @{
+ */
+
+#include <sys/types.h>
+
+/**
+ * @struct T_APIMSG_HEADER
+ * \~english _CWORD64_API message header structure
+ */
+typedef struct {
+ uint16_t replyid; //!< \~english message send result notify dest ID
+ uint16_t sndpno; //!< \~english message send source process No
+ uint16_t respno; //!< \~english message response process No
+ uint16_t cid; //!< \~english message command ID
+ uint16_t msgbodysize; //!< \~english message body size
+ uint8_t rid; //!< \~english message resource ID */
+ uint8_t reserve; //!< \~english reserve
+ uint8_t filler[2]; //!< \~english filter
+} T_APIMSG_HEADER;
+
+/**
+ * @struct T_APIMSG_MSGBUF_HEADER
+ * \~english _CWORD64_API message buffer header structure
+ */
+typedef struct {
+ uint32_t signo; //!< \~english signal No, _pb_SndMsg to set 0
+ T_APIMSG_HEADER hdr; //!< \~english message header
+} T_APIMSG_MSGBUF_HEADER;
+
+/**
+ * @struct _CWORD64_MSG_LOG_HDR
+ * \~english _CWORD64_API message log header structure
+ */
+typedef struct {
+ uint32_t kickTime; //!< \~english kick time
+ uint32_t srCid; //!< \~english message command ID
+ uint32_t pno; //!< \~english process No
+ uint32_t dataBytes; //!< \~english data size
+} _CWORD64_MSG_LOG_HDR;
+
+/** @}*/ // end of positioning_base_library
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // _POS_MESSAGE_HEADER_
diff --git a/vehicleservice/positioning_base_library/library/include/vehicle_service/positioning_base_library.h b/vehicleservice/positioning_base_library/library/include/vehicle_service/positioning_base_library.h
new file mode 100755
index 0000000..c6ce3ce
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/vehicle_service/positioning_base_library.h
@@ -0,0 +1,46 @@
+//
+// @copyright Copyright (c) 2017-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.
+//
+
+
+#ifndef VEHICLESERVICE_POSITIONINGBASELIBRARY_H_ // NOLINT(build/header_guard)
+#define VEHICLESERVICE_POSITIONINGBASELIBRARY_H_ // NOLINT(build/header_guard)
+
+/**
+ * @file positioning_base_library.h
+ * @brief Common header of positioning_base_library
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning_base_library
+ * @ingroup vehicle_service
+ * @{
+ */
+
+#include <vehicle_service/WPF_STD.h>
+#include <vehicle_service/sys_timerapi.h>
+#include <vehicle_service/std_types.h>
+#include <vehicle_service/pos_message_header.h>
+
+/** @}*/ // end of positioning_base_library
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // VEHICLESERVICE_POSITIONINGBASELIBRARY_H_
diff --git a/vehicleservice/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h b/vehicleservice/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h
new file mode 100755
index 0000000..b0fd4e1
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/vehicle_service/positioning_positioningbaselibrarylog.h
@@ -0,0 +1,91 @@
+/*
+ * @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.
+ */
+
+/*
+ * This file has been generated automatically.
+ * User hand written code entry is not allowed. Do not modify the file content.
+ *
+ */
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_POSITIONING_POSITIONINGBASELIBRARYLOG_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_POSITIONING_POSITIONINGBASELIBRARYLOG_H_
+
+/* Include Files */
+#include <native_service/ns_logger_if.h>
+
+#define ZONE_INIT ZONEMASK(10)
+#define ZONE_FUNC ZONEMASK(11)
+#define ZONE_MEM ZONEMASK(12)
+#define ZONE_APP ZONEMASK(13)
+#define ZONE_14 ZONEMASK(14)
+#define ZONE_15 ZONEMASK(15)
+#define ZONE_16 ZONEMASK(16)
+#define ZONE_17 ZONEMASK(17)
+#define ZONE_18 ZONEMASK(18)
+#define ZONE_19 ZONEMASK(19)
+#define ZONE_20 ZONEMASK(20)
+#define ZONE_21 ZONEMASK(21)
+#define ZONE_22 ZONEMASK(22)
+#define ZONE_23 ZONEMASK(23)
+#define ZONE_24 ZONEMASK(24)
+#define ZONE_25 ZONEMASK(25)
+#define ZONE_26 ZONEMASK(26)
+#define ZONE_27 ZONEMASK(27)
+#define ZONE_28 ZONEMASK(28)
+#define ZONE_INFO ZONEMASK(29)
+#define ZONE_WARN ZONEMASK(30)
+#define ZONE_ERR ZONEMASK(31)
+
+#define ZONE_POS_SYS_IN ZONE_SP_ZONE_99
+#define ZONE_POS_GPS_IN ZONE_SP_ZONE_100
+#define ZONE_POS_CMD_IN ZONE_SP_ZONE_101
+#define ZONE_POS_NAV_IN ZONE_SP_ZONE_102
+
+#define ZONE_TEXT_10 "Init"
+#define ZONE_TEXT_11 "Function"
+#define ZONE_TEXT_12 "Memory"
+#define ZONE_TEXT_13 "StateMachine Example"
+#define ZONE_TEXT_14 ""
+#define ZONE_TEXT_15 ""
+#define ZONE_TEXT_16 ""
+#define ZONE_TEXT_17 ""
+#define ZONE_TEXT_18 ""
+#define ZONE_TEXT_19 ""
+#define ZONE_TEXT_20 ""
+#define ZONE_TEXT_21 ""
+#define ZONE_TEXT_22 ""
+#define ZONE_TEXT_23 ""
+#define ZONE_TEXT_24 ""
+#define ZONE_TEXT_25 ""
+#define ZONE_TEXT_26 ""
+#define ZONE_TEXT_27 ""
+#define ZONE_TEXT_28 ""
+#define ZONE_TEXT_29 "Info"
+#define ZONE_TEXT_30 "Warning"
+#define ZONE_TEXT_31 "Error"
+
+#ifndef FRAMEWORKUNIFIEDLOGOPTIONS
+#define FRAMEWORKUNIFIEDLOGOPTIONS (LPRINT) /* LPRINT, LMSGQ, LSLOGGER */
+#endif
+
+#ifndef FRAMEWORKUNIFIEDLOGAPPZONES
+#define FRAMEWORKUNIFIEDLOGAPPZONES ZONE_INIT, ZONE_ERR, ZONE_14, ZONE_INFO, ZONE_POS_SYS_IN, ZONE_POS_GPS_IN, ZONE_POS_CMD_IN, \
+ ZONE_POS_NAV_IN
+#endif
+
+#define PS_APPNAME_MAX 12
+extern const CHAR kAppName[PS_APPNAME_MAX];
+
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_POSITIONING_POSITIONINGBASELIBRARYLOG_H_
diff --git a/vehicleservice/positioning_base_library/library/include/vehicle_service/std_types.h b/vehicleservice/positioning_base_library/library/include/vehicle_service/std_types.h
new file mode 100755
index 0000000..41ebbc8
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/vehicle_service/std_types.h
@@ -0,0 +1,55 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_STD_TYPES_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_STD_TYPES_H_
+
+/**
+ * @file std_types.h
+ * @brief Header file for base type definitions
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning_base_library
+ * @ingroup vehicle_service
+ * @{
+ */
+
+typedef signed char int8;
+typedef unsigned char u_int8;
+typedef signed short int int16;
+typedef unsigned short int u_int16;
+typedef signed int int32;
+typedef unsigned int u_int32;
+typedef float float_t;
+typedef double double_t;
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+/** @}*/ // end of positioning_base_library
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_STD_TYPES_H_
diff --git a/vehicleservice/positioning_base_library/library/include/vehicle_service/sys_timerapi.h b/vehicleservice/positioning_base_library/library/include/vehicle_service/sys_timerapi.h
new file mode 100755
index 0000000..03a24ff
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/include/vehicle_service/sys_timerapi.h
@@ -0,0 +1,359 @@
+/*
+ * @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.
+ */
+#ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_SYS_TIMERAPI_H_
+#define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_SYS_TIMERAPI_H_
+
+/**
+ * @file sys_timerapi.h
+ * @brief Header file for timer management
+ */
+
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup vehicle_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup positioning_base_library
+ * @ingroup vehicle_service
+ * @{
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Definition *
+ *---------------------------------------------------------------------------------*/
+
+#define WTM_DUPTIME_MAX 5 //!< \~english duplication timer max count
+
+#define TIMER_TYPE_SYN 1
+//!< \~english fixing cycle timer(unit: 100ms)
+#define TIMER_TYPE_USN 2
+//!< \~english asynchronous timer(unit: 100ms)
+#define TIMER_TYPE_ALM 5 //!< \~english specific time timer
+
+#define SUN 0 //!< \~english sunday
+#define MON 1 //!< \~english monday
+#define TUE 2 //!< \~english tuesday
+#define WED 3 //!< \~english wednesday
+#define THU 4 //!< \~english thursday
+#define FRI 5 //!< \~english friday
+#define SAT 6 //!< \~english saturday
+#define DEFAULT_DIFFTIME 0x00 //!< \~english time difference value of japan
+
+#define GPS_SAT 0x00 //!< \~english corrected GPS time
+#define GPS_IST 0x01 //!< \~english not corrected GPS time
+#define GPS_RTC 0x02 //!< \~english RTC time
+#define GPS_IRG 0x03 //!< \~english initial time
+#define GPS_NON 0x7E //!< \~english GPS unused
+#define GPS_IGN 0x7F //!< \~english time not received
+
+#define END_TIMER_RPT_OFF 0 //!< \~english No continuation
+#define END_TIMER_RPT_ON 1 //!< \~english With continuation
+
+#define CID_TIMER_SETGPS 0x4040
+//!< \~english command ID of GPS setting timer
+#define CID_TIMER_DIFSET 0x4045
+//!< \~english command ID of time difference setting timer
+#define CID_TIMER_CYCLE (CID)(CID_TIMER_BASE | CID_COM_SERIAL5)
+//!< \~english command ID of cycle data receive timer
+
+#define CNV_YEAR_MAX 136
+//!< \~english max value of conversion year(number of years + 1)
+#define SEC_PER_MIN 60 //!< \~english 60[sec]
+#define SEC_PER_HOUR 3600 //!< \~english 60[min] * 60[sec]
+#define SEC_PER_DAY 86400 //!< \~english 24[h] * 60[min] * 60[sec]
+
+#define TIM_ROLOVR_DISABLE 0 //!< \~english GPS week rollover correct prohibition
+#define TIM_ROLOVR_ENABLE 1 //!< \~english GPS week rollover correct permission
+
+/*
+ * Definition
+ * \~english timer manager error definition
+ */
+#define RET_ERR_NONEINIT (-30) //!< \~english initialization untreated error
+#define RET_ERR_SEMLOCK (-31) //!< \~english get semaphore error
+#define RET_ERR_SEMUNLOCK (-32) //!< \~english open semaphore error
+#define RET_ERR_SRAMREAD (-33) //!< \~english read SRAM error
+
+/*
+ * Definition
+ * \~english command notify information definition(almanac abnormality notify, and time enable notify)
+ */
+#define TIM_NUM_SNDCMD 4 //!< \~english command send number
+
+#define NON_TIMEUNIT_INVALID_TIME 0
+//!< \~english No time manager unit - system time not set
+#define NON_TIMEUNIT_VALID_TIME 1
+//!< \~english No time manager unit - system time set complete
+#define GPS_INVALID_TIME 2
+//!< \~english With GPS unit - system time not set
+#define GPS_VALID_TIME 3
+//!< \~english With GPS unit - system time set complete
+
+#define TMT_RETRY 3 //!< \~english retry count
+#define TMT_RETRY_INTERVAL 500 //!< \~english retry interval(500[msec])
+
+
+/*---------------------------------------------------------------------------------*
+ * Struct declaration *
+ *---------------------------------------------------------------------------------*/
+
+/**
+ * \~english define data type
+ */
+typedef struct {
+ u_int32 TimeOut[WTM_DUPTIME_MAX]; //!< \~english timeout value
+ u_int8 ContFlg; //!< \~english continue flag
+ u_int8 Dummy1; //!< \~english dummy data
+ u_int16 Dummy2; //!< \~english dummy data
+} TimerDupData;
+
+/**
+ * @struct RealTimeData
+ * \~english current time data
+ */
+typedef struct {
+ u_int16 Yyear; //!< \~english current time(year:A.D.)
+ u_int8 Mmonth; //!< \~english (month)
+ u_int8 Dday; //!< \~english (day)
+ u_int8 Hhour; //!< \~english (hour)
+ u_int8 Mmin; //!< \~english (min)
+ u_int8 Ssec; //!< \~english (sec)
+ u_int8 Wweek; //!< \~english (week)
+ u_int8 CrtFlg; //!< \~english GPS time not corrected/corrected flag
+ u_int8 CrtHou; //!< \~english the last correction(hour)
+ u_int8 CrtMin; //!< \~english min
+ u_int8 CrtSec; //!< \~english sec
+} RealTimeData;
+
+/**
+ * @struct RealTimeDataBcd
+ * \~english current time data(BCD format)
+ */
+typedef struct {
+ u_int16 Yyear; //!< \~english current time(year:A.D.BCD ex.0x1998)
+ u_int8 Mmonth; //!< \~english (month BCD 0x01 to 0x12)
+ u_int8 Dday; //!< \~english (day BCD 0x01 to 0x31)
+ u_int8 Hhour; //!< \~english (hour BCD 0x00 to 0x23)
+ u_int8 Mmin; //!< \~english (min BCD 0x00 to 0x59)
+ u_int8 Ssec; //!< \~english (sec BCD 0x00 to 0x59)
+ u_int8 Wweek; //!< \~english (week BIN 0x00 to 0x06)
+ u_int8 CrtFlg;
+ //!< \~english GPS time not corrected or corrected flag(BIN 0x00 to 0x03)
+ u_int8 CrtHou; //!< \~english the last correction(hour BCD 0x00 to 0x23)
+ u_int8 CrtMin; //!< \~english (min BCD 0x00 to 0x59)
+ u_int8 CrtSec; //!< \~english (sec BCD 0x00 to 0x59)
+} RealTimeDataBcd;
+
+/**
+ * @struct GpsSetData
+ * \~english GPS time setting data
+ */
+typedef struct {
+ u_int16 Yyear; //!< \~english current time(year:A.D.)
+ u_int8 Mmonth; //!< \~english (month)
+ u_int8 Dday; //!< \~english (day)
+ u_int8 Hhour; //!< \~english (hour)
+ u_int8 Mmin; //!< \~english (min)
+ u_int8 Ssec; //!< \~english (sec)
+ u_int8 Dummy; //!< \~english dummy data
+} GpsSetData;
+
+/**
+ * @struct TimerToutMsg
+ * \~english timeout message
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific)
+ u_int16 Dummy; //!< \~english dummy
+} TimerToutMsg;
+
+/**
+ * @struct TimerTimeReq
+ * \~english timer start request
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ PNO SndPno; //!< \~english process No.(claimant specific)
+ u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific)
+ u_int8 TimeType; //!< \~english timer type
+ u_int8 Dummy[3]; //!< \~english dummy data
+ TimerDupData DupData; //!< \~english timeout value
+} TimerTimeReq;
+
+/**
+ * @struct TimerAlrmReq
+ * \~english time specified timer start request
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ PNO SndPno; //!< \~english process No.(claimant specific)
+ u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific)
+ u_int8 TimeHou; //!< \~english specific timeout hour
+ u_int8 TimeMin; //!< \~english min
+ u_int8 TimeSec; //!< \~english sec
+ u_int8 Dummy; //!< \~english dummy
+} TimerAlrmReq;
+
+/**
+ * @struct TimerStopReq
+ * \~english timer stop request
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ PNO SndPno; //!< \~english process No.(claimant specific)
+ u_int16 TimerSeq; //!< \~english timer sequence No.(claimant specific)
+ u_int8 TimeType; //!< \~english timer type
+ u_int8 Dummy[3]; //!< \~english dummy data
+} TimerStopReq;
+
+/**
+ * @struct GpsSetTimeReq
+ * \~english GPS RTC time set request
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ PNO SndPno; //!< \~english process No.(claimant specific)
+ u_int8 Dummy1; //!< \~english dummy data
+ u_int8 Dummy2; //!< \~english dummy data
+ GpsSetData SetData; //!< \~english GPS setting data
+} GpsSetTimeReq;
+
+/**
+ * @struct GpsSetTimeReq
+ * \~english time difference set request
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ int8 DiffTime; //!< \~english time difference value
+ int8 Dummy1; //!< \~english dummy data
+ int16 Dummy2; //!< \~english dummy data
+} SetDiffTimeReq;
+
+
+/**
+ * @struct T_TIM_RCV_DATA
+ * \~english command notify information structure
+ */
+typedef struct {
+ PNO SndPno; //!< \~english command delivery PNO
+ u_int8 ucAlmanc_Flg;
+ //!< \~english almanac abnormal judgement notify complete flag
+ u_int8 ucInvalid_Flg;
+ //!< \~english time acquisition notify complete flag
+} T_TIM_RCV_DATA;
+
+/**
+ * @struct TimerSramData
+ * \~english timer SRAM data structure
+ */
+typedef struct {
+ u_int32 navitime; //!< \~english Navi operation addition time
+ int8 _difftime; //!< \~english time difference value of current time
+ int8 timeUnit; //!< \~english specific time manager unit
+ int8 dummy[2]; //!< \~english dummy data
+ T_TIM_RCV_DATA timCmdData[TIM_NUM_SNDCMD];
+ //!< \~english command receive information
+} TimerSramData;
+
+/**
+ * @struct SysTimeData
+ * \~english system time data
+ */
+typedef struct {
+ u_int16 Yyear; //!< \~english current time(year:A.D.BCD ex. 0x1998)
+ u_int8 Mmonth; //!< \~english (month BCD 0x01 to 0x12)
+ u_int8 Dday; //!< \~english (day BCD 0x01 to 0x31)
+ u_int8 Hhour; //!< \~english (hour BCD 0x00 to 0x23)
+ u_int8 Mmin; //!< \~english (min BCD 0x00 to 0x59)
+ u_int8 Ssec; //!< \~english (sec BCD 0x00 to 0x59)
+ u_int8 Wweek; //!< \~english (week BIN 0x00 to 0x06)
+} SysTimeData;
+
+/**
+ * @struct YearCntTbl
+ * \~english year convert table
+ */
+typedef struct TimeCnvTbl_tag {
+ uint32_t ulYear; //!< \~english year
+ uint32_t ulCount; //!< \~english count
+ uint32_t ulMonth[12]; //!< \~english month
+} YearCntTbl;
+
+/**
+ * @struct DayCntTbl
+ * \~english day convert table
+ */
+typedef struct DayCnvTbl_tag {
+ YearCntTbl stTbl[CNV_YEAR_MAX]; //!< \~english year convert table
+} DayCntTbl;
+
+/**
+ * @struct TG_TIM_ROLOVR_GPSWEEKCORDATA
+ * \~english GPS week correction data
+ */
+typedef struct {
+ u_int8 gpsweekcorcnt; //!< \~english GPS week rollover correct count
+ u_int8 permission; //!< \~english GPS week rollover correct permission
+ u_int8 dummy[2]; //!< \~english dummy data
+} TG_TIM_ROLOVR_GPSWEEKCORDATA;
+
+/**
+ * @struct TIMECHGIND_MSG
+ * \~english time change information message structure
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ RealTimeData RealTime; //!< \~english data body(current time data)
+} TIMECHGIND_MSG;
+
+/**
+ * @struct T_TIM_CMDMSG
+ * \~english time available notification/almanac abnormality notification structure
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+} T_TIM_CMDMSG;
+
+/**
+ * @struct T_TIM_RETTIMEMSG
+ * \~english time setting response message
+ */
+typedef struct {
+ T_APIMSG_MSGBUF_HEADER Header; //!< \~english message header
+ int8 cResult; //!< \~english process result
+ int8 dummy[2]; //!< \~english dummy data
+} T_TIM_RETTIMEMSG;
+
+/**
+ * @struct TimerModDat
+ * \~english current time data module structure
+ */
+typedef struct {
+ u_int32 InitFlg; //!< \~english initialization complete flag
+ u_int8 CrtFlg; //!< \~english corrected/not corrected flag
+ u_int8 CrtHou; //!< \~english the last correction: hour
+ u_int8 CrtMin; //!< \~english min
+ u_int8 CrtSec; //!< \~english sec
+} TimerModDat;
+
+/** @}*/ // end of positioning_base_library
+/** @}*/ // end of vehicle_service
+/** @}*/ // end of BaseSystem
+#endif // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_VEHICLE_SERVICE_SYS_TIMERAPI_H_
+
diff --git a/vehicleservice/positioning_base_library/library/libPOS_base_API.ver b/vehicleservice/positioning_base_library/library/libPOS_base_API.ver
new file mode 100755
index 0000000..019a271
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/libPOS_base_API.ver
@@ -0,0 +1,39 @@
+/*
+ * @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.
+ */
+
+#
+# libPOS_base_API version script
+#
+{
+ global:
+ _pb_*;
+ *MemoryTerm*;
+ *ErrTrapTerm*;
+ *MsgTerm*;
+ *EventTerm*;
+ *MutexTerm*;
+ *SemaphoreTerm*;
+ *ErrTrapInit*;
+ *MsgInit*;
+ *EventInit*;
+ *MemoryInit*;
+ *SemaphoreInit*;
+ *MutexInit*;
+ local:
+ *;
+};
+
+
diff --git a/vehicleservice/positioning_base_library/library/src/MsgBapi.cpp b/vehicleservice/positioning_base_library/library/src/MsgBapi.cpp
new file mode 100755
index 0000000..66e78ae
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/MsgBapi.cpp
@@ -0,0 +1,347 @@
+/*
+ * @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
+ * MsgBapi.cpp
+ * @brief system common functions
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <dirent.h>
+#include "_pbInternalProc.h"
+#include "WPF_STD_private.h"
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Create Shared Memory
+ *
+ * Create a file mapping object with the specified shared memory name and size, then <br>
+ * maps it to the invoking process space. If the shared memory that has already been <br>
+ * created is specified, an error is returned.<br>
+ * The shared memory management information allocates a heap area each time it is <br>
+ * created, and return this address as a shared memory handle.
+ *
+ * @param[in] TCHAR* name
+ * @param[in] DWORD size
+ *
+ * @return HANDLE<br>
+ * Except NULL Handle of the created shared memory(Management information pointer)<br>
+ * NULL ABEND
+ */
+HANDLE CreateSharedMemory(TCHAR* name, DWORD size) {
+ int32 lret = EOK;
+ RET_API ret_api = RET_ERROR;
+ int32 fd = POSITIONINGBASELIBRARY_NON_FD;
+ SHARED_MEMORY* p_shm = NULL;
+ char c_file_path[PATH_MAX + 1] = SHARED_MEMORY_DIRECTORY;
+
+ if ((name != NULL) && (size != 0)) { // LCOV_EXCL_BR_LINE 6:name can not be NULL, size can not be 0
+ /* Allocate the shared memory management information area in the heap. */
+ p_shm = reinterpret_cast<SHARED_MEMORY *>(malloc(sizeof(SHARED_MEMORY)));
+ if (p_shm == NULL) { // LCOV_EXCL_BR_LINE 5: malloc's error case
+ } else {
+ p_shm->h_heap = NULL;
+ p_shm->phy_addr = 0;
+ p_shm->h_map = NULL;
+ p_shm->size = size;
+
+ /* Create directory */
+ (void)mkdir(SHARED_MEMORY_DIRECTORY, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+
+ /* Create shared memory with the specified size and name.(Error if it already exists) */
+ (void)strncat(c_file_path, (const char*)name, 128);
+ fd = open(c_file_path, O_RDWR | O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); // LCOV_EXCL_BR_LINE 5: standard lib error // NOLINT(whitespace/line_length)
+ if (fd > POSITIONINGBASELIBRARY_NON_FD) /* Coverity CID: 18775 compliant */ { // LCOV_EXCL_BR_LINE 5: standard lib error // NOLINT(whitespace/line_length)
+ /* Set size */
+ lret = ftruncate(fd, size);
+ if (lret == EOK) { // LCOV_EXCL_BR_LINE 5: ftruncate's error case
+ /* Map the created shared memory to the invoking process space. */
+ p_shm->p_memory = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (p_shm->p_memory != MAP_FAILED) { // LCOV_EXCL_BR_LINE 5: standard lib error
+ ret_api = RET_NORMAL;
+ }
+ }
+ }
+ }
+ }
+
+ if (fd > POSITIONINGBASELIBRARY_NON_FD) /* Coverity CID: 18775 compliant */ {
+ close(fd);
+ }
+
+ if (ret_api == RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ /* Indicate that it is the creator of the shared memory */
+ p_shm->owner = TRUE;
+ } else {
+ // LCOV_EXCL_START 200: can not be not normal
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* In case of an error */
+ if (fd != POSITIONINGBASELIBRARY_NON_FD) {
+ /* Delete shared memory object if created */
+ shm_unlink(name);
+ }
+
+ if (p_shm != NULL) {
+ free(p_shm);
+ }
+
+ p_shm = NULL;
+ // LCOV_EXCL_STOP
+ }
+
+ return (HANDLE)p_shm;
+}
+
+/**
+ * @brief
+ * Open Shared Memory
+ *
+ * Create a file mapping object with the specified shared memory name and size, <br>
+ * then map it to the invoking process space. Since this is not shared memory <br>
+ * creation processing, an error is returned if it is not a file mapping object.<br>
+ * The shared memory management information allocates a heap area each time <br>
+ * it is created, and return this address as a shared memory handle.
+ *
+ * @param[in] TCHAR* name
+ * @param[in] DWORD size
+ *
+ * @return HANDLE<br>
+ * Except NULL Handle of the acquired shared memory(Management information pointer)<br>
+ * NULL ABEND
+ */
+HANDLE OpenSharedMemory(TCHAR* name, DWORD size) {
+ RET_API ret_api = RET_ERROR;
+ int32 fd = POSITIONINGBASELIBRARY_NON_FD;
+ SHARED_MEMORY* p_shm = NULL;
+ char c_file_path[PATH_MAX + 1] = SHARED_MEMORY_DIRECTORY;
+
+ if ((name != NULL) && (size != 0)) { // LCOV_EXCL_BR_LINE 6:name can not be NULL, size can not be 0
+ /* Allocate the shared memory management information area in the heap. */
+ p_shm = reinterpret_cast<SHARED_MEMORY *>(malloc(sizeof(SHARED_MEMORY)));
+ if (p_shm == NULL) { // LCOV_EXCL_BR_LINE 5: malloc's error case
+ } else {
+ p_shm->h_heap = NULL;
+ p_shm->phy_addr = 0;
+ p_shm->h_map = NULL;
+ p_shm->size = size;
+
+ /* Open shared memory with the specified size and name(Error if not exists) */
+ (void)strncat(c_file_path, (const char*)name, 128);
+ fd = open(c_file_path, O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); // LCOV_EXCL_BR_LINE 5: standard lib error
+ if (fd > POSITIONINGBASELIBRARY_NON_FD) /* Coverity CID: 18774 compliant */ {
+ /* Map open shared memory to invoking process space. */
+ p_shm->p_memory = reinterpret_cast<SHARED_MEMORY *>(mmap(0, size, PROT_READ | PROT_WRITE, \
+ MAP_SHARED | POSITIONINGBASELIBRARY_MAP_NON_INIT, fd, 0));
+ if (p_shm->p_memory != MAP_FAILED) { // LCOV_EXCL_BR_LINE 5: standard lib error
+ ret_api = RET_NORMAL;
+ }
+ }
+ }
+ }
+
+ if (fd > POSITIONINGBASELIBRARY_NON_FD) /* Coverity CID: 18774 compliant */ {
+ close(fd);
+ }
+
+ if (ret_api == RET_NORMAL) {
+ /* Indicate that the opener of the shared memory not the creator of it. */
+ p_shm->owner = FALSE;
+ } else {
+ /* In case of an error */
+ if (p_shm != NULL) {
+ free(p_shm);
+ }
+
+ p_shm = NULL;
+ }
+
+ return (HANDLE)p_shm;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DeleteAllSharedMemory()
+ * ABSTRACT : Delete all shared memory objects
+ * NOTE : Delete all shared memory objects
+ * : However, the heap area allocated at the time of shared memory creation or open is not released.
+ * ARGUMENT : None
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+DeleteAllSharedMemory(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 lret = EOK;
+ char* cwd = NULL;
+ char sz_cwd[PATH_MAX + 1] = {0};
+ DIR* p_dir = NULL;
+ struct dirent* p_dir_ent = NULL;
+
+ /* Get path of current directory */
+ cwd = getcwd(sz_cwd, PATH_MAX + 1);
+
+ if (cwd != NULL) {
+ /* Move to shared memory directory */
+ lret = chdir(SHARED_MEMORY_DIRECTORY);
+
+ if (lret == EOK) {
+ /* Open shared memory directory */
+ p_dir = opendir(SHARED_MEMORY_DIRECTORY);
+ if (p_dir != NULL) {
+ for (;;) {
+ /* Get directory entry */
+ p_dir_ent = readdir(p_dir);
+ if (p_dir_ent == NULL) {
+ break;
+ }
+
+ if ((_pb_strcmp(p_dir_ent->d_name, ".") != 0) &&
+ (_pb_strcmp(p_dir_ent->d_name, "..") != 0)) {
+ /* Delete shared memory objects */
+ shm_unlink(p_dir_ent->d_name);
+ }
+ }
+
+ /* Close shared memory directory */
+ closedir(p_dir);
+ }
+
+ /* Go to original directory */
+ lret = chdir(cwd);
+ if (lret != EOK) /* Coverity CID: 18816 compliant */ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "chdir ERROR [lret:%d]", lret);
+ }
+ }
+ }
+
+ /* Delete shared memory directory */
+ lret = rmdir(SHARED_MEMORY_DIRECTORY);
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetSharedMemoryPtr()
+ * ABSTRACT : Shared memory start address acquisition processing
+ * NOTE : Return the start address of the shared memory that is allocated/mapped at the
+ * : time of shared memory creation or open
+ * ARGUMENT : HANDLE h_shm Shared memory handle(Management information pointer)
+ * RETURN : void* Except NULL Pointer to the acquired shared memory
+ * : NULL ABEND
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void*
+GetSharedMemoryPtr(HANDLE h_shm) {
+ void *p_vret = NULL;
+ SHARED_MEMORY *p_shm = reinterpret_cast<SHARED_MEMORY *>(h_shm);
+
+ if (p_shm == NULL) /* If the shared memory handle that is not created or not opened is specified, */ { // LCOV_EXCL_BR_LINE 200: p_shm can not be NULL // NOLINT(whitespace/line_length)
+ } else {
+ p_vret = p_shm->p_memory;
+ }
+
+ return p_vret;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : CloseSharedMemory()
+ * ABSTRACT : Shared memory close processing
+ * NOTE : Close the shared memory that is allocated/mapped at the time of its creation or open
+ * ARGUMENT : HANDLE h_shm Shared memory handle(Management information pointer)
+ * RETURN : NONE
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+CloseSharedMemory(HANDLE h_shm) {
+ SHARED_MEMORY* p_shm = reinterpret_cast<SHARED_MEMORY *>(h_shm);
+ int32 lret = EOK;
+
+ if (p_shm == NULL) /* If the shared memory handle that is not created or not opened is specified, */ {
+ } else if (p_shm->phy_addr != 0) /* If the physical memory area address is specified,(Currently never comes here) */ {
+ if (p_shm->p_memory != NULL) {
+ /* Release physical memory area */
+ if (lret != EOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "_CWORD64_api.dll:%s:LINE %d\r\n munmap_device_memory ERROR In PbFreePhysicalMem\r\n", \
+ LTEXT(__FILE__), __LINE__);
+ _pb_Exit(); /* System recovery processing(Exception execution) */
+ }
+ }
+ } else {
+ /* Release the shared memory object mapped to invoking process space */
+ if (p_shm->p_memory != NULL) {
+ lret = munmap(p_shm->p_memory, p_shm->size);
+ p_shm->p_memory = NULL;
+ }
+
+ /* Release the shared memory management information allocated in the heap */
+ free(p_shm);
+ }
+
+ return;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DeleteSharedMemory()
+ * ABSTRACT : Shared memory object delete processing
+ * NOTE : Delete the shared memory object that is specified name
+ * ARGUMENT : TCHAR* name Pointer to the name of the shared memory to be deleted
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+DeleteSharedMemory(TCHAR* name) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 lret = EOK;
+ char* cwd = NULL;
+ char sz_cwd[PATH_MAX + 1] = {0};
+
+ if (name != NULL) {
+ /* Get path of current directory */
+ cwd = getcwd(sz_cwd, PATH_MAX + 1);
+
+ if (cwd != NULL) {
+ /* Move to shared memory directory */
+ lret = chdir(SHARED_MEMORY_DIRECTORY);
+
+ if (lret == EOK) {
+ /* Delete shared memory object */
+ lret = shm_unlink(name);
+
+ /* Go to original directory */
+ lret = chdir(cwd);
+ }
+ }
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+
+HANDLE
+OpenSharedMemoryAtPhysical(DWORD physical_address, DWORD size, DWORD protect) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return NULL;
+}
+// LCOV_EXCL_STOP
+
diff --git a/vehicleservice/positioning_base_library/library/src/_CWORD64_api.cpp b/vehicleservice/positioning_base_library/library/src/_CWORD64_api.cpp
new file mode 100755
index 0000000..ed833fd
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_CWORD64_api.cpp
@@ -0,0 +1,254 @@
+/*
+ * @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
+ * _CWORD64_api.cpp
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include <native_service/frameworkunified_framework_if.h>
+#include <native_service/cl_lock.h>
+#include <native_service/cl_lockid.h>
+#include "tchar.h"
+#include "WPF_STD_private.h"
+
+
+
+/*---------------------------------------------------------------------------------*
+ * Function Prototype *
+ *---------------------------------------------------------------------------------*/
+extern RET_API MutexInit(void);
+extern RET_API SemaphoreInit(void);
+extern RET_API MemoryInit(void);
+extern RET_API EventInit(void);
+extern RET_API MsgInit(void);
+extern RET_API ErrTrapInit(void);
+extern RET_API TimerInit(HANDLE h_app);
+extern void MsgTerm(void);
+
+static void BaseCreateMutex(void);
+static void BaseLockMutex(void);
+static void BaseUnlockMutex(void);
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+/** Handle for locking Base API setups */
+static HANDLE g_h_mtx = NULL;
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Setup Base API
+ *
+ * Perform the processing required to use the Base API.(Call per process)
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return RET_NORMAL Normal completion
+ */
+RET_API _pb_Setup_CWORD64_API(HANDLE h_app) { // NOLINT(readability/nolint) API
+ RET_API result;
+ static int8 i = 0;
+ int32 ret;
+
+ if (i != 0) {
+ /* If the process has already initialized */
+ /* nop */
+ } else {
+ /* Interprocess lock initialization(CLS) */
+ ret = CL_LockProcessInit(); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (ret != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockProcessInit ERROR!! [ret=%d]", ret);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ BaseCreateMutex(); /* Create Mutex */
+ BaseLockMutex(); /* Get Mutex */
+
+ /* Recheck during getting Mutex */
+ if (i == 0) { // LCOV_EXCL_BR_LINE 6: i can not be other value
+ /* Not initialized */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "_pb_Setup_CWORD64_API Entered.");
+
+ /* Mutex function initialization */
+ result = MutexInit();
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MutexInit ERROR!! [result=%d]", result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: function can not be not normal
+ }
+
+ /* Semaphore function initialization */
+ result = SemaphoreInit();
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "SemaphoreInit ERROR!! [result=%d]", \
+ result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: function can not be not normal
+ }
+
+ /* Memory function initialization */
+ result = MemoryInit();
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MemoryInit ERROR!! [result=%d]", result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: can not be not normal
+ }
+
+ /* Event function initialization */
+ result = EventInit();
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "EventInit ERROR!! [result=%d]", result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: function can not be not normal
+ }
+
+ /* Message function initialization */
+ result = MsgInit();
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgInit ERROR!! [result=%d]", result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: can not be not normal
+ }
+
+ result = ErrTrapInit();
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ErrTrapInit ERROR!! [result=%d]", result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: can not be not normal
+ }
+
+ /* For Positioning processes */
+ if (_tcscmp("Positioning", FrameworkunifiedGetAppName(h_app)) == 0) { // LCOV_EXCL_BR_LINE 200: can not be other value
+ /* Timer function initialization */
+ result = TimerInit(h_app);
+ if (result != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not be not normal
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "TimerInit ERROR!! [result=%d]", result);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: can not be not normal
+ }
+ }
+
+ i = 1;
+ }
+
+ BaseUnlockMutex(); /* Release Mutex */
+ }
+
+ /* Set application handle */
+ _pb_SetAppHandle(h_app);
+
+ return RET_NORMAL;
+}
+
+/**
+ * @brief
+ * Teardown Base API
+ *
+ * Base API termination processing (Call per process)
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+void _pb_Teardown_CWORD64_API(void) { // NOLINT(readability/nolint) API // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Interprocess Lock Control(CLS) */
+
+
+ /*
+ Resources cannot be released unless it is guaranteed that other processes do not call the Positioning API.
+ Even if the resource is not released at the time of termination, it will not lead to illegal operation such as memory leak.
+ Comment out release processing.
+ */
+
+ /* Mutex */
+ /* Semaphore */
+ /* Memory */
+ /* Event */
+ /* Message */
+
+ /* Timer */
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+
+/**
+ * @brief
+ * Create Mutex for Base API setups
+ */
+static void BaseCreateMutex(void) {
+ g_h_mtx = (HANDLE)CL_LockMap(LOCK_POS_MTX_1); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (g_h_mtx == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockMap ERROR [g_h_mtx:%p]", g_h_mtx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get Mutex for Base API setups
+ */
+static void BaseLockMutex(void) {
+ int32 ret;
+
+ ret = CL_LockGet(g_h_mtx); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (ret != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockGet ERROR [g_h_mtx:%p, ret:%d]", \
+ g_h_mtx, ret);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Release Mutex for Base API Setup
+ */
+static void BaseUnlockMutex(void) {
+ int32 ret;
+
+ ret = CL_LockRelease(g_h_mtx); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (ret != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockRelease ERROR [g_h_mtx:%p, ret:%d]", \
+ g_h_mtx, ret);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbCSection.cpp b/vehicleservice/positioning_base_library/library/src/_pbCSection.cpp
new file mode 100755
index 0000000..e144d6f
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbCSection.cpp
@@ -0,0 +1,131 @@
+/*
+ * @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.
+ */
+
+/*******************************************************************************
+* $Header:: $
+* $Revision:: $
+*******************************************************************************/
+
+/****************************************************************************
+ * File name :_pbCSection.cpp
+ * System name :GPF
+ * Subsystem name :_CWORD64_API Critical Section Function
+ * Title :Critical Section Function Definition File
+ ****************************************************************************/
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+#include "_pbInternalProc.h"
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : PbDeleteCriticalSection()
+* ABSTRACT : Specify a critical section object that is not owned and free all resources used by that object.
+* NOTE :
+* ARGUMENT : LPCRITICAL_SECTION lp_critical_section
+* RETURN : VOID defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+VOID PbDeleteCriticalSection(LPCRITICAL_SECTION lp_critical_section) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 lret = EOK;
+
+ if (lp_critical_section == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:%s:LINE %d\r\n Parameter ERROR In PbDeleteCriticalSection\r\n",
+ LTEXT(__FILE__), __LINE__);
+ } else {
+ lret = pthread_mutex_destroy(lp_critical_section);
+ if (lret != EOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:%s:LINE %d\r\n ERROR ... ErrNo[%d] In PbDeleteCriticalSection\r\n",
+ LTEXT(__FILE__), __LINE__, lret);
+ }
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : PbEnterCriticalSection()
+* ABSTRACT : Wait to take ownership of the specified critical section object
+* NOTE :
+* ARGUMENT : LPCRITICAL_SECTION lp_critical_section
+* RETURN : VOID defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+VOID PbEnterCriticalSection(LPCRITICAL_SECTION lp_critical_section) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 lret = EOK;
+
+ if (lp_critical_section == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:%s:LINE %d\r\n Parameter ERROR In PbEnterCriticalSection\r\n",
+ LTEXT(__FILE__), __LINE__);
+ } else {
+ lret = pthread_mutex_lock(lp_critical_section);
+ if (lret != EOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:%s:LINE %d\r\n ERROR ... ErrNo[%d] In PbEnterCriticalSection\r\n",
+ LTEXT(__FILE__), __LINE__, lret);
+ }
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : PbInitializeCriticalSection
+* ABSTRACT : Initialize the specified critical section object.
+* NOTE :
+* ARGUMENT : LPCRITICAL_SECTION lp_critical_section
+* RETURN : VOID defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+VOID PbInitializeCriticalSection(LPCRITICAL_SECTION lp_critical_section) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : PbLeaveCriticalSection
+* ABSTRACT : Discard ownership of the specified critical section object.
+* NOTE :
+* ARGUMENT : LPCRITICAL_SECTION lp_critical_section
+* RETURN : VOID defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+VOID PbLeaveCriticalSection(LPCRITICAL_SECTION lp_critical_section ) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 lret = EOK;
+
+ if (lp_critical_section == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:%s:LINE %d\r\n Parameter ERROR In PbLeaveCriticalSection\r\n",
+ LTEXT(__FILE__), __LINE__);
+ } else {
+ lret = pthread_mutex_unlock(lp_critical_section);
+ if (lret != EOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:%s:LINE %d\r\n ERROR ... ErrNo[%d] In PbLeaveCriticalSection\r\n",
+ LTEXT(__FILE__), __LINE__, lret);
+ }
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbCommon.cpp b/vehicleservice/positioning_base_library/library/src/_pbCommon.cpp
new file mode 100755
index 0000000..6bb4fb9
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbCommon.cpp
@@ -0,0 +1,928 @@
+/*
+ * @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 : _pbCommon.cpp
+ System name : 05 Integration Platform
+ Subsystem name : System wide functions
+ Title : System API _CWORD64_ configuration processes
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <vehicle_service/positioning_base_library.h>
+
+#include "_pbCommon.h"
+#include "WPF_STD_private.h"
+#include "sysup_addr.h"
+#include "tchar.h"
+#include "sysup.h"
+
+/*
+ Constants and data type definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define BLOCK_SIZE (1*1024*1024)
+#define WDTC_REG_ADDR (0x13500000 | ADDR_P2) /* WDT clear register address */
+#define SUM_ZERO 0
+#define ALLOC_SIZE 0x00200000
+#define EXIST_CLEAR 0x434c4f4b /* Flag to indicate cleared Non-OS management area */
+
+#define PRCM_BASE 0x48180000
+#define PRM_RSTCTRL 0xA0
+
+#define RST_GLOBAL_COLD_SW (0x01 << 1)
+#define RST_GLOBAL_WARM_SW (0x01 << 0)
+
+/*
+ Internal function prototype declarations
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+u_int32 RomCheck(u_int32 *start_addr, u_int32 check_size);
+u_int32 RomCheckEx(u_int32 *start_addr, u_int32 check_size);
+uint64_t AtoxLong(char* str, unsigned int ascii_size);
+void XtoaLong(uint64_t x, char* str);
+#ifdef PBCOM_CONFIGREAD
+static RET_API SysGetConfigSize(FILE*, u_int32*);
+static RET_API SysReadConfigInfo(FILE*, TCHAR*, TCHAR*, u_int32);
+static int SysUniToInt(TCHAR*, u_int32);
+#endif /* PBCOM_CONFIGREAD */
+
+/*
+ External function prototype declarations
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ Global Variable Definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef PSL_USED
+extern int g_n_api_set_id; /* ID variable for PSL registration */
+#endif // PSL_USED
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _CWORD64_NotOSAreaInit
+ * ABSTRACT : Initialization non-OS managed areas of _CWORD64_
+ * NOTE : This function initializes the non-OS control areas of _CWORD64_.
+ * ARGUMENT : None
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_CWORD64_NotOSAreaInit(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#ifndef CEPC_EM /* If not emulated in CEPC */
+ RET_API ret;
+ char *cp_addr = NULL;
+ u_int32 size;
+ u_int32 *p_clear_flag; /* Pointer for storing non-OS management area clear flag */
+ LPVOID notos_topaddr;
+
+ /* Link of shared memory area to store the non-OS management area clear flag */
+ ret = _pb_LinkShareData(const_cast<char*>("NOTOS_DATA"), reinterpret_cast<void**>(&cp_addr), &size);
+ if (ret != RET_NORMAL) {
+ /* Create a shared memory area to store the non-OS management area clear flag */
+ Memset64pSync(cp_addr, 0, sizeof(p_clear_flag)); /* NULL initialization process of acquisition area */
+ }
+
+ p_clear_flag = reinterpret_cast<u_int32*>(cp_addr);
+
+ /* Non-OS management area clear processing */
+ /* Because an exception occurs when garbage data remains in the message pool at startup,
+ Clear the entire non-OS management area as 0 Only for the first time after startup. */
+ if (*p_clear_flag != EXIST_CLEAR) {
+ /* Execute mapping to non-OS management area */
+ ret = PbAccessPhysicalMem(TOP_ADDR_NOTOS, /* Start address non-OS management area for of the _CWORD64_ */
+ &notos_topaddr, /* Start address of the mapping */
+ NOTOS_SISE, /* Area-size */
+ 0);
+
+ /* failed mapping */
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_msg.lib:%s:LINE %d\r\n PbAccessPhysicalMem ERROR In " \
+ "_CWORD64_NotOSAreaInit ... ret[%d] \r\n",
+ LTEXT(__FILE__), __LINE__, ret);
+ _pb_Exit();
+ }
+
+ /* Non-OS management area clear processing */
+ Memset64pSync(notos_topaddr, 0, NOTOS_SISE);
+
+ /* Shared area release processing */
+ ret = PbFreePhysicalMem(TOP_ADDR_NOTOS, /* Start address of the _CWORD64_ non-OS management area */
+ notos_topaddr, /* Start address of the mapped area */
+ NOTOS_SISE); /* Size */
+
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_msg.lib:%s:LINE %d\r\n PbFreePhysicalMem ERROR " \
+ "In_CWORD64_NotOSAreaInit ... ret[%d] \r\n",
+ LTEXT(__FILE__), __LINE__, ret);
+ _pb_Exit();
+ }
+
+ *p_clear_flag = EXIST_CLEAR; /* Set non-OS management area clear flag */
+ }
+#endif
+
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _CWORD64_APIInit
+ * ABSTRACT : System initialization of _CWORD64_API
+ * NOTE : This function is called once from the initialization process
+ * : at system startup to perform the _CWORD64_API initialization process.
+ * ARGUMENT : u_int32 (*sighand)() Completion of signal handling within APIs if NULL
+ * : Otherwise calls this first when a signal is raised
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_CWORD64_APIInit(u_int32 (*sighand)()) { // NOLINT(readability/nolint) API // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API RetSts = RET_ERROR;
+
+ if (sighand == NULL) {
+ /* Parameter is set to an error other than NULL */
+ RetSts = _pb_Setup_CWORD64_API(NULL); /* Execute initialization processing for normal processing */
+ }
+
+ return(RetSts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_GetPrgVer
+ * ABSTRACT : Get the program version
+ * NOTE : Get the program version of the mask ROM (BootLoader) and flash
+ * : ROM (NK-image) into specified buffers.
+ * : In hardware-independent CEPC emulation environment, return the following version,
+ * : otherwise always return RET_NORMAL as the return value.
+ * : mask_ver=0x0102 0304 0506 0708
+ * : flash_ver1=0x0102 0304 0506 0708
+ * : flash_ver2=0x0102 0304 0506 0708
+ * : flash_ver3=0x0102 0304 0506 0708
+ * ARGUMENT : T_SYS_PRGVER *pbuf Destination buffer address
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_pb_GetPrgVer(T_SYS_PRGVER *pbuf) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_UpManage
+ * ABSTRACT : Boot management process
+ * NOTE : Set the startup identifier in the SDRAM startup identification table (SDRAM)
+ * : or TinyFugue area (FLASH) at the next startup.
+ * : Which one to set depends on the table type of the argument.
+ * : Soft reset is performed when reset is instructed by the parameter.
+ * : In hardware-independent CEPC emulation environment, return the RET_NORMAL as the return value without recording the startup identifier.
+ * ARGUMENT : u_int16 up_sts :Startup Identifier Value
+ * : int reset :Reset instruction
+ * : u_int8 table :Table Type
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_pb_UpManage(u_int32 up_sts, int reset, u_int8 table) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Is reset instructed? */
+ if ((reset == SYS_RESET) || (reset == SYS_ONLY_RESET)) {
+ PbReset(); /* Soft reset */
+ }
+
+ return RET_NORMAL;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_RomcheckMask
+ * ABSTRACT : Check the sum value of masked part
+ * NOTE : Check the sum value of the mask ROM (BOOTROM)
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL :Sum value normal
+ * REL_ERROR :Sum value error
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_pb_RomcheckMask(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_RomcheckApl
+ * ABSTRACT : Check sum value of APL part (NK image)
+ * NOTE : In hardware-independent CEPC emulations do nothing and return RET_NORMAL.
+ * ARGUMENT :
+ * RETURN : RET_API RET_NORMAL :Sum Value Normal
+ * REL_ERROR :Sum value error
+ * RET_OSERROR :AccessPhysicalMem error
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_pb_RomcheckApl(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbReset
+ * ABSTRACT : Hard reset processing
+ * NOTE : Manipulate the WDT control register to generate a hard reset
+ * : Hardware-independent CEPC emulations do nothing and return RET_NORMAL.
+ * ARGUMENT : void
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+PbReset(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+
+ /* Message log output processing */
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " PbReset:%s:LINE %d\r\n #### HARD RESET !! ####\r\n",
+ LTEXT(__FILE__), __LINE__);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_GetDeviceInfo
+ * ABSTRACT : Getting device information
+ * NOTE : Gets device information into the specified buffer.
+ * : In hardware-independent CEPC emulations, the following device
+ * : information is returned permanently. The return value is always RET_NORMAL.
+ * : _CWORD31__no="8611052060010001" mci_no="CNCS0200A" date="200301011200"
+ * ARGUMENT : T_SYS_PRGVER *pbuf Destination buffer address
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_pb_GetDeviceInfo(T_SYS_DEVINFO *pbuf) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_WriteDeviceInfo
+ * ABSTRACT : Write device key information
+ * NOTE : Write device key information to flash memory
+ * ARGUMENT : u_char *ucpData Start address of write data (256 bytes)
+ * RETURN : int32 VUP_SUCCESS Flash write complete
+ * : VUP_FAILED Flash write abend
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+int32
+_pb_WriteDeviceInfo(u_char *ucpData) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_GetSramVer
+ * ABSTRACT : SRAM versioning process
+ * NOTE : Getting SRAM version
+ * : In hardware-independent CEPC emulations, return the following SRAM Version statically.
+ * : The return value is always RET_NORMAL.
+ * : SRAM Version=0x1112 1314
+ * ARGUMENT : char *pbuf Destination buffer address
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+_pb_GetSramVer(char *pbuf) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_GetDisplayInfo
+ * ABSTRACT : Getting display information
+ * NOTE : Get the screen size (width and height) into the buffer of the DISPLAY_INFO structure
+ * ARGUMENT : DISPLAY_INFO *pSystemInfo Screen size acquisition destination buffer address
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define DISPLAYINFO_SUBKEY_SIZE 56
+#define DISPLAYINFO_VALNAME_SIZE 16
+#define DISPLAYINFO_VAL_SIZE 8
+
+RET_API
+_pb_GetDisplayInfo(DISPLAY_INFO *pSystemInfo) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#ifdef PBCOM_CONFIGREAD
+ FILE* fpConfigFile = NULL; /* Configuration file handle */
+ TCHAR tcData[DISPLAYINFO_VAL_SIZE] = {0}; /* Data section read buffer */
+ TCHAR tcDataName[DISPLAYINFO_VALNAME_SIZE] = {0}; /* Data information storage buffer */
+ int iRet = PBCOM_API_NORMAL; /* API return value */
+#endif
+ int iHeight = 0; /* Screen height information */
+ int iWidth = 0; /* Screen width information */
+ RET_API Retapi = RET_NORMAL; /* Results of this Module process */
+
+ /************************************************************
+ * Parameter check
+ ************************************************************/
+ if (NULL == pSystemInfo) {
+ /* Parameter is set to error */
+ Retapi = RET_ERRPARAM;
+ }
+
+ /************************************************************
+ * Set the information in the configuration file
+ ************************************************************/
+#ifdef PBCOM_CONFIGREAD
+ /************************************************************
+ * Open configuration file
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ fpConfigFile = fopen(PBCOM_CONFIGFILE, "r");
+ if (NULL == fpConfigFile) {
+ /* Set error in as a result */
+ Retapi = RET_ERROR;
+ }
+ }
+
+ /************************************************************
+ * Get screen width information from configuration file
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Buffer clear */
+ memset(tcData, 0x00, sizeof(tcData));
+ memset(tcDataName, 0x00, sizeof(tcDataName));
+
+ /* Data information setting */
+ memcpy(tcDataName, PBCOM_CONFIG_INDEX_SCRWIDTH, strlen(PBCOM_CONFIG_INDEX_SCRWIDTH));
+
+ /************************************************************
+ * Setting file information reading process
+ ************************************************************/
+ Retapi = SysReadConfigInfo(fpConfigFile, tcDataName, tcData, (u_int32)sizeof(tcData));
+
+ /************************************************************
+ * Conversion process from character string (UNICODE) to numeric
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Conversion from string to numeric */
+ iHeight = SysUniToInt(tcData, strlen(tcData));
+ }
+ }
+
+ /************************************************************
+ * Get screen height information from setting file
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Buffer clear */
+ memset(tcData, 0x00, sizeof(tcData));
+ memset(tcDataName, 0x00, sizeof(tcDataName));
+
+ /* Data information setting */
+ memcpy(tcDataName, PBCOM_CONFIG_INDEX_SCRHEIGHT, strlen(PBCOM_CONFIG_INDEX_SCRHEIGHT));
+
+ /************************************************************
+ * Setting file information reading process
+ ************************************************************/
+ Retapi = SysReadConfigInfo(fpConfigFile, tcDataName, tcData, (u_int32)sizeof(tcData));
+
+ /************************************************************
+ * Conversion process from character string (UNICODE) to numeric
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Conversion from string to numeric */
+ iWidth = SysUniToInt(tcData, strlen(tcData));
+ }
+ }
+
+ /************************************************************
+ * Configuration file close
+ ************************************************************/
+ /* Executed only when the open is successful. */
+ if (NULL != fpConfigFile) {
+ iRet = fclose(fpConfigFile);
+ if (PBCOM_API_NORMAL != iRet) {
+ Retapi = RET_ERROR;
+ }
+ }
+
+ /************************************************************
+ * Direct value setting
+ ************************************************************/
+#else
+ iHeight = 480;
+ iWidth = 800;
+#endif
+ /************************************************************
+ * Display information setting
+ ************************************************************/
+
+ if (RET_NORMAL == Retapi) {
+ /* Coverity CID: 18756 compliant */
+ pSystemInfo->i_height_size = iHeight;
+ pSystemInfo->i_width_size = iWidth;
+ } /* Coverity CID: 18756 compliant */
+
+ return Retapi;
+}
+// LCOV_EXCL_STOP
+
+/******************************************************************************
+* MODULE : RomCheck
+* ABSTRACT : Calculate sum value within range of address specified by argument
+* FUNCTION : u_int32 RomCheck()
+* ARGUMENT : u_int32 *addr Start address for which sum value is to be calculated
+* u_int32 check_size Size for which the sum is to be calculated
+* NOTE :
+* RETURN : u_int32 sum Sum value
+******************************************************************************/
+u_int32
+RomCheck(u_int32 *start_addr, u_int32 check_size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int32 *addr_tmp;
+ u_int32 *end_addr;
+ u_int32 sum;
+
+ end_addr = start_addr + check_size / sizeof(u_int32);
+ addr_tmp = start_addr;
+
+ for (sum = 0; addr_tmp < end_addr;) {
+ sum += *(addr_tmp++);
+ }
+ return(sum);
+}
+// LCOV_EXCL_STOP
+
+/******************************************************************************
+* MODULE : RomCheckEx
+* ABSTRACT : Calculate sum value in range of address on ROM specified by argument
+* FUNCTION : u_int32 RomCheckEx()
+* ARGUMENT : u_int32 *addr Start address for which sum value is to be calculated
+* u_int32 check_size Size for which the sum is to be calculated
+* NOTE : For single operation(For a one-bank configuration). APIs provided by FROM management
+* are used because FROM management must be exclusively controled.
+* The sum calculation unit is assumed to be the sector size of FlashROM.
+* RETURN : u_int32 sum Sum value
+* When this function terminates with an error, "RET_ERROR" is returned.
+******************************************************************************/
+u_int32
+RomCheckEx(u_int32 *start_addr, u_int32 check_size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(0);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : AtoxLong
+ * ABSTRACT : Convert ASCII to hex
+ * FUNCTION : Convert a ASCII string (up to 8 characters) to a uint64_t hexadecimal string
+ * NOTE :
+ * RETURN : uint64_t :Converted hexadecimal number (up to 8 digits)
+ * INPUT : char *str -------------------- Pointer to a source ASCII string
+ * unsigned int ascii_size ------ Number of characters in source ASCII string
+ * OUTPUT :
+ ******************************************************************************/
+uint64_t AtoxLong(char* str, unsigned int ascii_size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ uint64_t x = 0; /* Return value */
+ unsigned int i; /* For work */
+ unsigned int tmp; /* For work */
+
+ /* Check that the specified ASCII number of characters does not exceed the number of digits represented by int64_t (8 hexadecimal digits). */
+ if (ascii_size > (sizeof(x)) * 2) {
+ ascii_size = static_cast<unsigned int>(sizeof(x) * 2);
+ }
+ /* Convert one character at a time to hexadecimal */
+ for (i = 0; i < ascii_size; i++) {
+ /* Is a number? */
+ tmp = *str - '0';
+ if (tmp > 9) {
+ /* Coverity CID: 18790 compliant */
+ /* a-f? */
+ tmp = *str - 'a' + 10;
+ if ((tmp < 0x0a) || (tmp > 0x0f)) {
+ /* A to F ? */
+ tmp = *str - 'A' + 10;
+ if ((tmp < 0x0a) || (tmp > 0x0f)) {
+ /* Stop when a non-hexadecimal value is found */
+ break;
+ }
+ }
+ }
+
+ /* Increase the digit */
+ x <<= 4;
+ /* Add to the bottom digit */
+ x |= tmp;
+ str++;
+ }
+
+ return x;
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : XtoaLong
+ * ABSTRACT : Convert HEX to ASCII
+ * FUNCTION : This function converts the 8-digit hexadecimal number from str[0] to the ASCII code and stores the code.
+ * NOTE : The string to be passed as *str must be at least 8 characters in length. * RETURN :
+ * INPUT : uint64_t x ------------ Source hexadecimal number
+ * OUTPUT : char* str ------------------ Converted ASCII Strings (8 Characters)
+ ******************************************************************************/
+void XtoaLong(uint64_t x, char* str) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int i; /* For looping */
+ int size; /* For looping */
+ char tmp; /* Conversion temporary buffer */
+
+ /* Maximum number of loops (for character string) */
+ size = static_cast<int>(sizeof(int64_t) * 2);
+ /* Convert eight digits */
+ for (i = 0; i < size; i++) {
+ tmp = static_cast<char>((x >> ((size - i - 1) * 4)) & 0x0F);
+
+ /* For 0xA to 0xF */
+ if (tmp > 0x09) {
+ str[i] = static_cast<char>('A' + tmp - 0x0A);
+ } else {
+ str[i] = static_cast<char>('0' + tmp);
+ }
+ }
+}
+// LCOV_EXCL_STOP
+
+/******************************************************************************
+* MODULE : _pb_SendSystemError
+* ABSTRACT : System error notification
+* FUNCTION : Notify the system error and reset the software.
+* ARGUMENT : PNO pno Error process No.
+* int32 errcode Error code
+* NOTE : _pb_SndMsg : Send message (System API)
+* _sys_GetPno : PNO to be gotten
+* RETURN : RET_API defined
+******************************************************************************/
+RET_API _pb_SendSystemError(PNO pno, int32 errcode) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ T_SYS_SYSTEMERROR msg; /* Message */
+ register T_APIMSG_HEADER *hdr; /* Message header */
+ RET_API api_ret;
+
+ /* Message Header Settings */
+ hdr = &(msg.bhead.hdr);
+
+ msg.bhead.signo = 0; /* Extension member */
+ hdr->sndpno = 0; /* Source Process No. */
+ hdr->respno = 0; /* Response destination process No.(None) */
+ hdr->cid = CID_INI_SYSTEMERR; /* Command ID */
+ hdr->msgbodysize = static_cast<uint16_t>(sizeof(T_SYS_SYSTEMERROR) - sizeof(T_APIMSG_MSGBUF_HEADER));
+ /* Main unit size */
+ hdr->rid = 0; /* Resources ID (Dummy) */
+ hdr->reserve = 0;
+ msg.pno = pno; /* Error process No. */
+ msg.errcode = errcode; /* Error code */
+
+ /* Send Message */
+ api_ret = _pb_SndMsg(PNO_GINI_MAIN, sizeof(msg), &msg, 0);
+
+ return(api_ret);
+}
+// LCOV_EXCL_STOP
+
+/******************************************************************************
+* MODULE : _pb_GetVupFileName
+* ABSTRACT : Getting the version upgrade file name
+* FUNCTION : Get the path name and file name of the version upgrade.
+* ARGUMENT : LPTSTR filename File name storage
+* u_char media Container media
+* NOTE :
+* RETURN : RET_API defined
+******************************************************************************/
+RET_API _pb_GetVupFileName(LPTSTR filename , u_char media) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API api_ret = RET_NORMAL; /* API return value */
+ T_SYS_PRGVER ver; /* Version Information */
+ RET_API ret; /* Internal function return value */
+ u_char kisyu; /* Storage of model code */
+
+ /* Get version */
+ ret = _pb_GetPrgVer(&ver);
+
+ if (ret == RET_NORMAL) {
+ /* Extract model code from version */
+ kisyu = ver.mask_ver[3];
+
+ /* If the media is a disk */
+ if (media == VUP_GETNAME_MEDIA_DISC) {
+ _stprintf(filename, _T("%s%s%s%02x%s"),
+ VUP_DISC_PATHNAME, VUP_PATHNAME_SYSTEM, VUP_FNAME_TOP, kisyu, VUP_FNAME_BTM);
+ } else {
+ /* Media is USB */
+ _stprintf(filename, _T("%s%s%s%02x%s"),
+ VUP_USB_PATHNAME, VUP_PATHNAME_SYSTEM, VUP_FNAME_TOP, kisyu, VUP_FNAME_BTM);
+ }
+ } else {
+ api_ret = RET_ERROR;
+ }
+
+ return(api_ret);
+}
+// LCOV_EXCL_STOP
+
+/******************************************************************************
+* MODULE : _pb_GetForceVupFileName
+* ABSTRACT : Getting the version upgrade file name
+* FUNCTION : Get the path name and file name of the version upgrade.
+* ARGUMENT : LPTSTR filename File name storage
+* u_char media Container media
+* NOTE :
+* RETURN : RET_API defined
+******************************************************************************/
+RET_API _pb_GetForceVupFileName(LPTSTR filename , u_char media) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API api_ret = RET_NORMAL; /* API return value */
+
+ /* If the media is a disk */
+ if (media == VUP_GETNAME_MEDIA_DISC) {
+ _stprintf(filename, _T("%s%s%s"),
+ VUP_DISC_PATHNAME, VUP_PATHNAME_SYSTEM, VUP_FNAME_FORCEVUP);
+ } else {
+ /* Media is USB */
+ _stprintf(filename, _T("%s%s%s"),
+ VUP_USB_PATHNAME, VUP_PATHNAME_SYSTEM, VUP_FNAME_FORCEVUP);
+ }
+
+ return(api_ret);
+}
+// LCOV_EXCL_STOP
+
+#ifdef PBCOM_CONFIGREAD
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SysGetConfigSize
+ * ABSTRACT : Setting file size acquisition processing
+ * NOTE : Get file size.
+ * : When this Module is called, an area must be allocated at a higher level.
+ * : Parameter checking is not performed in this Module.
+ * ARGUMENT : FILE* fpFile(File handle)
+ * : int* piSize(File size storage area)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static RET_API
+SysGetConfigSize(FILE* fpFile, u_int32* puiSize) {
+ int64_t lCurrentPos = 0; /* File current position */
+ int64_t lEndPos = 0; /* End position of the file */
+ int iRet = PBCOM_API_NORMAL; /* API processing result */
+ RET_API Retapi = RET_NORMAL; /* Result of this Module process */
+
+ /************************************************************
+ * Get current offset
+ ************************************************************/
+ lCurrentPos = ftell(fpFile);
+
+ /* If the return value is abnormal, the processing result is set to abnormal. */
+ if (PBCOM_API_ERROR == lCurrentPos) {
+ Retapi = RET_ERROR;
+ }
+
+ /************************************************************
+ * Get end offset (size)
+ * -Set offset to end-of-file
+ * -Get end-of-file offset
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Set offset to end-of-file */
+ iRet = fseek(fpFile, 0L, SEEK_END);
+
+ /* If the return value is abnormal, the processing result is set to abnormal. */
+ if (PBCOM_API_NORMAL != iRet) {
+ Retapi = RET_ERROR;
+ }
+ }
+
+ if (RET_NORMAL == Retapi) {
+ /* Get end-of-file offset */
+ lEndPos = ftell(fpFile);
+
+ /* Set file size if the return value is normal */
+ if (PBCOM_API_ERROR != lEndPos) {
+ *puiSize = (u_int32)lEndPos;
+ } else {
+ /* If the return value is abnormal, the processing result is set to abnormal. */
+ Retapi = RET_ERROR;
+ }
+ }
+
+ /************************************************************
+ * Revert current offset
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Revert offset and complete processing */
+ iRet = fseek(fpFile, lCurrentPos, SEEK_SET);
+
+ /* If the return value is abnormal, the processing result is set to abnormal. */
+ if (PBCOM_API_NORMAL != iRet) {
+ Retapi = RET_ERROR;
+ }
+ }
+
+ return Retapi;
+}
+#endif /* PBCOM_CONFIGREAD */
+
+#ifdef PBCOM_CONFIGREAD
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SysReadConfigInfo
+ * ABSTRACT : Setting file information reading process
+ * NOTE : Read the data associated with the specified data information from the configuration file.
+ * : When this module is called, an area must be allocated at a higher level.
+ * : Parameter checking is not performed in this module.
+ * ARGUMENT : FILE* fpConfig(File handle)
+ * : TCHAR* tcDataIndex(Data information)
+ * : TCHAR* tcDataBuf(Data read buffer)
+ * : int tcDataSize(Data read size)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static RET_API
+SysReadConfigInfo(FILE* fpConfig, TCHAR* tcDataIndex, TCHAR* tcDataValue, u_int32 tcDataSize) {
+ TCHAR tcReadBuf[PBCOM_CONFIGSIZE_MAX] = {0}; /* Read buffer */
+ u_int32 uiDataPos = 0; /* Data position */
+ u_int32 uiCpyPos = 0; /* Copy position */
+ u_int32 uiFileSize = 0; /* File size */
+ u_int32 uiReadSize = 0; /* Data read size */
+ u_int32 uiDataNum = 0; /* Number of read data */
+ int iRet = 0; /* API processing result */
+ RET_API Retapi = RET_NORMAL; /* Result of this Module process */
+
+ /************************************************************
+ * Get setting file size
+ ************************************************************/
+ /* Get setting file size */
+ Retapi = SysGetConfigSize(fpConfig, &uiFileSize);
+
+ /* When the setting file size is gotten successfully */
+ if (RET_NORMAL == Retapi) {
+ /* The maximum size of the configuration file is greater than or equal to the maximum size of the configuration file. */
+ if (uiFileSize > PBCOM_CONFIGSIZE_MAX) {
+ /* Set the maximum value of the configuration file as the size */
+ uiFileSize = PBCOM_CONFIGSIZE_MAX;
+ }
+ }
+
+ /************************************************************
+ * Read setting file
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Read data count */
+ uiDataNum = uiFileSize / sizeof(TCHAR);
+
+ /* Set file pointer to the beginning of file */
+ rewind(fpConfig);
+
+ /* Read the data */
+ uiReadSize = fread(tcReadBuf, sizeof(TCHAR), uiDataNum, fpConfig);
+
+ /* When the data corresponding to the file size cannot be read */
+ if (uiReadSize != uiFileSize) {
+ /* Set error in processing result */
+ Retapi = RET_ERROR;
+ }
+ }
+
+ /************************************************************
+ * Data information search & retrieval
+ * -Find data information from the configuration file you read
+ * -Read associated data if data information can be found
+ ************************************************************/
+ if (RET_NORMAL == Retapi) {
+ /* Set error to processing result (Set normal when search is normal) */
+ Retapi = RET_ERROR;
+
+ for (uiDataPos = 0; uiDataPos < uiDataNum; uiDataPos++) {
+ /* Determine file information */
+ iRet = memcmp(&tcReadBuf[uiDataPos], tcDataIndex, strlen(tcDataIndex));
+
+ /************************************************************
+ * If the applicable data information(Data information matched)
+ ************************************************************/
+ if (0 == iRet) {
+ /* Move to data position (Move file information)*/
+ uiDataPos += strlen(tcDataIndex) / sizeof(TCHAR);
+
+ /* Set normal to processing result for data discovery */
+ Retapi = RET_NORMAL;
+
+ /************************************************************
+ * Data read processing
+ * -Read data from the read data size
+ * -Assume that he end of the data has been reached when the following conditions are met
+ * NULL character code
+ * Line feed character code
+ * The data end of the configuration file is exceeded.
+ ************************************************************/
+ for (uiCpyPos = 0; uiCpyPos < tcDataSize; uiCpyPos++) {
+ if (uiDataNum > uiDataPos) {
+ /* Coverity CID: 18781 compliant */
+ /* If it is valid data */
+ if ((PBCOM_UNICODE_NUL != tcReadBuf[uiDataPos]) &&
+ (PBCOM_UNICODE_LF != tcReadBuf[uiDataPos])) {
+ /* Data setting*/
+ tcDataValue[uiCpyPos] = tcReadBuf[uiDataPos];
+ } else {
+ /* Exit from this loop */
+ break;
+ }
+ } else {
+ /* When the end of data is reached */
+ /* Exit from this loop */
+ break;
+ }
+ /* Move the data position by the set amount */
+ uiDataPos++;
+ }
+ /************************************************************
+ * Completion of data information search
+ ************************************************************/
+ break;
+ } else {
+ /************************************************************
+ * Not applicable data information(Data information mismatch)
+ ************************************************************/
+ /************************************************************
+ * Move to next data information
+ * -Determine supine data if following condition is met
+ * Line feed character code
+ * -End processing when the end of file is reached
+ ************************************************************/
+ while (uiDataPos < uiDataNum) {
+ /* Data determination */
+ if (PBCOM_UNICODE_LF == tcReadBuf[uiDataPos]) {
+ /*Next Data Detection */
+ break;
+ }
+ /* Move the data by the determined amount */
+ uiDataPos++;
+ }
+ }
+ }
+ }
+ return Retapi;
+}
+#endif /* PBCOM_CONFIGREAD */
+
+#ifdef PBCOM_CONFIGREAD
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SysUniToInt
+ * ABSTRACT : Converting from Unicode(string) to Int(number)
+ * NOTE : Convert from Unicode(string) to Int(number).
+ * : The number of characters that can be converted is defined in PBCOM_UTOIMAX_NUM.
+ * : When this module is called, an area must be allocated at a higher level.
+ * : Parameter checking is not performed in this module.
+ * ARGUMENT : TCHAR* tcData(Character string storage area)
+ * : int iDataSize(Character array size)
+ * RETURN : Number converted from character string
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static int SysUniToInt(TCHAR* tcData, u_int32 iDataSize) {
+ int iValue = 0; /* Converted value */
+ u_int8 ucCount = 0; /* Character string data position */
+
+ /************************************************************
+ * Parameter check
+ ************************************************************/
+ if (PBCOM_UTOIMAX_NUM < iDataSize) {
+ iDataSize = PBCOM_UTOIMAX_NUM;
+ }
+
+ /************************************************************
+ * Conversion from string to number
+ ************************************************************/
+ for (ucCount = 0; ucCount < iDataSize; ucCount++) {
+ /*If it is a number */
+ if ((tcData[ucCount] >= '0') &&
+ (tcData[ucCount] <= '9')) {
+ iValue = (iValue * 10) + (tcData[ucCount] - '0');
+ } else {
+ /* If it is not a digit */
+ /* End of data */
+ break;
+ }
+ }
+ return iValue;
+}
+#endif /* PBCOM_CONFIGREAD */
+
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : _sysCommon.cpp
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbDram.cpp b/vehicleservice/positioning_base_library/library/src/_pbDram.cpp
new file mode 100755
index 0000000..eb70131
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbDram.cpp
@@ -0,0 +1,284 @@
+/*
+ * @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 : _pbDram.cpp
+ System name : 05 Integration Platform
+ Subsystem name : System common functions
+ Title : System API
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+
+/*
+ Constants and structure definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define END 0xFFFFFFFF /* DRAM R/W check address table end flag */
+/* Definitions for CRC calculations */
+#define DIV_BYTE_DATA 0x000000FF
+#define CRC_INIT 0x00000000
+#define DATA_L_SHIFTNUM 8
+#define DATA_R_SHIFTNUM 24
+
+/*
+ Global Variable Definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+extern int g_n_api_set_id; /* ID variable for PSL registration */
+
+/*
+External function prototype declaration
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ BOOL VirtualCopy(LPVOID lpv_dest, LPVOID lpv_src, DWORD cb_size, DWORD fdw_protect);
+#ifdef __cplusplus
+};
+#endif
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramWt
+ * ABSTRACT : DRAM self-refresh area write process
+ * NOTE : Write the content of the buffer to the offset-position of the area of the specified DRAM ID.
+ * Perform CRC calculation and add it to the end of the area
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * void *pbuf Source buffer pointer
+ * u_int32 off Destination DRAM offsets(bytes)
+ * u_int16 size Transfer data size(bytes)
+ * RETURN : RET_API defineed
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramWt(u_int8 id, void *pbuf, u_int32 off, u_int16 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret = PbDramWt32(id, pbuf, off, (u_int32)size);
+ return(ret);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbDramWt32
+ * ABSTRACT : DRAM self-refresh area write process
+ * NOTE : Write the content of the buffer to the offset-position of the area of the specified DRAM ID.
+ * Perform CRC calculation and add it to the end of the area
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * void *pbuf Source buffer pointer
+ * u_int32 off Destination DRAM offsets(bytes)
+ * u_int32 size Transfer data size(bytes)
+ * RETURN : RET_API defined
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbDramWt32(u_int8 id, void *pbuf, u_int32 off, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramRd
+ * ABSTRACT : DRAM self-refresh area read process
+ * NOTE : Write the offsets of the area of the specified DRAM ID to buffer.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * u_int32 off Source DRAM Offsets(bytes)
+ * void *pbuf Destination buffer pointer
+ * u_int16 size Transfer data size(bytes)
+ * RETURN : RET_API definef
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramRd(u_int8 id, u_int32 off, void *pbuf, u_int16 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramRd32
+ * ABSTRACT : DRAM self-refresh area read process
+ * NOTE : Write the offsets of the area of the specified DRAM ID to buffer.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * u_int32 off Source DRAM Offset(bytes)
+ * void *pbuf Destination buffer pointer
+ * u_int32 size Transfer data size(bytes)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramRd32(u_int8 id, u_int32 off, void *pbuf, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramSz
+ * ABSTRACT : DRAM ID size acquisition processing
+ * NOTE : Get the effective area size of the specified DRAM ID.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * u_int16 *psize Size(bytes)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramSz(u_int8 id, u_int16 *psize) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramSz32
+ * ABSTRACT : DRAM ID size acquisition processing
+ * NOTE : Get the effective area size of the specified DRAM ID.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * u_int32 *psize Size(bytes)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramSz32(u_int8 id, u_int32 *psize) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramFilCrc
+ * ABSTRACT : DRAM memory-fill process (add CRC-value)
+ * NOTE : Fill with the specified patterns from the offset position of the area of the specified DRAM ID.
+ * After filling, add result of the CRC calculation to the end of the region.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * u_int32 off Fill destination DRAM offset(bytes)
+ * u_int8 pat Fill pattern
+ * u_int16 size Fill size(bytes)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramFilCrc(u_int8 id, u_int32 off, u_int8 pat, u_int16 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramFil32Crc
+ * ABSTRACT : DRAM memory-fill process (CRC-value addition)
+ * NOTE : Fill with the specified patterns from the offset position of the area of the specified DRAM ID.
+ * After filling, perform CRC calculation and add it to the end of the region
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * u_int32 off Fill destination DRAM offset(bytes)
+ * u_int8 pat Fill pattern
+ * u_int32 size Fill size(bytes)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramFil32Crc(u_int8 id, u_int32 off, u_int8 pat, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramCrcChk
+ * ABSTRACT : DRAM self-refresh area CRC-check
+ * NOTE : Perform CRC calculation for the specified area and check whether the CRC value is normal.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramCrcChk(u_int8 id) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramRWChk
+ * ABSTRACT : DRAM read/write checking
+ * NOTE : Check whether DRAM can be read/written correctly
+ * ARGUMENT : None
+ * RETURN : RET_API define RET_NORMAL : Normal status
+ * RET_ERROR : In case of read/write error
+ * RET_OSERRER : Virtual area mapping error
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramRWChk(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/*******************************************************************************
+ * MODULE : Crc
+ * ABSTRACT : Calculate sum of a given range
+ * FUNCTION : RET_API Crc(u_int32 start_addr,u_int32 size, u_int32 *sum);
+ * ARGUMENT : u_int32 start_addr Top address
+ * u_int32 size Size
+ * u_int32* sum Sum value storage
+ * NOTE : Calculate the 4 bytes sum of the size portion from start_addr and stores the result in sum.
+ * If start_addr and size are not 4-bytes boundaries, errors are returned.
+ * On error, -1 is stored in sum and returned.
+ * RETURN : RET_NORMAL Sum value calculation success
+ * RET_ERROR Sum value calculation failed
+ ******************************************************************************/
+RET_API
+Crc(u_int32 start_addr, u_int32 size, u_int32 *sum) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DramDestroy
+ * ABSTRACT : SRAM alternative DRAM self-refresh area destruction process
+ * NOTE : The SRAM replacement DRAM self-refresh area is destroyed by adding 1
+ * to the CRC value held by the area ID and destroying the CRC value.
+ * ARGUMENT : u_int8 id DRAM Area IDs
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DramDestroy(u_int8 id) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : CrcEx
+ * ABSTRACT : Calculate the sum of the CRC values in the given range and the CRC values passed in the arguments
+ * FUNCTION : RET_API CrcEx(u_int32 start_addr, u_int32 size, u_int32 *sum, u_int32 addcrc);
+ * ARGUMENT : u_int32 start_addr Top address
+ * u_int32 size Size
+ * u_int32* sum CRC value storage
+ * u_int32 addcrc CRC value to add
+ * NOTE : When the 4-bytes-CRC value for the size is calculated from start_addr,
+ * Add the CRC value passed in the fourth argument to sum, and store it in sum.
+ * Note:Because the address align is undefined, 1-byte calculation shall be performed.
+ * RETURN : RET_NORMAL Sum value calculation success
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+CrcEx(u_int32 start_addr, u_int32 size, u_int32 *sum, u_int32 addcrc) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+
+
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : _pbDram.cpp
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
diff --git a/vehicleservice/positioning_base_library/library/src/_pbEvent.cpp b/vehicleservice/positioning_base_library/library/src/_pbEvent.cpp
new file mode 100755
index 0000000..0912a13
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbEvent.cpp
@@ -0,0 +1,1695 @@
+/*
+ * @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
+ * _pbEvent.cpp
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <vehicle_service/positioning_base_library.h>
+#include "_pbEvent_Internal.h"
+#include "_pbInternalProc.h"
+#include "WPF_STD_private.h"
+#include "tchar.h"
+
+/*---------------------------------------------------------------------------------*
+ * Internal Function Prototype *
+ *---------------------------------------------------------------------------------*/
+static BOOL FindEventTable(PB_EVENT*, TCHAR*, u_int32*);
+static BOOL AllocNewEventTable(PB_EVENT*, u_int32*);
+
+static void FreeEventTable(PB_EVENT* p_event_table, int index);
+static RET_API SetProc(PB_EVENT_OPEN_HANDLE* p_event_open, int32 i_mode, int32 l_val, int32* lp_val);
+static RET_API WaitProc(PB_EVENT_OPEN_HANDLE*, WAITING_CONDITION*, u_int32);
+static BOOL CheckCondition(PB_EVENT* p_sys_event, DWORD wcn, int32 l_event_data);
+
+static EventID EventCreateNewEventInSystem(u_int8, int32, TCHAR*);
+static EventID EventCreateNewEventInProcess(u_int32);
+
+static RET_API EventSendSignal(PB_EVENT_OPEN_HANDLE*, u_int32);
+static RET_API EventWaitForSignal(PB_EVENT_OPEN_HANDLE*, u_int32, u_int32);
+
+static BOOL EventCreateMutex(PB_EVENT_OPEN_HANDLE*);
+static void EventLockMutex(PB_EVENT_OPEN_HANDLE*);
+static void EventUnlockMutex(PB_EVENT_OPEN_HANDLE*);
+static void EventDeleteMutex(PB_EVENT_OPEN_HANDLE*);
+
+void GetDebugEventMngTblSysEvent(void* p_buf, PB_EVENT* p_evt, uint8_t* p_indent);
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static PB_EVENT_INSTANCE g_instance; // NOLINT(readability/nolint)
+
+static uint8_t g_my_proc_cnt; /* Invoking process counter value */
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Initializing Event-Related Processing
+ *
+ * Instantiate and initialize system API event related processing.
+ * Creates a flags in the CLS event library.
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRINIT Initialization error
+ */
+RET_API EventInit(void) {
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ PB_EVENT* p_event_table = NULL;
+ u_int32 ul_share_mem_size = 0;
+ RET_API ret_api = RET_ERROR;
+ char c_share_mem_name[32] = {0};
+ char c_sem_name[32] = {0};
+ void *pv_share_mem_addr = NULL;
+ int32 n;
+ RET_API l_ret_api;
+
+ /* Create Mutex */
+ _tcscpy(c_sem_name, "POS_BASE_EVENT_MUTEX");
+ p_inst->id_event_table_sem = _pb_CreateSemaphore(c_sem_name); // LCOV_EXCL_BR_LINE 200: can not be 0
+ if (p_inst->id_event_table_sem == 0) /* When mutex creation fails */ { // LCOV_EXCL_BR_LINE 200: can not be 0
+ // LCOV_EXCL_START 200: can not be 0
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "_pb_CreateSemaphore ERROR [name:%s]", c_sem_name);
+ _pb_Exit();
+ // LCOV_EXCL_STOP
+ }
+
+ l_ret_api = _pb_SemLock(p_inst->id_event_table_sem); /* Get event-control-table-locking Mutex */
+ if (l_ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+
+ /* Initialize table of handles. */
+ for (n = 0; n < MAX_PB_EVENTS; n++) {
+ p_inst->p_handle_table[n] = NULL;
+ }
+
+ /* Generate shared memory name */
+ _tcscpy(c_share_mem_name, "POS_BASE_EVENT_TABLE");
+
+ /* Link to event information storage area */
+ ret_api = _pb_LinkShareData(c_share_mem_name, &pv_share_mem_addr, &ul_share_mem_size);
+ if (ret_api != RET_NORMAL) /* When the link fails */ {
+ /* Generate shared memory */
+ ret_api = _pb_CreateShareData(c_share_mem_name,
+ static_cast<u_int32>((sizeof(PB_EVENT) * MAX_PB_EVENTS)), &pv_share_mem_addr);
+
+ /* Terminate processing when generating fails */
+ if (ret_api != RET_NORMAL) {
+ ret_api = RET_ERRINIT; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ } else {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* Event information storage area initialization processing */
+ p_event_table = reinterpret_cast<PB_EVENT*>(pv_share_mem_addr);
+ for (n = 0; n < MAX_PB_EVENTS; n++) {
+ memset(reinterpret_cast<void *>(p_event_table[n].event_name), 0, \
+ sizeof(p_event_table[n].event_name));
+ p_event_table[n].l_event_val = 0;
+ for (int wcn = 0; wcn < MAX_PB_EVENT_WAIT_THREADS; wcn++) {
+ p_event_table[n].st_condition[wcn].uc_use_flag = FALSE; /* Initialize to unused */
+ p_event_table[n].st_condition[wcn].uc_waiting = FALSE;
+ p_event_table[n].st_condition[wcn].us_mode = 0;
+ p_event_table[n].st_condition[wcn].ul_mask = 0; /* Initialize Mask Value */
+ p_event_table[n].st_condition[wcn].l_min_val = 0;
+ p_event_table[n].st_condition[wcn].l_max_val = 0;
+ /* Initialize event values at WaitEvent Returns */
+ p_event_table[n].st_condition[wcn].l_last_val = 0;
+ p_event_table[n].st_condition[wcn].flag_id[p_event_table->proc_cnt] = 0;
+ }
+
+ p_event_table[n].l_process_ref = 0;
+ p_event_table[n].l_reset_data = 0;
+ p_event_table[n].uc_manual_reset = _CWORD64_EVENT_MANUALRESET_OFF;
+ }
+ }
+ } else {
+ /* When the link is successful */
+ p_event_table = reinterpret_cast<PB_EVENT*>(pv_share_mem_addr);
+ p_event_table->proc_cnt++;
+ }
+
+ if (ret_api == RET_NORMAL) /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ {
+ g_my_proc_cnt = p_event_table->proc_cnt;
+ /* Get the address of the acquired event information storage area. */
+ p_inst->h_shared_memory = (HANDLE)pv_share_mem_addr;
+ p_inst->p_event_table = reinterpret_cast<PB_EVENT*>(pv_share_mem_addr);
+ }
+
+ _pb_SemUnlock(p_inst->id_event_table_sem); // LCOV_EXCL_BR_LINE 200: no branch
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Event-related instance destruction processing
+ *
+ * Delete a Flag from the CLS Event Library (Not implemented)
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERROR ABEND
+ */
+RET_API EventTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ char c_share_mem_name[32] = {0};
+
+ RET_API ret_api = RET_NORMAL;
+
+ /* TODO:Implement processing to delete event flags */
+
+ /* Generate shared memory name */
+ _tcscpy(c_share_mem_name, "POS_BASE_EVENT_TABLE");
+
+ /* Discard the semaphore if it has already been created */
+ if (p_inst->id_event_table_sem != 0) {
+ PbDeleteSemaphore(p_inst->id_event_table_sem);
+ p_inst->id_event_table_sem = 0;
+ }
+
+ /* Discard the shared memory if it has already been created */
+ if (p_inst->h_shared_memory != NULL) {
+ /* Release shared memory */
+ PbDeleteShareData(c_share_mem_name);
+ p_inst->h_shared_memory = NULL;
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Create the event
+ *
+ * Create an event with the specified name and returns the event ID.<br>
+ * If it has already been generated, the event ID is searched and returned.
+ *
+ * @param[in] uc_manual_reset
+ * @param[in] l_init_data
+ * @param[in] *cp_event_name Pointer to the names of the event to be generated (NULL termination string)
+ *
+ * @return Non-zero Generated event ID<br>
+ * 0 Event generation error
+ */
+EventID _pb_CreateEvent(u_int8 uc_manual_reset, int32 l_init_data, // NOLINT(readability/nolint)
+ char *cp_event_name) { // NOLINT(readability/nolint)
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ EventID ret_event_id = 0;
+ TCHAR *p_event_name = NULL;
+ u_int32 index = 0;
+ BOOL bret = FALSE;
+ BOOL check_status = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ RET_API l_ret_api;
+
+ /* Parameter check */
+ if ((cp_event_name == NULL) ||
+ (uc_manual_reset >= _CWORD64_EVENT_MANUALRESET_MAX)) {
+ check_status = FALSE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+#ifdef UNICODE
+ /* Event name character limit processing */
+ if (strlen(cp_event_name) > MAX_EVENT_NAME_LEN) {
+ _pb_Exit(); /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ TCHAR unicodeEventName[MAX_EVENT_NAME_LEN + 1]; /* Maxmum nunber of characters + NULL area */
+ mbstowcs(unicodeEventName, cp_event_name, MAX_EVENT_NAME_LEN);
+ p_event_name = unicodeEventName;
+#else
+ p_event_name = cp_event_name;
+#endif // UNICODE
+
+ if ((check_status == TRUE) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (p_event_name[0] == __TEXT('\0'))) {
+ check_status = FALSE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Event name character limit processing */
+ if ((check_status == TRUE) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ (_tcslen(p_event_name) < MAX_EVENT_NAME_LEN)) {
+ l_ret_api = _pb_SemLock(p_inst->id_event_table_sem); /* Mutex from here */
+ if (l_ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+
+ /* Search the event table by the specified event name */
+ bret = FindEventTable(p_inst->p_event_table, p_event_name, &index);
+ /* If the same event already exists on the system */
+ if (bret != FALSE) {
+ ret_event_id = EventCreateNewEventInProcess(index); // LCOV_EXCL_BR_LINE 200: no branch
+ } else {
+ /* When creating a new file */
+ ret_event_id = EventCreateNewEventInSystem(uc_manual_reset, l_init_data, p_event_name); // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+ }
+
+ _pb_SemUnlock(p_inst->id_event_table_sem); // LCOV_EXCL_BR_LINE 200: no branch
+ }
+
+ return ret_event_id;
+}
+
+/**
+ * @brief
+ * Set the event
+ *
+ * Set the event value by specifying the event ID acquired when the event was created.<br>
+ * The event value setting modes are as follows.<br>
+ * SAPI_EVSET_ABSOLUTE : Absolute value setting(Specify the value to be set.)<br>
+ * SAPI_EVSET_RELATE : Relative value setting(Specifies the value relative to the current value.)
+ *
+ * @param[in] event_id Specify the event ID for which the event value is to be set.
+ * @param[in] l_set_mode Specify the event value setting mode
+ * @param[in] l_Val Specify the event value to be set
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Configuration mode error<br>
+ * RET_EV_NONE Specified event does not exist<br>
+ * RET_EV_MAX The set event value exceeds the maximum value<br>
+ * RET_EV_MIN The set event value is below the minimum value.
+ */
+RET_API _pb_SetEvent(EventID event_id, int32 l_set_mode, int32 l_val) { // NOLINT(readability/nolint)
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ RET_API ret_sts = RET_EV_NONE;
+ int32 l_work_val = 0;
+ u_int32 ul_index = (u_int32)event_id - 1;
+
+ /* Parameter check */
+ if (ul_index < MAX_PB_EVENTS) {
+ /* If the specified event ID value is within range */
+ p_event_open = p_inst->p_handle_table[ul_index];
+ /* If the specified event ID is registered in the table, */
+ if (p_event_open != NULL) {
+ /* Determine the event setting mode and call the event value setting function. */
+ if (l_set_mode == SAPI_EVSET_ABSOLUTE) {
+ ret_sts = SetProc(p_event_open, EVSET_ABSOLUTE, l_val, &l_work_val); // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+ } else if (l_set_mode == SAPI_EVSET_RELATE) {
+ ret_sts = SetProc(p_event_open, EVSET_RELATE, l_val, &l_work_val); // LCOV_EXCL_BR_LINE 200: no branch
+ } else {
+ ret_sts = RET_ERRPARAM;
+ }
+ }
+ }
+
+ return ret_sts;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SetandEvent()
+ * ABSTRACT : Event value AND setting process
+ * NOTE : Set the logical AND result of the specified mask value to the event value of the specified event ID.
+ * ARGUMENT : EventID event_id Specify the event ID to wait for an event
+ * : u_int32 ul_mask Mask value to be logically ANDed with the event value
+ * : int32* pl_val Pointer to the area to store the pre-event value
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_EV_NONE Specified event does not exist
+ * : RET_ERROR
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SetandEvent(EventID event_id, u_int32 ul_mask, int32* pl_val) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ RET_API ret_sts = RET_EV_NONE;
+ u_int32 ul_index = (u_int32)event_id - 1;
+
+ /* Parameter check */
+ if ((ul_index < MAX_PB_EVENTS) &&
+ (pl_val != NULL)) {
+ /* If the specified event ID value is within range */
+ p_event_open = p_inst->p_handle_table[ul_index];
+ /* If the specified event ID is registered in the table, */
+ if (p_event_open != NULL) {
+ ret_sts = SetProc(p_event_open, EVSET_AND, static_cast<int32>(ul_mask), pl_val);
+ }
+ }
+
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SetorEvent()
+ * ABSTRACT : Event value OR setting process
+ * NOTE : Set the logical OR result of the specified mask value and the event value of the specified event ID.
+ * ARGUMENT : EventID event_id Specify the event ID to wait for an event.
+ * : u_int32 ul_mask Mask value to be logically ANDed with the event value
+ * : int32* pl_val Pointer to the area to store the pre-event value
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_EV_NONE Specified event does not exist
+ * : RET_ERROR
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SetorEvent(EventID event_id, u_int32 ul_mask, int32* pl_val) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ RET_API ret_sts = RET_EV_NONE;
+ u_int32 ul_index = (u_int32)event_id - 1;
+
+ /* Parameter check */
+ if ((ul_index < MAX_PB_EVENTS) &&
+ (pl_val != NULL)) {
+ /* If the specified event ID value is within range */
+ p_event_open = p_inst->p_handle_table[ul_index];
+
+ /* If the specified event ID is registered in the table, */
+ if (p_event_open != NULL) {
+ ret_sts = SetProc(p_event_open, EVSET_OR, static_cast<int32>(ul_mask), pl_val);
+ }
+ }
+
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Wait for the event
+ *
+ * Wait until the event value of the specified event ID reaches the specified range.
+ *
+ * @param[in] event_id Specify the event ID for which the event value is to be set.
+ * @param[in] l_wait_mode Monitoring mode of event * Current only SAPI_EVWAIT_VAL is allowed
+ * @param[in] l_min_val Minimum Event Wait
+ * @param[in] l_max_val Maximum value waiting for an event
+ * @param[in] *pl_event_val Pointer to the event value storage area after waiting for an event
+ * @param[in] ul_mill_sec_time Timeout period(ms)
+ *
+_ * @return RET_NORMAL Normal completion<br>
+ * RET_EV_NONE Specified event does not exist<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_WaitEvent(EventID event_id, int32 l_wait_mode, int32 l_min_val, // NOLINT(readability/nolint)
+ int32 l_max_val, int32* pl_event_val, u_int32 ul_mill_sec_time) { // NOLINT(readability/nolint)
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ WAITING_CONDITION st_condition = {0};
+ RET_API ret_sts = RET_EV_NONE;
+ u_int32 ul_index = (u_int32)event_id - 1;
+
+ /* Parameter check */
+ if ((pl_event_val != NULL) &&
+ (ul_index < MAX_PB_EVENTS)) {
+ p_event_open = p_inst->p_handle_table[ul_index];
+
+ /* If the specified event ID is registered in the table, */
+ if (p_event_open != NULL) {
+ /* Set Wait Mode and Mask Value to Parameter Blk */
+ st_condition.us_mode = EVWAIT_VAL;
+ st_condition.l_min_val = l_min_val;
+ st_condition.l_max_val = l_max_val;
+
+ /* Call the event wait processing */
+ ret_sts = WaitProc(p_event_open, &st_condition, ul_mill_sec_time); // LCOV_EXCL_BR_LINE 200: no branch
+ if (ret_sts == RET_NORMAL) {
+ *pl_event_val = st_condition.l_last_val;
+ }
+ }
+ }
+
+ return ret_sts;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : WaitallclrEvent()
+ * ABSTRACT : Event Bit Clear Wait
+ * NOTE : Wait until all the bits specified by the mask value are cleared
+ * : for the event value of the specified event ID.
+ * ARGUMENT : EventID event_id Specifies the event ID to wait for an event.
+ * : u_int32 ul_mask Mask value waiting for an event (Bit pattern)
+ * : int32* pl_val Pointer to the event value storage area after waiting for an event
+ * : u_itn32 ul_mill_sec_time Timeout period(ms)
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_EV_NONE Specified event does not exist
+ * : RET_ERROR Maximum number of waiting threads exceeded
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+WaitallclrEvent(EventID event_id, u_int32 ul_mask, int32* pl_val, u_int32 ul_mill_sec_time) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ WAITING_CONDITION st_condition = {0};
+ RET_API ret_sts = RET_EV_NONE;
+ u_int32 ul_index = static_cast<u_int32>(event_id) - 1;
+
+ /* Parameter check */
+ if ((pl_val != NULL) &&
+ (ul_index < MAX_PB_EVENTS)) {
+ p_event_open = p_inst->p_handle_table[ul_index];
+
+ /* If the specified event ID is registered in the table, */
+ if (p_event_open != NULL) {
+ /* Set Wait Mode and Mask Value to Parameter Blk */
+ st_condition.us_mode = EVWAIT_ALLCLR;
+ st_condition.ul_mask = ul_mask;
+
+ /* Call the event wait processing */
+ ret_sts = WaitProc(p_event_open, &st_condition, ul_mill_sec_time);
+ if (ret_sts == RET_NORMAL) {
+ *pl_val = st_condition.l_last_val;
+ }
+ }
+ }
+
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : WaitanysetEvent()
+ * ABSTRACT : Event Bit Set Waiting Process
+ * NOTE : Wait until one of the bits specified by the mask value is set
+ * : for the event value of the specified event ID.
+ * ARGUMENT : EventID event_id Specify the event ID to wait for an event.
+ * : u_int32 ul_mask Mask value waiting for an event
+ * : int32* ipVal Pointer to the event value storage area after waiting for an event
+ * : u_itn32 ul_mill_sec_time Timeout period(ms)
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_EV_NONE Specified event does not exist
+ * : RET_ERROR When the maximum number of waiting events is exceeded
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+WaitanysetEvent(EventID event_id, u_int32 ul_mask, int32* pl_val, u_int32 ul_mill_sec_time) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ WAITING_CONDITION st_condition = {0};
+ RET_API ret_sts = RET_EV_NONE;
+ u_int32 ul_index = (u_int32)event_id - 1;
+
+ /* Parameter check */
+ if ((pl_val != NULL) &&
+ (ul_index < MAX_PB_EVENTS)) {
+ p_event_open = p_inst->p_handle_table[ul_index];
+
+ /* If the specified event ID is registered in the table, */
+ if (p_event_open != NULL) {
+ /* Set Wait Mode and Mask Value to Parameter Blk */
+ st_condition.us_mode = EVWAIT_ANYSET;
+ st_condition.ul_mask = ul_mask;
+
+ /* Call the event wait processing */
+ ret_sts = WaitProc(p_event_open, &st_condition, ul_mill_sec_time);
+ if (ret_sts == RET_NORMAL) {
+ *pl_val = st_condition.l_last_val;
+ }
+ }
+ }
+
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : LookupEvent()
+ * ABSTRACT : Event value reading process
+ * NOTE : Read the event value of the specified event ID.
+ * ARGUMENT : EventID event_id Specify the event ID to read the event value from.
+ * : int32 *iEventVal Pointer to the read event value storage area
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_EV_NONE Specified event does not exist
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+LookupEvent(EventID event_id, int32* pl_event_val) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ u_int32 ul_index = (u_int32)event_id - 1;
+ RET_API ret_sts = RET_EV_NONE;
+
+ /* Parameter check */
+ if ((pl_event_val != NULL) &&
+ (ul_index < MAX_PB_EVENTS)) {
+ p_event_open = p_inst->p_handle_table[ul_index];
+
+ /* When the specified event ID is already registered in the table */
+ if (p_event_open != NULL) {
+ EventLockMutex(p_event_open);
+ /* Store the current event value. */
+ *pl_event_val = static_cast<int32>(p_event_open->p_sys_event->l_event_val);
+ EventUnlockMutex(p_event_open);
+ ret_sts = RET_NORMAL;
+ }
+ }
+
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Delete the event
+ *
+ * Delete the event with the specified event ID.
+ *
+ * @param[in] event_id Specify the event ID for which the event value is to be set.
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_EV_NONE Specified event does not exist
+ */
+RET_API _pb_DeleteEvent(EventID event_id) { // NOLINT(readability/nolint)
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ RET_API ret_api = RET_EV_NONE;
+ u_int32 index = static_cast<u_int32>(event_id) - 1;
+ EV_ERR ev_err;
+ RET_API l_ret_api;
+
+ /* Parameter check */
+ if (index < MAX_PB_EVENTS) {
+ p_event_open = p_inst->p_handle_table[index];
+ /* When the specified event ID is registered in the table */
+ if (p_event_open != NULL) {
+ ret_api = RET_NORMAL;
+ }
+ }
+
+ /* Parameter normal */
+ if (ret_api == RET_NORMAL) {
+ l_ret_api = _pb_SemLock(p_inst->id_event_table_sem);
+ if (l_ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed");
+ }
+
+ /* When no one references in the same process */
+ if ((p_event_open->l_thread_ref - 1) <= 0) {
+ /* Delete event flag */
+ ev_err = EV_destroy_flag(p_event_open->p_sys_event->st_condition[0].flag_id[g_my_proc_cnt]);
+ /* When initialization fails */
+ if (ev_err == EV_OK) {
+ p_event_open->p_sys_event->st_condition[0].flag_id[g_my_proc_cnt] = 0;
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "EV_destroy_flag ERROR!! [ev_err=%d, flag_id=0x%x]", \
+ ev_err, p_event_open->p_sys_event->st_condition[0].flag_id[g_my_proc_cnt]);
+
+ ret_api = RET_ERROR;
+ }
+ }
+
+ /* When the event flag is deleted successfully */
+ if (ret_api == RET_NORMAL) {
+ /* Reduce the number of event references in the same process */
+ p_event_open->l_thread_ref--;
+
+ /* When no one references in the same process */
+ if (p_event_open->l_thread_ref <= 0) {
+ /* Reduce the number of event references in the system */
+ p_event_open->p_sys_event->l_process_ref--;
+ }
+
+ /* When no one references in the system */
+ if (p_event_open->p_sys_event->l_process_ref <= 0) {
+ /* Initialization of the target area */
+ FreeEventTable(p_inst->p_event_table, index);
+ }
+
+ /* If no one references in the same process, release the resource here */
+ if (p_event_open->l_thread_ref <= 0) {
+ /* Exclusive deletion for the target event */
+ EventDeleteMutex(p_event_open);
+
+ /* Open the heap area storing the target event. */
+ /* */
+ PbProcessHeapFree(0, p_inst->p_handle_table[index]);
+ p_inst->p_handle_table[index] = NULL;
+ }
+ }
+
+ _pb_SemUnlock(p_inst->id_event_table_sem);
+ }
+
+ return ret_api;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : ResetEvent()
+ * ABSTRACT : Event Clear
+ * NOTE : Specified event clear processing
+ * ARGUMENT : EventID event_id Event ID to reset
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_EV_NONE ABEND
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+ResetEvent(EventID event_id) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ RET_API ret_sts = RET_EV_NONE;
+ u_int32 ul_index = (u_int32)event_id - 1;
+
+ /* Parameter check */
+ if (ul_index < MAX_PB_EVENTS) {
+ p_event_open = p_inst->p_handle_table[ul_index];
+
+ /* When the specified event ID is already registered in the table */
+ if (p_event_open != NULL) {
+ EventLockMutex(p_event_open);
+
+ /* Clear the event value */
+ p_event_open->p_sys_event->l_event_val = p_event_open->p_sys_event->l_reset_data;
+
+ EventUnlockMutex(p_event_open);
+ ret_sts = RET_NORMAL;
+ }
+ }
+
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/* Private functions. */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SetProc()
+ * ABSTRACT : General Event Configuration Processing
+ * NOTE : Sets the event according to the specified event setting method.
+ * ARGUMENT : PB_EVENT_OPEN_HANDLE* p_event_open Pointer to manage event waiting for the event TBL
+ * : int32 i_mode Event setting method
+ * : int32 iVal Event setting value
+ * : int32* ipVal Pointer to the area to store the pre-event value
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_ERROR
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static RET_API
+SetProc(PB_EVENT_OPEN_HANDLE* p_event_open, int32 i_mode, int32 l_val, int32* lpVal) {
+ RET_API ret_sts = RET_NORMAL;
+ int32 lTempEventData = 0;
+ int32 lTestValue = 0;
+ BOOL bCastCondFlag = FALSE;
+
+ EventLockMutex(p_event_open);
+
+ /* Get current event value */
+ lTempEventData = p_event_open->p_sys_event->l_event_val;
+ *lpVal = p_event_open->p_sys_event->l_event_val; /* Set the value before the event operation */
+
+ /* Switch Processing by event configuration mode */
+ switch (i_mode) { // LCOV_EXCL_BR_LINE 200:only the first two cases will be called
+ case EVSET_ABSOLUTE: /* In absolute mode */ {
+ /* Updating event values with specified values */
+ lTempEventData = l_val;
+ break;
+ }
+ case EVSET_RELATE: /* In relative setting mode */ {
+ lTestValue = lTempEventData + l_val;
+ /* Exceeding representable event value */
+ if ((l_val > 0) && (lTempEventData > lTestValue)) {
+ ret_sts = RET_EV_MAX;
+ }
+ /* Below representable event value */
+ if ((l_val < 0) && (lTempEventData < lTestValue)) {
+ ret_sts = RET_EV_MIN;
+ }
+ /* Normal range */
+ if (ret_sts == RET_NORMAL) {
+ /* Add specified value to event value */
+ lTempEventData += l_val;
+ }
+ break;
+ }
+ case EVSET_AND: { // LCOV_EXCL_BR_LINE 200: i_mode cannot be this value
+ // LCOV_EXCL_START 200: i_mode cannot be this value
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lTempEventData &= ((u_int32)l_val); /* Logical AND of the event value and the specified value */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case EVSET_OR: { // LCOV_EXCL_BR_LINE 200: i_mode cannot be this value
+ // LCOV_EXCL_START 200: i_mode cannot be this value
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lTempEventData |= ((u_int32)l_val); /* Logical AND of the event value and the specified value */
+ break;
+ // LCOV_EXCL_STOP
+ }
+ default: /* Event setting mode error */ // LCOV_EXCL_BR_LINE 200: i_mode cannot be this value
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_sts = RET_ERRPARAM; // LCOV_EXCL_LINE 200: i_mode cannot be this value
+ }
+
+ /* When the manual reset function is enabled */
+
+ if (ret_sts == RET_NORMAL) {
+ /* When the manual reset function is enabled */
+ if (p_event_open->p_sys_event->uc_manual_reset == _CWORD64_EVENT_MANUALRESET_ON) {
+ /* Set event value */
+ p_event_open->p_sys_event->l_event_val = lTempEventData;
+ }
+
+ /* Loop for the maximum number of waiting threads per event and check the condition of event wait processing of the state TBL. */
+ for (DWORD wcn = 0; wcn < MAX_PB_EVENT_WAIT_THREADS; wcn++) {
+ /* If the event wait flag is waiting, */
+ if (p_event_open->p_sys_event->st_condition[wcn].uc_waiting == TRUE) {
+ /* Check if event wait conditions are met */
+ BOOL bret = CheckCondition(p_event_open->p_sys_event, wcn, lTempEventData);
+ /* If the event wait conditions are met, */
+ if (bret == TRUE) {
+ bCastCondFlag = TRUE;
+ /* Save the event value at the time of SetEvent issuance (at the time of WaitEvent return). */
+ p_event_open->p_sys_event->st_condition[wcn].l_last_val = lTempEventData;
+
+ /* Processing to prevent concurrent SetEvent from more than one threads for a single event which is in WAIT state */
+ /* Set WAIT status to wait-canceled */
+ p_event_open->p_sys_event->st_condition[wcn].uc_waiting = FALSE;
+ /* Setting the default min value for event */
+ p_event_open->p_sys_event->st_condition[wcn].l_min_val = MIN_EVENT_VAL;
+ /* Setting the default max event */
+ p_event_open->p_sys_event->st_condition[wcn].l_max_val = MAX_EVENT_VAL;
+
+ /* Signal issuance */
+ (void)EventSendSignal(p_event_open, static_cast<int>(wcn));
+ }
+ }
+ }
+
+ /* When the manual reset function is disabled */
+ if (p_event_open->p_sys_event->uc_manual_reset != _CWORD64_EVENT_MANUALRESET_ON) {
+ /* If no one has issued the event */
+ if (bCastCondFlag == FALSE) {
+ /* Set event value */
+ p_event_open->p_sys_event->l_event_val = lTempEventData;
+ } else {
+ /* If issued event */
+ /* Reset event value */
+ p_event_open->p_sys_event->l_event_val = p_event_open->p_sys_event->l_reset_data;
+ }
+ }
+ }
+
+ EventUnlockMutex(p_event_open);
+
+ return ret_sts;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : WaitProc()
+ * ABSTRACT : Generic Event Wait Processing
+ * NOTE : Wait for an event according to the wait queue of the specified event.
+ * ARGUMENT : PB_EVENT_OPEN_HANDLE* p_event_open Pointer to TBL which is managed waiting for events
+ * : WAITING_CONDITION* st_condition Pointer to the event wait condition setting parameter
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_ERROR The maximum number of waits has been exceeded, or a parameter error has occurred.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static RET_API
+WaitProc(PB_EVENT_OPEN_HANDLE* p_event_open, WAITING_CONDITION* st_condition, u_int32 ul_mill_sec_time) {
+ RET_API ret_sts = RET_ERROR;
+ u_int32 ul_wcn = 0;
+
+ /* Get semaphore for event table */
+ EventLockMutex(p_event_open);
+
+ /* Loop for the maximum number of waiting threads per event and retrieve free area of state TBL */
+ for (ul_wcn = 0; ul_wcn < MAX_PB_EVENT_WAIT_THREADS; ul_wcn++) {
+ if ((p_event_open->p_sys_event->st_condition[ul_wcn].uc_use_flag == FALSE) && \
+ (p_event_open->p_sys_event->st_condition[ul_wcn].uc_waiting == FALSE)) {
+ /* For the unused state TBL */
+ /* If the event wait flag is released, */
+ /* finish searching when free area is found */
+ ret_sts = RET_NORMAL;
+ break;
+ }
+ }
+
+ /* If there is free space in the state TBL */
+ if (ret_sts == RET_NORMAL) {
+ /* Set wait rule for free space of state TBL */
+ /* Determine the wait rule */
+ switch (st_condition->us_mode) { // LCOV_EXCL_BR_LINE 200: can not be EVWAIT_ALLCLR and EVWAIT_ANYSET
+ case EVWAIT_VAL: /* For range waiting */
+ {
+ /* Set event monitoring mode */
+ p_event_open->p_sys_event->st_condition[ul_wcn].us_mode = st_condition->us_mode;
+ /* Set the minimum value for establishing an event */
+ p_event_open->p_sys_event->st_condition[ul_wcn].l_min_val = st_condition->l_min_val;
+ /* Set the maximum value for establishing an event */
+ p_event_open->p_sys_event->st_condition[ul_wcn].l_max_val = st_condition->l_max_val;
+ break;
+ }
+ case EVWAIT_ALLCLR: /* If waiting for the specified bit to be cleared */ // LCOV_EXCL_BR_LINE 200: can not be EVWAIT_ALLCLR
+ case EVWAIT_ANYSET: /* If waiting for the specified bit to be set */ // LCOV_EXCL_BR_LINE 200: can not be EVWAIT_ANYSET
+ {
+ // LCOV_EXCL_START 200: can not be EVWAIT_ANYSET and EVWAIT_ALLCLR
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Set event monitoring mode */
+ p_event_open->p_sys_event->st_condition[ul_wcn].us_mode = st_condition->us_mode;
+ /* Set event wait mask value */
+ p_event_open->p_sys_event->st_condition[ul_wcn].ul_mask = st_condition->ul_mask;
+ break;
+ // LCOV_EXCL_STOP
+ }
+ default:
+ ret_sts = RET_ERROR;
+ }
+ }
+
+ /* When the specified mode is normal */
+ if (ret_sts == RET_NORMAL) {
+ /* Check if event wait conditions are met */
+ BOOL bret = CheckCondition(p_event_open->p_sys_event, ul_wcn, p_event_open->p_sys_event->l_event_val);
+
+ /* Target event received */
+ if (bret == TRUE) {
+ /* Set the received event value */
+ st_condition->l_last_val = p_event_open->p_sys_event->l_event_val;
+ /* Since it does not wait for an event, set the initial value to the state TBL. */
+ p_event_open->p_sys_event->st_condition[ul_wcn].uc_waiting = FALSE;
+ p_event_open->p_sys_event->st_condition[ul_wcn].uc_use_flag = FALSE;
+ /* Set the default minimum value for the event */
+ p_event_open->p_sys_event->st_condition[ul_wcn].l_min_val = MIN_EVENT_VAL;
+ /* Set the default maximum value for the event */
+ p_event_open->p_sys_event->st_condition[ul_wcn].l_max_val = MAX_EVENT_VAL;
+
+ /* When the manual reset function is disabled */
+ if (p_event_open->p_sys_event->uc_manual_reset != _CWORD64_EVENT_MANUALRESET_ON) {
+ /* Initialize event values */
+ p_event_open->p_sys_event->l_event_val = p_event_open->p_sys_event->l_reset_data;
+ }
+ } else {
+ /* When no event is received */
+ /* Set event wait state in free area of state TBL */
+ /* Set event wait flag to waiting */
+ p_event_open->p_sys_event->st_condition[ul_wcn].uc_waiting = TRUE;
+ /* Set table usage flag in use */
+ p_event_open->p_sys_event->st_condition[ul_wcn].uc_use_flag = TRUE;
+
+ /* Perform event wait */
+ ret_sts = EventWaitForSignal(p_event_open, ul_wcn, ul_mill_sec_time);
+ /* Set event wait flag to unused */
+ p_event_open->p_sys_event->st_condition[ul_wcn].uc_waiting = FALSE;
+ /* Set table usage flag to unused */
+ p_event_open->p_sys_event->st_condition[ul_wcn].uc_use_flag = FALSE;
+ /* Set the default minimum value for the event */
+ p_event_open->p_sys_event->st_condition[ul_wcn].l_min_val = MIN_EVENT_VAL;
+ /* Setting the default maximum value for the event */
+ p_event_open->p_sys_event->st_condition[ul_wcn].l_max_val = MAX_EVENT_VAL;
+ /* Set event return value */
+ st_condition->l_last_val = p_event_open->p_sys_event->st_condition[ul_wcn].l_last_val;
+ }
+ }
+
+ /* Release semaphore for event table */
+ EventUnlockMutex(p_event_open);
+
+ return ret_sts;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FindEventTable()
+ * ABSTRACT : Event Table Search Processing
+ * NOTE : Search the event table for the specified event name and return the index number
+ * : of the event if it has been already registerd.
+ * ARGUMENT : PB_EVENT *p_event_table Pointer to the start of event table array in the shared memory
+ * : TCHAR *ptcEventName Event name to search
+ * : u_int32* puc_index storage area for the index number of the specified event table
+ * RETURN : BOOL FALSE No specified event
+ * : TRUE Specified Event Yes
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static BOOL
+FindEventTable(PB_EVENT* p_event_table, TCHAR* ptcEventName, u_int32* puc_index) {
+ u_int32 ul_index = 0;
+ BOOL bret = FALSE;
+
+ for (ul_index = 0; ul_index < MAX_PB_EVENTS; ul_index++) {
+ if (_tcscmp(p_event_table[ul_index].event_name, ptcEventName) == 0) {
+ /* Save target index */
+ *puc_index = ul_index;
+ bret = TRUE;
+ break;
+ }
+ }
+
+ return bret;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : AllocNewEventTable()
+ * ABSTRACT : Event table allocation processing
+ * NOTE : Search the event table pointed to from the beginning for an area in
+ * : which the event name is not registered, and returns its index number.
+ * : The event table structure is allocated as an array in shared memory.
+ * : One element of the array is the event table structure, and its index
+ * : plus one is used as the event ID.
+ * : Whether the event table structure is in use or unused is determined
+ * : by whether the event name is set or not.
+ * : Note: Since the Mutex part inside this function was deleted to
+ * : fix a bug caused by Mutex leak, use Mutex around this function from the
+ * : outside before using this function.
+ * ARGUMENT : PB_EVENT *p_event_table Start pointer of the event table array in shared memory
+ * : TCHAR *name Event name to reserve table Note: Currently unused.
+ * : HANDLE hMutex Mutex handle for event table Note: Currently unused.
+ * RETURN : DWORD other than -1 Index number of the allocted event table
+ * : -1 There is no free space in the event table.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static BOOL
+AllocNewEventTable(PB_EVENT* p_event_table, u_int32* puc_index) {
+ u_int32 ul_index = 0;
+ BOOL bret = FALSE;
+
+ for (ul_index = 0; ul_index < MAX_PB_EVENTS; ul_index++) {
+ if (p_event_table[ul_index].event_name[0] == __TEXT('\0')) {
+ *puc_index = ul_index;
+ bret = TRUE;
+ break;
+ }
+ }
+
+ return bret;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FreeEventTable()
+ * ABSTRACT : Event table release processing
+ * NOTE : Initialize the event name and event value of the index number
+ * : of the specified event table to make them free.
+ * ARGUMENT : PB_EVENT *p_event_table Start pointer of the event table array in shared memory
+ * : int index Index number of the event table to release
+ * : HANDLE hMutex Mutex handle for event table
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static void
+FreeEventTable(PB_EVENT* p_event_table, int index) {
+ p_event_table[index].event_name[0] = __TEXT('\0');
+ p_event_table[index].l_event_val = 0;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : CheckCondition()
+ * ABSTRACT : Event condition determination processing
+ * NOTE : Check whether the event value of the specified event table is
+ * : satisfied as an event wait condition.
+ * ARGUMENT : PB_EVENT *p_event_table Start pointer of the event table array in shared memory
+ * : DWORD wcn Index number of the event table to be checked
+ * RETURN : BOOL TRUE Condition satisfied
+ * : FALSE Condition not met
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static BOOL CheckCondition(PB_EVENT* p_sys_event, DWORD wcn, int32 l_event_data) {
+ BOOL bret = FALSE;
+
+ if (p_sys_event != NULL) { // LCOV_EXCL_BR_LINE 6: p_sys_event can not be NULL
+ /* Determine the wait mode of the event state TBL. */
+ switch (p_sys_event->st_condition[wcn].us_mode) { // LCOV_EXCL_BR_LINE 200: EVWAIT_ALLCLR and EVWAIT_ANYSET will not be called // NOLINT(whitespace/line_length)
+ case EVWAIT_VAL: /* For value range wait */
+ {
+ /* Check whether the event value is within the condition satisfied range */
+ if ((l_event_data >= p_sys_event->st_condition[wcn].l_min_val) &&
+ (l_event_data <= p_sys_event->st_condition[wcn].l_max_val)) {
+ bret = TRUE;
+ }
+ break;
+ }
+ case EVWAIT_ALLCLR: /* When waiting for all specified bits to be cleared */ // LCOV_EXCL_BR_LINE 200: can not be EVWAIT_ALLCLR // NOLINT(whitespace/line_length)
+ {
+ // LCOV_EXCL_START 200: can not be EVWAIT_ALLCLR
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if ((((u_int32)l_event_data) & p_sys_event->st_condition[wcn].ul_mask) == EVENT_BIT_ZERO) {
+ bret = TRUE;
+ }
+ break;
+ // LCOV_EXCL_STOP
+ }
+ case EVWAIT_ANYSET: /* If the specified bit is waiting to set any bits */ // LCOV_EXCL_BR_LINE 200: can not be EVWAIT_ANYSET // NOLINT(whitespace/line_length)
+ {
+ // LCOV_EXCL_START 200: can not be EVWAIT_ALLCLR
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if ((((u_int32)l_event_data) & p_sys_event->st_condition[wcn].ul_mask) != EVENT_BIT_ZERO) {
+ bret = TRUE;
+ }
+ break;
+ // LCOV_EXCL_STOP
+ }
+ default: /* If the wait mode is out of range, */
+ break; /* return with error */
+ }
+ }
+
+ return bret;
+}
+
+/**
+ * @brief
+ * Event generation processing
+ *
+ * @param[in] u_int8 uc_manual_reset
+ * @param[in] int32 l_init_data
+ * @param[in] char *cp_event_name Pointer to the names of event to be generated (NULL termination string)
+ * @return EventID Non-zero Event ID created<br>
+ * 0 Event generation error
+ */
+static EventID EventCreateNewEventInSystem(u_int8 uc_manual_reset, int32 l_init_data, TCHAR* p_event_name) {
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ PB_EVENT *p_sys_event = NULL;
+ EventID ret_event_id = 0;
+ u_int32 ul_index = 0;
+ BOOL bret = FALSE;
+ EV_ERR ev_err;
+
+ /* Parameter check */
+ if (p_event_name != NULL) { // LCOV_EXCL_BR_LINE 6: p_event_name can not be NULL
+ /* Parameter normal */
+ /* Get the index number of the newly created event table */
+ bret = AllocNewEventTable(p_inst->p_event_table, &ul_index);
+
+ /* When there is no free space */
+ if (bret == FALSE) {
+ /* Error log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_CWORD64_api.dll:_pb_CreateEvent : AllocNewEventTable Full... \r\n");
+ }
+ }
+
+ /* When there is free space */
+ if (bret != FALSE) {
+ /* allocate event table to generate from heap */
+ /* */
+ p_event_open = reinterpret_cast<PB_EVENT_OPEN_HANDLE*>(PbProcessHeapAlloc(0, sizeof(PB_EVENT_OPEN_HANDLE))); // LCOV_EXCL_BR_LINE 200: can not be NULL // NOLINT(whitespace/line_length)
+
+ /* Failure in allocating heap area */
+ if (p_event_open == NULL) { // LCOV_EXCL_BR_LINE 200: can not be NULL
+ // LCOV_EXCL_START 200: can not be NULL
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ bret = FALSE;
+ /* Error log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_CWORD64_api.dll:_pb_CreateEvent : CreateHeap ... GetAddr[0x%08x], size[%ld] \r\n",
+ p_event_open, sizeof(PB_EVENT_OPEN_HANDLE));
+ // LCOV_EXCL_STOP
+ }
+ }
+
+ /* When the heap area can be allocated */
+ if (bret != FALSE) {
+ /* Initialization of generated event management information */
+ p_event_open->index = ul_index;
+ p_event_open->p_sys_event = &p_inst->p_event_table[ul_index];
+ p_event_open->l_thread_ref = 1;
+
+ /* Initialization processing of event information storage area */
+ p_sys_event = p_event_open->p_sys_event;
+ _tcscpy(p_sys_event->event_name, p_event_name); /* Event name registration */
+ p_sys_event->l_event_val = l_init_data; /* Default setting */
+ for (u_int32 ul_wcn = 0; ul_wcn < MAX_PB_EVENT_WAIT_THREADS; ul_wcn++) {
+ p_sys_event->st_condition[ul_wcn].uc_use_flag = FALSE;
+ p_sys_event->st_condition[ul_wcn].uc_waiting = FALSE;
+ p_sys_event->st_condition[ul_wcn].us_mode = 0;
+ p_sys_event->st_condition[ul_wcn].l_min_val = MIN_EVENT_VAL;
+ p_sys_event->st_condition[ul_wcn].l_max_val = MAX_EVENT_VAL;
+
+ /* Create Event Flag */
+ ev_err = EV_create_flag_auto_id(&(p_sys_event->st_condition[0].flag_id[g_my_proc_cnt])); // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+ if (ev_err != EV_OK) /* When initialization fails */ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "EV_create_flag_auto_id ERROR!! [ev_err=%d, flag_id=0x%x", \
+ ev_err, p_sys_event->st_condition[0].flag_id[g_my_proc_cnt]);
+
+ /* Release heap space */
+ PbProcessHeapFree(0, p_event_open); // LCOV_EXCL_BR_LINE 200: no branch
+
+ ret_event_id = 0;
+ bret = FALSE;
+ }
+ }
+
+ if (bret != FALSE) {
+ p_sys_event->l_process_ref = 1; /* Set the number of references to this event. */
+ p_sys_event->l_reset_data = l_init_data; /* Default setting */
+ p_sys_event->uc_manual_reset = uc_manual_reset; /* Setting for a manual reset */
+
+ /* Create an event table Mutex and set it in the event table. */
+ bret = EventCreateMutex(p_event_open);
+ /* If generating fails, reset is executed. */
+ if (bret == FALSE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "_CWORD64_api.dll:%s:LINE %d\r\n", LTEXT(__FILE__), __LINE__); \
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "CreateMutex Err ... Event Name[%s]\r\n", p_event_name);
+ _pb_Exit();
+ }
+
+ /* Register event table with event instance */
+ p_inst->p_handle_table[ul_index] = p_event_open;
+ ret_event_id = ul_index + 1;
+ }
+ }
+
+ return ret_event_id;
+}
+
+/**
+ * @brief
+ * Event generation processing
+ *
+ * @param[in] char *cpEventName Pointer to name of the event to be generated (NULL termination string)
+ * @return EventID Non-zero Event ID created<br>
+ * 0 Event generation error
+ */
+static EventID EventCreateNewEventInProcess(u_int32 index) {
+ PB_EVENT_OPEN_HANDLE *p_event_open = NULL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ EventID ret_event_id = 0;
+ EV_ERR ev_err;
+
+ /* Already created in the same process */
+ if (p_inst->p_handle_table[index] != NULL) { // LCOV_EXCL_BR_LINE 200: can not be NULL
+ /* When the number of event references in the same process is less than the upper limit */
+ if (p_inst->p_handle_table[index]->l_thread_ref < _CWORD64_EVENT_MAXOPEN_IN_PROCESS) {
+ /* Increase the number of thread references */
+ (p_inst->p_handle_table[index]->l_thread_ref)++;
+ ret_event_id = index + 1;
+ } else {
+ /* When the number of event references in the same process is the upper limit */
+ /* Error log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_CreateEvent Err ... Event Max In Process : EventName[%s]\r\n",
+ p_inst->p_handle_table[index]->p_sys_event->event_name);
+ }
+ } else {
+ /* Creating for the first time in the process */
+ /* Checking the upper limit of the reference count of the same event in the system */
+ if (p_inst->p_event_table[index].l_process_ref < _CWORD64_EVENT_MAXOPEN_IN_SYSTEM) {
+ /* Allocate event table to generate from heap */
+ /* */
+ p_event_open = reinterpret_cast<PB_EVENT_OPEN_HANDLE*>(PbProcessHeapAlloc(0, \
+ sizeof(PB_EVENT_OPEN_HANDLE)));
+
+ /* Failure in allocating heap area */
+ if (p_event_open == NULL) {
+ /* Error log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "_CWORD64_api.dll:_pb_CreateEvent : CreateHeap ... GetAddr[0x%08x], size[%ld] \r\n", \
+ p_event_open, sizeof(PB_EVENT_OPEN_HANDLE));
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
+ "_pb_CreateEvent Err ... Event Max In sYSTEM : EventName[%s]\r\n",
+ p_inst->p_handle_table[index]->p_sys_event->event_name);
+ }
+
+ /* When heap allocation is successful */
+ if (p_event_open != NULL) {
+ /* When it is not created in the same process, set each data. */
+ /* Set the index to which the event name is registered */
+ p_event_open->index = index;
+ /* Initialize the reference count of the threads referencing this event in the same process. */
+ p_event_open->l_thread_ref = 1;
+ /* Set event instance start address */
+ p_event_open->p_sys_event = &p_inst->p_event_table[index];
+ /* Add the reference count of the process referencing this event in the system. */
+ p_event_open->p_sys_event->l_process_ref++;
+
+ /* Create an event flag */
+ ev_err = EV_create_flag_auto_id(&(p_event_open->p_sys_event->st_condition[0].flag_id[g_my_proc_cnt]));
+ if (ev_err != EV_OK) /* When initialization fails */ {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "EV_create_flag_auto_id ERROR!! [ev_err=%d, flag_id=0x%x]",
+ ev_err, p_event_open->p_sys_event->st_condition[0].flag_id[g_my_proc_cnt]);
+
+ /* Release heap space */
+ PbProcessHeapFree(0, p_event_open);
+
+ ret_event_id = 0;
+ } else {
+ /* Even if event information already exists in the system, the Mutex is created for each process. */
+ (void)_pb_CreateMutex(NULL, FALSE, p_event_open->p_sys_event->name_of_mutex);
+
+ p_inst->p_handle_table[index] = p_event_open; /* Register event tables with event instance */
+ ret_event_id = index + 1;
+ }
+ }
+ }
+
+ return ret_event_id;
+}
+
+/**
+ * @brief
+ * Send the signal
+ *
+ * Sends the specified event signal.
+ *
+ * - Sending signals in the CLS event library
+ *
+ * @param[in] PB_EVENT_OPEN_HANDLE *p_evet_open_handle
+ * @param[in] u_int32 ul_index
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERROR Other errors
+ */
+static RET_API EventSendSignal(PB_EVENT_OPEN_HANDLE *p_evet_open_handle, u_int32 ul_index) {
+ RET_API ret_api = RET_NORMAL;
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ EV_ERR ev_err;
+ int32 i;
+ BOOL errFlag = TRUE;
+
+ if ((p_evet_open_handle != NULL) &&
+ (ul_index < MAX_PB_EVENT_WAIT_THREADS)) {
+ for (i = 0; i <= p_inst->p_event_table->proc_cnt; i++) {
+ /* Signal issuance */
+ if (p_evet_open_handle->p_sys_event->st_condition[ul_index].flag_id[i] != 0) {
+ ev_err = EV_set_flag(p_evet_open_handle->p_sys_event->st_condition[ul_index].flag_id[i], 1);
+ if (ev_err == EV_OK) {
+ errFlag = FALSE;
+ }
+ }
+ }
+ }
+
+ if (errFlag == TRUE) /* Event issuance NG */ {
+ ret_api = RET_ERROR;
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Wait for the signal
+ *
+ * Wait until the specified signal is received. Timeout can be specified (ms).
+ * When this API is called, the semaphore for the event element must be acquired.
+ *
+ * Receive a signal in the CLS event library.
+ *
+ * @param[in] *p_evet_open_handle
+ * @param[in] ul_index
+ * @param[in] ul_mill_sec_time
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRTIMEOUT Timeout End<br>
+ * RET_ERROR Other errors
+ */
+static RET_API EventWaitForSignal(PB_EVENT_OPEN_HANDLE *p_evet_open_handle, u_int32 ul_index, \
+ u_int32 ul_mill_sec_time) {
+ RET_API ret_api = RET_ERRTIMEOUT;
+ EV_ERR ev_err;
+ EV_Flag ev_flag;
+ u_int32 timeOutCnt = 0;
+
+ /* Parameter check */
+ if ((p_evet_open_handle != NULL) && (ul_index < MAX_PB_EVENT_WAIT_THREADS)) { // LCOV_EXCL_BR_LINE 6: param can not be invalid // NOLINT(whitespace/line_length)
+ /* Release semaphore for event table */
+ EventUnlockMutex(p_evet_open_handle); // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Distribute processing by timeout period */
+ /* To check the event occurrence status */
+ if (ul_mill_sec_time == 0) {
+ /* Untreated */
+ } else if (ul_mill_sec_time == INFINITE) {
+ /* Without timeout */
+ ret_api = RET_NORMAL;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "EV_wait_flag CALL [flag_id=0x%x]",
+ p_evet_open_handle->p_sys_event->st_condition[ul_index].flag_id[g_my_proc_cnt]);
+
+ /* Wait for event flag */
+ ev_err = EV_wait_flag(p_evet_open_handle->p_sys_event->st_condition[ul_index].flag_id[g_my_proc_cnt], \
+ &ev_flag); // LCOV_EXCL_BR_LINE 200: no branch
+ if (ev_err != EV_OK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "EV_wait_flag ERROR!! [ev_err=%d]", ev_err);
+ ret_api = RET_ERROR;
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, \
+ "EV_wait_flag RETURN [ev_err=%d]", ev_err);
+ }
+ } else {
+ /* When the timeout period is specified */
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "EV_get_flag CALL [flag_id=0x%x]",
+ p_evet_open_handle->p_sys_event->st_condition[ul_index].flag_id[g_my_proc_cnt]);
+
+ while (1) {
+ /* Get elag event */
+ ev_err = EV_get_flag(p_evet_open_handle->p_sys_event->st_condition[ul_index].flag_id[g_my_proc_cnt], \
+ &ev_flag); // LCOV_EXCL_BR_LINE 200: no branch
+ if (ev_err == EV_OK) {
+ if (ev_flag.flagID == EV_NO_ID) {
+ timeOutCnt++;
+ if (timeOutCnt <= ul_mill_sec_time) {
+ usleep(1000); // LCOV_EXCL_BR_LINE 200: no branch
+ } else {
+ break; /* Timeout error */
+ }
+ } else {
+ ret_api = RET_NORMAL;
+ break;
+ }
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "EV_get_flag ERROR!! [ev_err=%d]", ev_err);
+ ret_api = RET_ERROR;
+ break;
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "EV_get_flag BREAK [ret_api=%d]", ret_api);
+ }
+
+ /* Get event table semaphore */
+ EventLockMutex(p_evet_open_handle); // LCOV_EXCL_BR_LINE 200: no branch
+ } else {
+ /* Parameter error */
+ ret_api = RET_ERROR;
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Create the mutex for event
+ *
+ * @param[in] *p_evet_open_handle
+ *
+ * @return TRUE Normal completion<br>
+ * FALSE ABENDs
+ */
+static BOOL EventCreateMutex(PB_EVENT_OPEN_HANDLE *p_evet_open_handle) {
+ static u_int8 idx = 0;
+ uint32_t ulPid; /* Process ID */
+ BOOL bret = FALSE;
+ TCHAR name[NAME_MAX];
+ HANDLE handle;
+
+ /* Parameter check */
+ if (p_evet_open_handle != NULL) { // LCOV_EXCL_BR_LINE 6: p_evet_open_handle can not be NULL
+ ulPid = (uint32_t)getpid();
+
+ wsprintf(name, __TEXT("POS_BASE_EVENT_MUTEX%05d_p%d"), idx, ulPid);
+
+ /****************************************/
+ /* Create Mutex */
+ /****************************************/
+ handle = _pb_CreateMutex(NULL, FALSE, name);
+ if (handle != NULL) {
+ _tcscpy(p_evet_open_handle->p_sys_event->name_of_mutex, name);
+ idx++;
+ bret = TRUE;
+ }
+ }
+
+ /* When mutex processing fails */
+ if (bret != TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "bret ERROR [bret:%d]", bret);
+ }
+
+ return bret;
+}
+
+/**
+ * @brief
+ * Lock the mutex for event
+ *
+ * @param[in] *p_evet_open_handle
+ */
+static void EventLockMutex(PB_EVENT_OPEN_HANDLE *p_evet_open_handle) {
+ DWORD lret = WAIT_FAILED;
+ HANDLE handle;
+
+ if (p_evet_open_handle != NULL) { // LCOV_EXCL_BR_LINE 6: p_evet_open_handle can not be NULL
+ /* Get handle from Mutex name */
+ handle = _pb_CreateMutex(NULL, FALSE, p_evet_open_handle->p_sys_event->name_of_mutex);
+
+ /****************************************/
+ /* Get Mutex */
+ /****************************************/
+ lret = PbMutexLock(handle, INFINITE);
+
+ /* Cancel by deleting the generated portion when a handle was acquired */
+ (void)PbDeleteMutex(handle);
+ }
+
+ /* When mutex processing fails */
+ if (lret != WAIT_OBJECT_0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "lret ERROR [lret:%lu]", lret);
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Unlock the mutex for event
+ *
+ * @param[in] *p_evet_open_handle
+ */
+static void EventUnlockMutex(PB_EVENT_OPEN_HANDLE *p_evet_open_handle) {
+ BOOL bret = FALSE;
+ HANDLE handle;
+
+ if (p_evet_open_handle != NULL) { // LCOV_EXCL_BR_LINE 6: p_evet_open_handle can not be NULL
+ /* Get handle from Mutex name */
+ handle = _pb_CreateMutex(NULL, FALSE, p_evet_open_handle->p_sys_event->name_of_mutex);
+
+ /****************************************/
+ /* Release Mutex */
+ /****************************************/
+ bret = PbMutexUnlock(handle);
+
+ /* Cancel by deleting the generated portion when a handle was acquired */
+ (void)PbDeleteMutex(handle);
+ }
+
+ /* When mutex processing fails */
+ if (bret != TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "bret ERROR [bret:%d]", bret);
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * delete the mutex for event
+ *
+ * @param[in] *p_evet_open_handle
+ */
+static void EventDeleteMutex(PB_EVENT_OPEN_HANDLE *p_evet_open_handle) {
+ RET_API ret_api = RET_ERROR;
+ HANDLE handle;
+
+ if (p_evet_open_handle != NULL) { // LCOV_EXCL_BR_LINE 6: p_evet_open_handle can not be NULL
+ /* Get handle from Mutex name */
+ handle = _pb_CreateMutex(NULL, FALSE, p_evet_open_handle->p_sys_event->name_of_mutex);
+
+ /****************************************/
+ /* Delete Mutex */
+ /****************************************/
+ ret_api = static_cast<RET_API>(PbDeleteMutex(handle)); /* Coverity CID:18817 Comment Managed */
+
+ /* Cancel by deleting the generated portion when a handle was acquired */
+ (void)PbDeleteMutex(handle);
+ }
+
+ /* When mutex processing fails */
+ if (ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ret_api ERROR [ret_api:%d]", ret_api);
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get dump information
+ *
+ * @param[out] p_buf Dump info
+ * @param[in/out] p_len Buffer size
+ */
+void _pb_GetDebugEventMngTbl(void* p_buf, uint8_t* p_len) {
+ PB_EVENT_INSTANCE *p_inst = &g_instance;
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufHdlTbl[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufSysEvt[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_tmp[DEBUG_DUMP_MAX_SIZE];
+ uint8_t buf_indent[16];
+ uint32_t i;
+ PB_EVENT_OPEN_HANDLE* p_hdl_tbl;
+ uint8_t cnt = 0;
+
+ if ((p_buf != NULL) && (p_len != NULL)) {
+ memset(&buf[0], 0x00, sizeof(buf));
+ memset(&bufSysEvt, 0x00, sizeof(bufSysEvt));
+ snprintf(reinterpret_cast<char *>(&buf_indent[0]), sizeof(buf_indent), " ");
+ GetDebugEventMngTblSysEvent(&bufSysEvt[0], p_inst->p_event_table, &buf_indent[0]); // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Event-1\n ShrMem:%p\n idEvt:%d\n Evt:\n%s",
+ p_inst->h_shared_memory,
+ p_inst->id_event_table_sem,
+ &bufSysEvt[0]);
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ p_buf = reinterpret_cast<void *>((reinterpret_cast<uint8_t *>(p_buf)) + sizeof(buf));
+ cnt++;
+ if (cnt < *p_len) {
+ memset(&bufHdlTbl[0], 0x00, sizeof(bufHdlTbl));
+ for (i = 0; i < MAX_PB_EVENTS; i++) {
+ // p_handle_table
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ p_hdl_tbl = p_inst->p_handle_table[i];
+ if (p_hdl_tbl == NULL) {
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n [%d] NULL",
+ i);
+ } else {
+ memset(&bufSysEvt[0], 0x00, sizeof(bufSysEvt));
+ snprintf(reinterpret_cast<char *>(&buf_indent[0]), sizeof(buf_indent), " ");
+ GetDebugEventMngTblSysEvent(&bufSysEvt[0], p_hdl_tbl->p_sys_event, &buf_indent[0]);
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n [%d]\n h_heap:%p, index:%lu, l_thread_ref:%d\n p_sys_event:\n%s",
+ i,
+ p_hdl_tbl->h_heap,
+ p_hdl_tbl->index,
+ p_hdl_tbl->l_thread_ref,
+ &bufSysEvt[0]);
+ }
+ strncat(reinterpret_cast<char *>(&bufHdlTbl[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ if (((i + 1) % 4) == 0) {
+ cnt++;
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Event-%d\n Handle:%s",
+ cnt,
+ &bufHdlTbl[0]);
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ p_buf = reinterpret_cast<void *>((reinterpret_cast<uint8_t *>(p_buf)) + sizeof(buf));
+ memset(&bufHdlTbl[0], 0x00, sizeof(bufHdlTbl));
+ if (cnt >= *p_len) {
+ break;
+ }
+ }
+ }
+ }
+ if (cnt < *p_len) {
+ if (bufHdlTbl[0] != 0x00) {
+ cnt++;
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Event-%d\n Handle:%s",
+ cnt,
+ &bufHdlTbl[0]);
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ }
+ *p_len = cnt;
+ }
+ }
+}
+
+/**
+ * @brief
+ * Get dump information(PB_EVENT)
+ *
+ * @param[out] p_buf Dump info
+ * @param[in] pEvt PB_EVENT
+ * @param[in] pIndent Indenting
+ */
+void GetDebugEventMngTblSysEvent(void* p_buf, PB_EVENT* pEvt, uint8_t* pIndent) {
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_condition[1024];
+ static uint8_t buf_flag_id[512];
+ static uint8_t buf_tmp[DEBUG_DUMP_MAX_SIZE];
+ uint32_t i;
+ uint32_t e;
+
+ if ((p_buf != NULL) && (pEvt != NULL)) { // LCOV_EXCL_BR_LINE 6: p_buf and pEvt can not be NULL
+ memset(&buf, 0x00, sizeof(buf));
+ memset(&buf_condition, 0x00, sizeof(buf_condition));
+ snprintf(reinterpret_cast<char *>(&(buf_condition)), sizeof(buf_condition), "stCnd:");
+ for (i = 0; i < MAX_PB_EVENT_WAIT_THREADS; i++) {
+ memset(&buf_flag_id, 0x00, sizeof(buf_flag_id));
+ for (e = 0; e < MAX_EVENT_PROC_NUM; e++) {
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "[%d]0x%08x ", e, pEvt->st_condition[i].flag_id[e]);
+ strncat(reinterpret_cast<char *>(&buf_flag_id[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ }
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s [%d] UseFlg:%d, Wait:%d, Mode:%d, Mask:%d, Min:%d, Max:%d, Last:%d, flag:%s",
+ pIndent,
+ i,
+ pEvt->st_condition[i].uc_use_flag,
+ pEvt->st_condition[i].uc_waiting,
+ pEvt->st_condition[i].us_mode,
+ pEvt->st_condition[i].ul_mask,
+ pEvt->st_condition[i].l_min_val,
+ pEvt->st_condition[i].l_max_val,
+ pEvt->st_condition[i].l_last_val,
+ &buf_flag_id[0]);
+ strncat(reinterpret_cast<char *>(&buf_condition[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ }
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "%s EvtName:%s",
+ pIndent,
+ pEvt->event_name);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s EvtVal:%d",
+ pIndent,
+ pEvt->l_event_val);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s %s",
+ pIndent,
+ &buf_condition[0]);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s ProcRef:%d",
+ pIndent,
+ pEvt->l_process_ref);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s ResetData:%d",
+ pIndent,
+ pEvt->l_reset_data);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s ManualReset:%d",
+ pIndent,
+ pEvt->uc_manual_reset);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n%s name_of_mutex:%s",
+ pIndent,
+ pEvt->name_of_mutex);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ }
+}
diff --git a/vehicleservice/positioning_base_library/library/src/_pbFsys.cpp b/vehicleservice/positioning_base_library/library/src/_pbFsys.cpp
new file mode 100755
index 0000000..ee132b0
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbFsys.cpp
@@ -0,0 +1,171 @@
+/*
+ * @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 : _pbFsys.cpp
+ System name : 05 Integration Platform
+ Subsystem name : System common functions
+ Title : System API file access control related processes
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+
+/*
+ Constants and structure definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define ALLOC_SIZE 0x00200000
+#define MAX_MUTEX_NAME_LEN 32
+
+/* Flag structure for file system protection */
+typedef struct {
+ u_int8 file_write_flag;
+ u_int8 dummy1;
+ u_int8 recover_flag;
+ u_int8 dummy2;
+} FSYS_FLAG_STRUCT;
+
+/* File system protection flag area control table */
+typedef struct {
+ TCHAR mtx_name[MAX_MUTEX_NAME_LEN]; /* Mutex name */
+ HANDLE h_mutex; /* Mutex handles */
+} FSYS_GLOBAL;
+
+/*
+ Global Variable Definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+FSYS_FLAG_STRUCT *g_fsys_flag_top_addr;
+
+/*
+ External function prototype declaration
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ BOOL VirtualCopy(LPVOID lpv_dest, LPVOID lpv_src, DWORD cb_size, DWORD fdw_protect);
+#ifdef __cplusplus
+}
+#endif
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FileSystemCheckInit
+ * ABSTRACT : File system protection flag area and setting value initialization processing
+ * NOTE : Allocate a flag area for protecting the file system, create a Mutex
+ * : for locking the area, and initialize the flags as follows.
+ * : File access flag :File Access Permission State
+ * : FlashFS recovery status flag :FlashFS access-prohibited status
+ * ARGUMENT : None
+ * RETURN : RET_API define
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+FileSystemCheckInit(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return (RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FileSystemCheckTerm
+ * ABSTRACT : File system protection flag area release processing
+ * NOTE :
+ * ARGUMENT : None
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+FileSystemCheckTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SetFileAccessFlag
+ * ABSTRACT : File access flag setting process
+ * NOTE : Sets the write access state in the file access flag.Parameter
+ * : Set "Write prohibited state" at the time of parameter error.
+ * ARGUMENT : u_int8 status : File access flag setting value
+ * WRITE_FLAG_OFF : Write prohibited state to file
+ * WRITE_FLAG_ON : Write permission status for the file
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+SetFileAccessFlag(u_int8 status) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetFileAccessFlag
+ * ABSTRACT : File access flag acquisition processing
+ * NOTE : Gets the write access status to a file from the file access flag
+ * ARGUMENT : u_int8 *status Pointer for storing access status
+ * RETURN : RET_NORMAL Normal completion Note : Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+GetFileAccessFlag(u_int8 *status) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *status = WRITE_FLAG_ON;
+ return (RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SetFFSRecoverFlag
+ * ABSTRACT : FLASH file system recovery processing status setting processing
+ * NOTE : Sets the status of FLASH file system recovery
+ * ARGUMENT : u_int8 status : FLASH file system recovery process status setting
+ * RECOVER_OFF : Access authorization state
+ * RECOVER_ON : Access prohibited status during recovery processing
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+void
+SetFFSRecoverFlag(u_int8 status) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetFFSRecoverFlag
+ * ABSTRACT : FLASH file system recovery processing status acquisition processing
+ * NOTE : Gets the status of FLASH file system recovery
+ * ARGUMENT : u_int8 *status Pointer for storing recovery processing status
+ * RETURN : RET_API define
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+GetFFSRecoverFlag(u_int8 *status) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return (RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetFSAccessSts
+ * ABSTRACT : File system access status acquisition processing
+ * NOTE : Gets the access status to the file system
+ * ARGUMENT : u_int8 *status Pointer for storing the file system access status
+ * RETURN : RET_API define
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+GetFSAccessSts(u_int8 *status) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *status = FSNOACCESS;
+
+ return (RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* End _pbFsys.cpp */
diff --git a/vehicleservice/positioning_base_library/library/src/_pbMem.cpp b/vehicleservice/positioning_base_library/library/src/_pbMem.cpp
new file mode 100755
index 0000000..4028ae3
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbMem.cpp
@@ -0,0 +1,989 @@
+/*
+ * @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 : _pbMem.cpp
+ System name : 05 Integration Platform
+ Subsystem name : System common functions
+ Title : System API
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "tchar.h"
+#include "WPF_STD_private.h"
+#include "_pbInternalProc.h"
+
+/*
+ Constants and data type definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define MAX_AREA_NAME_LEN 32
+#define MAX_FILENAME_LEN 32
+#define _CWORD64__MEM_MUTEX_NAME __TEXT("POS_BASE_MEM_MUTEX")
+#define MAX_ROMFILENAME_LEN (32-4) /* To the name appended with "_rom" at the time of registration */
+#define PHYADDR_MAX 0x9FFFFFFF /* Physical address of the boundary divided by 256 */
+#define ROM_DATA_SIZE 0x00400000 /* Size of the virtual ROM data area(4MB) */
+#define ALLOC_SIZE 0x00200000 /* 2MB (Minimum VirtualAlloc allocation of shared memory, */
+/* which is less than 2MB, is not mapped to shared memory) */
+#define OFFSET_SIZE 0x00001000 /* 4KB (VirtualCopy Addressing Units) */
+
+ /* Memory map information */
+typedef struct TagMemMapItem {
+ HANDLE h_heap; /* Handle of heap. */
+ struct TagMemMapItem* p_next; /* Pointers to the next Chain memory map table */
+ struct TagMemMapItem* p_prev; /* Pointers to the previous Chain memory map table */
+ DWORD address;
+ TCHAR name[MAX_AREA_NAME_LEN]; /* Name of shared data area(Not used when permit is processed) */
+ HANDLE h_shared_mem; /* Shared memory handle */
+} MEMMAP_ITEM;
+
+/* Memory map information management table */
+typedef struct {
+ HANDLE h_heap; /* Heap handle of the invoking table */
+ MEMMAP_ITEM* p_head; /* Pointer to the first memory map information */
+ MEMMAP_ITEM* p_tail; /* Pointer to the terminating memory map information */
+ DWORD num_of_items; /* Chain memory map data */
+ HANDLE h_mutex; /* _CWORD64__MEM_MUTEX Exclusive Mutex handles */
+} MEMMAP_LIST;
+
+typedef struct {
+ DWORD mem_size;
+ DWORD reserv[3];
+} _CWORD64_SHMHDR;
+
+/* LINK ROM data top address/size storage ROM data */
+typedef struct {
+ u_int32 *link_rom_addr; /* ROM data start address */
+ u_int32 link_size; /* ROM data size */
+} LINK_ROM;
+
+/*
+ Internal function prototype declaration
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static void UnlinkFromMemMapList(MEMMAP_ITEM* p_item);
+static void LinkToMemMapList(MEMMAP_ITEM* p_item);
+static MEMMAP_ITEM* FindMemMapItemByName(TCHAR* name);
+
+/*
+ Global variable
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+MEMMAP_LIST* g_p_mem_map_list;
+
+/**
+ * @brief
+ * Memory API initialization
+ *
+ * @param[in] none
+ *
+ * @return RET_API RET_NORMAL Normal completion<br>
+ * RET_ERROR ABENDs
+ */
+
+RET_API MemoryInit(void) {
+ RET_API ret_api = RET_NORMAL;
+ TCHAR name[] = _CWORD64__MEM_MUTEX_NAME;
+
+ // LCOV_EXCL_BR_START 5: standard lib error
+ g_p_mem_map_list = reinterpret_cast<MEMMAP_LIST *>(PbProcessHeapAlloc(0, sizeof(MEMMAP_ITEM)));
+ // LCOV_EXCL_BR_STOP
+ if (g_p_mem_map_list == NULL) { // LCOV_EXCL_BR_LINE 5: standard lib error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 5: standard lib error
+ } else {
+ /* Initialization of memory map information management table */
+ g_p_mem_map_list->h_heap = NULL;
+ g_p_mem_map_list->p_head = NULL;
+ g_p_mem_map_list->p_tail = NULL;
+ g_p_mem_map_list->num_of_items = 0;
+
+ /* Create Mutex */
+ g_p_mem_map_list->h_mutex = _pb_CreateMutex(NULL, TRUE, name); // LCOV_EXCL_BR_LINE 200: no branch
+ if (g_p_mem_map_list->h_mutex == NULL) { // LCOV_EXCL_BR_LINE 200: can not be NULL
+ // LCOV_EXCL_START 200:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateMutex ERROR [name:%s]", name);
+ _pb_Exit(); /* System recovery processing(Exception execution) */
+ // LCOV_EXCL_STOP
+ }
+ }
+
+ return ret_api;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : MemoryTerm
+ * ABSTRACT : Memory API termination processing
+ * NOTE : This function frees each allocated object.
+ * : This function must be called only once by DllMain() at process termination.
+ * ARGUMENT : None
+ * RETURN : Return RET_NORMAL
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+MemoryTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+
+ if (g_p_mem_map_list == NULL) {
+ ret_api = RET_ERROR;
+ } else {
+ /* Lock Mutex */
+ PbMutexLock(g_p_mem_map_list->h_mutex, INFINITE);
+
+ while (g_p_mem_map_list->num_of_items > 0) {
+ MEMMAP_ITEM* p_item = g_p_mem_map_list->p_head;
+ if (g_p_mem_map_list->num_of_items == 1) {
+ /* Delete last one of memory map list */
+ g_p_mem_map_list->p_head = NULL;
+ g_p_mem_map_list->p_tail = NULL;
+ g_p_mem_map_list->num_of_items = 0;
+ } else {
+ /* Deletes the beginning of the memory map list, with the next at the beginning. */
+ g_p_mem_map_list->p_head = g_p_mem_map_list->p_head->p_next;
+ g_p_mem_map_list->p_head->p_prev = NULL;
+ g_p_mem_map_list->num_of_items--;
+ }
+
+ /* Releases the real memory specified in the memory map list. */
+ if (p_item != NULL) {
+ PbProcessHeapFree(0, p_item);
+ p_item = NULL;
+ }
+ }
+
+ /* Release Mutex */
+ PbMutexUnlock(g_p_mem_map_list->h_mutex);
+
+ /* Delete Mutex */
+ PbDeleteMutex(g_p_mem_map_list->h_mutex);
+
+ /* Free MEMMAP_LIST structure */
+ PbProcessHeapFree(0, g_p_mem_map_list);
+ g_p_mem_map_list = NULL;
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Allocate Process Heap
+ *
+ * Allocates a memory block from the process heap
+ *
+ * @param[in] DWORD dw_flags Heap allocation scheme
+ * @param[in] SIZE_T dw_bytes Number of bytes to allocate
+ *
+ * @return LPVOID Except NULL Pointer to the allocated memory block
+ * NULL Assignment Failed
+ */
+LPVOID PbProcessHeapAlloc(DWORD dw_flags, SIZE_T dw_bytes) {
+ LPVOID pv_ret = NULL;
+
+ if ((dw_flags & HEAP_ZERO_MEMORY) == 0) { // LCOV_EXCL_BR_LINE 200: dw_flags cannot have bit HEAP_ZERO_MEMORY
+ /* Zero initialization not specified */
+ pv_ret = malloc(dw_bytes);
+ } else {
+ /* Zero initialization specified */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ pv_ret = calloc(dw_bytes, sizeof(char)); // LCOV_EXCL_LINE 200: dw_flags cannot have bit HEAP_ZERO_MEMORY
+ }
+
+ return pv_ret;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PrivateHeapAlloc
+ * ABSTRACT : Allocate a block of memory from the private heap
+ * NOTE : Because there is no private-heap notion in PosixBasedOS001,
+ * Allocate from the process-heap using ProcessHeapAlloc
+ * ARGUMENT : DWORD dw_flags Controlling Heap Allocation Methods
+ * : SIZE_T dw_bytes Number of bytes to allocate
+ * RETURN : LPVOID Except NULL Pointer to the allocated memory block
+ * : NULL Assignment Failed
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+LPVOID
+PrivateHeapAlloc(DWORD dw_flags, SIZE_T dw_bytes) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return PbProcessHeapAlloc(dw_flags, dw_bytes);
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Free Process Heap
+ *
+ * Frees memory blocks allocated from the process heap
+ *
+ * @param[in] DWORD dw_flags Heap free method(Unused)
+ * @param[in] LPVOID lp_mem Pointer to the memory to be freed
+ *
+ * @return BOOL Non-zero Normal completion
+ * 0 ABENDs
+ */
+BOOL PbProcessHeapFree(DWORD dw_flags, LPVOID lp_mem) {
+ free(lp_mem);
+
+ return TRUE;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PrivateHeapFree
+ * ABSTRACT : Free memory blocks allocated from private heap
+ * NOTE : Because there is no private-heap notion in PosixBasedOS001,
+ * Open using ProcessHeapFree
+ * ARGUMENT : DWORD dw_flags Heap release option(Not used by PosixBasedOS001)
+ * : LPVOID lp_mem Pointer to the memory to be freed
+ * RETURN : BOOL Non-zero Normal
+ * : 0 Abnormality
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+BOOL
+PrivateHeapFree(DWORD dw_flags, LPVOID lp_mem) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return PbProcessHeapFree(dw_flags, lp_mem);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : MemPermit
+ * ABSTRACT : Acquire access privilege to non-managed memory block of invoking process
+ * NOTE : To the data of the unmanaged memory block of invoking process
+ * : Allocate to accessible area of invoking process
+ * ARGUMENT : u_int32 mem_adr Start address of the data area to which access privileges are granted
+ * : u_int32 size Size of the data area to be granted access privileges
+ * : int32 perm PERM_NONCACHE(Cache invalidation), PERM_CACHE(Cache enabled)
+ * : void** ptr Returns the start address of the actual data area that can be accessed
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_ERROR ABENDs
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API MemPermit(u_int32 mem_adr, u_int32 size, int32 perm, void** ptr) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : MemProtect
+ * ABSTRACT : Revoking access privileges to invoking process unmanaged memory blocks
+ * NOTE : Free unmanaged memory block allocated to invoking process area
+ * ARGUMENT : u_int32 mem_adr Start address of the data area from which the access privilege is to be revoked
+ * : u_int32 size Size of the data area for which access privileges are to be revoked
+ * RETURN : RET_API RET_NORMAL Access privilege revocation successful
+ * : RET_ERROR Failed to revoke access privilege
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API MemProtect(u_int32 mem_adr, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Create Share Data
+ *
+ * @param[in] char* area_name Pointer to shared data area name string
+ * @param[in] u_int32 size Size of the data portion
+ * @param[out] void** mem_ptr Pointer to the start address of the shared data area
+ *
+ * @return RET_API
+ * RET_NORMAL Normal
+ * RET_ERROR Abnormality
+ */
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+RET_API _pb_CreateShareData(char* area_name, u_int32 size, void** mem_ptr) // NOLINT(readability/nolint) WPF_SYSAPI.h
+#else
+RET_API _pb_CreateShareData(TCHAR* area_name, u_int32 size, void** mem_ptr) // NOLINT(readability/nolint) WPF_SYSAPI.h
+#endif // _CWORD64_API_DOES_NOT_USE_UNICODE
+{
+ RET_API ret_api = RET_NORMAL;
+ TCHAR *p_area_name = NULL;
+ TCHAR name[MAX_AREA_NAME_LEN] = {0};
+ HANDLE h_shm = NULL;
+ _CWORD64_SHMHDR *p_hdr = reinterpret_cast<_CWORD64_SHMHDR *>(MAP_FAILED);
+ MEMMAP_ITEM *p_item = NULL;
+#ifdef UNDER_CE
+ TCHAR unicode_area_name[MAX_AREA_NAME_LEN] = {0};
+#endif // UNDER_CE
+
+ if (mem_ptr == NULL) {
+ ret_api = RET_ERROR; /* Parameter error */
+ } else if (area_name == NULL) {
+ ret_api = RET_ERROR; /* Parameter error */
+ } else {
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+#ifdef UNDER_CE
+ if (area_name[0] == '\0') {
+ ret_api = RET_ERROR;
+ } else {
+ /* Shared memory name character limit processing */
+ if (strlen(area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ } else {
+ mbstowcs(unicode_area_name, area_name, MAX_AREA_NAME_LEN);
+ p_area_name = unicode_area_name;
+ }
+ }
+#else
+ p_area_name = area_name;
+ if (_tcslen(p_area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ }
+#endif
+#else
+ p_area_name = area_name;
+ if (_tcslen(p_area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ }
+#endif
+ }
+
+ if (ret_api == RET_NORMAL) {
+ if ((p_area_name[0] == __TEXT('\0')) || (size == 0)) {
+ ret_api = RET_ERROR; /* Parameter error */
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ _tcscpy(name, p_area_name);
+
+ /* Lock Mutex */
+ PbMutexLock(g_p_mem_map_list->h_mutex, INFINITE); // LCOV_EXCL_BR_LINE 200: no branch
+
+ p_item = FindMemMapItemByName(name); /* Search memory map object by area name */
+ if (p_item != NULL) /* When there is already a generated name */ {
+ *mem_ptr = NULL;
+ ret_api = RET_ERROR; /* Return in error because it has been generated */
+ } else {
+ /* Allocate MEMMAP_ITEM structure from heap */
+ // LCOV_EXCL_BR_START 5: standard lib error
+ p_item = reinterpret_cast<MEMMAP_ITEM *>(PbProcessHeapAlloc(0, sizeof(MEMMAP_ITEM)));
+ // LCOV_EXCL_BR_STOP
+ if (p_item == NULL) { // LCOV_EXCL_BR_LINE 5: standard lib error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *mem_ptr = NULL; // LCOV_EXCL_LINE 5: standard lib error
+ ret_api = RET_ERROR; /* Failed to allocate */ // LCOV_EXCL_LINE 5: standard lib error
+ } else {
+ p_item->h_heap = NULL;
+ p_item->p_next = NULL;
+ p_item->p_prev = NULL;
+ p_item->address = 0;
+ p_item->h_shared_mem = NULL;
+ LinkToMemMapList(p_item); /* Add to end of memory map list */ // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Allocate shared memory */
+ h_shm = CreateSharedMemory(name, size + sizeof(_CWORD64_SHMHDR)); // LCOV_EXCL_BR_LINE 200: can not be null
+ if (h_shm == NULL) { // LCOV_EXCL_BR_LINE 200: can not be null
+ // LCOV_EXCL_START 200: can not be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Remove the target memory-mapped object from the memory-mapped list */
+ UnlinkFromMemMapList(p_item);
+ PbProcessHeapFree(0, p_item);
+ p_item = NULL;
+ *mem_ptr = NULL;
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ p_item->h_shared_mem = h_shm;
+ /* Get Accessible Address */
+ // LCOV_EXCL_BR_START 200: can not be null
+ p_hdr = reinterpret_cast<_CWORD64_SHMHDR *>(GetSharedMemoryPtr(p_item->h_shared_mem));
+ // LCOV_EXCL_BR_STOP
+ if (p_hdr == NULL) { // LCOV_EXCL_BR_LINE 200: can not be null
+ // LCOV_EXCL_START 200: can not be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Delete allocated shared memory */
+ CloseSharedMemory(h_shm);
+ DeleteSharedMemory(name);
+ /* Remove the target memory-mapped object from the memory-mapped list */
+ UnlinkFromMemMapList(p_item);
+ PbProcessHeapFree(0, p_item);
+ p_item = NULL;
+ *mem_ptr = NULL;
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ p_hdr->mem_size = size;
+ *mem_ptr = reinterpret_cast<void*>(p_hdr + 1); /* Start at the address following the header */
+ _tcscpy(p_item->name, name); /* Name registration in the table */
+ }
+ }
+ }
+ }
+
+ /* Release Mutex */
+ PbMutexUnlock(g_p_mem_map_list->h_mutex); // LCOV_EXCL_BR_LINE 200: no branch
+ } else {
+ /* When an error occurs during parameter check */
+ if (mem_ptr != NULL) {
+ *mem_ptr = NULL;
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Link Share Data
+ *
+ * @param[in] char* area_name Pointer to shared data area name string
+ * @param[out] void** mem_ptr Pointer to the start address of the shared data area
+ * @param[out] u_int32* size Size of the data portion
+ *
+ * @return RET_API
+ * RET_NORMAL Normal
+ * RET_ERROR Abnormality
+ */
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+RET_API _pb_LinkShareData(char* area_name, void** mem_ptr, u_int32* size) // NOLINT(readability/nolint) WPF_SYSAPI.h
+#else
+RET_API _pb_LinkShareData(TCHAR* area_name, void** mem_ptr, u_int32* size) // NOLINT(readability/nolint) WPF_SYSAPI.h
+#endif // _CWORD64_API_DOES_NOT_USE_UNICODE
+{
+ RET_API ret_api = RET_NORMAL;
+ TCHAR *p_area_name = NULL;
+ TCHAR name[MAX_AREA_NAME_LEN] = {0};
+ _CWORD64_SHMHDR *p_hdr = reinterpret_cast<_CWORD64_SHMHDR *>(MAP_FAILED);
+ MEMMAP_ITEM *p_item = NULL;
+ HANDLE h_shm = NULL;
+ HANDLE h_shm_temp = NULL;
+ DWORD mem_size = 0;
+#ifdef UNDER_CE
+ TCHAR unicode_area_name[MAX_AREA_NAME_LEN] = {0};
+#endif
+
+ if (mem_ptr == NULL) {
+ ret_api = RET_ERROR; /* Parameter error */
+ } else if ((area_name == NULL) || (size == NULL)) {
+ ret_api = RET_ERROR; /* Parameter error */
+ } else {
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+#ifdef UNDER_CE
+ if (area_name[0] == '\0') {
+ ret_api = RET_ERROR;
+ } else {
+ /* Shared memory name character limit processing */
+ if (strlen(area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ } else {
+ mbstowcs(unicode_area_name, area_name, MAX_AREA_NAME_LEN);
+ p_area_name = unicode_area_name;
+ }
+ }
+#else
+ p_area_name = area_name;
+ if (_tcslen(p_area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ }
+#endif
+#else
+ p_area_name = area_name;
+ if (_tcslen(p_area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ }
+#endif
+ }
+
+ if (ret_api == RET_NORMAL) {
+ if (p_area_name[0] == __TEXT('\0')) {
+ ret_api = RET_ERROR; /* Parameter error */
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ *size = 0;
+ _tcscpy(name, p_area_name);
+ mem_size = (u_int32) * size;
+
+ /* Lock Mutex */
+ PbMutexLock(g_p_mem_map_list->h_mutex, INFINITE); // LCOV_EXCL_BR_LINE 200: no branch
+
+ p_item = FindMemMapItemByName(name); /* Search memory map object by area name */
+ if (p_item != NULL) {
+ /* When there is already a generated name */
+ h_shm = p_item->h_shared_mem;
+ // LCOV_EXCL_BR_START 200: can not be null
+ p_hdr = reinterpret_cast<_CWORD64_SHMHDR*>(GetSharedMemoryPtr(h_shm)); /* Get Accessible Address */
+ // LCOV_EXCL_BR_STOP
+ if (p_hdr == NULL) { // LCOV_EXCL_BR_LINE 200: can not be null
+ // LCOV_EXCL_START 200: can not be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *mem_ptr = NULL;
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ /* Start at the address following the header */
+ *mem_ptr = reinterpret_cast<void *>(p_hdr + 1);
+ *size = static_cast<u_int32>(p_hdr->mem_size);
+ }
+ } else {
+ /* When no memory map object has been created */
+ /* Allocate MEMMAP_ITEM structure from heap */
+ // LCOV_EXCL_BR_START 5: standard lib error
+ p_item = reinterpret_cast<MEMMAP_ITEM*>(PbProcessHeapAlloc(0, sizeof(MEMMAP_ITEM)));
+ // LCOV_EXCL_BR_STOP
+ if (p_item == NULL) { // LCOV_EXCL_BR_LINE 5: standard lib error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ *mem_ptr = NULL; // LCOV_EXCL_LINE 5: standard lib error
+ ret_api = RET_ERROR; /* Failed to allocate */ // LCOV_EXCL_LINE 5: standard lib error
+ } else {
+ p_item->h_heap = NULL;
+ p_item->p_next = NULL;
+ p_item->p_prev = NULL;
+ p_item->address = 0;
+ _tcscpy(p_item->name, name);
+ p_item->h_shared_mem = NULL;
+ LinkToMemMapList(p_item); /* Add to end of memory map list */ // LCOV_EXCL_BR_LINE 200: no branch
+
+ ret_api = RET_ERROR; /* Process result initialization */
+ /* Maps the shared data area to physical memory and returns its information pointer
+ * (Check if not found by table lookup, but other processes are already reserved) */
+ h_shm_temp = OpenSharedMemory(p_item->name, sizeof(_CWORD64_SHMHDR)); // LCOV_EXCL_BR_LINE 200: no branch
+ if (h_shm_temp != NULL) {
+ /* Get Accessible Address */
+ p_hdr = reinterpret_cast<_CWORD64_SHMHDR*>(GetSharedMemoryPtr(h_shm_temp)); // LCOV_EXCL_BR_LINE 200: can not be NULL // NOLINT(whitespace/line_length)
+ if (p_hdr != NULL) { // LCOV_EXCL_BR_LINE 200: can not be NULL
+ mem_size = p_hdr->mem_size;
+ ret_api = RET_NORMAL;
+ }
+ CloseSharedMemory(h_shm_temp); // LCOV_EXCL_BR_LINE 200: no branch
+ }
+
+ if (ret_api == RET_NORMAL) {
+ ret_api = RET_ERROR; /* Process result initialization */
+ /* Maps the shared data area to physical memory and returns its information pointer */
+ h_shm = OpenSharedMemory(p_item->name, mem_size); // LCOV_EXCL_BR_LINE 200: no branch
+ if (h_shm != NULL) {
+ p_item->h_shared_mem = h_shm;
+ /* Get Accessible Address */
+ p_hdr = reinterpret_cast<_CWORD64_SHMHDR*>(GetSharedMemoryPtr(p_item->h_shared_mem));
+ if (p_hdr != NULL) {
+ *mem_ptr = reinterpret_cast<void*>(p_hdr + 1); /* Start at the address following the header */
+ *size = static_cast<u_int32>(mem_size);
+ ret_api = RET_NORMAL;
+ }
+ }
+ }
+
+ if (ret_api != RET_NORMAL) {
+ UnlinkFromMemMapList(p_item); /* Remove the target memory-mapped object from the memory-mapped list */
+
+ PbProcessHeapFree(0, p_item); // LCOV_EXCL_BR_LINE 200: no branch
+ p_item = NULL;
+ *mem_ptr = NULL;
+ *size = 0;
+ }
+ }
+ }
+
+ /* Release Mutex */
+ PbMutexUnlock(g_p_mem_map_list->h_mutex); // LCOV_EXCL_BR_LINE 200: no branch
+ } else {
+ /* When an error occurs during parameter check */
+ if (mem_ptr != NULL) {
+ *mem_ptr = NULL;
+ }
+ }
+
+ return ret_api;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbDeleteShareData
+ * ABSTRACT : Shared data area deletion processing
+ * NOTE : Deletes (releases) the shared memory area allocated under the name of the shared data area.
+ * ARGUMENT : char* area_name Pointer to shared data area name string
+ * RETURN : RET_API RET_NORMAL Normal
+ * : RET_ERROR The specified shared data does not exist
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+PbDeleteShareData(char* area_name) // LCOV_EXCL_START 8:dead code
+#else
+PbDeleteShareData(TCHAR* area_name)
+#endif // _CWORD64_API_DOES_NOT_USE_UNICODE
+{
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+ TCHAR *p_area_name = NULL;
+ TCHAR name[MAX_AREA_NAME_LEN] = {0};
+ MEMMAP_ITEM *p_item = NULL;
+#ifdef UNDER_CE
+ TCHAR unicode_area_name[MAX_AREA_NAME_LEN] = {0};
+#endif
+
+ /* Parameter check */
+ if (area_name == NULL) /* If the name of the shared area is NULL */ {
+ ret_api = RET_ERROR;
+ } else {
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+#ifdef UNDER_CE
+ if (strlen(area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ } else {
+ mbstowcs(unicode_area_name, area_name, MAX_AREA_NAME_LEN);
+ p_area_name = unicode_area_name;
+ }
+#else
+ p_area_name = area_name;
+ if (_tcslen(p_area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ }
+#endif
+#else
+ p_area_name = area_name;
+ if (_tcslen(p_area_name) >= MAX_AREA_NAME_LEN) {
+ ret_api = RET_ERROR;
+ }
+#endif
+ if (ret_api == RET_NORMAL) {
+ if (p_area_name[0] == __TEXT('\0')) {
+ ret_api = RET_ERROR;
+ }
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ /* Shared memory is allocated with the name of the shared area, or the memory map information management table is searched. */
+ _tcscpy(name, p_area_name);
+
+ /* Lock Mutex */
+ PbMutexLock(g_p_mem_map_list->h_mutex, INFINITE);
+
+ p_item = FindMemMapItemByName(name); /* Search memory map object by area name */
+ if (p_item == NULL) /* If the area name is not in the memory-map information management TBL */ {
+ /* If the area name is not in the memory map information management TBL, it has not been created or deleted. */
+ /* Release Mutex */
+ PbMutexUnlock(g_p_mem_map_list->h_mutex);
+ ret_api = RET_ERROR;
+ } else {
+ /* If the area name is in the memory map information management TBL */
+ /* Removes the memory map information from the Chain of the memory map information management table. */
+ UnlinkFromMemMapList(p_item);
+
+ /* Releases the Mutex of the memory map information management table and releases the shared memory. */
+ /* Release Mutex */
+ PbMutexUnlock(g_p_mem_map_list->h_mutex);
+
+ if (p_item->h_shared_mem != NULL) {
+ CloseSharedMemory(p_item->h_shared_mem);
+ p_item->h_shared_mem = NULL;
+ }
+
+ /* Frees memory-map information from the heap */
+ PbProcessHeapFree(0, p_item);
+
+ /* Deleting Shared Memory Objects */
+ /*************************************************************/
+ /* Note: Be sure to delete it, so Do not use DeleteShareData */
+ /* if you want to link elsewhere. */
+ /*************************************************************/
+ DeleteSharedMemory(name);
+ }
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : LinkRomData
+ * ABSTRACT : ROM data link
+ * NOTE : Links data located in ROM.
+ * : Specifies the name of the file in which the data is to be stored, and points to the start address of the data.
+ * : Get pointer and data size.
+ * ARGUMENT : char *filename Pointer to the string of the name of the ROM data storage file
+ * : void **mem_ptr Pointer to the start address of the ROM data storage file
+ * : u_int32 *size Pointer to the size of the data portion
+ * RETURN : RET_API RET_NORMAL Normal status
+ * : RET_ERROR Specified ROM data storage file does not exist
+ * : File name character string width error
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+RET_API LinkRomData(char* filename, void** mem_ptr, u_int32* size) // LCOV_EXCL_START 8:dead code
+#else
+RET_API LinkRomData(TCHAR* filename, void** mem_ptr, u_int32* size)
+#endif // _CWORD64_API_DOES_NOT_USE_UNICODE
+{
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL; /* Coverity CID: 18772 compliant */
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbAccessPhysicalMem
+ * ABSTRACT : Access to Physical Memory Area Allocation Data
+ * NOTE : Access data allocated in the physical memory area.
+ * : The physical memory area is mapped to the shared memory area and mapped.
+ * : The start address is returned.
+ * ARGUMENT : u_int32 addr Start address of the physical memory area
+ * : void **mem_ptr Pointer to the start address of the mapped shared area
+ * : u_int32 size Size of the data
+ * : u_int32 mode Access mode
+ * : ACCESS_MODE_READONLY :Read Only
+ * : ACCESS_MODE_READWRITE:Reading and Writing
+ * RETURN : RET_API RET_NORMAL Normal status
+ * : RET_ERRPARAM Parameter error
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbAccessPhysicalMem(u_int32 addr, void **mem_ptr, u_int32 size, u_int32 mode) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL; /* Coverity CID: 18767 compliant */
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbFreePhysicalMem
+ * ABSTRACT : Access release processing to the physical memory area allocation data
+ * NOTE : Releases access to data allocated in a physical memory area
+ * : Releases the shared memory area Allocate by AccessPhysicalMem.
+ * ARGUMENT : u_int32 addr Start address of the physical memory area to be released
+ * : void *mem_ptr Pointer to the start address of the mapped shared area
+ * : u_int32 size Data size to be released
+ * RETURN : RET_API RET_NORMAL Normal status
+ * : RET_ERRPARAM Parameter error
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbFreePhysicalMem(u_int32 addr, void *mem_ptr, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL; /* Coverity CID: 18766 compliant */
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FindMemMapItemByName
+ * ABSTRACT : Memory map information retrieval processing
+ * NOTE : Retrieves the memory map information by the specified shared data area name.
+ * ARGUMENT : TCHAR* name Pointer to shared data area name character string
+ * RETURN : MEMMAP_ITEM* !NULL Pointer to memory map information
+ * : NULL Memory map information does not exist
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static MEMMAP_ITEM*
+FindMemMapItemByName(TCHAR* name) {
+ MEMMAP_ITEM* ret = NULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ if (g_p_mem_map_list == NULL) { // LCOV_EXCL_BR_LINE 200: g_p_mem_map_list can not be NULL
+ /* If the memory map information management table is not allocated, */
+ /* nop */
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ } else if (g_p_mem_map_list->num_of_items == 0) {
+ /* If no memory map information is allocated, */
+ /* nop */
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ } else {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ MEMMAP_ITEM* p_item = g_p_mem_map_list->p_head;
+ /* Gets the pointer of the memory map Chain at the beginning of the file. */
+ /* Loops until there is no memory map Chain */
+ while (p_item != NULL) {
+ if (_tcscmp(p_item->name, name) == 0) {
+ /* If the name of the memory map information matches the name of the argument */
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* Returns a pointer to the memory map information */
+ ret = p_item;
+ break; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+ p_item = p_item->p_next; /* Retrieves the pointers of the memory map data Chain next time. */
+ }
+ }
+
+ return(ret); /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : LinkToMemMapList
+ * NOTE : Adding a Memory Map Object to the Memory Map List
+ * ARGUMENT : MEMMAP_ITEM* p_item Specify a memory-mapped object
+ * RETURN : Without
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static void
+LinkToMemMapList(MEMMAP_ITEM* p_item) {
+ BOOL processing_complete = FALSE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ if (g_p_mem_map_list == NULL) { // LCOV_EXCL_BR_LINE 200: g_p_mem_map_list can not be NULL
+ // LCOV_EXCL_START 200: g_p_mem_map_list can not be NULL
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ processing_complete = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ // LCOV_EXCL_STOP
+ }
+
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ if ((processing_complete == FALSE) && (g_p_mem_map_list->num_of_items == 0)) {
+ g_p_mem_map_list->p_head = p_item;
+ g_p_mem_map_list->p_tail = p_item;
+ g_p_mem_map_list->num_of_items = 1;
+ processing_complete = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ if (processing_complete == FALSE) {
+ g_p_mem_map_list->p_tail->p_next = p_item;
+ p_item->p_prev = g_p_mem_map_list->p_tail;
+ p_item->p_next = NULL;
+ g_p_mem_map_list->p_tail = p_item;
+ g_p_mem_map_list->num_of_items++;
+ }
+ return;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : UnlinkFromMemMapList
+ * ABSTRACT : Memory map information deletion processing
+ * NOTE : Memory map information specified by the pointer is stored in the memory map information management table.
+ * : From the Chain structures.The memory map information is not released.
+ * ARGUMENT : MEMMAP_ITEM* p_item Pointer to the memory map information to be deleted
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static void
+UnlinkFromMemMapList(MEMMAP_ITEM* p_item) {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ BOOL processing_complete = FALSE;
+ /* Parameter check */
+ if (g_p_mem_map_list == NULL) { // LCOV_EXCL_BR_LINE 200: g_p_mem_map_list can not be NULL
+ /* If the memory map information management table is not allocated, */
+ /* nop */
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ } else if (p_item == NULL) { // LCOV_EXCL_BR_LINE 200: p_item can not be NULL
+ /* If a pointer to memory-mapped information is not specified, */
+ /* nop */
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ } else if (g_p_mem_map_list->num_of_items == 0) { // LCOV_EXCL_BR_LINE 200: num_of_items can not be 0
+ /* If no memory map information is allocated, */
+ /* nop */
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ } else {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* Chain detachment process when there is only one memory map data item */
+ if (g_p_mem_map_list->num_of_items == 1) {
+ if (g_p_mem_map_list->p_head == p_item) {
+ /* If only one memory map is reserved */
+ /* For the top memory map information of the memo map information management table */
+ g_p_mem_map_list->p_head = NULL; /* Initializes the top memory map to NULL. */
+ g_p_mem_map_list->p_tail = NULL; /* NULL initialization of the termination memory map data */
+ g_p_mem_map_list->num_of_items = 0; /* Initializes the control memory map information count to zero. */
+ }
+ /* Specified memory map information pointer does not exist */
+ processing_complete = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Memory-map-information-removal process at the top of the Chain */
+ if ((processing_complete == FALSE) && (p_item == g_p_mem_map_list->p_head)) {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* If the specified memory map information is the first memory map information, */
+ /* The leading memory map information pointer is changed to the next Chain pointer. */
+ g_p_mem_map_list->p_head = g_p_mem_map_list->p_head->p_next;
+ /* Change the previous Chain source of the first memory map to NULL */
+ g_p_mem_map_list->p_head->p_prev = NULL;
+ g_p_mem_map_list->num_of_items--; /* Decrement the number of management memory map information */
+ p_item->p_next = NULL; /* Initialize the Chain destination of the removed memory map NULL. */
+ processing_complete = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Memory-map data detachment process at the end of the Chain */
+ if ((processing_complete == FALSE) && (p_item == g_p_mem_map_list->p_tail)) {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* If the pointed-to memory-map information is terminated, */
+ /* Change the terminating memory-map info pointer to the previous Chain source */
+ g_p_mem_map_list->p_tail = g_p_mem_map_list->p_tail->p_prev;
+ /* Change the Chain destination of the terminated memory map to NULL. */
+ g_p_mem_map_list->p_tail->p_next = NULL;
+ /* Decrement the number of management memory map information */
+ g_p_mem_map_list->num_of_items--;
+ /* The previous Chain source of the removed memory map data is NULL initialized. */
+ p_item->p_prev = NULL;
+ processing_complete = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Checking the memory map info Chain for errors */
+ if ((processing_complete == FALSE) &&
+ (g_p_mem_map_list->num_of_items <= 2)) {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ /* No more than two memory maps are possible except at the beginning and end. */
+ processing_complete = TRUE; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ }
+
+ /* Departure process other than the start and end of the memory map data Chain */
+ if (processing_complete == FALSE) {
+ /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */
+ p_item->p_prev->p_next = p_item->p_next; /* Set the next Chain destination of the previous memory map to the next one */
+ p_item->p_next->p_prev = p_item->p_prev; /* Previous Chain of one memory map before previous */
+ g_p_mem_map_list->num_of_items--; /* Decrement the number of management memory map information */
+ p_item->p_prev = NULL; /* The previous Chain source of the removed memory map data is NULL initialized. */
+ p_item->p_next = NULL; /* Initialize the Chain destination of the removed memory map NULL. */
+ }
+ }
+ return;
+}
+
+/**
+ * @brief
+ * Obtain dump information
+ *
+ * @param[out] p_buf Dump info
+ */
+void _pb_GetDebugMemoryMngTbl(void* p_buf) { // NOLINT(readability/nolint) WPF_SYSAPI.h
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_tmp[256];
+ uint32_t i = 0;
+
+ if (p_buf != NULL) {
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf), "Memory");
+
+ if (g_p_mem_map_list == NULL) { // LCOV_EXCL_BR_LINE 200: g_p_mem_map_list can not be NULL
+ // LCOV_EXCL_START 200: g_p_mem_map_list can not be NULL
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ strncat(reinterpret_cast<char *>(&buf[0]), "\n NULL", strlen("\n NULL"));
+ // LCOV_EXCL_STOP
+ } else if (g_p_mem_map_list->num_of_items == 0) { // LCOV_EXCL_BR_LINE 200: num_of_items can not be 0
+ // LCOV_EXCL_START 200: num_of_items can not be 0
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ strncat(reinterpret_cast<char *>(&buf[0]), "\n num_of_items:0", strlen("\n num_of_items:0"));
+ // LCOV_EXCL_STOP
+ } else {
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp), // LCOV_EXCL_BR_LINE 5: c lib error case
+ "\n h_heap:%p, p_head:%s, p_tail:%s, num_of_items:%lu, h_mutex:%p",
+ g_p_mem_map_list->h_heap,
+ ((g_p_mem_map_list->p_head == NULL)?"NULL":"NOT NULL"),
+ ((g_p_mem_map_list->p_tail == NULL)?"NULL":"NOT NULL"),
+ g_p_mem_map_list->num_of_items,
+ g_p_mem_map_list->h_mutex);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ MEMMAP_ITEM* p_item = g_p_mem_map_list->p_head;
+ while (p_item != NULL) {
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n [%02d]h_heap:%10p, p_next:%s, p_prev:%s, name:%40s, hShrMem:%10p, adr:%lu",
+ i,
+ p_item->h_heap,
+ ((p_item->p_next == NULL)?"NULL ":"NOT NULL"),
+ ((p_item->p_prev == NULL)?"NULL ":"NOT NULL"),
+ p_item->name,
+ p_item->h_shared_mem,
+ p_item->address);
+ i++;
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ p_item = p_item->p_next;
+ }
+ }
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ }
+}
diff --git a/vehicleservice/positioning_base_library/library/src/_pbMisc.cpp b/vehicleservice/positioning_base_library/library/src/_pbMisc.cpp
new file mode 100755
index 0000000..c52b7c6
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbMisc.cpp
@@ -0,0 +1,226 @@
+/*
+ * @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 : _pbMisc.cpp
+ System name : 05 Integration Platform
+ Subsystem name : System common functions
+ Title : System API Time-of-day operations related processing group
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+
+/*
+ Declaration of constant data type
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+typedef struct {
+ DWORD time_on_january1_1970; /* Time on January 1, 1970 when it expressed */
+ /* with the total second number from January 1, 1601 */
+} BTIME_INSTANCE;
+
+/*
+ Internal function prototype declaration
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static DWORD FileTimeToSeonds(FILETIME* p_ft);
+
+/*
+ Global Variable Definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+BTIME_INSTANCE g_instance; // NOLINT(readability/nolint) global class instance
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : MiscInit()
+ * ABSTRACT : Time-related processing instance initialization processing
+ * NOTE : Assign and hold 1/1/1970 to FILETIME variables
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL Normal completion Note: Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+MiscInit(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BTIME_INSTANCE *p_inst = &g_instance;
+ SYSTEMTIME st;
+ FILETIME ft;
+ BOOL bret;
+
+ /* Set the system time to the default value (January 1, 1970, 00:00:00). */
+ st.wYear = 1970;
+ st.wMonth = 1;
+ st.wDayOfWeek = 0;
+ st.wDay = 1;
+ st.wHour = 0;
+ st.wMinute = 0;
+ st.wSecond = 0;
+ st.wMilliseconds = 0;
+
+ /* Converting System Time to File Time */
+ bret = PbSystemTimeToFileTime(&st, &ft);
+ if (bret != TRUE) {
+ /* If the conversion fails, */
+ p_inst->time_on_january1_1970 = 0; /* Save to instance with zero elapsed seconds */
+ } else {
+ /* If the conversion is successful, */
+ p_inst->time_on_january1_1970 = FileTimeToSeonds(&ft); /* Save File Time Elapsed Seconds to Instance */
+ }
+
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FileTimeToSeonds()
+ * ABSTRACT : File Time -> Time Conversion Processing
+ * NOTE : Convert the file time to seconds
+ * ARGUMENT : FILETIME *p_ft Pointer to the file time structure
+ * RETURN : DWORD Elapsing time(In seconds)
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static DWORD
+FileTimeToSeonds(FILETIME* p_ft) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 0;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : MiscTerm()
+ * ABSTRACT : Time-related processing instance release processing
+ * NOTE :
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL Normal completion Note: Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+MiscTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : Sleep()
+ * ABSTRACT : Sleep Processing
+ * NOTE : Cause the caller to sleep at the number of ticks specified by the argument
+ * ARGUMENT : u_int32 ticks Sleep time(Specify in ticks)
+ * : 0 Sleep permanently
+ * : 1 Discard the time slice
+ * RETURN : RET_API Normal completion Note: Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+Sleep(u_int32 ticks) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DWORD milliseconds;
+
+ switch (ticks) {
+ case 0: /* infinite delay. */
+ {
+ milliseconds = INFINITE;
+ break;
+ }
+ case 1: /* the thread to relinquish the remainder of its time slice */
+ /* to any other thread of equal priority that is ready to run. */
+ /* If there are no other threads of equal priority ready to run, */
+ /* the function returns immediately, and the thread continues execution. */
+ {
+ milliseconds = 0;
+ break;
+ }
+ default: /* Time tranrate from per 10ms tick count to per milli second. */
+ milliseconds = (DWORD)ticks * 10;
+ break;
+ }
+ PbMilliSecSleep(static_cast<u_int32>(milliseconds));
+
+ return(RET_NORMAL);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbMilliSecSleep()
+ * ABSTRACT : Sleep Processing(Units of ms)
+ * NOTE : Cause the caller to sleep at the number of ticks specified by the argument
+ * ARGUMENT : u_int32 ul_mill_time Sleep time(Specified in millimeters)
+ * : 0 Discard the time slice
+ * : INFINITE Sleep permanently
+ * RETURN : RET_API Normal completion Note: Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API PbMilliSecSleep(u_int32 ul_mill_time) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ switch (ul_mill_time) {
+ case 0:
+ {
+ /* Discard the time slice */
+ sched_yield();
+ break;
+ }
+ case INFINITE:
+ {
+ /* Abort processing indefinitely */
+ while (1) {
+ sleep(INFINITE);
+ }
+ }
+ default:
+ /* Sleep for Specified Time */
+ usleep(ul_mill_time * 1000);
+ break;
+ }
+
+ return RET_NORMAL;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SecSleep()
+ * ABSTRACT : Sleep Processing(s unit)
+ * NOTE : Cause the caller to sleep at the number of ticks specified by the argument
+ * ARGUMENT : u_int32 ul_time Sleep time(Specify in seconds)
+ * : 0 Discard the time slice
+ * : INFINITE Sleep permanently
+ * RETURN : RET_API Normal completion Note: Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API SecSleep(u_int32 ul_time) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ switch (ul_time) {
+ case 0:
+ {
+ /* Discard the time slice */
+ sched_yield();
+ break;
+ }
+ case INFINITE:
+ {
+ /* Abort processing indefinitely */
+ while (1) {
+ sleep(INFINITE);
+ }
+ }
+ default:
+ /* Sleep for Specified Time */
+ sleep(ul_time);
+ break;
+ }
+
+ return RET_NORMAL;
+}
+// LCOV_EXCL_STOP
+
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : _sysMisc.cpp
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
diff --git a/vehicleservice/positioning_base_library/library/src/_pbMsg.cpp b/vehicleservice/positioning_base_library/library/src/_pbMsg.cpp
new file mode 100755
index 0000000..3919239
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbMsg.cpp
@@ -0,0 +1,1572 @@
+/*
+ * @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
+ * _pbMsg.cpp
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_types.h>
+#include <vehicle_service/positioning_base_library.h>
+#include <native_service/ns_message_center_if.h>
+#include "_pbEvent_Internal.h"
+#include "_pbInternalProc.h"
+
+#include <native_service/frameworkunified_framework_if.h>
+#include "WPF_STD_private.h"
+#include "tchar.h"
+
+/*---------------------------------------------------------------------------------*
+ * Define *
+ *---------------------------------------------------------------------------------*/
+#define MSG_MAX_NUM_CTRL_MSGQUE (32) /* Maximum number of message queues */
+#define MSG_MAX_NUM_CTRL_THREAD (16) /* Maximum number of threads/process */
+
+#define FULL_MSG_NUM_CTRL_MSGQUE (MSG_MAX_NUM_CTRL_MSGQUE - 4) /* Message control table threshold (no free) */
+#define WARN_MSG_NUM_CTRL_MSGQUE (MSG_MAX_NUM_CTRL_MSGQUE - 10) /* Message control table threshold (warning) */
+
+/*---------------------------------------------------------------------------------*
+ * Structure *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Control table for message queues
+*/
+typedef struct {
+ PNO pno; /**< Process No. */
+ char name[MAX_QUEUE_NAME_SIZE]; /**< Message Que Name */
+ HANDLE h_positioningbaselibrary_sender[MSG_MAX_NUM_CTRL_THREAD]; /**< handle to the Sender */
+ HANDLE h_sender; /**< handle to the Sender */
+ HANDLE h_receiver; /**< handle to the Receiver */
+ HANDLE h_zc_sender; /**< handle to the ZcSender */
+ uint8_t msg_rcv_buf[MAX_QUEUE_MSG_SIZE]; /**< Message buffer */
+} MSG_CTRL_DETAIL_INFO;
+
+/*!
+ @brief Control table for message queues
+*/
+typedef struct {
+ MSG_CTRL_DETAIL_INFO info[MSG_MAX_NUM_CTRL_MSGQUE]; /**< message infomation */
+ uint32_t use_cnt; /**< Use Counter */
+ uint32_t rsv_cnt; /**< Reserve Counter */
+} MSG_CTRL_INFO;
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+/**
+ Message control table
+ Note: Access to this instance shall be made through the operation module.
+*/
+static MSG_CTRL_INFO g_msg_ctrl_tbl; // NOLINT(readability/nolint) global Class instance
+
+/** Message-control-table-locking Mutex handles */
+static HANDLE g_h_mtx;
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+/* Message Control Table Operation Functions */
+static void MsgSetPnoOfCtrlTbl(u_int32 idx, PNO pno); /* PNO setting */
+static PNO MsgGetPnoOfCtrlTbl(u_int32 idx); /* PNO acquisition */
+static void MsgSetNameOfCtrlTbl(u_int32 idx, LPCTSTR name); /* Message queue name setting */
+static char* MsgGetNameOfCtrlTbl(u_int32 idx); /* Get Message Queue Name */
+static void MsgSetReceiverHandleOfCtrlTbl(u_int32 idx, HANDLE handle); /* Message queue handle setting */
+static HANDLE MsgGetReceiverHandleOfCtrlTbl(u_int32 idx); /* Get message queue handle */
+static void MsgSetSenderHandleOfCtrlTbl(u_int32 idx, HANDLE handle); /* Message send handle setting */
+static HANDLE MsgGetSenderHandleOfCtrlTbl(u_int32 idx); /* Get message send handle */
+/* Message send handle setting*/
+static void MsgSetPositioningbaselibrarySenderHandleOfCtrlTbl(u_int32 idx, HANDLE handle, uint32_t offset);
+static HANDLE MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(u_int32 idx, uint32_t offset); /* Get message send handle */
+static void MsgSetZcSenderHandleOfCtrlTbl(u_int32 idx, HANDLE handle); /* Message send handle setting */
+static HANDLE MsgGetZcSenderHandleOfCtrlTbl(u_int32 idx); /* Get message send handle */
+static uint8_t* MsgGetMsgRcvBufOfCtrlTbl(uint32_t idx); /* Get message receive buffer */
+static u_int32 MsgSearchEmptyOfCtrlTbl(void); /* Retrieval of free space in control table */
+static u_int32 MsgSearchPnoOfCtrlTbl(PNO pno); /* Retrieval of control table PNO */
+static u_int32 MsgSearchNameOfCtrlTbl(LPCTSTR name); /* Retrieve control table queue name */
+static void MsgIncUseCntOfCtrlTbl(void); /* Control table usage counter increment */
+static void MsgDecUseCntOfCtrlTbl(void); /* Control table usage counter increment */
+static void MsgIncRsvCntOfCtrlTbl(void); /* Control table reservation counter increment */
+static void MsgDecRsvCntOfCtrlTbl(void); /* Control table reservation counter increment */
+
+/* Mutex handling Functions for Accessing Message Control Tables */
+static void MsgCreateMutex(void); /* Mutex generating */
+/* Message send handle setting */
+/* static void MsgDeleteMutex(void); */ // Todo:Uncomment out after completion of implementation of termination processing
+static void MsgLockMutex(void); /* Mutex retrieval */
+static void MsgUnlockMutex(void); /* Mutex release */
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Initialize the message function
+ *
+ * Message control table initialization
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error
+ */
+RET_API MsgInit(void) {
+ RET_API ret_api = RET_NORMAL;
+ u_int32 i;
+
+ MsgCreateMutex();
+
+ /* Control table initialization */
+ memset(g_msg_ctrl_tbl.info, 0x00, sizeof(g_msg_ctrl_tbl.info));
+
+ for (i = 0; i < MSG_MAX_NUM_CTRL_MSGQUE; i++) {
+ /* Empty character is set for the message queue name. */
+ _tcscpy(g_msg_ctrl_tbl.info[i].name, "");
+ }
+ g_msg_ctrl_tbl.use_cnt = 0;
+ g_msg_ctrl_tbl.rsv_cnt = 0;
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Term
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERROR ABENDs
+ */
+RET_API MsgTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_ERROR;
+ RET_API ret;
+ EFrameworkunifiedStatus estatus;
+ HANDLE handle;
+ u_int32 idx;
+ PNO pno;
+
+ MsgLockMutex();
+
+ /* Release Message Transmission/Reception Handle */
+ for (idx = 0; idx < MSG_MAX_NUM_CTRL_MSGQUE; idx++) {
+ /* Receive handle acquisition */
+ pno = MsgGetPnoOfCtrlTbl(idx);
+ if (pno != 0) {
+ /* For queue information for internal threads */
+ /* Delete Message Queue */
+ ret = PbDeleteMsg(pno);
+ if (ret != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "McClose ERROR " \
+ "[ret:%d, pno:%d]", ret, pno);
+ /* The module returns OK even if it fails. */
+ }
+ } else {
+ /* Other than the above(Send handle to external process) */
+ /* Get send handle */
+ handle = MsgGetSenderHandleOfCtrlTbl(idx);
+ if (handle != NULL) {
+ estatus = FrameworkunifiedMcClose(handle);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "FrameworkunifiedMcClose ERROR " \
+ "[estatus:%d, handle:%p]", estatus, handle);
+ /* The module returns OK even if it fails. */
+ } else {
+ /* Message control table update */
+ MsgSetSenderHandleOfCtrlTbl(idx, NULL); /* Send handle */
+
+ MsgSetNameOfCtrlTbl(idx, ""); /* Name */
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### MESSAGE TABLE INFORMATION # " \
+ "(--) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, h_sender=%p, h_receiver=%p, name=%s",
+ idx, MsgGetPnoOfCtrlTbl(idx), PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, \
+ PbGetLocalTid()), MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ }
+ }
+ }
+
+ MsgUnlockMutex();
+
+ /* MsgDeleteMutex(); */ // Todo:Uncomment out after completion of implementation of termination processing
+
+ /* TODO:Delete the shared memory for the message management table */
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Create the message queue
+ *
+ * Creates a message queue.
+ * This function is implemented on the assumption that a thread name is assigned by prctl() and then called from that thread.
+ * The generated message queue name is the same as the thread name.
+ *
+ * @param[in] pno Process number
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_CreateMsg(PNO pno) { // NOLINT(readability/nolint) interface
+ RET_API ret_api = RET_NORMAL; /* Results of this Module process */
+ u_int32 idx;
+ HANDLE handle = NULL;
+ char name[MAX_QUEUE_NAME_SIZE];
+ size_t len;
+
+ /* If PNO is invalid (0), the parameter is abnormal and processing is not performed. */
+ if (pno == 0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [pno:%d]", pno);
+ ret_api = RET_ERRPARAM;
+ } else {
+ /* Get Thread Name */
+ (void)prctl(PR_GET_NAME, name);
+
+ len = _tcslen(name);
+ if (len >= MAX_QUEUE_NAME_SIZE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Length of thread name is too long(>=%d). " \
+ "[len:%zu]", MAX_QUEUE_NAME_SIZE, len);
+ ret_api = RET_ERRPARAM;
+ } else {
+ MsgLockMutex(); // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Check if the specified PNO is already registered */
+ idx = MsgSearchPnoOfCtrlTbl(pno); // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* When the entry is already stored */
+ if (idx != MSG_MAX_NUM_CTRL_MSGQUE) {
+ /* No processing */
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### MESSAGE TABLE INFORMATION # " \
+ "(+) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, h_sender=%p, h_receiver=%p, name=%s", \
+ idx, MsgGetPnoOfCtrlTbl(idx), PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, \
+ PbGetLocalTid()), MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ } else {
+ /* Not registered */
+ /* Search for free space */
+ idx = MsgSearchEmptyOfCtrlTbl();
+ if (idx == MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 200: idx can not be MSG_MAX_NUM_CTRL_MSGQUE
+ /* Be impossible by design */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgSearchEmptyOfCtrlTbl ERROR " \
+ "[idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: idx can not be MSG_MAX_NUM_CTRL_MSGQUE
+
+ /* don't arrive here. */
+ } else {
+ /* Create Message Queue */
+ handle = McOpenReceiver(name); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (handle == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* In the event of failure */
+ // LCOV_EXCL_START 5: standard lib error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McOpenReceiver ERROR " \
+ "[handle:%p, name:%s]", handle, name);
+ _pb_Exit();
+ // LCOV_EXCL_STOP
+ /* don't arrive here. */
+ } else {
+ /* If successful */
+ /* Message control table update */
+ MsgSetPnoOfCtrlTbl(idx, pno); /* PNO */ // LCOV_EXCL_BR_LINE 200: no branch
+
+ MsgSetReceiverHandleOfCtrlTbl(idx, handle); /* Receive handle */ // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+
+ MsgSetNameOfCtrlTbl(idx, name); /* Name */ // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Increment Message Control Table Usage Counter */
+ MsgIncUseCntOfCtrlTbl();
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, \
+ "### MESSAGE TABLE INFORMATION # (++) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, " \
+ "h_sender=%p, h_receiver=%p, name=%s", idx, MsgGetPnoOfCtrlTbl(idx), \
+ PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, PbGetLocalTid()), \
+ MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ }
+ }
+ }
+
+ MsgUnlockMutex(); // LCOV_EXCL_BR_LINE 200: no branch
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Delete the message queue
+ *
+ * Delete a message queue.
+ * Deleted from the message control table even if closing of the send/receive handle fails
+ *
+ * @param[in] pno
+ *
+ * @return RET_NORMAL Normal completion
+ */
+RET_API PbDeleteMsg(PNO pno) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL; /* Results of this Module process */
+ uint32_t idx;
+ uint32_t i;
+ HANDLE handle;
+ EFrameworkunifiedStatus estatus;
+
+ idx = MsgSearchPnoOfCtrlTbl(pno);
+ if (idx != MSG_MAX_NUM_CTRL_MSGQUE) {
+ /* Receive handle acquisition */
+ handle = MsgGetReceiverHandleOfCtrlTbl(idx);
+ if (handle != NULL) {
+ estatus = McClose(handle);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "McClose ERROR " \
+ "[estatus:%d, handle:%p]", estatus, handle);
+ /* The module returns OK even if the Close fails. */
+ }
+ }
+
+ /* Get send handle */
+ handle = MsgGetSenderHandleOfCtrlTbl(idx);
+ if (handle != NULL) {
+ estatus = McClose(handle);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "McClose ERROR " \
+ "[estatus:%d, handle:%p]", estatus, handle);
+ /* The module returns OK even if the Close fails. */
+ }
+ }
+
+ /* Get send handle */
+ handle = MsgGetZcSenderHandleOfCtrlTbl(idx);
+ if (handle != NULL) {
+ estatus = McZcClose(handle);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "McZcClose ERROR " \
+ "[estatus:%d, handle:%p]", estatus, handle);
+ /* The module returns OK even if the Close fails. */
+ }
+ }
+
+ /* Message control table update */
+ MsgSetPnoOfCtrlTbl(idx, 0); /* PNO */
+
+ for (i = 0; i < MSG_MAX_NUM_CTRL_THREAD; i++) {
+ MsgSetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, NULL, i); /* Send handle */
+ }
+
+ MsgSetSenderHandleOfCtrlTbl(idx, NULL); /* Send handle */
+
+ MsgSetReceiverHandleOfCtrlTbl(idx, NULL); /* Receive handle */
+
+ MsgSetNameOfCtrlTbl(idx, ""); /* Name */
+
+ /* Decrement Message Control Table Usage Counter */
+ MsgDecUseCntOfCtrlTbl();
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### MESSAGE TABLE INFORMATION # " \
+ "(--) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, h_sender=%p, h_receiver=%p, name=%s", \
+ idx, MsgGetPnoOfCtrlTbl(idx), PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, \
+ PbGetLocalTid()), MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Receive the message
+ *
+ * Receive a message for the specified PNO.If the specified PNO is invalid, an error is returned.
+ * If the size of the received data exceeds the size specified in the parameter, an error is returned.
+ *
+ * @param[in] pno Process number
+ * @param[in] size Message size
+ * @param[out] msgbuf Pointer to message area
+ * @param[in] mode Not used
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_RcvMsg(PNO pno, u_int16 size, void** msgbuf, u_int16 mode) { // NOLINT(readability/nolint) interface
+ RET_API ret_api = RET_RCVMSG; /* Results of this Module process */
+ u_int32 idx;
+ HANDLE h_msg_que = NULL;
+ char source[MAX_QUEUE_NAME_SIZE];
+ u_int32 cmd_id;
+ EFrameworkunifiedStatus rcv_sts;
+ u_int8* p_msg_rcv_buf;
+ u_int32 msg_len = 0;
+ void* p_rcv_data;
+
+ /* Null Check */
+ if (msgbuf == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [msgbuf:%p]", msgbuf);
+ ret_api = RET_ERRPARAM;
+ } else if (pno == 0) {
+ /* PNO-invalid Check */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [pno:%d]", pno);
+ ret_api = RET_ERRPARAM;
+ } else {
+ /* Search if the specified PNO is registered in the control table */
+ idx = MsgSearchPnoOfCtrlTbl(pno); // LCOV_EXCL_BR_LINE 200: no branch
+ /* Not stored */
+ if (idx == MSG_MAX_NUM_CTRL_MSGQUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgSearchPnoOfCtrlTbl ERROR " \
+ "[idx:%d, pno:0x%x]", idx, pno);
+ ret_api = RET_ERRPARAM;
+ } else {
+ /* If it is registered */
+ /* Handle acquisition */
+ h_msg_que = MsgGetReceiverHandleOfCtrlTbl(idx); // LCOV_EXCL_BR_LINE 200: recv handle created in _pb_CreateMsg //NOLINT(whitespace/line_length)
+ if (h_msg_que == NULL) { // LCOV_EXCL_BR_LINE 200: recv handle created in _pb_CreateMsg
+ /* Be impossible by design */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Msg_getMsgQueHandleOfCtrlTbl ERROR " \
+ "[h_msg_que:%p, idx:%d]", h_msg_que, idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: recv handle created in _pb_CreateMsg
+
+ /* don't arrive here. */
+ }
+
+ /* Get Message Buffer */
+ p_msg_rcv_buf = MsgGetMsgRcvBufOfCtrlTbl(idx); // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Receive message */
+ // LCOV_EXCL_BR_START 4: nsfw error
+ rcv_sts = McReceive(h_msg_que,
+ source, /* app that sent this message */
+ &cmd_id, /* Command ID */
+ MAX_QUEUE_MSG_SIZE,
+ (PVOID)p_msg_rcv_buf);
+ // LCOV_EXCL_BR_STOP
+
+ if (rcv_sts != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* In the event of failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McReceive ERROR " \
+ "[rcv_sts:%d, h_msg_que:%p, source:%s, cmd_id:0x%x]", rcv_sts, h_msg_que, source, cmd_id);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ /* If successful */
+ /* Size check */
+ msg_len = McGetLength(p_msg_rcv_buf); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if ((msg_len <= size) && (msg_len > 0)) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* OK */
+ /* Get Message */
+ p_rcv_data = McGetDataPointer(p_msg_rcv_buf); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (p_rcv_data == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ rcv_sts = McGetDataOfSize(p_msg_rcv_buf, *msgbuf, msg_len);
+ if (rcv_sts != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* Message acquisition failure */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "McGetDataOfSize ERROR [rcv_sts:%d]", rcv_sts);
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, \
+ "McReceive/McGetDataOfSize SUCCESS [rcv_sts:%d, h_msg_que:%p, source:%s, " \
+ "cmd_id:0x%x, msg_len:%d]", rcv_sts, h_msg_que, source, cmd_id, msg_len);
+ }
+ } else {
+ *msgbuf = p_rcv_data;
+ }
+ } else {
+ /* NG */
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McGetLength ERROR " \
+ "[size:%d < msg_len:%d]", size, msg_len);
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ }
+ }
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Send the message
+ *
+ * For in-process communication
+ * Sends a message to the specified PNO.If the specified PNO is invalid, an error is returned.
+ *
+ * @param[in] pno Process number
+ * @param[in] size Message size
+ * @param[in] msgbuf Pointer to message storage area
+ * @param[in] mode Not used
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_SndMsg(PNO pno, u_int16 size, void* msgbuf, u_int16 mode) { // NOLINT(readability/nolint) interface
+ RET_API ret_api = RET_NORMAL; /* Results of this Module process */
+ u_int32 idx;
+ PCSTR msg_que_name;
+ HANDLE handle; /* handle to the send message queue */
+ EFrameworkunifiedStatus estatus;
+ T_APIMSG_MSGBUF_HEADER *p_msg_header;
+ CID cid;
+
+ /* Null Check */
+ if (msgbuf == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [msgbuf:%p]", msgbuf);
+ ret_api = RET_ERRPARAM;
+ } else if (pno == 0) {
+ /* PNO-invalid Check */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [pno:%d]", pno);
+ ret_api = RET_ERRPARAM;
+ } else {
+ MsgLockMutex();
+
+ /* Check if the specified PNO is registered in the message control table */
+ idx = MsgSearchPnoOfCtrlTbl(pno);
+ if (idx == MSG_MAX_NUM_CTRL_MSGQUE) {
+ /* Not stored */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgSearchPnoOfCtrlTbl ERROR!! " \
+ "[pno=%d]", pno);
+
+ ret_api = RET_ERRPARAM;
+ } else {
+ /* If it is registered */
+ /* Acquire transmission handle from management table */
+ handle = MsgGetSenderHandleOfCtrlTbl(idx);
+ if (handle == NULL) {
+ /* Get message queue name */
+ msg_que_name = MsgGetNameOfCtrlTbl(idx);
+
+ /* Get send handle */
+ handle = McOpenSender(msg_que_name); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When handle acquisition fails */
+ if (handle == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McOpenSender ERROR " \
+ "[handle:%p, msg_que_name:%s]", handle, msg_que_name);
+
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ }
+
+ /* Message control table update */
+ MsgSetSenderHandleOfCtrlTbl(idx, handle); /* Send handle */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### MESSAGE TABLE INFORMATION # " \
+ "(+) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, h_sender=%p, h_receiver=%p, name=%s", \
+ idx, MsgGetPnoOfCtrlTbl(idx), PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, \
+ PbGetLocalTid()), MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ }
+ /* When handle acquisition is successful */
+ if (handle != NULL) {
+ p_msg_header = reinterpret_cast<T_APIMSG_MSGBUF_HEADER*>(msgbuf);
+ cid = p_msg_header->hdr.cid;
+
+ /* Messaging */
+ estatus = McSend(handle,
+ "", /* Sender name */
+ cid, /* Command ID */
+ size,
+ msgbuf); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When transmission fails */
+ if (estatus != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McSend ERROR " \
+ "[estatus:%d, idx:%d, handle:%p, cid:0x%x, size:%d]", estatus, idx, handle, cid, size);
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "McSend SUCCESS " \
+ "[estatus:%d, idx:%d, handle:%p, cid:0x%x, size:%d]", estatus, idx, handle, cid, size);
+ }
+
+ /* Close all handles at the time of termination */
+ }
+ }
+
+ MsgUnlockMutex();
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Acquire transmission buffer for in-process communication (for non-copy API)
+ * Gets the buffer for sending messages to the specified PNO.If the specified PNO is invalid, an error is returned.
+ * Set the send data in the acquired buffer and send it with _pb_ZcSndMsg().
+ *
+ * @param[in] pno Process number
+ * @param[out] p_snd_buf Transmitting buffer
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_GetZcSndBuf(PNO pno, void** p_snd_buf) { // NOLINT(readability/nolint) interface
+ RET_API ret_api = RET_NORMAL; /* Results of this Module process */
+ u_int32 idx;
+ PCSTR msg_que_name;
+ HANDLE handle; /* handle to the send message queue */
+
+ /* PNO-invalid Check */
+ if (pno == 0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [pno:%d]", pno);
+ ret_api = RET_ERRPARAM;
+ } else {
+ MsgLockMutex();
+
+ /* Check if the specified PNO is registered in the message control table */
+ idx = MsgSearchPnoOfCtrlTbl(pno);
+ if (idx == MSG_MAX_NUM_CTRL_MSGQUE) {
+ /* Not stored */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgSearchPnoOfCtrlTbl ERROR!! [pno=%d]", pno);
+
+ ret_api = RET_ERRPARAM;
+ } else {
+ /* If it is registered */
+ /* Acquire transmission handle from management table */
+ handle = MsgGetZcSenderHandleOfCtrlTbl(idx);
+ if (handle == NULL) {
+ /* Get message queue name */
+ msg_que_name = MsgGetNameOfCtrlTbl(idx);
+
+ /* Get send handle */
+ handle = McZcOpenSender(msg_que_name); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (handle == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When handle acquisition fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McOpenSender ERROR " \
+ "[handle:%p, msg_que_name:%s]", handle, msg_que_name);
+
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ }
+
+ /* Message control table update */
+ MsgSetZcSenderHandleOfCtrlTbl(idx, handle); /* Send handle */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### MESSAGE TABLE INFORMATION # " \
+ "(+) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, h_sender=%p, h_receiver=%p, name=%s",
+ idx, MsgGetPnoOfCtrlTbl(idx), PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, \
+ PbGetLocalTid()), MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ }
+
+ if (handle != NULL) {
+ /* When handle acquisition is successful */
+ /* Get message send buffer */
+ *p_snd_buf = McZcGetBuf(handle); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (*p_snd_buf == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When buffer acquisition fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McZcSetParam ERROR " \
+ "[idx:%d, handle:%p]", idx, handle);
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ }
+
+ /* Close all handles at the time of termination */
+ }
+ }
+
+ MsgUnlockMutex();
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Send the message
+ *
+ * For in-process communication(for non-copy API)
+ * Sends a message to the specified PNO.If the specified PNO is invalid, an error is returned.
+ * Before calling this function, send data must be set in the area acquired by _pb_GetZcSndBuf().
+ *
+ * @param[in] pno Process number
+ * @param[in] size Message size
+ * @param[in] mode Not used
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_ZcSndMsg(PNO pno, u_int16 size, u_int16 mode) { // NOLINT(readability/nolint) interface
+ RET_API ret_api = RET_NORMAL; /* Results of this Module process */
+ u_int32 idx;
+ HANDLE handle; /* handle to the send message queue */
+ EFrameworkunifiedStatus estatus;
+ T_APIMSG_MSGBUF_HEADER *p_msg_header;
+ CID cid;
+ void* p_send_data;
+
+ /* PNO-invalid Check */
+ if (pno == 0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [pno:%d]", pno);
+ ret_api = RET_ERRPARAM;
+ } else {
+ MsgLockMutex();
+
+ /* Check if the specified PNO is registered in the message control table */
+ idx = MsgSearchPnoOfCtrlTbl(pno);
+ if (idx == MSG_MAX_NUM_CTRL_MSGQUE) {
+ /* Not stored */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgSearchPnoOfCtrlTbl ERROR!! [pno=%d]", pno);
+
+ ret_api = RET_ERRPARAM;
+ } else {
+ /* If it is registered */
+ /* Acquire transmission handle from management table */
+ handle = MsgGetZcSenderHandleOfCtrlTbl(idx); // LCOV_EXCL_BR_LINE 200: sender handle set in _pb_GetZcSndBuf
+ if (handle == NULL) { // LCOV_EXCL_BR_LINE 200: sender handle set in _pb_GetZcSndBuf
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "handle ERROR " \
+ "[pno=%d, idx=%d]", pno, idx);
+
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 200: sender handle set in _pb_GetZcSndBuf
+ }
+ /* When handle acquisition is successful */
+ if (handle != NULL) {
+ /* Messaging */
+ /* Set the transmission data in advance. */
+ p_send_data = McZcGetBuf(handle);
+ if (p_send_data != NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ p_msg_header = reinterpret_cast<T_APIMSG_MSGBUF_HEADER*>(p_send_data);
+ cid = p_msg_header->hdr.cid;
+ estatus = McZcSetParam(handle, cid, size);
+ if (estatus == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ estatus = McZcSend(handle); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When transmission fails */
+ if (estatus != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McZcSend ERROR " \
+ "[estatus:%d, idx:%d, handle:%p, cid:0x%x, size:%d]", estatus, \
+ idx, handle, cid, size);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "McZcSend SUCCESS " \
+ "[estatus:%d, idx:%d, handle:%p, cid:0x%x, size:%d]", estatus, \
+ idx, handle, cid, size);
+ }
+ } else {
+ /* When parameter setting fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McZcSetParam ERROR " \
+ "[estatus:%d, idx:%d, handle:%p, cid:0x%x, size:%d]", estatus, idx, handle, cid, size);
+ ret_api = RET_ERROR;
+ }
+ } else {
+ /* When parameter buffer acquisition fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McZcGetBuf ERROR " \
+ "[idx:%d, handle:%p, size:%d]", idx, handle, size);
+ ret_api = RET_ERROR;
+ }
+
+ /* Close all handles at the time of termination */
+ }
+ }
+
+ MsgUnlockMutex();
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Send the message
+ *
+ * For interprocess communication
+ * Sends a message to the specified process.If the specified process is invalid, an error is returned.
+ *
+ * Note: Since the data sent by this function is to be received by the dispatcher, the message header
+ * must not be included in the send data specified by the argument.
+ *
+ * @param[in] name Destination Process Name
+ * @param[in] cid Command ID
+ * @param[in] size Message size
+ * @param[in] msgbuf Pointer to message storage area
+ * @param[in] mode Not used
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERRPARAM Parameter error<br>
+ * RET_ERROR Other errors
+ */
+RET_API _pb_SndMsg_Ext(PCSTR name, CID cid, u_int16 size, const void* msgbuf, // NOLINT(readability/nolint) interface
+ u_int16 mode) {
+ RET_API ret_api = RET_NORMAL; /* Results of this Module process */
+ uint32_t thread_offset;
+ u_int32 idx;
+ HANDLE h_positioningbaselibrary_service = NULL;
+ EFrameworkunifiedStatus estatus;
+ size_t len;
+ HANDLE h_app;
+
+ /* Null Check */
+ if ((name == NULL) || (msgbuf == NULL)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR " \
+ "[name:%p, msgbuf:%p]", name, msgbuf);
+ ret_api = RET_ERRPARAM;
+ } else {
+ h_app = _pb_GetAppHandle();
+
+ len = _tcslen(name);
+ if (len >= MAX_QUEUE_NAME_SIZE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!! " \
+ "Length of thread name is too long(>=%d). [len:%zu]", MAX_QUEUE_NAME_SIZE, len);
+ ret_api = RET_ERRPARAM;
+ } else {
+ thread_offset = PbGetLocalTid();
+
+ MsgLockMutex();
+
+ idx = MsgSearchNameOfCtrlTbl(name);
+
+ if (idx != MSG_MAX_NUM_CTRL_MSGQUE) {
+ h_positioningbaselibrary_service = MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, thread_offset);
+ if (h_positioningbaselibrary_service == NULL) {
+ h_positioningbaselibrary_service = FrameworkunifiedMcOpenSender(h_app, name); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When handle acquisition fails */
+ if (h_positioningbaselibrary_service == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "FrameworkunifiedMcOpenSender ERROR!! " \
+ "[h_positioningbaselibrary_service=%p, h_app=%p, name=%s]", h_positioningbaselibrary_service, h_app, name);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ /* Message control table update */
+ MsgSetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, h_positioningbaselibrary_service, thread_offset); /* Send handle */
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### MESSAGE TABLE INFORMATION # " \
+ "(+) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, h_sender=%p, h_receiver=%p, name=%s", \
+ idx, MsgGetPnoOfCtrlTbl(idx), PbGetLocalTid(), \
+ MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, PbGetLocalTid()), MsgGetSenderHandleOfCtrlTbl(idx), \
+ MsgGetReceiverHandleOfCtrlTbl(idx), MsgGetNameOfCtrlTbl(idx));
+ }
+ }
+ } else {
+ /* Search for free space */
+ idx = MsgSearchEmptyOfCtrlTbl();
+ if (idx == MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 200: idx can not be MSG_MAX_NUM_CTRL_MSGQUE
+ /* Be impossible by design */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgSearchEmptyOfCtrlTbl ERROR!! " \
+ "[idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: idx can not be MSG_MAX_NUM_CTRL_MSGQUE
+
+ /* don't arrive here. */
+ } else {
+ /* Get send handle */
+ h_positioningbaselibrary_service = FrameworkunifiedMcOpenSender(h_app, name); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When handle acquisition fails */
+ if (h_positioningbaselibrary_service == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "FrameworkunifiedMcOpenSender ERROR!! " \
+ "[h_positioningbaselibrary_service=%p, h_app=%p, name=%s]", h_positioningbaselibrary_service, h_app, name);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ /* Message control table update */
+ MsgSetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, h_positioningbaselibrary_service, thread_offset); /* Send handle */
+
+ MsgSetNameOfCtrlTbl(idx, name); /* Name */
+
+ /* Increment Message Control Table Usage Counter */
+ MsgIncUseCntOfCtrlTbl();
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, \
+ "### MESSAGE TABLE INFORMATION # (++) idx=%d, pno=%d, h_positioningbaselibrary_sender[%d]=%p, " \
+ "h_sender=%p, h_receiver=%p, name=%s", idx, MsgGetPnoOfCtrlTbl(idx), \
+ PbGetLocalTid(), MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(idx, PbGetLocalTid()), \
+ MsgGetSenderHandleOfCtrlTbl(idx), MsgGetReceiverHandleOfCtrlTbl(idx), \
+ MsgGetNameOfCtrlTbl(idx));
+ }
+ }
+ }
+
+ MsgUnlockMutex();
+ /* When handle acquisition is successful */
+ if (h_positioningbaselibrary_service != NULL) {
+ /* Messaging */
+ estatus = FrameworkunifiedSendMsg(h_positioningbaselibrary_service, cid, size, msgbuf); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When transmission fails */
+ if (estatus != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "FrameworkunifiedSendMsg ERROR!! " \
+ "[name=%s, estatus=%d, h_positioningbaselibrary_service=%p, cid=%d, size=%d]", \
+ name, estatus, h_positioningbaselibrary_service, cid, size);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, "Send message = " \
+ "[Destination:%s][CID:0x%X]", name, cid);
+ }
+ /* Close all handles at the time of termination */
+ }
+ }
+ }
+
+ return ret_api;
+}
+
+/*---------------------------------------------------------------------------------*
+ * Local Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * PNO setting(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] pno Process number
+ */
+static void MsgSetPnoOfCtrlTbl(u_int32 idx, PNO pno) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d, pno:%d]", idx, pno);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ } else {
+ g_msg_ctrl_tbl.info[idx].pno = pno;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * PNO acquisition(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] pno Process number
+ */
+static PNO MsgGetPnoOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].pno;
+}
+
+/**
+ * @brief
+ * Message queue name setting(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] name Message queue name
+ */
+static void MsgSetNameOfCtrlTbl(u_int32 idx, LPCTSTR name) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d, name:%s]", idx, name);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ _tcscpy(g_msg_ctrl_tbl.info[idx].name, name);
+
+ return;
+}
+
+/**
+ * @brief
+ * Get Message Queue Name(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ *
+ * @return Message queue name
+ */
+static char* MsgGetNameOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].name;
+}
+
+/**
+ * @brief
+ * Message reception handle setting(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] handle Message queue handle
+ */
+static void MsgSetReceiverHandleOfCtrlTbl(u_int32 idx, HANDLE handle) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR " \
+ "[idx:%d, handle:%p]", idx, handle);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ } else {
+ g_msg_ctrl_tbl.info[idx].h_receiver = handle;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get message reception handle(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ *
+ * @return Message queue handle
+ */
+static HANDLE MsgGetReceiverHandleOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].h_receiver;
+}
+
+/**
+ * @brief
+ * Message send handle setting(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] handle Message queue handle
+ */
+static void MsgSetSenderHandleOfCtrlTbl(u_int32 idx, HANDLE handle) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR " \
+ "[idx:%d, handle:%p]", idx, handle);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ } else {
+ g_msg_ctrl_tbl.info[idx].h_sender = handle;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get message send handle(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ *
+ * @return Message queue handle
+ */
+static HANDLE MsgGetSenderHandleOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].h_sender;
+}
+
+
+/**
+ * @brief
+ * Positioningbaselibrary message send handle setting(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] handle Message queue handle
+ * @param[in] offset Local thread ID
+ */
+static void MsgSetPositioningbaselibrarySenderHandleOfCtrlTbl(u_int32 idx, HANDLE handle, uint32_t offset) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR " \
+ "[idx:%d, handle:%p]", idx, handle);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ } else {
+ g_msg_ctrl_tbl.info[idx].h_positioningbaselibrary_sender[offset] = handle;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Positioningbaselibrary message send handle acquisition(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] offset Local thread ID
+ *
+ * @return Message queue handle
+ */
+static HANDLE MsgGetPositioningbaselibrarySenderHandleOfCtrlTbl(u_int32 idx, uint32_t offset) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].h_positioningbaselibrary_sender[offset];
+}
+
+/**
+ * @brief
+ * Message send handle setting(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ * @param[in] handle Message queue handle
+ */
+static void MsgSetZcSenderHandleOfCtrlTbl(u_int32 idx, HANDLE handle) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR " \
+ "[idx:%d, handle:%p]", idx, handle);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ } else {
+ g_msg_ctrl_tbl.info[idx].h_zc_sender = handle;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get message send handle(Message control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control Table Element Number
+ *
+ * @return Message queue handle
+ */
+static HANDLE MsgGetZcSenderHandleOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].h_zc_sender;
+}
+
+/**
+ * @brief
+ * Get message receive buffer(Message control table)
+ *
+ * @param[in] idx Control Table Element Number
+ *
+ * @return Pointer to message receive buffer
+ */
+static uint8_t* MsgGetMsgRcvBufOfCtrlTbl(uint32_t idx) {
+ /* check index */
+ if (idx >= MSG_MAX_NUM_CTRL_MSGQUE) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+
+ /* don't arrive here. */
+ }
+
+ return g_msg_ctrl_tbl.info[idx].msg_rcv_buf;
+}
+
+/**
+ * @brief
+ * Search unused area(Message control table)
+ *
+ * Returns the index (minimum value) for accessing the unused area in the message control table.<br>
+ * Returns the maximum message queue management value (MSG_MAX_NUM_CTRL_MSGQUE) <br>
+ * when no unused area exists
+ *
+ * @return Index for access(Unused area exists.)<br>
+ * Maximum mutex management value(No unused area)
+ */
+static u_int32 MsgSearchEmptyOfCtrlTbl(void) {
+ int32 ret;
+ u_int32 idx;
+
+ for (idx = 0; idx < MSG_MAX_NUM_CTRL_MSGQUE; idx++) {
+ ret = _tcscmp(g_msg_ctrl_tbl.info[idx].name, "");
+
+ /* For unused space */
+ if (ret == 0) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+/**
+ * @brief
+ * PNO search(Message control table)
+ *
+ * Retrieves whether the specified PNO is already registered in the message control table.<br>
+ * If it is registered, the access index is returned.If it is not stored,<br>
+ * Returns the maximum message queue management value (MSG_MAX_NUM_CTRL_MSGQUE).
+ *
+ * @param[in] pno Process number
+ *
+ * @return Index for access(If it is registered)<br>
+ * Maximum value of message queue management(Not stored)
+ */
+static u_int32 MsgSearchPnoOfCtrlTbl(PNO pno) {
+ u_int32 idx;
+ PNO lPno;
+
+ for (idx = 0; idx < MSG_MAX_NUM_CTRL_MSGQUE; idx++) {
+ lPno = MsgGetPnoOfCtrlTbl(idx);
+
+ /* If there is a match */
+ if (lPno == pno) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+
+/**
+ * @brief
+ * Queue name search(Message control table)
+ *
+ * Retrieves whether the specified queue name is already registered in the message control table.<br>
+ * If it is registered, the access index is returned.If it is not stored,<br>
+ * Returns the maximum message queue management value (MSG_MAX_NUM_CTRL_MSGQUE).
+ *
+ * @param[in] Name queue-name
+ *
+ * @return Index for access(If it is registered)<br>
+ * Maximum value of message queue management(Not stored)
+ */
+static u_int32 MsgSearchNameOfCtrlTbl(LPCTSTR name) {
+ int32 ret;
+ u_int32 idx;
+
+ for (idx = 0; idx < MSG_MAX_NUM_CTRL_MSGQUE; idx++) {
+ ret = _tcscmp(g_msg_ctrl_tbl.info[idx].name, name);
+
+ /* If there is a match */
+ if (ret == 0) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+
+/**
+ * @brief
+ * Creation of Mutex for accessing the message control table
+ */
+static void MsgCreateMutex(void) {
+ g_h_mtx = _pb_CreateMutex(NULL, 0, "Msg_Mutex");
+ if (g_h_mtx == NULL) { // LCOV_EXCL_BR_LINE 200: can not be not NULL
+ // LCOV_EXCL_START 200: can not be not NULL
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateMutex ERROR [g_h_mtx:%p]", g_h_mtx);
+ _pb_Exit();
+ // LCOV_EXCL_STOP
+
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Acquire Mutex for accessing the message control table
+ */
+static void MsgLockMutex(void) {
+ DWORD ret;
+ ret = PbMutexLock(g_h_mtx, INFINITE); // LCOV_EXCL_BR_LINE 200: mutex lock can not failed
+ if (ret != WAIT_OBJECT_0) { // LCOV_EXCL_BR_LINE 200: mutex lock can not failed
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbMutexLock ERROR " \
+ "[ret:%lu, g_h_mtx:%p]", ret, g_h_mtx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: mutex lock can not failed
+
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Releasing the Mutex for accessing the message control table
+ */
+static void MsgUnlockMutex(void) {
+ BOOL ret;
+ ret = PbMutexUnlock(g_h_mtx); // LCOV_EXCL_BR_LINE 200: mutex lock can not failed
+ if (ret != TRUE) { // LCOV_EXCL_BR_LINE 200: mutex lock can not failed
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbMutexUnlock ERROR " \
+ "[ret:%d, g_h_mtx:%p]", ret, g_h_mtx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: mutex lock can not failed
+
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Obtain dump information
+ *
+ * @param[out] pBuf Dump info
+ * @param[in/out] pLen Buffer size
+ */
+void _pb_GetDebugMsgMngTbl(void* pBuf, uint8_t* pLen) {
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufPositioningbaselibrarySender[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufMsg[DEBUG_DUMP_MAX_SIZE];
+ uint32_t i;
+ uint32_t e;
+ uint8_t cnt = 0;
+
+ if ((pBuf != NULL) && (pLen != NULL)) {
+ memset(&buf[0], 0x00, sizeof(buf));
+ memset(&bufMsg[0], 0x00, sizeof(bufMsg));
+ for (i = 0; i < MSG_MAX_NUM_CTRL_MSGQUE; i++) {
+ memset(&bufPositioningbaselibrarySender[0], 0x00, sizeof(bufPositioningbaselibrarySender));
+ for (e = 0; e < MSG_MAX_NUM_CTRL_THREAD; e++) {
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "[%02d]%10p ", e, g_msg_ctrl_tbl.info[i].h_positioningbaselibrary_sender[e]);
+ strncat(reinterpret_cast<char *>(&bufPositioningbaselibrarySender[0]), reinterpret_cast<char *>(&bufTmp[0]), \
+ strlen(reinterpret_cast<char *>(&bufTmp[0])));
+ }
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] pno:0x%04x, name:%16s, hSnd:%10p, hRcv:%10p, hPSnd:%s",
+ i,
+ g_msg_ctrl_tbl.info[i].pno,
+ g_msg_ctrl_tbl.info[i].name,
+ g_msg_ctrl_tbl.info[i].h_sender,
+ g_msg_ctrl_tbl.info[i].h_receiver,
+ &bufPositioningbaselibrarySender[0]);
+ strncat(reinterpret_cast<char *>(&bufMsg[0]), reinterpret_cast<char *>(&bufTmp[0]), \
+ strlen(reinterpret_cast<char *>(&bufTmp[0])));
+ if (((i+1) % 8) == 0) {
+ cnt++;
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Message-%d%s",
+ cnt,
+ &bufMsg[0]);
+ memcpy(pBuf, &buf[0], sizeof(buf));
+ pBuf = reinterpret_cast<void *>((reinterpret_cast<uint8_t *>(pBuf)) + sizeof(buf));
+ memset(&bufMsg[0], 0x00, sizeof(bufMsg));
+ if (cnt >= *pLen) {
+ break;
+ }
+ }
+ }
+ if (cnt < *pLen) {
+ if (bufMsg[0] != 0x00) {
+ cnt++;
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Message-%d%s",
+ cnt,
+ &bufMsg[0]);
+ memcpy(pBuf, &buf[0], sizeof(buf));
+ }
+ *pLen = cnt;
+ }
+ }
+}
+
+/**
+ * @brief
+ * Message Control Table Usage Counter Increment
+ *
+ * @param[in] none
+ */
+static void MsgIncUseCntOfCtrlTbl(void) {
+ g_msg_ctrl_tbl.use_cnt++;
+ return;
+}
+
+/**
+ * @brief
+ * Message control table usage counter decrement
+ *
+ * @param[in] none
+ */
+static void MsgDecUseCntOfCtrlTbl(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ g_msg_ctrl_tbl.use_cnt--;
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Message Control Table Reserved Counter Increment
+ *
+ * @param[in] none
+ */
+static void MsgIncRsvCntOfCtrlTbl(void) {
+ g_msg_ctrl_tbl.rsv_cnt++;
+ return;
+}
+
+/**
+ * @brief
+ * Message Control Table Reserved Counter Decrement
+ *
+ * @param[in] none
+ */
+static void MsgDecRsvCntOfCtrlTbl(void) {
+ g_msg_ctrl_tbl.rsv_cnt--;
+ return;
+}
+
+/**
+ * @brief
+ * Resource Acquisition Decision(Message control table)
+ *
+ * @param[in] none
+ *
+ * @return BOOL
+ * @retval TRUE : Normal
+ * @retval FALSE : Anomaly (Resource shortage)
+ */
+BOOL _pb_GetMsgResource(void) {
+ BOOL ret = TRUE;
+ uint32_t cnt;
+
+ MsgLockMutex();
+
+ /* Increment Message Control Table Reservation Counter */
+ MsgIncRsvCntOfCtrlTbl();
+
+ cnt = g_msg_ctrl_tbl.use_cnt + g_msg_ctrl_tbl.rsv_cnt;
+ if (cnt >= FULL_MSG_NUM_CTRL_MSGQUE) {
+ ret = FALSE;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Lack of resources " \
+ "[FATAL][use_cnt:%d rsv_cnt:%d]", g_msg_ctrl_tbl.use_cnt, g_msg_ctrl_tbl.rsv_cnt);
+ } else if (cnt >= WARN_MSG_NUM_CTRL_MSGQUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Lack of resources " \
+ "[WARN][use_cnt:%d rsv_cnt:%d]", g_msg_ctrl_tbl.use_cnt, g_msg_ctrl_tbl.rsv_cnt);
+ }
+
+ MsgUnlockMutex();
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Resource release(Message control table)
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+void _pb_ReleaseMsgResource(void) {
+ MsgLockMutex();
+
+ /* Decrement Message Control Table Reservation Counter */
+ MsgDecRsvCntOfCtrlTbl();
+
+ MsgUnlockMutex();
+
+ return;
+}
diff --git a/vehicleservice/positioning_base_library/library/src/_pbMutex.cpp b/vehicleservice/positioning_base_library/library/src/_pbMutex.cpp
new file mode 100755
index 0000000..06254ab
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbMutex.cpp
@@ -0,0 +1,1423 @@
+/*
+ * @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
+ * _pbMutex.cpp
+ */
+
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+
+#ifndef PT_PB_MUTEX_STUB__CWORD71_
+
+#include <vehicle_service/positioning_base_library.h>
+#include "_pbInternalProc.h"
+#include <native_service/cl_lock.h>
+#include <native_service/cl_lockid.h>
+#include "WPF_STD_private.h"
+#include "tchar.h"
+
+/*---------------------------------------------------------------------------------*
+ * Define *
+ *---------------------------------------------------------------------------------*/
+/* Mutex control table name (Shared Memory) */
+#define MUTEX_CTRL_TBL_NAME __TEXT("POS_BASE_MUTEX_TABLE")
+
+/*
+ Max. available Lock ID
+ Note : Lock ID application is 1 (for BaseAPI initialization) + 1 (for Mutex function control) + 30 (for provision) = 32
+*/
+#define MAX_CTRL_MUTEX_NUM (30)
+
+#define FULL_CTRL_MUTEX_NUM (MAX_CTRL_MUTEX_NUM - 4) /** Mutex control data threshold (no free) */
+#define WARN_CTRL_MUTEX_NUM (MAX_CTRL_MUTEX_NUM - 10) /** Mutex control data threshold (warning) */
+
+/*
+ ID needs to be aplicated
+
+ If you increase or decrease the IDs, define maximum number of managed LOCK IDs and
+ the default setting of "Lock ID Resource List" must also be changed.
+*/
+#define MUTEX_LOCK_ID_0 LOCK_POS_MTX_2 /* Mutex management-information-exclusive control */
+#define MUTEX_LOCK_ID_1 LOCK_POS_MTX_3
+#define MUTEX_LOCK_ID_2 LOCK_POS_MTX_4
+#define MUTEX_LOCK_ID_3 LOCK_POS_MTX_5
+#define MUTEX_LOCK_ID_4 LOCK_POS_MTX_6
+#define MUTEX_LOCK_ID_5 LOCK_POS_MTX_7
+#define MUTEX_LOCK_ID_6 LOCK_POS_MTX_8
+#define MUTEX_LOCK_ID_7 LOCK_POS_MTX_9
+#define MUTEX_LOCK_ID_8 LOCK_POS_MTX_10
+#define MUTEX_LOCK_ID_9 LOCK_POS_MTX_11
+#define MUTEX_LOCK_ID_10 LOCK_POS_MTX_12
+#define MUTEX_LOCK_ID_11 LOCK_POS_MTX_13
+#define MUTEX_LOCK_ID_12 LOCK_POS_MTX_14
+#define MUTEX_LOCK_ID_13 LOCK_POS_MTX_15
+#define MUTEX_LOCK_ID_14 LOCK_POS_MTX_16
+#define MUTEX_LOCK_ID_15 LOCK_POS_MTX_17
+#define MUTEX_LOCK_ID_16 LOCK_POS_MTX_18
+#define MUTEX_LOCK_ID_17 LOCK_POS_MTX_19
+#define MUTEX_LOCK_ID_18 LOCK_POS_MTX_20
+#define MUTEX_LOCK_ID_19 LOCK_POS_MTX_21
+#define MUTEX_LOCK_ID_20 LOCK_POS_MTX_22
+#define MUTEX_LOCK_ID_21 LOCK_POS_MTX_23
+#define MUTEX_LOCK_ID_22 LOCK_POS_MTX_24
+#define MUTEX_LOCK_ID_23 LOCK_POS_MTX_25
+#define MUTEX_LOCK_ID_24 LOCK_POS_MTX_26
+#define MUTEX_LOCK_ID_25 LOCK_POS_MTX_27
+#define MUTEX_LOCK_ID_26 LOCK_POS_MTX_28
+#define MUTEX_LOCK_ID_27 LOCK_POS_MTX_29
+#define MUTEX_LOCK_ID_28 LOCK_POS_MTX_30
+#define MUTEX_LOCK_ID_29 LOCK_POS_MTX_31
+#define MUTEX_LOCK_ID_30 LOCK_POS_MTX_32
+
+typedef int32 LOCK_ID;
+
+/*---------------------------------------------------------------------------------*
+ * Structure *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Mutex control information(Interprocess common-details)
+ */
+typedef struct {
+ LOCK_ID lock_id; /**< Lock ID */
+ TCHAR name[NAME_MAX]; /**< Mutex Name */
+ int32 ref_cnt; /**< Reference Counter */
+ uint32_t thread_id; /**< Thread IDs while Lock is being acquired (Initial value:0) Note: For debugging */
+ BOOL is_rel_fail; /**< Release failure information (Failed:TRUE) Note: For debugging */
+ BOOL is_forbid_access; /**< Deletion occurred during Lock acquisition (Deletion occurred:TRUE) Note: For debugging */
+} MUTEX_CTRL_SHARED_DETAIL;
+
+/*!
+ @brief Mutex control information (Interprocess common)
+ */
+typedef struct {
+ MUTEX_CTRL_SHARED_DETAIL detail[MAX_CTRL_MUTEX_NUM]; /**< Common Infomation */
+ uint32_t use_cnt; /**< Use Counter */
+ uint32_t rsv_cnt; /**< Reserve Counter */
+} MUTEX_CTRL_SHARED_INFO;
+
+/*!
+ @brief Mutex control information
+*/
+typedef struct {
+ HANDLE handle[MAX_CTRL_MUTEX_NUM]; /**< Mutex Handle */
+ int32 ref_cnt[MAX_CTRL_MUTEX_NUM]; /**< Reference Counter */
+ MUTEX_CTRL_SHARED_INFO* info; /**< Common Infomation */
+} MUTEX_CTRL_INFO;
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+/**
+ Mutex control table pointer (Partial shared memory)
+ Note: Access to this instance shall be made through the operation module.
+ */
+static MUTEX_CTRL_INFO g_mutex_ctrl_tbl; // NOLINT(readability/nolint) global class instance
+
+static HANDLE g_h_mtx; /** Mutex control-information-locking Mutex handle */
+static HANDLE g_h_shm; /** Shared memory handle */ // Coverity CID: 18788 compliant
+
+
+/** Lock ID Resource List */
+static const LOCK_ID kLockIdList[MAX_CTRL_MUTEX_NUM] = {
+ MUTEX_LOCK_ID_1,
+ MUTEX_LOCK_ID_2,
+ MUTEX_LOCK_ID_3,
+ MUTEX_LOCK_ID_4,
+ MUTEX_LOCK_ID_5,
+ MUTEX_LOCK_ID_6,
+ MUTEX_LOCK_ID_7,
+ MUTEX_LOCK_ID_8,
+ MUTEX_LOCK_ID_9,
+ MUTEX_LOCK_ID_10,
+ MUTEX_LOCK_ID_11,
+ MUTEX_LOCK_ID_12,
+ MUTEX_LOCK_ID_13,
+ MUTEX_LOCK_ID_14,
+ MUTEX_LOCK_ID_15,
+ MUTEX_LOCK_ID_16,
+ MUTEX_LOCK_ID_17,
+ MUTEX_LOCK_ID_18,
+ MUTEX_LOCK_ID_19,
+ MUTEX_LOCK_ID_20,
+ MUTEX_LOCK_ID_21,
+ MUTEX_LOCK_ID_22,
+ MUTEX_LOCK_ID_23,
+ MUTEX_LOCK_ID_24,
+ MUTEX_LOCK_ID_25,
+ MUTEX_LOCK_ID_26,
+ MUTEX_LOCK_ID_27,
+ MUTEX_LOCK_ID_28,
+ MUTEX_LOCK_ID_29,
+ MUTEX_LOCK_ID_30,
+};
+
+/*
+ Mutex property information (Information for each process)
+ _pb_CreateMutex calls -> 1
+ DeleteMutex calls -> 0
+ Only "1" can be used in the process.
+ */
+BOOL g_is_mutex_owner_tbl[MAX_CTRL_MUTEX_NUM];
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+/* Mutex Control Table Manipulation Functions */
+static void MutexSetLockIdOfCtrlTbl(u_int32 idx, LOCK_ID l_id); /* Set Lock ID */
+static LOCK_ID MutexGetLockIdOfCtrlTbl(u_int32 idx); /* Get Lock ID */
+static void MutexSetMutexNameOfCtrlTbl(u_int32 idx, LPCTSTR name); /* Set Mutex name */
+static void MutexSetMutexHandleOfCtrlTbl(u_int32 idx, HANDLE handle); /* Set Mutex handle */
+static HANDLE MutexGetMutexHandleOfCtrlTbl(u_int32 idx); /* Get Mutex Handle */
+static void MutexSetTidOfCtrlTbl(uint32_t idx, uint32_t tid); /* Set thread ID while Lock is being acquired */
+static uint32_t MutexGetTidOfCtrlTbl(uint32_t idx); /* Get thread ID while Lock is being acquired */
+static void MutexSetIsRelFailOfCtrlTbl(uint32_t idx, BOOL flag); /* Set release failure information */
+static void MutexSetIsForbidAccessOfCtrlTbl(uint32_t idx, BOOL flag); /* Set deletion occurrence while Lock is being acquired */
+static u_int32 MutexGetIdxOfCtrlTbl(HANDLE h_mutex); /* Get index for access */
+static void MutexIncRefCntOfCtrlTbl(u_int32 idx); /* Increment Mutex reference counter */
+static void MutexDecRefCntOfCtrlTbl(u_int32 idx); /* Decrement Mutex reference counter */
+static int32 MutexGetRefCntOfCtrlTbl(u_int32 idx); /* Get Mutex reference counter */
+static int32 MutexGetRefCntLocalOfCtrlTbl(u_int32 idx); /* Get mutex reference counter (in-process) */
+static u_int32 MutexSearchNameOfCtrlTbl(LPCTSTR name); /* Search mutex name */
+static u_int32 MutexSearchEmptyOfCtrlTbl(void); /* Search unused area */
+static void MutexIncUseCntOfCtrlInfo(void); /* Increment Mutex using counter */
+static void MutexDecUseCntOfCtrlInfo(void); /* Decrement Mutex using counter */
+static void MutexIncRsvCntOfCtrlInfo(void); /* Increment Mutex reserved counter */
+static void MutexDecRsvCntOfCtrlInfo(void); /* Decrement Mutex reserved counter */
+
+/* Mutex ownership-information manipulation functions */
+static void MutexSetFlagOfOwnerTbl(u_int32 idx, BOOL flag); /* Set ownership-information */
+static BOOL MutexGetFlagOfOwnerTbl(u_int32 idx); /* Get ownership-information */
+
+/* Mutex manipulation functions for accessing Mutex control tables */
+static void MutexCreateMutex(void); /* Create Mutex */
+static void MutexLockMutex(void); /* Get Mutex */
+static void MutexUnlockMutex(void); /* Release Mutex */
+static void MutexDeleteMutex(void); /* Delete Mutex */
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Initialize the mutex function
+ *
+ * Call the in-process initialization API for locking between processes that provide CLS.<br>
+ * Create shared memory for a Mutex control table.<br>
+ * Create a mutex for accessing Mutex control info.<br>
+ * If an error occurs during internal processing of this API, subsequent normal operations cannot be performed, so call _pb_Exit().
+ *
+ * @return RET_NORMAL
+ */
+RET_API MutexInit(void) {
+ RET_API ret_api = RET_NORMAL;
+ MUTEX_CTRL_SHARED_INFO **pp_tbl;
+ u_int32 idx;
+
+ memset(g_mutex_ctrl_tbl.handle, 0, sizeof(g_mutex_ctrl_tbl.handle));
+ memset(g_mutex_ctrl_tbl.ref_cnt, 0, sizeof(g_mutex_ctrl_tbl.ref_cnt));
+
+ /* Set pointer to Mutex control table */
+ pp_tbl = &(g_mutex_ctrl_tbl.info);
+
+ MutexCreateMutex(); /* Create Mutex for accessing Mutex control info */
+
+ MutexLockMutex(); /* Get Mutex for accessing Mutex control info */
+
+ /* Open the Mutex control table shared memory */
+ g_h_shm = OpenSharedMemory((TCHAR*)(MUTEX_CTRL_TBL_NAME), // NOLINT(readability/casting)
+ sizeof(MUTEX_CTRL_SHARED_INFO));
+
+ /* If called for the first time within all processes, an error occurs and the following processing is performed. */
+ if (g_h_shm == NULL) { // LCOV_EXCL_BR_LINE 200: can not be other val
+ /* Create shared memory for Mutex control table */
+ // LCOV_EXCL_BR_LINE 200: can not return NULL
+ g_h_shm = CreateSharedMemory((TCHAR*)MUTEX_CTRL_TBL_NAME, // NOLINT(readability/casting)
+ sizeof(MUTEX_CTRL_SHARED_INFO));
+ if (g_h_shm == NULL) /* In case of an error */ { // LCOV_EXCL_BR_LINE 200: can not return NULL
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateShareData ERROR [hShm:%p]", g_h_shm);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: cannot return NULL
+ /* don't arrive here. */
+ }
+ }
+
+ MutexUnlockMutex(); /* Release of Mutex for accessing Mutex control info */
+
+ /* Set addresses of the acquired shared memory as a pointer of the Mutex control table. */
+ *pp_tbl = reinterpret_cast<MUTEX_CTRL_SHARED_INFO*>(GetSharedMemoryPtr(g_h_shm));
+
+ /* Initialize various information of control table */
+ for (idx = 0; idx < MAX_CTRL_MUTEX_NUM; idx++) {
+ /* Set Lock ID in Mutex control table(Overwrite from the second process onwards) */
+ MutexSetLockIdOfCtrlTbl(idx, kLockIdList[idx]);
+
+ MutexSetFlagOfOwnerTbl(idx, FALSE);
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Terminate
+ */
+RET_API MutexTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+
+ CloseSharedMemory(g_h_shm);
+
+ MutexDeleteMutex();
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Create Mutex
+ *
+ * Create a named mutex that can be locked between processes.
+ *
+ * @param[in] lp_mutex_attributes Security descriptor(Unused)
+ * @param[in] b_initial_owner Initial owner flag(Unused)
+ * @param[in] lp_name Mutex name
+ *
+ * @return Except NULL Handle of the created mutex (Management information pointer)<br>
+ * NULL ABEND
+ */
+HANDLE _pb_CreateMutex(LPSECURITY_ATTRIBUTES lp_mutex_attributes, // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ BOOL b_initial_owner, LPCTSTR lp_name) {
+ int32 idx; /* For accessing Mutex control table */
+ HANDLE h_mutex = NULL; /* Mutex handle */
+ void *p_addr;
+ int32 errno;
+ LOCK_ID lock_id;
+ size_t len;
+
+ /* Null check */
+ if (lp_name == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!!");
+ } else {
+ len = _tcslen(lp_name);
+ if (len >= NAME_MAX) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!! " \
+ "Length of mutex name is too long(>=%d). [len:%zu]", NAME_MAX, len);
+ } else {
+ MutexLockMutex(); /* Get Mutex for accessing Mutex control info */
+
+ /* Retrieve whether the specified mutex name exists in the Mutex control table */
+ idx = MutexSearchNameOfCtrlTbl(lp_name);
+
+ /* Already assigned */
+ if (idx != MAX_CTRL_MUTEX_NUM) {
+ /* Get mutex handle from Mutex control table */
+ h_mutex = MutexGetMutexHandleOfCtrlTbl(idx);
+
+ /* First-time creation within a process */
+ if (h_mutex == NULL) {
+ /* Get Lock ID */
+ lock_id = MutexGetLockIdOfCtrlTbl(idx);
+
+ /* Lock information mapping (CLS) */
+ p_addr = CL_LockMap(lock_id); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* In case of an error */
+ if (p_addr == MAP_FAILED) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* Output an error log and return an error value */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockMap ERROR!! [p_addr:%p, errno:%d]", p_addr, errno);
+ } else {
+ /* Successful allocation */
+ /* Set Mutex handle in the mutex management table */
+ MutexSetMutexHandleOfCtrlTbl(idx, (HANDLE)p_addr);
+
+ h_mutex = (HANDLE)p_addr;
+ }
+ }
+
+ if (h_mutex != NULL) { // LCOV_EXCL_BR_LINE 200: h_mutex can not be NULL
+ /* Increment Mutex reference counter */
+ MutexIncRefCntOfCtrlTbl(idx);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__,
+ "### MUTEX TABLE INFORMATION # (+) idx:%d HANDLE:%p, " \
+ "ref_cnt:%d, LOCK_ID:%d, NAME:%s, ref_cnt:%d, tid:%d, fail:%d, forbid:%d",
+ idx,
+ g_mutex_ctrl_tbl.handle[idx],
+ g_mutex_ctrl_tbl.ref_cnt[idx],
+ g_mutex_ctrl_tbl.info->detail[idx].lock_id,
+ g_mutex_ctrl_tbl.info->detail[idx].name,
+ g_mutex_ctrl_tbl.info->detail[idx].ref_cnt,
+ g_mutex_ctrl_tbl.info->detail[idx].thread_id,
+ g_mutex_ctrl_tbl.info->detail[idx].is_rel_fail,
+ g_mutex_ctrl_tbl.info->detail[idx].is_forbid_access);
+ }
+ } else {
+ /* For a new assignment */
+ /* Get the free space in the mutex management table. */
+ idx = MutexSearchEmptyOfCtrlTbl();
+
+ /* Get Lock ID */
+ lock_id = MutexGetLockIdOfCtrlTbl(idx);
+
+ /* Lock information mapping (CLS) */
+ p_addr = CL_LockMap(lock_id);
+
+ /* In case of an error */
+ if (p_addr == MAP_FAILED) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* Output an error log and return an error value. */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockMap ERROR!! " \
+ "[p_addr:%p, errno:%d] In _pb_CreateMutex", p_addr, errno);
+ } else {
+ /* Successful allocation */
+ /* Set Mutex Hanlde in the mutex management table */
+ MutexSetMutexHandleOfCtrlTbl(idx, (HANDLE)p_addr);
+
+ /* Set the mutex name in the mutex management table */
+ MutexSetMutexNameOfCtrlTbl(idx, lp_name);
+
+ /* Increment Mutex reference counter */
+ MutexIncRefCntOfCtrlTbl(idx);
+
+ /* Increment mutex using counter */
+ MutexIncUseCntOfCtrlInfo();
+
+ h_mutex = (HANDLE)p_addr;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__,
+ "### MUTEX TABLE INFORMATION # (++) idx:%d HANDLE:%p, ref_cnt:%d, " \
+ "LOCK_ID:%d, NAME:%s, ref_cnt:%d, tid:%d, fail:%d, forbid:%d",
+ idx,
+ g_mutex_ctrl_tbl.handle[idx],
+ g_mutex_ctrl_tbl.ref_cnt[idx],
+ g_mutex_ctrl_tbl.info->detail[idx].lock_id,
+ g_mutex_ctrl_tbl.info->detail[idx].name,
+ g_mutex_ctrl_tbl.info->detail[idx].ref_cnt,
+ g_mutex_ctrl_tbl.info->detail[idx].thread_id,
+ g_mutex_ctrl_tbl.info->detail[idx].is_rel_fail,
+ g_mutex_ctrl_tbl.info->detail[idx].is_forbid_access);
+ }
+ }
+
+ if (h_mutex != NULL) { // LCOV_EXCL_BR_LINE 200: can not be NULL
+ /* Update Mutex ownership */
+ MutexSetFlagOfOwnerTbl(idx, TRUE);
+ }
+
+ /* Release the Mutex for accessing Mutex control info */
+ MutexUnlockMutex();
+ }
+ }
+
+ return h_mutex;
+}
+
+/**
+ * @brief
+ * Delete the mutex
+ *
+ * Decrement the Mutex reference counter and delete it when it reaches zero.
+ *
+ * @param[in] h_mutex Mutex handle (CreateMutex return value)
+ *
+ * @return WAIT_OBJECT_0 Normal completion<br>
+ * WAIT_FAILED ABEND
+ */
+DWORD PbDeleteMutex(HANDLE h_mutex) {
+ DWORD lret = WAIT_OBJECT_0;
+ u_int32 idx;
+ int32 ref_cnt;
+ int32 ret;
+ BOOL is_owner;
+ uint32_t tid;
+
+ /* Null check */
+ if (h_mutex == NULL) { // LCOV_EXCL_BR_LINE 6: h_mutex cannot be NULL
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR");
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; /* ABEND */ // LCOV_EXCL_LINE 6: h_mutex cannot be NULL
+ } else {
+ MutexLockMutex(); /* Get Mutex for accessing Mutex control info */
+
+ /* Retrieve the index of the management table containing the Mutex handles */
+ idx = MutexGetIdxOfCtrlTbl(h_mutex);
+ /* When the specified Mutex handle is not registered */
+ if (idx == MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 200: idx can no be MAX_CTRL_MUTEX_NUM
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "Argment ERROR [h_mutex:%p]", h_mutex);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; /* ABEND */ // LCOV_EXCL_LINE 200: idx can no be MAX_CTRL_MUTEX_NUM
+ } else {
+ /* If it is registered */
+ /* Determinate its ownership */
+ is_owner = MutexGetFlagOfOwnerTbl(idx);
+ if (is_owner == TRUE) {
+ /* Get Mutex reference counter */
+ ref_cnt = MutexGetRefCntOfCtrlTbl(idx);
+
+ /* No clients are using the specified Mutex. */
+ if ((ref_cnt - 1) <= 0) {
+ /* Lock information unmapping (CLS) */
+ ret = CL_LockUnmap(reinterpret_cast<void*>(h_mutex)); // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When an error occurs */
+ if (ret == -1) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockUnmap ERROR");
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; /* ABEND */ // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ /* If successful */
+ /* Remove Mutex hanlde from Mutex control table */
+ MutexSetMutexHandleOfCtrlTbl(idx, NULL);
+
+ /* Delete the mutex name from the Mutex control table */
+ MutexSetMutexNameOfCtrlTbl(idx, "");
+
+ /* Update Mutex ownership */
+ MutexSetFlagOfOwnerTbl(idx, FALSE);
+
+ /* Decrement Mutex reference counter */
+ MutexDecRefCntOfCtrlTbl(idx);
+
+ /* Decrement mutex using counter */
+ MutexDecUseCntOfCtrlInfo();
+
+ tid = MutexGetTidOfCtrlTbl(idx);
+ if (tid != 0) { // LCOV_EXCL_BR_LINE 200: tid can not be 0
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ MutexSetIsForbidAccessOfCtrlTbl(idx, TRUE); // LCOV_EXCL_LINE 200: tid can not be 0
+ }
+
+ /* Initialize debug information */
+ MutexSetTidOfCtrlTbl(idx, 0);
+ MutexSetIsRelFailOfCtrlTbl(idx, FALSE);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__,
+ "### MUTEX TABLE INFORMATION # (--) idx:%d HANDLE:%p, ref_cnt(local):%d, " \
+ "LOCK_ID:%d, NAME:%s, ref_cnt:%d, tid:%d, fail:%d, forbid:%d",
+ idx,
+ g_mutex_ctrl_tbl.handle[idx],
+ g_mutex_ctrl_tbl.ref_cnt[idx],
+ g_mutex_ctrl_tbl.info->detail[idx].lock_id,
+ g_mutex_ctrl_tbl.info->detail[idx].name,
+ g_mutex_ctrl_tbl.info->detail[idx].ref_cnt,
+ g_mutex_ctrl_tbl.info->detail[idx].thread_id,
+ g_mutex_ctrl_tbl.info->detail[idx].is_rel_fail,
+ g_mutex_ctrl_tbl.info->detail[idx].is_forbid_access);
+ }
+ } else {
+ /* If exists */
+ /* Determine if any clients are referencing in the process */
+ ref_cnt = MutexGetRefCntLocalOfCtrlTbl(idx);
+ if ((ref_cnt - 1) <= 0) { // LCOV_EXCL_BR_LINE 200: ref_cnt can not bigger than 1
+ // LCOV_EXCL_START 200: ref_cnt can not bigger than 1
+ //AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Lock information unmapping (CLS) */
+ ret = CL_LockUnmap(reinterpret_cast<void*>(h_mutex));
+ /* When an error occurs */
+ if (ret == -1) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockUnmap ERROR");
+ lret = WAIT_FAILED; /* ABEND */
+ } else {
+ /* If successful */
+ /* Remove Mutex Hanlde from the Mutex control table */
+ MutexSetMutexHandleOfCtrlTbl(idx, NULL);
+
+ /* Update Mutex ownership */
+ MutexSetFlagOfOwnerTbl(idx, FALSE);
+ }
+ // LCOV_EXCL_STOP
+ }
+
+ if (lret == WAIT_OBJECT_0) {
+ /* Decrement Mutex refernce counter */
+ MutexDecRefCntOfCtrlTbl(idx);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__,
+ "### MUTEX TABLE INFORMATION # (-) idx:%d HANDLE:%p, ref_cnt(local):%d, " \
+ "LOCK_ID:%d, NAME:%s, ref_cnt:%d, tid:%d, fail:%d, forbid:%d",
+ idx,
+ g_mutex_ctrl_tbl.handle[idx],
+ g_mutex_ctrl_tbl.ref_cnt[idx],
+ g_mutex_ctrl_tbl.info->detail[idx].lock_id,
+ g_mutex_ctrl_tbl.info->detail[idx].name,
+ g_mutex_ctrl_tbl.info->detail[idx].ref_cnt,
+ g_mutex_ctrl_tbl.info->detail[idx].thread_id,
+ g_mutex_ctrl_tbl.info->detail[idx].is_rel_fail,
+ g_mutex_ctrl_tbl.info->detail[idx].is_forbid_access);
+ }
+ }
+
+ } else { // LCOV_EXCL_BR_LINE 200: is_owner can not be FALSE
+ /* If it is not the owner */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; // LCOV_EXCL_LINE 200: is_owner can not be FALSE
+ }
+ }
+
+ MutexUnlockMutex(); /* Release of Mutex for accessing Mutex control info */
+ }
+
+ return lret;
+}
+
+/**
+ * @brief
+ * Mutex Lock
+ *
+ * Take ownership of the mutex and start locking.
+ *
+ * @param[in] h_mutex Mutex handle(CreateMutex return value)
+ * @param[in] timeout Timeout (Millisecond)
+ *
+ * @return WAIT_OBJECT_0 Succeeded to get ownership<br>
+ * WAIT_TIMEOUT Failed to get ownership (Timeout)<br>
+ * WAIT_FAILED Failed to get ownership (Error)
+ */
+DWORD PbMutexLock(HANDLE h_mutex, DWORD timeout) {
+ DWORD lret = WAIT_OBJECT_0;
+ int32 ret;
+ DWORD time_out_cnt = 0;
+ u_int32 idx;
+ BOOL is_owner;
+ uint32_t tid;
+
+ /* Null check */
+ if (h_mutex == NULL) { // LCOV_EXCL_BR_LINE 6: h_mutex cannot be NULL
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR");
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; /* ABEND */ // LCOV_EXCL_LINE 6: h_mutex cannot be NULL
+ } else {
+ /* Retrieve the index of the management table containing the Mutex handles */
+ idx = MutexGetIdxOfCtrlTbl(h_mutex);
+ /* When the specified Mutex handle is not registered */
+ if (idx == MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot be MAX_CTRL_MUTEX_NUM
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [h_mutex:%p, idx:%d]", \
+ h_mutex, idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; /* ABEND */ // LCOV_EXCL_LINE 6: idx cannot be MAX_CTRL_MUTEX_NUM
+ } else {
+ /* If it is registered */
+ /* Determinate ownership */
+ is_owner = MutexGetFlagOfOwnerTbl(idx);
+ if (is_owner == TRUE) {
+ tid = PbGetTid();
+
+ /* No timeout specified */
+ if (timeout == INFINITE) { // LCOV_EXCL_BR_LINE 6: timeout will not be other case
+ /* Get Lock (CLS) */
+ ret = CL_LockGet(reinterpret_cast<void*>(h_mutex)); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (ret != 0) /* In case of ABEND */ { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockGet ERROR [h_mutex:%p, ret:%d]", h_mutex, ret);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; /* ABEND */ // LCOV_EXCL_LINE 4: nsfw error
+ } else {
+ /* Set thread ID during lock */
+ MutexSetTidOfCtrlTbl(idx, tid);
+ }
+ } else {
+ // LCOV_EXCL_START 6: timeout will not be other case
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Timeout specified */
+ while (1) {
+ /* Get Lock (CLS) */
+ ret = CL_LockNowait(reinterpret_cast<void*>(h_mutex));
+ if (ret != 0) /* In case of ABEND */ {
+ /* Invalid parameter */
+ if (ret != EBUSY) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockGet ERROR [h_mutex:%p, ret:%d]", h_mutex, ret);
+ lret = WAIT_FAILED; /* ABEND */
+ break;
+ }
+
+ time_out_cnt++;
+ if (time_out_cnt <= timeout) {
+ usleep(1000);
+ } else {
+ /* Timeout error */
+ lret = WAIT_TIMEOUT;
+ break;
+ }
+ } else {
+ /* Successful acquisition */
+ /* Set thread ID during lock */
+ MutexSetTidOfCtrlTbl(idx, tid);
+
+ break;
+ }
+ }
+ // LCOV_EXCL_STOP
+ }
+ } else { // LCOV_EXCL_BR_LINE 200: is_owner can not be FALSE
+ /* If it is not the owner */
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ lret = WAIT_FAILED; // LCOV_EXCL_LINE 200: is_owner can not be FALSE
+ }
+ }
+ }
+
+ return lret;
+}
+
+/**
+ * @brief
+ * Mutex Unlock
+ *
+ * Release the mutex ownership and terminate the lock.
+ *
+ * @param[in] h_mutex Mutex handle(CreateMutex return value)
+ *
+ * @return TURE Normal<br>
+ * FALSE Error
+ */
+BOOL PbMutexUnlock(HANDLE h_mutex) {
+ BOOL bret = FALSE;
+ int32 ret;
+ u_int32 idx;
+ BOOL is_owner;
+ uint32_t tid;
+
+ /* Null check */
+ if (h_mutex == NULL) { // LCOV_EXCL_BR_LINE 6: h_mutex can not be NULL
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR");
+ } else {
+ /* Retrieve the index of the management table containing the Mutex handle */
+ idx = MutexGetIdxOfCtrlTbl(h_mutex);
+ /* When the specified Mutex handle is not registered */
+ if (idx == MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 200: idx can not be MAX_CTRL_MUTEX_NUM
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "MutexGetIdxOfCtrlTbl ERROR [h_mutex:%p, idx:%d]", h_mutex, idx);
+ } else {
+ /* If it is registered */
+ /* Determinate ownership */
+ is_owner = MutexGetFlagOfOwnerTbl(idx);
+ if (is_owner == TRUE) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* Release thread ID setting during lock */
+ MutexSetTidOfCtrlTbl(idx, 0);
+
+ /* Release the Lock */
+ ret = CL_LockRelease(reinterpret_cast<void*>(h_mutex));
+ if (ret == 0) /* If successful */ { // LCOV_EXCL_BR_LINE 4: nsfw error
+ bret = TRUE;
+
+ } else { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Failed */
+ tid = PbGetTid();
+
+ /* Retry to set the thread ID during lock */
+ MutexSetTidOfCtrlTbl(idx, tid);
+
+ /* Add the release failure information */
+ MutexSetIsRelFailOfCtrlTbl(idx, TRUE);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockRelease ERROR [h_mutex:%p, ret:%d]", h_mutex, ret);
+ // LCOV_EXCL_STOP
+ }
+ }
+ }
+ }
+
+ return bret;
+}
+
+/*---------------------------------------------------------------------------------*
+ * Local Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Set the Lock ID (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] l_id Lock ID
+ */
+static void MutexSetLockIdOfCtrlTbl(u_int32 idx, LOCK_ID l_id) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, l_id:%d]", idx, l_id);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_mutex_ctrl_tbl.info->detail[idx].lock_id = l_id;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get the Lock ID (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ */
+static LOCK_ID MutexGetLockIdOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_mutex_ctrl_tbl.info->detail[idx].lock_id;
+}
+
+/**
+ * @brief
+ * Set the Mutex name (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] name Mutex name
+ */
+static void MutexSetMutexNameOfCtrlTbl(u_int32 idx, LPCTSTR name) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, name:%s]", idx, name);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ _tcscpy(g_mutex_ctrl_tbl.info->detail[idx].name, name);
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Set the Mutex handle (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] handle Mutex handle
+ */
+static void MutexSetMutexHandleOfCtrlTbl(u_int32 idx, HANDLE handle) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, handle:%p]", idx, handle);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_mutex_ctrl_tbl.handle[idx] = handle;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get the Mutex handle (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ *
+ * @return Mutex handle
+ */
+static HANDLE MutexGetMutexHandleOfCtrlTbl(u_int32 idx) {
+ HANDLE handle = NULL;
+
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ handle = g_mutex_ctrl_tbl.handle[idx];
+ }
+
+ return handle;
+}
+
+/**
+ * @brief
+ * Set the thread ID during lock acquisition (Mutex control table)
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] tid Thread ID
+ * @note If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ */
+static void MutexSetTidOfCtrlTbl(uint32_t idx, uint32_t tid) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_mutex_ctrl_tbl.info->detail[idx].thread_id = tid;
+ }
+
+ return;
+}
+
+
+/**
+ * @brief
+ * Get the thread ID during lock acquisition (Mutex control table)
+ *
+ * @param[in] idx Control table accessor
+ *
+ * @return Thread ID
+ *
+ * @note If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ */
+static uint32_t MutexGetTidOfCtrlTbl(uint32_t idx) {
+ uint32_t tid = 0;
+
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ tid = g_mutex_ctrl_tbl.info->detail[idx].thread_id;
+ }
+
+ return tid;
+}
+
+
+/**
+ * @brief
+ * Set the release failure information (Mutex control table)
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] flag Failed to release:TURE
+ * @note If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ */
+static void MutexSetIsRelFailOfCtrlTbl(uint32_t idx, BOOL flag) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_mutex_ctrl_tbl.info->detail[idx].is_rel_fail = flag;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Set deletion-occurrence information during Lock acquisition (Mutex control table)
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] flag When deletion occurs while Lock is being acquired:TRUE
+ * @note If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ */
+static void MutexSetIsForbidAccessOfCtrlTbl(uint32_t idx, BOOL flag) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_mutex_ctrl_tbl.info->detail[idx].is_forbid_access = flag;
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Get index for access (Mutex control table)
+ *
+ * Return the index for accessing the area of the Mutex control table in which <br>
+ * the specified mutex handle is registered. If the specified handle is not <br>
+ * registered, the maximum number of mutex management (MAX_MUTEX_CTRL_NUM) is returned.
+ *
+ * @param[in] h_mutex Mutex handle
+ *
+ * @return Index for access (Specified handle is already registered)<br>
+ * Maximum mutex management value (Specified handle is not registered)
+ */
+static u_int32 MutexGetIdxOfCtrlTbl(HANDLE h_mutex) {
+ u_int32 idx;
+ HANDLE handle;
+
+ for (idx = 0; idx < MAX_CTRL_MUTEX_NUM; idx++) {
+ /* Get handle from Mutex control table */
+ handle = MutexGetMutexHandleOfCtrlTbl(idx);
+
+ if (handle == h_mutex) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+/**
+ * @brief
+ * Increment the Mutex reference counter (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ */
+static void MutexIncRefCntOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ g_mutex_ctrl_tbl.info->detail[idx].ref_cnt++;
+ g_mutex_ctrl_tbl.ref_cnt[idx]++;
+
+ return;
+}
+
+/**
+ * @brief
+ * Decrement the Mutex reference counter (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ */
+static void MutexDecRefCntOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ g_mutex_ctrl_tbl.info->detail[idx].ref_cnt--;
+ g_mutex_ctrl_tbl.ref_cnt[idx]--;
+
+ return;
+}
+
+/**
+ * @brief
+ * Get the Mutex Reference Counter (Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ *
+ * @return Reference counter value
+ */
+static int32 MutexGetRefCntOfCtrlTbl(u_int32 idx) {
+ int32 ret = 0;
+
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ ret = g_mutex_ctrl_tbl.info->detail[idx].ref_cnt;
+ }
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Get mutex reference counter (in-process)(Mutex control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ *
+ * @return Reference counter value
+ */
+static int32 MutexGetRefCntLocalOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_mutex_ctrl_tbl.ref_cnt[idx];
+}
+
+/**
+ * @brief
+ * Search mutex name (Mutex control table)
+ *
+ * Retrieve whether the specified mutex is already registered in the Mutex control table.<br>
+ * If it is registered, the access index is returned.If it is not registered,<br>
+ * return the maximum mutex management value(MAX_CTRL_MUTEX_NUM).
+ *
+ * @param[in] name Mutex name
+ *
+ * @return Index for access(If it is registered)<br>
+ * Maximum mutex management value (Not registered)
+ */
+static u_int32 MutexSearchNameOfCtrlTbl(LPCTSTR name) {
+ int32 ret;
+ u_int32 idx;
+
+ for (idx = 0; idx < MAX_CTRL_MUTEX_NUM; idx++) {
+ ret = _tcscmp(g_mutex_ctrl_tbl.info->detail[idx].name, name);
+
+ /* If there is a match */
+ if (ret == 0) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+/**
+ * @brief
+ * Search unused area (Mutex control table)
+ *
+ * Return the lowest-numbered index for accessing unused space in the Mutex control table.<br>
+ * Return the maximum value((MAX_CTRL_MUTEX_NUM)) of message queue management <br>
+ * when no unused area exists.
+ *
+ * @return Index for access (Unused area exists)<br>
+ * Maximum mutex management value (No unused area)
+ */
+static u_int32 MutexSearchEmptyOfCtrlTbl(void) {
+ u_int32 idx;
+
+ idx = MutexSearchNameOfCtrlTbl("");
+
+ return idx;
+}
+
+/**
+ * @brief
+ * Set the Mutex ownership flag (Ownership-information table)
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] flag ownership-information
+ */
+static void MutexSetFlagOfOwnerTbl(u_int32 idx, BOOL flag) {
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, flag:%d]", idx, flag);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_is_mutex_owner_tbl[idx] = flag;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get the Mutex ownership flag (Ownership-information table)
+ *
+ * @param[in] idx Control table accessor
+ *
+ * @return TRUE Owned
+ * FALSE Not owned
+ */
+static BOOL MutexGetFlagOfOwnerTbl(u_int32 idx) {
+ BOOL bret = FALSE;
+
+ /* check index */
+ if (idx >= MAX_CTRL_MUTEX_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ bret = g_is_mutex_owner_tbl[idx];
+ }
+
+ return bret;
+}
+
+/**
+ * @brief
+ * Create Mutex for accessing the Mutex control table
+ */
+static void MutexCreateMutex(void) {
+ g_h_mtx = (HANDLE)CL_LockMap(MUTEX_LOCK_ID_0); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (g_h_mtx == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "CL_LockMap ERROR [g_h_mtx:%p]", g_h_mtx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Delete Mutex for accessing Mutex control table
+ */
+static void MutexDeleteMutex(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 ret;
+
+ ret = CL_LockUnmap(g_h_mtx);
+ if (ret != 0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockUnmap ERROR [g_h_mtx:%p, ret:%d]", g_h_mtx, ret);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Get Mutex for accessing Mutex control table
+ */
+static void MutexLockMutex(void) {
+ int32 ret;
+
+ ret = CL_LockGet(g_h_mtx); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (ret != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockGet ERROR [g_h_mtx:%p, ret:%d]", g_h_mtx, ret);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Release Mutex for accessing Mutex control table
+ */
+static void MutexUnlockMutex(void) {
+ int32 ret;
+
+ ret = CL_LockRelease(g_h_mtx); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (ret != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "CL_LockRelease ERROR [g_h_mtx:%p, ret:%d]", g_h_mtx, ret);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 4: nsfw error
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get dump information
+ *
+ * @param[out] p_buf Dump info
+ * @param[in/out] p_len Buffer size
+ */
+void _pb_GetDebugMutexMngTbl(void* p_buf, uint8_t* p_len) {
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_tmp[512];
+ static uint8_t buf_info[DEBUG_DUMP_MAX_SIZE];
+ uint32_t i;
+ uint8_t cnt = 0;
+
+ if ((p_buf != NULL) && (p_len != NULL)) {
+ memset(&buf[0], 0x00, sizeof(buf));
+ memset(&buf_info[0], 0x00, sizeof(buf_info));
+ for (i = 0; i < MAX_CTRL_MUTEX_NUM; i++) {
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n [%02d]id:%10d, nm:%40s, ref_cnt:%10d, tid:%03d, fail:%01d, " \
+ "forbid:%01d, handle:%10p, ref_cnt(local):%10d",
+ i,
+ g_mutex_ctrl_tbl.info->detail[i].lock_id,
+ g_mutex_ctrl_tbl.info->detail[i].name,
+ g_mutex_ctrl_tbl.info->detail[i].ref_cnt,
+ g_mutex_ctrl_tbl.info->detail[i].thread_id,
+ g_mutex_ctrl_tbl.info->detail[i].is_rel_fail,
+ g_mutex_ctrl_tbl.info->detail[i].is_forbid_access,
+ g_mutex_ctrl_tbl.handle[i],
+ g_mutex_ctrl_tbl.ref_cnt[i]);
+ strncat(reinterpret_cast<char *>(&buf_info[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ if (((i + 1) % 10) == 0) {
+ cnt++;
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Mutex-%d%s",
+ cnt,
+ &buf_info[0]);
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ p_buf = reinterpret_cast<void *>((reinterpret_cast<uint8_t *>(p_buf)) + sizeof(buf));
+ memset(&buf_info[0], 0x00, sizeof(buf_info));
+ if (cnt >= *p_len) {
+ break;
+ }
+ }
+ }
+ if (cnt < *p_len) {
+ if (buf_info[0] != 0x00) {
+ cnt++;
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf),
+ "Mutex-%d%s",
+ cnt,
+ &buf_info[0]);
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ }
+ *p_len = cnt;
+ }
+ }
+}
+
+/**
+ * @brief
+ * Increment the Mutex using counter
+ *
+ * @param[in] none
+ */
+static void MutexIncUseCntOfCtrlInfo(void) {
+ g_mutex_ctrl_tbl.info->use_cnt++;
+ return;
+}
+
+/**
+ * @brief
+ * Decrement Mutex using counter
+ *
+ * @param[in] none
+ */
+static void MutexDecUseCntOfCtrlInfo(void) {
+ g_mutex_ctrl_tbl.info->use_cnt--;
+ return;
+}
+
+/**
+ * @brief
+ * Increment Mutex reserved counter
+ *
+ * @param[in] none
+ */
+static void MutexIncRsvCntOfCtrlInfo(void) {
+ g_mutex_ctrl_tbl.info->rsv_cnt++;
+ return;
+}
+
+/**
+ * @brief
+ * Decrement Mutex reserved counter
+ *
+ * @param[in] none
+ */
+static void MutexDecRsvCntOfCtrlInfo(void) {
+ g_mutex_ctrl_tbl.info->rsv_cnt--;
+ return;
+}
+
+/**
+ * @brief
+ * Determine resources ready (Mutex control data)
+ *
+ * @param[in] none
+ *
+ * @return BOOL
+ * @retval TRUE : Normal
+ * @retval FALSE : Error (Resource shortage)
+ */
+BOOL _pb_GetMutexResource(void) {
+ BOOL ret = TRUE;
+ uint32_t cnt;
+
+ MutexLockMutex();
+
+ /* Increment Mutex reserved counter */
+ MutexIncRsvCntOfCtrlInfo();
+
+ cnt = g_mutex_ctrl_tbl.info->use_cnt + g_mutex_ctrl_tbl.info->rsv_cnt;
+ if (cnt >= FULL_CTRL_MUTEX_NUM) {
+ ret = FALSE;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "Lack of resources [FATAL][use_cnt:%d rsv_cnt:%d]", g_mutex_ctrl_tbl.info->use_cnt, \
+ g_mutex_ctrl_tbl.info->rsv_cnt);
+ } else if (cnt >= WARN_CTRL_MUTEX_NUM) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "Lack of resources [WARN][use_cnt:%d rsv_cnt:%d]", g_mutex_ctrl_tbl.info->use_cnt, \
+ g_mutex_ctrl_tbl.info->rsv_cnt);
+ }
+
+ MutexUnlockMutex();
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Release resources (Mutex control data)
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+void _pb_ReleaseMutexResource(void) {
+ MutexLockMutex();
+
+ /* Decrement Mutex reserved counter */
+ MutexDecRsvCntOfCtrlInfo();
+
+ MutexUnlockMutex();
+
+ return;
+}
+#endif /* PT_PB_MUTEX_STUB__CWORD71_ */
diff --git a/vehicleservice/positioning_base_library/library/src/_pbOSCtrl.cpp b/vehicleservice/positioning_base_library/library/src/_pbOSCtrl.cpp
new file mode 100755
index 0000000..c38016a
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbOSCtrl.cpp
@@ -0,0 +1,541 @@
+/*
+ * @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 : _pbOSCtrl.cpp
+ System name :
+ Subsystem name :
+ Title :
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include <unistd.h>
+#include <stdint.h>
+#include <sys/mman.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+#include "_pbInternalProc.h"
+#include "_pbSerial.h"
+/* For CreateFile--> */
+#include <sys/select.h>
+#include <fcntl.h>
+#include <strings.h>
+#include <termios.h>
+/* For CreateFile <-- */
+
+#define GPS_FUNC_DEBUG_MSG__CWORD71__FILE 0
+
+#if GPS_FUNC_DEBUG_MSG__CWORD71__FILE
+#define FILE_OUT_LINE 50
+static u_int8 file_buf[FILE_OUT_LINE][1024];
+static u_int16 line_size_buf[FILE_OUT_LINE];
+
+/* Log destination selection (Activate the one you want to output.) */
+#define POS_GPS_R_LOGFILE_PATH "/nv/BS/vs/positioning_base_library/rwdata/Test_Pos_gps_read_data.txt"
+#define POS_GPS_W_LOGFILE_PATH "/nv/BS/vs/positioning_base_library/rwdata/Test_Pos_gps_write_data.txt"
+
+#endif /* GPS_FUNC_DEBUG_MSG__CWORD71__FILE */
+
+/* For CreateFile--> */
+#define BAUDRATE B9600
+#define MODEMDEVICE "/dev/tty.gps"
+/* For CreateFile <-- */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : ClearCommError
+* ABSTRACT : Get the communication error information and report the current status of the communication device.
+* NOTE :
+* ARGUMENT :
+* RETURN : BOOL defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* Wait for replacement */
+BOOL ClearCommError(HANDLE h_file, LPDWORD lp_errors, LPCOMSTAT lp_stat) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 0;
+// LCOV_EXCL_STOP
+}
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : GetCommState
+* ABSTRACT : Store the current control settings of the specified communication device in the device control block (DCB struct).
+* NOTE :
+* ARGUMENT :
+* RETURN : BOOL defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* Wait for replacement */ /* TODO IHFLOW OHFLOW declarations are missing */
+BOOL GetCommState(HANDLE h_file, LPDCB lp_dcb) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 1;
+// LCOV_EXCL_STOP
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : GetCommTimeouts
+* ABSTRACT : Get the timeout parameters for all read and write operations performed on the specified communication device.
+* NOTE :
+* ARGUMENT :
+* RETURN : BOOL defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+BOOL GetCommTimeouts(HANDLE h_file, LPCOMMTIMEOUTS lp_comm_timeouts) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if 1 /* GPF */
+ BOOL bret = FALSE;
+ DWORD dw_read = 0;
+ DWORD dw_write = 0;
+
+ if ((INVALID_HANDLE_VALUE != h_file) && (NULL != lp_comm_timeouts)) {
+ /* Initialization */
+ memset(lp_comm_timeouts, 0, sizeof(COMMTIMEOUTS));
+ bret = SerialObjectTimeoutGet(h_file, &dw_read, &dw_write);
+ if (TRUE == bret) {
+ lp_comm_timeouts->write_total_timeout_constant = dw_write;
+ if (0 == dw_read) {
+ /* Return as 0? or return this setting? */
+ lp_comm_timeouts->read_interval_timeout = INFINITE;
+ lp_comm_timeouts->read_total_timeout_constant = 0;
+ lp_comm_timeouts->read_total_timeout_multiplier = 0;
+ } else {
+ lp_comm_timeouts->read_total_timeout_constant = dw_read;
+ }
+ } else {
+ /* not exist in the list */
+ lp_comm_timeouts->write_total_timeout_constant = INFINITE;
+ lp_comm_timeouts->read_total_timeout_constant = INFINITE;
+ bret = TRUE;
+ }
+ }
+
+ return bret;
+
+#endif /* GPF */
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Clear Communication Buffer
+ *
+ * Discard all characters in the output buffer or input buffer of the specified resource
+ *
+ *
+ * @param[in] h_file Handle of the communication resource
+ * @param[in] dw_flags Operation to perform
+ *
+ * @return Processing result
+ * @retval TRUE processing succeeded
+ * @retval FALSE Processing failed
+ */
+BOOL PurgeComm(HANDLE h_file, DWORD dw_flags) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL ret = 0;
+ int res = -1;
+ /* h_file is FD, and less than INT_MAX(0x7fffffff) */
+ /* Flush received but unreceived data */
+ res = tcflush(static_cast<int>((long)h_file), TCIFLUSH); // NOLINT(runtime/int)
+ if (res != -1) {
+ ret = 1;
+ }
+ return ret;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : SetCommMask
+* ABSTRACT : Specify a set of events to monitor for a specific communication device.
+* NOTE :
+* ARGUMENT :
+* RETURN : BOOL defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+BOOL SetCommMask(HANDLE h_file, DWORD dw_evt_mask) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if 1 /* GPF */
+ BOOL bret = FALSE;
+
+ bret = SerialObjectWaitmaskAdd(h_file, dw_evt_mask);
+ return bret;
+#endif /* GPF */
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ *
+ * Communication setting
+ *
+ * Set the serial communication according to the setting information.
+ *
+ * @param[in] h_file Communication handle
+ * @param[in] lp_dcb Serial port setting information
+ *
+ * @return Processing result
+ * @retval TRUE processing succeeded
+ * @retval FALSE Processing failed
+ */
+BOOL SetCommState(HANDLE h_file, LPDCB lp_dcb) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ struct termios newtio;
+#if 1
+ bzero(&newtio, sizeof(newtio));
+ cfmakeraw(&newtio); /* RAW mode */
+ newtio.c_cflag |= (BAUDRATE | CS8 | CLOCAL | CREAD);/*Baud:9600*/
+ newtio.c_lflag &= ~ECHO;
+#endif
+ /* h_file is FD, and less than INT_MAX(0x7fffffff) */
+ tcflush(static_cast<int>((long)h_file), TCIFLUSH); // NOLINT(runtime/int)
+ tcsetattr(static_cast<int>((long)h_file), TCSANOW, &newtio); // NOLINT(runtime/int)
+
+ return 1;
+}
+// LCOV_EXCL_STOP
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : SetCommTimeouts
+* ABSTRACT : Set the timeout parameter for all read and write operations performed on the specified communication device.
+* NOTE :
+* ARGUMENT :
+* RETURN : BOOL defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+BOOL SetCommTimeouts(HANDLE h_file, LPCOMMTIMEOUTS lp_comm_timeouts) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if 1 /* GPF */
+ BOOL bret = FALSE;
+ DWORD dw_read_timeout = INFINITE;
+ DWORD dw_write_timeout = INFINITE;
+
+ /* Calculate timeout time */
+ if ((INFINITE == lp_comm_timeouts->read_interval_timeout)
+ && (0 == lp_comm_timeouts->read_total_timeout_constant)
+ && (0 == lp_comm_timeouts->read_total_timeout_multiplier)) {
+ /* Set without waiting */
+ dw_read_timeout = 0;
+ } else {
+ dw_read_timeout = lp_comm_timeouts->read_total_timeout_constant;
+ }
+
+
+ dw_write_timeout = lp_comm_timeouts->write_total_timeout_constant;
+
+ bret = SerialObjectTimeoutAdd(h_file, dw_read_timeout, dw_write_timeout);
+
+ return bret;
+#endif /* GPF */
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ *
+ * Waiting for communication event
+ *
+ * Wait for an event to be generated for a specified handle
+ * Note : Continue to wait indefinitely until data reception/error occurs
+ *
+ * @param[in] h_file Communication handle
+ * @param[out] lp_evt_mask Pointer to the variable to receive the event
+ * @param[in] lp_overlapped OVERLAPPED Pointer to a struct[Note:Not used]
+ *
+ * @return Processing result
+ * @retval TRUE Processing succeeded
+ * @retval FALSE Processing failed
+ */
+BOOL WaitCommEvent(HANDLE h_file, LPDWORD lp_evt_mask, LPOVERLAPPED lp_overlapped) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL ret = 0;
+ int res = -1;
+ int fd;
+ fd_set fds_set_err;
+ fd_set fds_set; // Set of file descriptor
+
+ struct timeval tv;
+
+ /* Monitor for 0.5 seconds */
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ /* h_file is FD, and less than INT_MAX(0x7fffffff) */
+ fd = static_cast<int>((long)h_file); // NOLINT(runtime/int)
+
+ /* Initialization */
+ FD_ZERO(&fds_set);
+ FD_ZERO(&fds_set_err);
+
+ FD_SET(fd, &fds_set);
+ FD_SET(fd, &fds_set_err);
+
+ res = select(fd + 1, &fds_set, NULL, &fds_set_err, &tv);
+
+ if (res > 0) {
+ if (FD_ISSET(fd, &fds_set)) {
+ *lp_evt_mask = EV_RXCHAR;
+ ret = 1;
+
+ } else {
+ *lp_evt_mask = EV_ERROR;
+ ret = 0;
+ }
+ } else {
+ ret = 0;
+ }
+ return ret;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ *
+ * Create file
+ *
+ * Create or open an object and return a handle which can be used to access the object
+ *
+ * @param lp_file_name Not used
+ * @param dw_desired_access Not used
+ * @param dw_share_mode Not used
+ * @param lp_security_attributes Not used
+ * @param dw_creation_disposition Not used
+ * @param dw_flags_and_attributes Not used
+ * @param h_template_file Not used
+ *
+ * @return Handle
+ */
+HANDLE CreateFile(LPCTSTR lp_file_name, DWORD dw_desired_access, DWORD dw_share_mode, LPSECURITY_ATTRIBUTES lp_security_attributes, DWORD dw_creation_disposition, DWORD dw_flags_and_attributes, HANDLE h_template_file) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int fd;
+ int loop = 1;
+
+ while (loop == 1) {
+ fd = open(MODEMDEVICE, O_RDWR | O_NOCTTY);
+ if (fd != -1) {
+ break;
+ }
+ sleep(1);
+ }
+ /* fd is FD, and less than INT_MAX(0x7fffffff) and the return data type is HANDLE. */
+ return (HANDLE)((long)(fd)); // NOLINT(runtime/int)
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ *
+ * Close file
+ *
+ * Close an open file
+ *
+ * @param[in] h_object Handle
+ *
+ * @return Processing result
+ * @retval TRUE Processing succeeded
+ * @retval FALSE Processing failed
+ */
+BOOL CloseFile(HANDLE h_object) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (h_object != reinterpret_cast<void*>(-1)) {
+ /* h_object is FD, and less than INT_MAX(0x7fffffff) */
+ close(static_cast<int>((long)h_object)); // NOLINT(runtime/int)
+ } else {
+ /* nop */
+ }
+ return 0;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ *
+ * Write File
+ *
+ * Writing Data to a File
+ *
+ * @param[in] h_file Handle
+ * @param[in] lp_buffer buffer to write
+ * @param[out] n_number_of_bytes_to_write Maximum writing size
+ * @param[out] lpNumberOfBytesWrite Writing size
+ * @param lp_overlapped Not used
+ *
+ * @return Processing result
+ * @retval TRUE Processing succeeded
+ * @retval FALSE Processing failed
+ */
+BOOL WriteFile(HANDLE h_file, LPCVOID lp_buffer, DWORD n_number_of_bytes_to_write, LPDWORD lp_number_of_bytes_written, LPOVERLAPPED lp_overlapped) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int res = -1;
+ BOOL ret = 0;
+ int fd;
+ fd_set fds_set; /* Set of file descriptors */
+ fd_set fds_set_err;
+
+ struct timeval tv;
+
+#if GPS_FUNC_DEBUG_MSG__CWORD71__FILE
+ static FILE* fp = NULL; /* For debugging */
+ int i;
+#endif /* GPS_FUNC_DEBUG_MSG__CWORD71__FILE */
+
+ /* monitor for 2 seconds.*/
+ tv.tv_sec = 2;
+ tv.tv_usec = 0;
+ /* h_file is FD, and less than INT_MAX(0x7fffffff) */
+ fd = static_cast<int>((long)h_file); // NOLINT(runtime/int)
+
+ /* Initialization */
+ FD_ZERO(&fds_set);
+ FD_ZERO(&fds_set_err);
+
+ FD_SET(fd, &fds_set);
+ FD_SET(fd, &fds_set_err);
+
+ res = select(fd + 1, &fds_set, NULL, &fds_set_err, &tv);
+ if (res > 0) {
+ if (FD_ISSET(fd, &fds_set)) {
+ /* h_file is FD, and less than INT_MAX(0x7fffffff) */
+ res = static_cast<int>(write(static_cast<int>((long)h_file), lp_buffer, // NOLINT(runtime/int)
+ n_number_of_bytes_to_write));
+ *lp_number_of_bytes_written = res;
+
+#if GPS_FUNC_DEBUG_MSG__CWORD71__FILE
+ if (fp == NULL) {
+ /* File initialization */
+ fp = fopen(POS_GPS_W_LOGFILE_PATH, "w+");
+ } else {
+ fp = fopen(POS_GPS_W_LOGFILE_PATH, "a+");
+ }
+ for (i = 0; i < n_number_of_bytes_to_write; i++) {
+ fprintf(fp, "%02x ", *(reinterpret_cast<char *>(lp_buffer) + i));
+ }
+ fprintf(fp, "\n");
+ fclose(fp);
+#endif /* GPS_FUNC_DEBUG_MSG__CWORD71__FILE */
+ }
+ } else {
+ }
+
+ if (res != -1) {
+ ret = 1;
+ }
+
+ return ret;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : Wsprintf
+* ABSTRACT : Format a string and store the value in a buffer. If any of the arguments are passed,
+* Format according to the corresponding format specifier in the format control string and copies it to the output buffer.
+* NOTE :
+* ARGUMENT :
+* RETURN : int defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+int Wsprintf(LPTSTR lp_out, LPCTSTR lp_fmt, ...) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+#if 1 /* GPF */
+ int rtn;
+ va_list args;
+
+ va_start(args, lp_fmt);
+ /* Seems to be occured problems because the buffer size is not known. */
+ rtn = vswprintf(reinterpret_cast<wchar_t*>(lp_out), 256, reinterpret_cast<const wchar_t*>(lp_fmt), args);
+ va_end(args);
+
+ return rtn;
+#endif /* GPF */
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* MODULE : PbSystemTimeToFileTime
+* ABSTRACT : Convert the system date and time to 64-bit format file time.
+* NOTE :
+* ARGUMENT :
+* RETURN : BOOL defined
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+BOOL PbSystemTimeToFileTime(const SYSTEMTIME* lp_system_time, LPFILETIME lp_file_time) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return FALSE;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * Function name : MunmapDeviceIo<br>
+ * Register unmapping<br>
+ *
+ * Overview : Remove the mapping of a register to memory.<br>
+ *
+ * -# Release the mapping of the specified register to memory.
+ *
+ * @param h_dev [I]Handle to the device object
+ * @param map_size [I]Size of mapped device I/O memory
+ *
+ * @return RET_API Processing result
+ * @retval RET_NORMAL Processing succeeded
+ * @retval RET_ERROR Processing failed
+ */
+/* Wait for replacement */
+RET_API MunmapDeviceIo(HANDLE h_dev, u_int32 map_size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL;
+// LCOV_EXCL_STOP
+}
+
+/**
+ * Function name : MmapDeviceIo<br>
+ * Register mapping<br>
+ *
+ * Overview : Map registers to memory.<br>
+ *
+ * -# Map the specified register to memory.
+ *
+ * @param map_size [I]Size of mapped device I/O memory
+ * @param map_addr [I]Mapped physical address
+ *
+ * @return HANDLE Processing result
+ * @retval Except NULL Handle
+ * @retval NULL Processing failed
+ */
+/* Wait for replacement */
+HANDLE MmapDeviceIo(u_int32 map_size, u_int32 map_addr) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL;
+// LCOV_EXCL_STOP
+}
+
+/**
+ * @brief
+ *
+ * Kill
+ *
+ * Exit program
+ *
+ * @param[in] p_func Calling function
+ * @param[in] line Number of caller rows
+ */
+void _pb_Exit_d(const char* p_func, int line) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length) // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int ret = -1;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "FORBIDDEN ERROR [Called by:%s, Line:%d]", p_func, line);
+ exit(ret);
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+
+/* GPF001_sample_ttaka add end */
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbOther.cpp b/vehicleservice/positioning_base_library/library/src/_pbOther.cpp
new file mode 100755
index 0000000..73ff300
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbOther.cpp
@@ -0,0 +1,799 @@
+/*
+ * @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
+ * _pbOther.cpp
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <asm/unistd.h>
+#include <native_service/frameworkunified_types.h>
+
+#include <vehicle_service/positioning_base_library.h>
+#include "_pbInternalProc.h"
+#include <other_service/VP_GetEnv.h>
+#include "WPF_STD_private.h"
+#include "tchar.h"
+
+
+
+/*---------------------------------------------------------------------------------*
+ * Define *
+ *---------------------------------------------------------------------------------*/
+/* Shared memory */
+#define POS_BASE_OTHER_PROC_ID "POS_BASE_OTHER_PROC_ID"
+
+#define MAX_OTHER_PROC_NUM (32) /** Maximum number of the management information to translate the process name to PNO */
+#define MAX_NUM_CTRL_TID (16) /** Maximum number of tje TID management for thread in Process */
+
+#define OTHER_PNO_BASE (0x9000) /** Base number of local process */
+
+#define THREAD_NAME_LEN_MAX (32)
+
+#define FULL_OTHER_PROC_NUM (MAX_OTHER_PROC_NUM - 4) /** Threshold of the management information to translate the process name to PNO (no free) */
+#define WARN_OTHER_PROC_NUM (MAX_OTHER_PROC_NUM - 10) /** Threshold of the management information to translate the process name to PNO (warning) */
+
+typedef void* (*_CWORD64_PROCMNG_START_ROUTINE)(void*);
+
+/*---------------------------------------------------------------------------------*
+ * Structure *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Process identification information
+ */
+typedef struct {
+ PNO pno; /**< Process number */
+ char name[THREAD_NAME_LEN_MAX]; /**< Process name */
+} PROC_ID;
+
+/*!
+ @brief Process information
+ */
+typedef struct {
+ PROC_ID id[MAX_OTHER_PROC_NUM]; /**< Process identification information */
+ uint32_t use_cnt; /**< Used number */
+ uint32_t rsv_cnt; /**< Reserved number */
+} PROC_INFO;
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Value *
+ *---------------------------------------------------------------------------------*/
+static HANDLE g_h_app[MAX_NUM_CTRL_TID]; /** Application handle */
+static HANDLE g_h_mtx; /** Shared-information-locking Mutex handle */
+static HANDLE g_h_shm; /** Shared memory handle */ // Coverity CID: 18787 compliant
+
+static PROC_INFO* g_p_proc_id_tbl; /** Process Name-PNO Translation Table */
+
+/*---------------------------------------------------------------------------------*
+ * Internal Function Prototype *
+ *---------------------------------------------------------------------------------*/
+/* Process number to PNO translation table manipulation functions */
+static void OtherSetPnoOfCnvTbl(u_int32 idx, PNO pno);
+static void OtherSetNameOfCnvTbl(u_int32 idx, PCSTR name);
+static PNO OtherGetPnoOfCnvTbl(u_int32 idx);
+static PCSTR OtherGetNameOfCnvTbl(u_int32 idx);
+static u_int32 OtherSearchPnoOfCnvTbl(PNO pno);
+static u_int32 OtherSearchNameOfCnvTbl(PCSTR name);
+static void OtherIncUseCntOfCnvTbl(void);
+static void OtherIncRsvCntOfCnvTbl(void);
+static void OtherDecRsvCntOfCnvTbl(void);
+
+static void OtherCreateMutex(void);
+static void OtherDeleteMutex(void);
+static void OtherLockMutex(void);
+static void OtherUnlockMutex(void);
+
+/**
+ * @brief
+ * Initialize other funtion
+ *
+ * @return RET_NORMAL Normal completion
+ */
+RET_API ErrTrapInit(void) {
+ RET_API ret_api = RET_NORMAL;
+ PROC_INFO **pp_tbl;
+ u_int16 idx;
+
+ pp_tbl = &g_p_proc_id_tbl; /* Set a pointer to a table to translate the process name to PNO */
+
+ OtherCreateMutex(); /* Create Mutex for accessing shared info */
+ OtherLockMutex(); /* Acquire Mutex for accessing shared info */
+
+ /* Open shared memory for a table to translate the process name to PNO */
+ g_h_shm = OpenSharedMemory(const_cast<char*>(POS_BASE_OTHER_PROC_ID), sizeof(PROC_INFO));
+
+ /* If called for the first time within all processes, an error occurs and the following processing is performed. */
+ if (g_h_shm == NULL) { // LCOV_EXCL_BR_LINE 200: can not be not NULL
+ /* Create shared memory for a table to translate the name to PNO */
+ g_h_shm = CreateSharedMemory(const_cast<char*>(POS_BASE_OTHER_PROC_ID), sizeof(PROC_INFO));
+ /* In case of an error */
+ if (g_h_shm == NULL) { // LCOV_EXCL_BR_LINE 200: can not be NULL
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateShareData ERROR " \
+ "[g_h_shm:%p]", g_h_shm);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // // LCOV_EXCL_LINE 200: can not be NULL
+ /* don't arrive here. */
+ }
+ }
+
+ OtherUnlockMutex(); /* Release Mutex for accessing shared info */
+
+ /* Set the acquired shared memory address as a pointer for a table to translate the process name to PNO */
+ *pp_tbl = reinterpret_cast<PROC_INFO*>(GetSharedMemoryPtr(g_h_shm));
+
+ /* Table initialization */
+ for (idx = 0; idx < MAX_OTHER_PROC_NUM; idx++) {
+ /* Set PNO into the table to translate the process name to PNO (Overwrite from the second process onwards) */
+ OtherSetPnoOfCnvTbl(idx, static_cast<PNO>(OTHER_PNO_BASE + idx));
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Terminate other function
+ */
+void ErrTrapTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ CloseSharedMemory(g_h_shm);
+
+ OtherDeleteMutex();
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Create Thread
+ *
+ * @param[in] lp_thread_attributes Not used
+ * @param[in] dw_stack_size Initial stack size
+ * @param[in] lp_start_address Address of the effective function of the thread
+ * @param[in] lp_parameter Thread arguments
+ * @param[in] dw_creation_flags Not used
+ * @param[in] lp_thread_id Thread identifier
+ * @param[in] pno PNO
+ * @param[in] priority Thread priority
+ *
+ * @return Non-zero:Normal status, 0:When an error occurs
+ */
+HANDLE _pb_CreateThread(LPSECURITY_ATTRIBUTES lp_thread_attributes, DWORD dw_stack_size, LPTHREAD_START_ROUTINE lp_start_address, LPVOID lp_parameter, DWORD dw_creation_flags, LPDWORD lp_thread_id, PNO pno, int32 priority) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ pthread_attr_t st_thread_attr;
+ pthread_t ul_thread_id = 0;
+ sched_param st_thread_param = {0};
+ HANDLE handle = NULL;
+ int32 lret = EOK;
+ BOOL bret = FALSE;
+
+ /* null check */
+ if (lp_thread_id == NULL) {
+ // no op
+ } else {
+ /* Initializing Attributes */
+ lret = pthread_attr_init(&st_thread_attr);
+
+ /* When the attribute initialization is successful */
+ if (lret == EOK) {
+ /* Do not inherit parent scheduling policies */
+ lret = pthread_attr_setinheritsched(&st_thread_attr, PTHREAD_EXPLICIT_SCHED);
+ }
+
+ /* If you successfully configure policy inheritance */
+ if (lret == EOK) {
+ /* Scheduling settings */
+ lret = pthread_attr_setschedpolicy(&st_thread_attr, SCHED_RR);
+ }
+
+ /* Successful Scheduling settings */
+ if (lret == EOK) {
+ /* Create a thread with the lowest priority so that the spawned thread */
+ /* do not run until they are ready for processing */
+ st_thread_param.sched_priority = 1;
+ lret = pthread_attr_setschedparam(&st_thread_attr, &st_thread_param);
+ }
+
+ /* If the priority setting is successful */
+ if (lret == EOK) {
+ lret = pthread_create(&ul_thread_id,
+ NULL,
+ (_CWORD64_PROCMNG_START_ROUTINE)lp_start_address,
+ lp_parameter);
+ }
+
+ /* Successful pthread_create */
+ if (lret == EOK) {
+ bret = TRUE;
+ }
+ }
+
+ /* When priority setting is successful */
+ if (bret != FALSE) {
+ /* Return value setting */
+ handle = (HANDLE)ul_thread_id;
+ *lp_thread_id = ul_thread_id;
+ } else {
+ /* Error log output */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "lret ERROR [lret:%d]", lret);
+ }
+
+ return handle;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Get the thread ID
+ *
+ * @return Thread ID
+ */
+uint32_t PbGetTid(void) {
+ uint32_t ul_tid;
+
+ ul_tid = (uint32_t)syscall(__NR_gettid);
+
+ return ul_tid;
+}
+
+/**
+ * @brief
+ * Get the local thread ID
+ *
+ * Local thread ID = [0, 1, 2, ...]<br>
+ * The local thread ID is unique in the process, and dynamically assigned in the order in which <br>
+ * this API was called during the process execution. <br>
+ *
+ * @return Local thread ID
+ */
+uint32_t PbGetLocalTid(void) {
+ static uint32_t g_tid[MAX_NUM_CTRL_TID] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
+ }; /** In-process thread ID management table */
+
+ uint32_t ul_tid;
+ uint32_t ul_idx;
+ uint32_t ul_local_tid = 0xFFFFFFFF;
+
+ ul_tid = PbGetTid();
+
+ OtherLockMutex(); /* Get Mutex for accessing shared info */
+
+ for (ul_idx = 0; ul_idx < MAX_NUM_CTRL_TID; ul_idx++) {
+ if (g_tid[ul_idx] == ul_tid) {
+ ul_local_tid = ul_idx;
+ }
+ }
+
+ if (ul_local_tid == 0xFFFFFFFF) {
+ for (ul_idx = 0; ul_idx < MAX_NUM_CTRL_TID; ul_idx++) {
+ if (g_tid[ul_idx] == 0xFFFFFFFF) {
+ g_tid[ul_idx] = ul_tid;
+ ul_local_tid = ul_idx;
+
+ break;
+ }
+ }
+
+ if (ul_local_tid == 0xFFFFFFFF) {
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Local Tid buffer is overfull!!");
+ _pb_Exit();
+
+ /* don't arrive here. */
+ }
+ }
+
+ OtherUnlockMutex(); /* Release Mutex for accessing shared info */
+
+ return ul_local_tid;
+}
+
+
+/**
+ * @brief
+ * Get Application Handle
+ *
+ * Get the application handle of the invoking thread.
+ *
+ * @return Non-zero:Normal status, 0:When an error occurs
+ */
+HANDLE _pb_GetAppHandle(void) { // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ const uint32_t offset = PbGetLocalTid();
+
+ return g_h_app[offset];
+}
+
+
+/**
+ * @brief
+ * Set Application Handle
+ *
+ * Set the application handle of the invoking thread.
+ *
+ * @param[in] name Process name
+ */
+void _pb_SetAppHandle(HANDLE h_app) { // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ const uint32_t offset = PbGetLocalTid();
+
+ OtherLockMutex(); /* Get Mutex for accessing shared info */
+
+ g_h_app[offset] = h_app;
+
+ OtherUnlockMutex(); /* Release Mutex for accessing shared info */
+
+ return;
+}
+
+
+/**
+ * @brief
+ * Convert process name to pno
+ *
+ * Translate process name to PNO.<br>
+ * If the process name specified in the argument is the first name to <br>
+ * be translated by this API, a new PNO is assigned and returned. <br>
+ * If NULL is specified, 0 is returned.
+ *
+ * @param[in] name Process name
+ *
+ * @return Process number
+ */
+PNO _pb_CnvName2Pno(PCSTR name) { // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ u_int32 idx;
+ PNO pno = 0;
+ size_t len;
+
+ /* null check */
+ if (name == NULL) {
+ pno = 0;
+ } else {
+ len = _tcslen(name);
+ if (len >= THREAD_NAME_LEN_MAX) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!! " \
+ "Length of thread name is too long(>=%d). [len:%zu]", THREAD_NAME_LEN_MAX, len);
+ } else {
+ OtherLockMutex();
+
+ idx = OtherSearchNameOfCnvTbl(name);
+
+ if (idx != MAX_OTHER_PROC_NUM) {
+ pno = OtherGetPnoOfCnvTbl(idx);
+ } else {
+ idx = OtherSearchNameOfCnvTbl("");
+ OtherSetNameOfCnvTbl(idx, name);
+ /* Increment using-counter */
+ OtherIncUseCntOfCnvTbl();
+ pno = OtherGetPnoOfCnvTbl(idx);
+ }
+
+ OtherUnlockMutex();
+ }
+ }
+
+ return pno;
+}
+
+/**
+ * @brief
+ * Convert pno to process name
+ *
+ * Translate PNO to the process name.
+ * Return the process name set by _pb_CnvName2Pno to the PNO argument.
+ * If a non-PNO value is given by _pb_CnvName2Pno is specified,
+ * NULL is returned.
+ *
+ * @param[in] pno Process number
+ *
+ * @return Process name
+ */
+PCSTR _pb_CnvPno2Name(PNO pno) { // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ u_int32 idx;
+ PCSTR name = NULL;
+
+ OtherLockMutex();
+
+ idx = OtherSearchPnoOfCnvTbl(pno);
+
+ if (idx != MAX_OTHER_PROC_NUM) {
+ name = OtherGetNameOfCnvTbl(idx);
+ }
+
+ OtherUnlockMutex();
+
+ return name;
+}
+
+
+/**
+ * @brief
+ * Get environment variables
+ *
+ * @param[in] Environment variable name
+ * @param[in] Pointer to environment variable value
+ */
+void GetEnv(const char* p_env_str, char* p_env_buff) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ VP_GetEnv(p_env_str, p_env_buff);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VP_GetEnv:%s=%s", p_env_str, p_env_buff);
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/*---------------------------------------------------------------------------------*
+ * Local Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * PNO setting(The table to translate the process name to PNO)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] u_int32 idx Table accessor
+ * @param[in] PNO pno Process number
+ *
+ * @return none
+ */
+static void OtherSetPnoOfCnvTbl(u_int32 idx, PNO pno) {
+ /* check index */
+ if (idx >= MAX_OTHER_PROC_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, pno:%d]", idx, pno);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ g_p_proc_id_tbl->id[idx].pno = pno;
+
+ return;
+}
+
+/**
+ * @brief
+ * Set process name (The table to translate the process name to PNO)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] u_int32 idx Table accessor
+ * @param[in] PCSTR name Process name
+ *
+ * @return none
+ */
+static void OtherSetNameOfCnvTbl(u_int32 idx, PCSTR name) {
+ /* check index */
+ if (idx >= MAX_OTHER_PROC_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, name:%s]", idx, name);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ _tcscpy(g_p_proc_id_tbl->id[idx].name, name);
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get PNO (The table to translate the process name to PNO)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] u_int32 idx Table accessor
+ *
+ * @return PNO
+ */
+static PNO OtherGetPnoOfCnvTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_OTHER_PROC_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_p_proc_id_tbl->id[idx].pno;
+}
+
+/**
+ * @brief
+ * Get process name (The table to translate the process name to PNO)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] u_int32 idx Table accessor
+ *
+ * @return PCSTR
+ */
+static PCSTR OtherGetNameOfCnvTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_OTHER_PROC_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_p_proc_id_tbl->id[idx].name;
+}
+
+/**
+ * @brief
+ * Retrieve PNO (The table to translate the process name to PNO)
+ *
+ * If the PNO specified in the argument exists in the table, return the index for access.
+ * If not exists, return the maximum number of local PNO controls (MAX_OTHER_PROC_NUM).
+ *
+ * @param[in] PNO pno Process number
+ *
+ * @return u_int32 Table accessor
+ */
+static u_int32 OtherSearchPnoOfCnvTbl(PNO pno) {
+ u_int32 idx;
+ PNO lPno;
+
+ for (idx = 0; idx < MAX_OTHER_PROC_NUM; idx++) {
+ lPno = OtherGetPnoOfCnvTbl(idx);
+
+ if (lPno == pno) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+/**
+ * @brief
+ * Retrieve process name (The table to translate the process name to PNO)
+ *
+ * If the process specified by the argument exists in the table, return the index for access.
+ * If not exists, return the maximum number of local PNO controls (MAX_OTHER_PROC_NUM).
+ *
+ * @param[in] PCSTR name Process name
+ *
+ * @return u_int32 Table accessor
+ */
+static u_int32 OtherSearchNameOfCnvTbl(PCSTR name) {
+ int32 ret;
+ u_int32 idx;
+
+ for (idx = 0; idx < MAX_OTHER_PROC_NUM; idx++) {
+ ret = _tcscmp(g_p_proc_id_tbl->id[idx].name, name);
+
+ /* If there is a match */
+ if (ret == 0) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+
+/**
+ * @brief
+ * Create Mutex for accessing shared info
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+static void OtherCreateMutex(void) {
+ g_h_mtx = _pb_CreateMutex(NULL, 0, "Other_Mutex");
+ if (g_h_mtx == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateMutex ERROR [g_h_mtx:%p]", g_h_mtx);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Delete Mutex for accessing shared info
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+static void OtherDeleteMutex(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DWORD ret;
+ ret = PbDeleteMutex(g_h_mtx);
+ if (ret != WAIT_OBJECT_0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbDeleteMutex ERROR " \
+ "[ret:%lu, g_h_mtx:%p]", ret, g_h_mtx);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Get Mutex for accessing shared info
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+static void OtherLockMutex(void) {
+ DWORD ret;
+ ret = PbMutexLock(g_h_mtx, INFINITE);
+ if (ret != WAIT_OBJECT_0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbMutexLock ERROR " \
+ "[ret:%lu, g_h_mtx:%p]", ret, g_h_mtx);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Open Mutex for Accessing Shared Info
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+static void OtherUnlockMutex(void) {
+ BOOL ret;
+ ret = PbMutexUnlock(g_h_mtx);
+ if (ret != TRUE) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbMutexUnlock ERROR " \
+ "[ret:%d, g_h_mtx:%p]", ret, g_h_mtx);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Get dump information
+ *
+ * @param[out] pBuf Dump info
+ */
+void _pb_GetDebugOtherMngTbl(void* pBuf) {
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t bufTmp[64];
+ uint32_t i;
+
+ if (pBuf != NULL) {
+ memset(&buf[0], 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&buf[0]), sizeof(buf), "Other");
+ if (g_p_proc_id_tbl == NULL) { // LCOV_EXCL_BR_LINE 200: g_p_proc_id_tbl can not be NULL
+ // LCOV_EXCL_START 200: g_p_proc_id_tbl can not be NULL
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ strncat(reinterpret_cast<char *>(&buf[0]), "\n NULL", strlen("\n NULL"));
+ // LCOV_EXCL_STOP
+ } else {
+ for (i = 0; i < MAX_OTHER_PROC_NUM; i++) {
+ memset(&bufTmp[0], 0x00, sizeof(bufTmp));
+ snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp),
+ "\n [%02d] pno:0x%04x, name:%s",
+ i,
+ g_p_proc_id_tbl->id[i].pno,
+ g_p_proc_id_tbl->id[i].name);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), \
+ strlen(reinterpret_cast<char *>(&bufTmp[0])));
+ }
+ }
+ memcpy(pBuf, &buf[0], sizeof(buf));
+ }
+}
+
+/**
+ * @brief
+ * Increment the usage counter of the table to translate process name to PNO
+ *
+ * @param[in] none
+ */
+static void OtherIncUseCntOfCnvTbl(void) {
+ g_p_proc_id_tbl->use_cnt++;
+ return;
+}
+
+/**
+ * @brief
+ * Increment the counter to reserve the table to translate the process name to PNO
+ *
+ * @param[in] none
+ */
+static void OtherIncRsvCntOfCnvTbl(void) {
+ g_p_proc_id_tbl->rsv_cnt++;
+ return;
+}
+
+/**
+ * @brief
+ * Decrement the counter to reserve the table to translate the process name to PNO
+ *
+ * @param[in] none
+ */
+static void OtherDecRsvCntOfCnvTbl(void) {
+ g_p_proc_id_tbl->rsv_cnt--;
+ return;
+}
+
+/**
+ * @brief
+ * Determine resources ready (The table to translate the process name to PNO)
+ *
+ * @param[in] none
+ *
+ * @return BOOL
+ * @retval TRUE : Normal
+ * @retval FALSE : Error (Resource shortage)
+ */
+BOOL _pb_GetOtherResource(void) {
+ BOOL ret = TRUE;
+ uint32_t cnt;
+
+ OtherLockMutex();
+
+ /* Increment reserved counter */
+ OtherIncRsvCntOfCnvTbl();
+
+ cnt = g_p_proc_id_tbl->use_cnt + g_p_proc_id_tbl->rsv_cnt;
+ if (cnt >= FULL_OTHER_PROC_NUM) {
+ ret = FALSE;
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Lack of resources " \
+ "[FATAL][use_cnt:%d rsv_cnt:%d]", g_p_proc_id_tbl->use_cnt, g_p_proc_id_tbl->rsv_cnt);
+ } else if (cnt >= WARN_OTHER_PROC_NUM) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Lack of resources " \
+ "[WARN][use_cnt:%d rsv_cnt:%d]", g_p_proc_id_tbl->use_cnt, g_p_proc_id_tbl->rsv_cnt);
+ }
+
+ OtherUnlockMutex();
+
+ return ret;
+}
+
+/**
+ * @brief
+ * Release resources (The table to translate process name to PNO)
+ *
+ * @param[in] none
+ *
+ * @return none
+ */
+void _pb_ReleaseOtherResource(void) {
+ OtherLockMutex();
+
+ /* Decrement reserved counter */
+ OtherDecRsvCntOfCnvTbl();
+
+ OtherUnlockMutex();
+
+ return;
+}
diff --git a/vehicleservice/positioning_base_library/library/src/_pbProcMng.cpp b/vehicleservice/positioning_base_library/library/src/_pbProcMng.cpp
new file mode 100755
index 0000000..e8d9601
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbProcMng.cpp
@@ -0,0 +1,207 @@
+/*
+ * @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 : _pbProcMng.cpp
+ System name :
+ Subsystem name :
+ Title :
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include <fcntl.h>
+#include <sys/procfs.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+#include "_pbInternalProc.h"
+#include "_pbWaitforsingleobject.h"
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : ExitProcess
+ * ABSTRACT : Terminate one process and all threads belonging to that process.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : VOID defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+VOID ExitProcess(UINT u_exit_code) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ exit(u_exit_code);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetCurrentProcess
+ * ABSTRACT : Get a pseudo handle for the current process.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : HANDLE defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* QAC 3460 */
+HANDLE GetCurrentProcess(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return reinterpret_cast<HANDLE>(getpid());
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetCurrentProcessId
+ * ABSTRACT : Get the process identifier of the calling process.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : DWORD defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* QAC 3460 */
+DWORD GetCurrentProcessId(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return (DWORD)getpid();
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : _pb_ExitThread
+ * ABSTRACT : Terminate a thread
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : VOID defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+VOID _pb_ExitThread(DWORD dw_exit_code) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length) // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* Delete handle type */
+ WaitObjectDel(reinterpret_cast<HANDLE*>(pthread_self()));
+
+ return pthread_exit (reinterpret_cast<void*>(dw_exit_code));
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : TerminateThread
+ * ABSTRACT : Terminate a thread
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : BOOL defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+BOOL TerminateThread(HANDLE h_thread, DWORD dw_exit_code) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ int32 lret = EOK;
+ BOOL bret = TRUE;
+
+ /* Delete handle type */
+ WaitObjectDel(h_thread);
+
+ /* When an error occurs */
+ if (lret == EOK) {
+ bret = FALSE;
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetExitCodeThread
+ * ABSTRACT : Get the exit status of the specified thread.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : BOOL defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+BOOL GetExitCodeThread(HANDLE h_thread, LPDWORD lp_exit_code) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return TRUE;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : WaitExitThread
+ * ABSTRACT : Wait for the thread to terminate.
+ * NOTE : It can only be used for a thread in the same process according to PosixBasedOS001.
+ * ARGUMENT :
+ * RETURN : BOOL defined
+ * RET_NORMAL : Normal completion
+ * RET_ERROR : ABEND
+ * RET_ERRTIMEOUT : Timeout occurred
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API WaitExitThread(HANDLE h_handle, u_int32 ul_mill_seconds, u_int32* pul_exit_code) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return RET_NORMAL; /* Coverity CID: 18759 compliant */
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetCurrentThread
+ * ABSTRACT : Get a pseudo handle for the current thread.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : HANDLE defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* QAC 3460 */
+HANDLE GetCurrentThread(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return (HANDLE)pthread_self();
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetCurrentThreadId
+ * ABSTRACT : Get the thread identifier of the calling thread.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : DWORD defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* QAC 3460 */
+DWORD GetCurrentThreadId(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return (DWORD)pthread_self();
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : GetThreadTimes
+ * ABSTRACT : Get time information about the specified thread.
+ * NOTE :
+ * ARGUMENT :
+ * RETURN : BOOL defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+BOOL GetThreadTimes(HANDLE h_process, HANDLE h_thread, LPFILETIME lp_creation_time, LPFILETIME lp_exit_time, LPFILETIME lp_kernel_time, LPFILETIME lp_user_time) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return TRUE; /* Coverity CID: 18765 compliant */
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : ResumeThread
+ * ABSTRACT : Decrease the thread suspend count by 1.
+ * NOTE : Always return 0 because no suspend operation is supported according to PosixBasedOS001.
+ * ARGUMENT :
+ * RETURN : DWORD defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+DWORD ResumeThread(HANDLE h_thread) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 0;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SuspendThread
+ * ABSTRACT : Suspend execution of the specified thread.
+ * NOTE : Always return 0 because no suspend operation is supported according to PosixBasedOS001.
+ * ARGUMENT :
+ * RETURN : DWORD defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+DWORD SuspendThread(HANDLE h_thread) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return 0;
+}
+// LCOV_EXCL_STOP
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbSem.cpp b/vehicleservice/positioning_base_library/library/src/_pbSem.cpp
new file mode 100755
index 0000000..1264d79
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbSem.cpp
@@ -0,0 +1,780 @@
+/*
+ * @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
+ * _pbSem.cpp
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+#include "_pbInternalProc.h"
+#include "WPF_STD_private.h"
+#include "tchar.h"
+
+/*
+ Constants and structure definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#define MAX_PB_SEMAPHORES 256
+#define MAX_SEMAPHORE_NAME_LEN 32
+#define MAX_PB_SEMAPHORES_INPROC 16
+
+/* Name storage table */
+typedef struct {
+ TCHAR semaphore_name[MAX_SEMAPHORE_NAME_LEN + 1]; /* Semaphore name(Specified name of the user APP) */
+ DWORD ref_counter; /* Reference Counter (Currently unused, always 1) */
+} PB_SEMAPHORE;
+
+/* Control information storage table */
+typedef struct {
+ HANDLE h_heap; /* Handle of the heap area allocated for expanding the self TBL (control-information-storage TBL) */
+ PB_SEMAPHORE* p_sys_semaphore; /* Address where the self name in the name storage table is stored (Top address of self name) */
+ DWORD index; /* Semaphore ID that is equal to the index of self TBL (control information strage TBL:p_handle_table) + 1 */
+ HANDLE h_semaphore; /* Semaphore handle (Semaphore or Mutex according to the above DEBUG defines) */
+ HANDLE h_mutex; /* Mutex handle for locking when updating the self TBL (control information storage TBL) */
+} PB_SEMAPHORE_OPEN_HANDLE;
+
+/* Semaphore information management table */
+typedef struct {
+ PB_SEMAPHORE_OPEN_HANDLE* p_handle_table[MAX_PB_SEMAPHORES]; /* Pointer to control information storage table */
+ HANDLE h_shared_memory; /* Handle of shared memory allocated for name storage table to expand */
+ HANDLE h_mutex; /* Mutex handle to lock when updating the name storage table */
+ PB_SEMAPHORE* p_semaphore_table; /* Pointer to the name storage table (Allocate as many areas as the maximum number of registrations in shared memory)*/
+} PB_SEMAPHORE_INSTANCE;
+
+typedef struct /* In-process semaphore management table */ {
+ char semaphore_name[MAX_SEMAPHORE_NAME_LEN]; /* Semaphore name (Specified name of the user APP) */
+ HANDLE h_heap; /* Heap handle of critical section structure area */
+ CRITICAL_SECTION *p_cs; /* Critical section pointer(Semaphore ID) */
+} PB_SEM_INPROC;
+
+/*
+ Internal function prototype declarations
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static DWORD FindSemaphoreTable(PB_SEMAPHORE* p_semaphore_table, TCHAR* name, HANDLE h_mutex);
+static DWORD AllocNewSemaphoreTable(PB_SEMAPHORE* p_semaphore_table, TCHAR* name, HANDLE h_mutex);
+static void FreeSemaphoreTable(PB_SEMAPHORE* p_semaphore_table, int index, HANDLE h_mutex);
+
+/*
+ Global variable definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static PB_SEMAPHORE_INSTANCE g_instance; // NOLINT(readability/nolint) global class instance
+/* CS for exclusive control of in-process semaphore management table */
+CRITICAL_SECTION g_sem_in_proc_tbl_mng_cs;
+/* Pointer to the in-process semaphore management table */
+PB_SEM_INPROC *g_p_sem_in_proc_mng = NULL;
+
+/*
+ * Inline functions.
+ */
+inline void
+MakeSemaphoreName(TCHAR* name, DWORD index) {
+ wsprintf(name, __TEXT("POS_BASE_SEMAPHORE_SEM%05d"), static_cast<int32>(index));
+}
+inline void
+MakeMutexName(TCHAR* name, DWORD index) {
+ wsprintf(name, __TEXT("POS_BASE_SEMAPHORE_MUTEX%05d"), static_cast<int32>(index));
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SemaphoreInit
+ * ABSTRACT : Semaphore initialization processing
+ * NOTE : This function is called when _CWORD64_api.dll is ATTACH from processes
+ * : and initializes the process.
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * RET_ERRINIT ABEND
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SemaphoreInit(void) {
+ RET_API ret_api = RET_NORMAL;
+ PB_SEMAPHORE_INSTANCE *p_inst = &g_instance;
+ TCHAR name[32] = {0};
+ DWORD semaphore_table_size = 0;
+ int32 n = 0;
+ PB_SEMAPHORE *p_semaphore_table = NULL;
+ BOOL b_create = FALSE;
+
+ /* Initialize the semaphore information management table */
+ for (n = 0; n < MAX_PB_SEMAPHORES; n++) {
+ p_inst->p_handle_table[n] = NULL; /* NULL initialize the control data storage table */
+ }
+
+ /* Initialize the semaphore name storage table */
+ _tcscpy(name, __TEXT("POS_BASE_SEMAPHORE_TABLE"));
+ semaphore_table_size = sizeof(PB_SEMAPHORE) * MAX_PB_SEMAPHORES;
+ /* Open shared memory with the name _CWORD64__SEMAPHORE_TABLE */
+ p_inst->h_shared_memory = OpenSharedMemory(name, semaphore_table_size);
+ if (p_inst->h_shared_memory == NULL) /* If shared memory does not exist */ {
+ /* Create a shared memory with the name _CWORD64__SEMAPHORE_TABLE */
+ p_inst->h_shared_memory = CreateSharedMemory(name, semaphore_table_size);
+ if (p_inst->h_shared_memory == NULL) /* If shared memory creation fails */ {
+ ret_api = RET_ERRINIT; /* Ends in error */
+ } else {
+ b_create = TRUE; /* Create shared memory */
+
+ /* Allocate the created shared memory to the semaphore name storage table and initialize it. */
+ // LCOV_EXCL_BR_START 200: cannot be null
+ p_semaphore_table = reinterpret_cast<PB_SEMAPHORE*>(GetSharedMemoryPtr(p_inst->h_shared_memory));
+ // LCOV_EXCL_BR_STOP
+ if (p_semaphore_table == NULL) { // LCOV_EXCL_BR_LINE 200: cannot be null
+ // LCOV_EXCL_START 200: cannot be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ CloseSharedMemory(p_inst->h_shared_memory);
+ DeleteSharedMemory(name);
+ ret_api = RET_ERRINIT; /* Ends in error */
+ // LCOV_EXCL_STOP
+ } else {
+ for (n = 0; n < MAX_PB_SEMAPHORES; n++) {
+ p_semaphore_table[n].semaphore_name[0] = __TEXT('\0'); /* Initialize name */
+ p_semaphore_table[n].ref_counter = 0; /* Initialize reference counter */
+ }
+ }
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ /* Save the address of the shared memory to the name storage table pointer of the semaphore information management table. */
+ // LCOV_EXCL_BR_START 200: cannot be null
+ p_inst->p_semaphore_table = reinterpret_cast<PB_SEMAPHORE*>(GetSharedMemoryPtr(p_inst->h_shared_memory));
+ // LCOV_EXCL_BR_STOP
+ if (p_inst->p_semaphore_table == NULL) { // LCOV_EXCL_BR_LINE 200: cannot be null
+ // LCOV_EXCL_START 200: cannot be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ CloseSharedMemory(p_inst->h_shared_memory);
+ if (b_create != FALSE) {
+ DeleteSharedMemory(name);
+ }
+ ret_api = RET_ERRINIT; /* Ends in error */
+ // LCOV_EXCL_STOP
+ } else {
+ /* Mutex creation process for semaphore-information-management table */
+ _tcscpy(name, __TEXT("POS_BASE_SEMAPHORE_MUTEX"));
+ /* Save the handle of the created Mutex in the Mutex handles for semaphore-information-management-table */
+ p_inst->h_mutex = _pb_CreateMutex(NULL, FALSE, name); // LCOV_EXCL_BR_LINE 200: can not be null
+ if (p_inst->h_mutex == NULL) { /* Failed to create a Mutex. */ // LCOV_EXCL_BR_LINE 200: can not be null
+ // LCOV_EXCL_START 200: can not be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_CWORD64_api.dll:%s:LINE %d\r\n CreateMutex ERROR " \
+ "In SemaphoreInit\r\n", LTEXT(__FILE__), __LINE__);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Mutex_Name : %s\r\n", name);
+ _pb_Exit();
+ // LCOV_EXCL_STOP
+ }
+ }
+ }
+
+ return ret_api;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SemaphoreTerm
+ * ABSTRACT : Semaphore function termination processing
+ * NOTE : Called when the process ATTACH to _CWORD64_api.dll terminates, and then terminated.
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL Always this value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SemaphoreTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ PB_SEMAPHORE_INSTANCE *p_inst = &g_instance;
+
+ if (p_inst->h_mutex != NULL) {
+ PbDeleteMutex(p_inst->h_mutex);
+ p_inst->h_mutex = NULL;
+ }
+
+ if (p_inst->h_shared_memory != NULL) {
+ CloseSharedMemory(p_inst->h_shared_memory);
+ p_inst->h_shared_memory = NULL;
+ }
+
+ return RET_NORMAL;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Create Semaphore
+ *
+ * Create a semaphore and return a semaphore ID.<br>
+ * For a semaphore that has already been created, return the same value of the semaphore ID when it has been created.
+ *
+ * @param[in] *sem_name Pointer to the semaphore name string to be created (NULL termination)
+ *
+ * @return Semaphore ID created other than 0<br>
+ * 0 ABEND to create semaphore
+ */
+#ifdef _CWORD64_API_DOES_NOT_USE_UNICODE
+SemID _pb_CreateSemaphore(char* sem_name) // NOLINT(readability/nolint) WPF_SYSAPI.h API
+#else
+SemID _pb_CreateSemaphore(TCHAR* sem_name) // NOLINT(readability/nolint) WPF_SYSAPI.h API
+#endif // _CWORD64_API_DOES_NOT_USE_UNICODE
+{
+ SemID ret_sem_id = 0;
+ TCHAR *p_semaphore_name = NULL;
+ PB_SEMAPHORE_INSTANCE *p_inst = &g_instance;
+ TCHAR name[MAX_SEMAPHORE_NAME_LEN + 1] = {0};
+ PB_SEMAPHORE_OPEN_HANDLE *p_semaphore_open = NULL;
+ DWORD index = 0;
+
+ /* Check if the semaphore name is NULL */
+ if (sem_name == NULL) {
+ } else {
+ p_semaphore_name = sem_name;
+
+ /* Check if the semaphore name is specified */
+ if (p_semaphore_name[0] == __TEXT('\0')) {
+ } else if (_tcslen(p_semaphore_name) > MAX_SEMAPHORE_NAME_LEN) {
+ /* Check whether the semaphore name is less than or equal to the maximum number of characters */
+ } else {
+ /* Allocate Heap control information storage table area to create a semaphore */
+ p_semaphore_open = reinterpret_cast<PB_SEMAPHORE_OPEN_HANDLE *>(PbProcessHeapAlloc(0, \
+ sizeof(PB_SEMAPHORE_OPEN_HANDLE))); // LCOV_EXCL_BR_LINE 200: no branch
+ }
+
+ if (p_semaphore_open != NULL) {
+ PbMutexLock(p_inst->h_mutex, INFINITE); /* Mutex Lock from here */ // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+
+ /* Retrieve the name storage table expanded in the shared memory with the user-specified name. */
+ index = FindSemaphoreTable(p_inst->p_semaphore_table, p_semaphore_name, p_inst->h_mutex);
+ if (index != ((DWORD) - 1)) {
+ /* The semaphore name specified for the user already exists. */
+ /* Check if the control information storage table exists */
+ if (p_inst->p_handle_table[index] != NULL) {
+ /* If the control information storage TBL exists,(If it has already been created by this process) */
+ /* release the previously allocated Heap because it is not needed. */
+ PbProcessHeapFree(0, p_semaphore_open); // LCOV_EXCL_BR_LINE 200: no branch
+ /* Retrieve the pointer to the TBL storing the existing control information. */
+ p_semaphore_open = p_inst->p_handle_table[index];
+ PbMutexUnlock(p_inst->h_mutex); /* Mutex release */ // LCOV_EXCL_BR_LINE 200: no branch
+ /* Convert from an index of array to a semaphore ID and return (If it has already been created in this process) */
+ ret_sem_id = static_cast<SemID>(index + 1);
+ } else {
+ // LCOV_EXCL_START 200: p_handle_table can not be NULL
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* If a semaphore with the established name exists but the control information table does not exist, link to it or create it in the following processing. */
+ /* (A semaphore was created by another process or the created process was terminated.) */
+ /* Store the assigned semaphore ID in the control information storage table. */
+ p_semaphore_open->index = index;
+ /* Store the start address of the name storage table */
+ p_semaphore_open->p_sys_semaphore = &p_inst->p_semaphore_table[index];
+ /* Store the address of the control information TBL (Heap) into the semaphore information management TBL. */
+ p_inst->p_handle_table[index] = p_semaphore_open;
+
+ /* Create the object name of the semaphore from the position (index of array) of the control information storage TBL. */
+ /* "_CWORD64__SEMAPHORE_SEMAPHORExxxxx" : xxxxx is expanded with five-digit array index */
+ MakeSemaphoreName(name, index);
+
+ /* Create a semaphore object using Mutex and store its handle into the control information storage TBL. */
+ p_semaphore_open->h_semaphore = _pb_CreateMutex(NULL, FALSE, name);
+ if (p_semaphore_open->h_semaphore == NULL) {
+ /* If the semaphore object creation failed, */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_CWORD64_api.dll:%s:LINE %d\r\n CreateMutex ERROR " \
+ "In _pb_CreateSemaphore\r\n", LTEXT(__FILE__), __LINE__);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Mutex_Name : %s\r\n", name);
+ _pb_Exit(); /* Make reset */
+ }
+
+ /* Create a Mutex name for locking the control information storage TBL from the position (index of array) of the control information storage TBL */
+ /* "_CWORD64__SEMAPHORE_MUTEXxxxxx" : xxxxx is expanded with five-digit array index */
+ MakeMutexName(name, index);
+ /* Create a Mutex for locking the control information storage TBL and store its handle into the control information storage TBL */
+ p_semaphore_open->h_mutex = _pb_CreateMutex(NULL, FALSE, name);
+ if (p_semaphore_open->h_mutex == NULL) {
+ /* If the creation of a Mutex for locking the control data storage TBL fails, */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_CWORD64_api.dll:%s:LINE %d\r\n CreateMutex ERROR " \
+ "In _pb_CreateSemaphore\r\n", LTEXT(__FILE__), __LINE__);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Mutex_Name : %s\r\n", name);
+ _pb_Exit();
+ }
+ /* Semaphore Lock for updating semaphore information control TBL */
+ PbMutexLock(p_semaphore_open->h_mutex, INFINITE);
+ p_semaphore_open->p_sys_semaphore->ref_counter = 1;
+ /* Semaphore UnLock upon completion of updating semaphore-information-management-TBL */
+ PbMutexUnlock(p_semaphore_open->h_mutex);
+ /* Semaphore UnLock upon completion of updating semaphore-information-management-TBL */
+ PbMutexUnlock(p_inst->h_mutex);
+
+ ret_sem_id = static_cast<SemID>(index + 1); /* Convert from an index of array to a semaphore ID and return */
+ /* (A semaphore was created by another process or the created process was terminated.) */
+ // LCOV_EXCL_STOP
+ }
+ } else {
+ /* If the semaphore name specified by the user does not exist, it is newly created in the following processing. */
+ /* Free-space retrieval processing for the name storage table */
+ index = AllocNewSemaphoreTable(p_inst->p_semaphore_table, p_semaphore_name, p_inst->h_mutex);
+ if (index == ((DWORD) - 1)) { // LCOV_EXCL_BR_LINE 200: table buffer is enough, can not failed
+ /* If there is no free space in the name storage table */
+ /* Initialize the name storage TBL pointer of the control information storage TBL. (it may be No meaning due to release heap area in the following processing?) */
+ // LCOV_EXCL_START 200: table buffer is enough, can not failed
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ p_semaphore_open->p_sys_semaphore = NULL;
+ /* Free the Heap area allocated for control information storage TBL */
+ PbProcessHeapFree(0, p_semaphore_open);
+ /* Semaphore UnLock to recover from errors */
+ PbMutexUnlock(p_inst->h_mutex);
+ // LCOV_EXCL_STOP
+ } else {
+ /* Store the assigned semaphore ID in the control information storage table. */
+ p_semaphore_open->index = index;
+ /* Store this start address of the name storage table */
+ p_semaphore_open->p_sys_semaphore = &p_inst->p_semaphore_table[index];
+ p_semaphore_open->p_sys_semaphore->ref_counter = 1; /* Reset reference counter. */
+ /* Store the control information TBL (Heap) address in the semaphore information management TBL. */
+ p_inst->p_handle_table[index] = p_semaphore_open;
+
+ /* Create the object name of the semaphore from the position (array index) of the control information storage TBL. */
+ /* "_CWORD64__SEMAPHORE_SEMAPHORExxxxx" : xxxxx is expanded with five-digit array index */
+ MakeSemaphoreName(name, index);
+ p_semaphore_open->h_semaphore = _pb_CreateMutex(NULL, FALSE, name); // LCOV_EXCL_BR_LINE 200: cannot be null // NOLINT(whitespace/line_length)
+ if (p_semaphore_open->h_semaphore == NULL) { // LCOV_EXCL_BR_LINE 200: cannot be null
+ // LCOV_EXCL_START 200: can not be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_CWORD64_api.dll:%s:LINE %d\r\n CreateMutex ERROR " \
+ "In _pb_CreateSemaphore\r\n", LTEXT(__FILE__), __LINE__);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Mutex_Name : %s\r\n", name);
+ _pb_Exit();
+ // LCOV_EXCL_STOP
+ }
+
+ MakeMutexName(name, index);
+ p_semaphore_open->h_mutex = _pb_CreateMutex(NULL, FALSE, name); // LCOV_EXCL_BR_LINE 200: cannot be null // NOLINT(whitespace/line_length)
+ if (p_semaphore_open->h_mutex == NULL) { // LCOV_EXCL_BR_LINE 200: cannot be null
+ // LCOV_EXCL_START 200: can not be null
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_CWORD64_api.dll:%s:LINE %d\r\n CreateMutex ERROR " \
+ "In _pb_CreateSemaphore\r\n", LTEXT(__FILE__), __LINE__);
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Mutex_Name : %s\r\n", name);
+ _pb_Exit();
+ // LCOV_EXCL_STOP
+ }
+ /* Semaphore name registration */
+ _tcscpy(p_semaphore_open->p_sys_semaphore->semaphore_name, p_semaphore_name);
+
+ PbMutexUnlock(p_inst->h_mutex); /* Mutex lock to new create semaphore ends here */ // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+
+ ret_sem_id = static_cast<SemID>(index + 1); /* Convert from an array index to a semaphore ID and return */
+ }
+ }
+ }
+ }
+
+ return ret_sem_id; /* Return the allocated semaphore ID. */
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbDeleteSemaphore
+ * ABSTRACT : Semaphore deletion processing
+ * NOTE : Delete the semaphore specified by semaphore ID
+ * ARGUMENT : SemID sem_id Semaphore ID to be deleted
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_OSERROR ABEND
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbDeleteSemaphore(SemID sem_id) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+ int index = 0;
+ PB_SEMAPHORE_INSTANCE *p_inst = &g_instance;
+ PB_SEMAPHORE_OPEN_HANDLE *p_semaphore_open = NULL;
+ DWORD dw_ret_sts = 0;
+ DWORD ref_counter = 0;
+
+ /* Parameter check */
+ if (sem_id == 0) {
+ /* Error if specified semaphore ID is zero */
+ ret_api = RET_OSERROR;
+ }
+
+ if (ret_api == RET_NORMAL) {
+ index = static_cast<int>(sem_id) - 1; /* Calculate the index number of the semaphore table from the specified semaphore ID. */
+ if (index >= MAX_PB_SEMAPHORES) {
+ /* If the specified semaphore ID is out of range */
+ ret_api = RET_OSERROR;
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ PbMutexLock(p_inst->h_mutex, INFINITE); /* Need this exclusion? Seems to not be used exclusion at Locking/Unlocking... */
+ p_semaphore_open = p_inst->p_handle_table[index];
+ PbMutexUnlock(p_inst->h_mutex); /* Need this exclusion? Seems to not be used exclusion at Locking/Unlocking... */
+ if (p_semaphore_open == NULL) /* If the specified semaphore ID is not registered in the table */ {
+ ret_api = RET_OSERROR;
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ /* Return an error if the semaphore is locked */
+ dw_ret_sts = PbMutexLock(p_semaphore_open->h_semaphore, 0);
+ if (dw_ret_sts == WAIT_TIMEOUT) {
+ ret_api = RET_OSERROR;
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ PbMutexUnlock(p_semaphore_open->h_semaphore);
+
+ PbMutexLock(p_semaphore_open->h_mutex, INFINITE);
+ if (p_semaphore_open->p_sys_semaphore->ref_counter > 0) {
+ p_semaphore_open->p_sys_semaphore->ref_counter--;
+ }
+
+ ref_counter = p_semaphore_open->p_sys_semaphore->ref_counter;
+ PbMutexUnlock(p_semaphore_open->h_mutex);
+
+ if (ref_counter == 0) {
+ PbMutexLock(p_inst->h_mutex, INFINITE); /* Get Mutex */
+
+ FreeSemaphoreTable(p_inst->p_semaphore_table, index, p_inst->h_mutex);
+ p_semaphore_open->p_sys_semaphore = NULL;
+ if (p_semaphore_open->h_semaphore != NULL) {
+ PbDeleteMutex(p_semaphore_open->h_semaphore);
+ p_semaphore_open->h_semaphore = NULL;
+ }
+
+ if (p_semaphore_open->h_mutex != NULL) {
+ PbDeleteMutex(p_semaphore_open->h_mutex);
+ p_semaphore_open->h_mutex = NULL;
+ }
+
+ PbProcessHeapFree(0, p_semaphore_open);
+
+ p_inst->p_handle_table[index] = NULL;
+ PbMutexUnlock(p_inst->h_mutex); /* Release Mutex */
+ }
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Semaphore Lock
+ *
+ * Get the semaphore with the specified semaphore ID. Do not return from this function until it is acquired.
+ *
+ * @param[in] sem_id Semaphore ID of the semaphore to be acquired
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_OSERROR ABEND
+ */
+RET_API _pb_SemLock(SemID sem_id) { // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ RET_API ret_api = RET_OSERROR;
+ PB_SEMAPHORE_INSTANCE *p_inst = &g_instance;
+ PB_SEMAPHORE_OPEN_HANDLE *p_semaphore_open = NULL;
+ int index = 0;
+ DWORD result = 0;
+
+ /* Parameter check */
+ if (sem_id != 0) {
+ /* The specified semaphore ID is non-zero */
+ index = static_cast<int>(sem_id) - 1; /* Calculate the index number of the semaphore table from the specified semaphore ID. */
+ if (index >= MAX_PB_SEMAPHORES) {
+ /* If the specified semaphore ID is out of range */
+ } else {
+ p_semaphore_open = p_inst->p_handle_table[index];
+ if (p_semaphore_open != NULL) {
+ /* If the specified semaphore ID is already registered in the table, */
+ ret_api = RET_NORMAL;
+ }
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ /* Wait forever until a semaphore is acquired */
+ result = PbMutexLock(p_semaphore_open->h_semaphore, INFINITE);
+
+ switch (result) {
+ case WAIT_OBJECT_0: {
+ ret_api = RET_NORMAL;
+ break;
+ }
+ case WAIT_ABANDONED: { // LCOV_EXCL_BR_LINE 200: function do not return this
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_OSERROR; // LCOV_EXCL_LINE 200: function do not return this
+ break; // LCOV_EXCL_LINE 200: function do not return this
+ }
+ case WAIT_TIMEOUT: { // LCOV_EXCL_BR_LINE 200: parameter INFINITE not return this
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_OSERROR; // LCOV_EXCL_LINE 200: parameter INFINITE not return this
+ break; // LCOV_EXCL_LINE 200: parameter INFINITE not return this
+ }
+ default:
+ ret_api = RET_OSERROR;
+ break;
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Semaphore Unlock
+ *
+ * Release the semaphore specified by semaphore ID.
+ *
+ * @param[in] sem_id Semaphore ID of the semaphore to be released
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_OSERROR ABEND
+ */
+RET_API _pb_SemUnlock(SemID sem_id) { // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ RET_API ret_api = RET_OSERROR;
+ int index = 0;
+ PB_SEMAPHORE_INSTANCE *p_inst = &g_instance;
+ PB_SEMAPHORE_OPEN_HANDLE *p_semaphore_open = NULL;
+ BOOL ok = FALSE;
+
+ /* Parameter check */
+ if (sem_id != 0) {
+ /* The specified semaphore ID is non-zero */
+ index = static_cast<int>(sem_id) - 1; /* Calculate the index number of the semaphore table from the specified semaphore ID. */
+ if (index >= MAX_PB_SEMAPHORES) {
+ /* If the specified semaphore ID is out of range */
+ } else {
+ p_semaphore_open = p_inst->p_handle_table[index];
+ if (p_semaphore_open != NULL) {
+ /* If the specified semaphore ID is already registered in the table, */
+ ret_api = RET_NORMAL;
+ }
+ }
+ }
+
+ if (ret_api == RET_NORMAL) {
+ ok = PbMutexUnlock(p_semaphore_open->h_semaphore); // LCOV_EXCL_BR_LINE 200: unlock can not failed
+ if (ok == FALSE) { // LCOV_EXCL_BR_LINE 200: unlock can not failed
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_OSERROR; // LCOV_EXCL_LINE 200: unlock can not failed
+ }
+ }
+
+ return ret_api;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : InitSemaphoreInProcess
+ * ABSTRACT : Semaphore initialization processing
+ * NOTE : Initialize to use semaphore that is valid only within a process
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_OSERROR ABEND
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+InitSemaphoreInProcess(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+ DWORD pid; /* Process ID */
+ TCHAR wcs_share_data_name[32]; /* Name of shared data area for in-process semaphore management table */
+ char mbs_share_data_name[32]; /* Name of shared data area for in-process semaphore management table */
+ char *cp_addr = NULL; /* For returning the start address of the shared data area */
+ u_int32 dummy_size; /* For returning the size of shared data area */
+
+ pid = getpid(); /* Get process ID */
+
+ memset(&wcs_share_data_name[0], 0, sizeof(wcs_share_data_name));
+ memset(&mbs_share_data_name[0], 0, sizeof(mbs_share_data_name));
+#ifdef UNDER_CE
+ /* Create the name of shared data area for in-process semaphore management table */
+ wsprintf(&wcs_share_data_name[0], __TEXT("SemInProc_%08x"), pid);
+ wcstombs(&mbs_share_data_name[0], &wcs_share_data_name[0], sizeof(mbs_share_data_name));
+#else
+ /* Create the name of shared data area for in-process semaphore management table */
+ wsprintf(&mbs_share_data_name[0], __TEXT("SemInProc_%08x"), static_cast<int32>(pid));
+#endif
+
+ /* Link to shared data area for semaphore management table in process */
+ ret_api = _pb_LinkShareData(&mbs_share_data_name[0], reinterpret_cast<void**>(&cp_addr), &dummy_size);
+ if (ret_api == RET_NORMAL) {
+ /* Successful completion because _pb_InitSemaphoreInProcess has already been executed. */
+ } else {
+ /* Create shared data area for in-process semaphore management table */
+ ret_api = _pb_CreateShareData(&mbs_share_data_name[0],
+ static_cast<u_int32>(sizeof(PB_SEM_INPROC) * MAX_PB_SEMAPHORES_INPROC), \
+ reinterpret_cast<void**>(&cp_addr));
+ if (ret_api == RET_NORMAL) {
+ /* Save top address of in-process semaphore management table */
+ g_p_sem_in_proc_mng = reinterpret_cast<PB_SEM_INPROC *>(cp_addr);
+
+ /* Initialization processing of the critical section object for in-process semaphore management table lock */
+ PbInitializeCriticalSection(&g_sem_in_proc_tbl_mng_cs);
+ } else {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " _CWORD64_api.dll:%s:LINE %d\r\n ## " \
+ "ERROR:InitSemaphoreInProcess --> _pb_CreateShareData ##\r\n", LTEXT(__FILE__), __LINE__);
+ ret_api = RET_OSERROR;
+ }
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DeinitSemaphoreInProcess
+ * ABSTRACT : Semaphore function termination processing
+ * NOTE : Terminate semaphore function that is valid only within a process
+ * ARGUMENT : None
+ * RETURN : RET_API RET_NORMAL Normal completion
+ * : RET_OSERROR ABEND
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DeinitSemaphoreInProcess(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+ PB_SEM_INPROC *p_sem_in_proc; /* Pointer to the in-process semaphore management table */
+ DWORD pid; /* Process ID */
+ TCHAR wcs_share_data_name[32]; /* Name of shared data area for in-process semaphore management table */
+ char mbs_share_data_name[32]; /* Name of shared data area for in-process semaphore management table */
+ char *cp_addr = NULL; /* For returning the start address of the shared data area */
+ u_int32 dummy_size; /* For returning the size of the shared data area */
+ int i;
+
+ pid = getpid(); /* Get process ID */
+
+ memset(&wcs_share_data_name[0], 0, sizeof(wcs_share_data_name));
+ memset(&mbs_share_data_name[0], 0, sizeof(mbs_share_data_name));
+#ifdef UNDER_CE
+ /* Create the name of shared data area for in-process semaphore management table */
+ wsprintf(&wcs_share_data_name[0], __TEXT("SemInProc_%08x"), pid);
+ wcstombs(&mbs_share_data_name[0], &wcs_share_data_name[0], sizeof(mbs_share_data_name));
+#else/* Create the name of shared data area for in-process semaphore management table */
+ wsprintf(&mbs_share_data_name[0], __TEXT("SemInProc_%08x"), static_cast<int32>(pid));
+#endif
+
+ /* Link to shared data area for in-process semaphore management table */
+ ret_api = _pb_LinkShareData(&mbs_share_data_name[0], reinterpret_cast<void**>(&cp_addr), &dummy_size);
+ if (ret_api != RET_NORMAL) {
+ ret_api = RET_NORMAL; /* If the link fails, it is assumed to have been deleted and it completes normally. */
+ } else {
+ /* Get CS for exclusive control of in-process semaphore management table */
+ PbEnterCriticalSection(&g_sem_in_proc_tbl_mng_cs);
+
+ p_sem_in_proc = g_p_sem_in_proc_mng; /* Get start address of in-process semaphore management table */
+ if (p_sem_in_proc == NULL) {
+ ret_api = RET_OSERROR;
+ } else {
+ /* Search in-process semaphore management table (delete all semaphores) */
+ for (i = 0; i < MAX_PB_SEMAPHORES_INPROC; i++, p_sem_in_proc++) {
+ if (p_sem_in_proc->p_cs != 0) {
+ PbDeleteCriticalSection(p_sem_in_proc->p_cs); /* Delete critical section */
+ /* Release the Heap area allocated as the critical section structured area */
+ PbProcessHeapFree(0, p_sem_in_proc->p_cs);
+ }
+ }
+
+ ret_api = PbDeleteShareData(&mbs_share_data_name[0]); /* Delete shared data area */
+ if (ret_api != RET_NORMAL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " _CWORD64_api.dll:%s:LINE %d\r\n ## " \
+ "ERROR:DeinitSemaphoreInProcess --> PbDeleteShareData ##\r\n", LTEXT(__FILE__), __LINE__);
+ ret_api = RET_OSERROR;
+ } else {
+ g_p_sem_in_proc_mng = NULL;
+ }
+ }
+
+ PbLeaveCriticalSection(&g_sem_in_proc_tbl_mng_cs); /* Release CS for exclusive control of in-process semaphore management table */
+
+ if (ret_api == RET_NORMAL) {
+ /* When the process is completed normally up to this point */
+ PbDeleteCriticalSection(&g_sem_in_proc_tbl_mng_cs); /* Delete critical section */
+ }
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/***** Internal functions *****/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FindSemaphoreTable
+ * ABSTRACT : Name storage table retrieval processing
+ * NOTE : Retrieve the specified name storage table with the specified name,
+ * : and return its array index if the specified name exists in the table.
+ * : The specified Mutex is locked during this table retrieval processing.
+ * ARGUMENT : PB_SEMAPHORE* p_semaphore_table Pointer to the name storage TBL
+ * TCHAR* name Pointer to the name to be retrieved
+ * HANDLE h_mutex Handle of the name storage TBL-locking Mutex
+ * RETURN : DWORD othe than -1 Array index of containing the name string to be retrieved
+ * : -1 Specified name does not exist
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static DWORD
+FindSemaphoreTable(PB_SEMAPHORE* p_semaphore_table, TCHAR* name, HANDLE h_mutex) {
+ DWORD ret = (DWORD) - 1;
+ /* Loop up to the maximum number of entries and search the name storage table. */
+ for (int n = 0; n < MAX_PB_SEMAPHORES; n++) {
+ /* If there is a matching name, */
+ if (_tcscmp(p_semaphore_table[n].semaphore_name, name) == 0) {
+ ret = n; /* Return the index of the array in which the given name existed */
+ break;
+ }
+ }
+ /* UnLock the lock Mutex because the search for the name storage table has been completed. */
+ /* PbMutexUnlock(h_mutex); */
+
+ return ret; /* Since no search name exists, an error value of-1 is returned. */
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : AllocNewSemaphoreTable
+ * ABSTRACT : Name storage table free space retrieval processing
+ * NOTE : Retrieve the specified name storage table from the beginning,
+ * : return the array index of any free space.
+ * : [Note] Because the Mutex part inside this function has been deleted
+ * : to fix a bug caused by Mutex leaks, the whole function must be
+ * : locked by Mutex from the outside when this function is used.
+ * ARGUMENT : PB_SEMAPHORE *p_semaphore_table
+ * TCHAR *name
+ * HANDLE h_mutex
+ * RETURN : DWORD
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static DWORD
+AllocNewSemaphoreTable(PB_SEMAPHORE* p_semaphore_table, TCHAR* name, HANDLE h_mutex) {
+ DWORD ret = (DWORD) - 1;
+ /* Loop up to the maximum number of entries and search the name storage table. */
+ for (int n = 0; n < MAX_PB_SEMAPHORES; n++) {
+ /* If there is free space */
+ if (p_semaphore_table[n].semaphore_name[0] == __TEXT('\0')) {
+ ret = n;
+ break;
+ }
+ }
+
+ return ret;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : FreeSemaphoreTable
+ * ABSTRACT :
+ * NOTE :
+ * ARGUMENT : PB_SEMAPHORE* p_semaphore_table
+ * int index
+ * HANDLE h_mutex
+ * RETURN : None
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+static void
+FreeSemaphoreTable(PB_SEMAPHORE* p_semaphore_table, int index, HANDLE h_mutex) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ p_semaphore_table[index].semaphore_name[0] = __TEXT('\0');
+}
+// LCOV_EXCL_STOP
+
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : _sysSem.cpp
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
diff --git a/vehicleservice/positioning_base_library/library/src/_pbSerial.cpp b/vehicleservice/positioning_base_library/library/src/_pbSerial.cpp
new file mode 100755
index 0000000..c6044af
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbSerial.cpp
@@ -0,0 +1,525 @@
+/*
+ * @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.
+ */
+
+
+#include "_pbSerial.h"
+#include "WPF_STD_private.h"
+#include "_pbInternalProc.h"
+
+typedef struct SerialTable {
+ HANDLE h_handle; /* Registration handle */
+ DWORD dw_wait_mask; /* SetMask */
+ DWORD dw_read_timeout; /* milisec */
+ DWORD dw_write_timeout; /* milisec */
+ struct SerialTable *next;
+} SERIAL_TABLE;
+
+static SERIAL_TABLE *g_pst_serial_table = NULL;
+static pthread_mutex_t g_func_lock_mutex = PTHREAD_MUTEX_INITIALIZER; /* Consider replacing it later */
+
+/* Prototype declarations */
+static BOOL FindList(SERIAL_TABLE **p_list, HANDLE h_obj);
+static BOOL AddList(SERIAL_TABLE *p_add_list);
+static BOOL DelList(SERIAL_TABLE *h_del_obj);
+static BOOL FunctionLock(void);
+static BOOL FunctionUnlock(void);
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* _sys internal public APIs
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/****************************************************************************
+@brief SerialTableInit<BR>
+ Initialize each process
+@outline SerialTableInit<BR>
+ Initialize each process
+@type Completion return type
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialTableInit(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* do nothing at this time */
+ return TRUE;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief SerialTableTerm<BR>
+ termination processing for each process
+@outline SerialTableTerm<BR>
+ termination processing for each process
+@type Completion return type
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialTableTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (NULL != g_pst_serial_table) {
+ /* delete the list? */
+ }
+ return TRUE;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief SerialObjectTimeoutAdd<BR>
+ Set read/write timeout
+@outline SerialObjectTimeoutAdd<BR>
+ Set read/write timeout
+@type Completion return type
+
+@param[in] HANDLE h_obj : Handle to set the timeout
+@param[in] DWORD dw_read_timeout : Timeout to read (Millisecond)
+@param[in] DWORD dw_write_timeout : Timeout to write (Millisecond)
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialObjectTimeoutAdd(HANDLE h_obj, DWORD dw_read_timeout, DWORD dw_write_timeout) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *p_list = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != h_obj) {
+ FunctionLock();
+ bret = FindList(&p_list, h_obj);
+ if (TRUE == bret) {
+ /* Already exists in the list */
+ if (NULL != p_list) {
+ p_list->dw_read_timeout = dw_read_timeout;
+ p_list->dw_write_timeout = dw_write_timeout;
+ bret = TRUE;
+ } else {
+ /* The list pointer is expected to be in the list but cannot be retrieved. */
+ bret = FALSE;
+ }
+ } else {
+ /* Not exist in the list */
+ p_list = reinterpret_cast<SERIAL_TABLE*>(malloc(sizeof(SERIAL_TABLE)));
+ if (NULL != p_list) {
+ p_list->next = NULL;
+ p_list->dw_wait_mask = 0;
+ p_list->h_handle = h_obj;
+ p_list->dw_read_timeout = dw_read_timeout;
+ p_list->dw_write_timeout = dw_write_timeout;
+ bret = AddList(p_list);
+ if (FALSE == bret) {
+ /* Registration failure */
+ free(p_list);
+ bret = FALSE;
+ } else {
+ /* Registration success */
+ bret = TRUE;
+ }
+ } else {
+ /* Falied to get memory */
+ bret = FALSE;
+ }
+ }
+ FunctionUnlock();
+ } else {
+ /* Parameter error */
+ bret = FALSE;
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief SerialObjectTimeoutGet<BR>
+ Get read/write timeout
+@outline SerialObjectTimeoutGet<BR>
+ Get read/write timeout
+@type Completion return type
+
+@param[in] HANDLE h_obj : Handle for getting the timeout
+@param[out] DWORD* dw_read_timeout : Timeout to read (Millisecond)
+@param[out] DWORD* dw_write_timeout : Timeout to write (Millisecond)
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialObjectTimeoutGet(HANDLE h_obj, DWORD *dw_read_timeout, DWORD *dw_write_timeout) { // LCOV_EXCL_START 8:dead code // NOLINT(whitespace/line_length)
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *p_list = NULL;
+ BOOL bret = FALSE;
+
+ if ((NULL != h_obj) && (NULL != dw_read_timeout) && (NULL != dw_write_timeout)) {
+ FunctionLock();
+ bret = FindList(&p_list, h_obj);
+ if (TRUE == bret) {
+ /* Exists in the list */
+ if (NULL != p_list) {
+ *dw_read_timeout = p_list->dw_read_timeout;
+ *dw_write_timeout = p_list->dw_write_timeout;
+ bret = TRUE;
+ } else {
+ /* The list pointer is expected to be in the list but cannot be retrieved. */
+ bret = FALSE;
+ }
+ } else {
+ /* Not exist in the list */
+ bret = FALSE;
+ }
+ FunctionUnlock();
+ } else {
+ /* Parameter error */
+ bret = FALSE;
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief SerialObjectWaitmaskAdd<BR>
+ Set the mask of event wait factor
+@outline SerialObjectWaitmaskAdd<BR>
+ Set the mask of event wait factor
+@type Completion return type
+
+@param[in] HANDLE h_obj : Handle to set the mask
+@param[in] DWORD dw_mask : Value of mask
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialObjectWaitmaskAdd(HANDLE h_obj, DWORD dw_mask) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *p_list = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != h_obj) {
+ FunctionLock();
+ bret = FindList(&p_list, h_obj);
+ if (TRUE == bret) {
+ /* already exists in the list */
+ if (NULL != p_list) {
+ /* Clear unused flags */
+ p_list->dw_wait_mask = (DWORD)((dw_mask) & (EV_RXCHAR | EV_ERROR | EV_DSR));
+ bret = TRUE;
+ } else {
+ /* The list pointer is expected to be in the list but cannot be retrieved. */
+ bret = FALSE;
+ }
+ } else {
+ /* Not exist in the list */
+ p_list = reinterpret_cast<SERIAL_TABLE*>(malloc(sizeof(SERIAL_TABLE)));
+ if (NULL != p_list) {
+ p_list->next = NULL;
+ p_list->h_handle = h_obj;
+ p_list->dw_read_timeout = INFINITE; /* Infinity wait as initial value */
+ p_list->dw_write_timeout = INFINITE; /* Infinity wait as initial value */
+ /* Clear unused flags */
+ p_list->dw_wait_mask = (DWORD)((dw_mask) & (EV_RXCHAR | EV_ERROR | EV_DSR));
+ bret = AddList(p_list);
+ if (FALSE == bret) {
+ /* Registration failure */
+ free(p_list);
+ bret = FALSE;
+ } else {
+ /* registration success */
+ bret = TRUE;
+ }
+ } else {
+ /* Failed to get memory */
+ bret = FALSE;
+ }
+ }
+ FunctionUnlock();
+ } else {
+ /* Parameter error */
+ bret = FALSE;
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief SerialObjectWaitmaskGet<BR>
+ Get the set mask value from a handle
+@outline SerialObjectWaitmaskGet<BR>
+ Get the set mask value from a handle
+@type Completion return type
+
+@param[in] HANDLE h_obj : Handle from which the mask is to be acquired
+@param[out] DWORD* dw_mask : mask value
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialObjectWaitmaskGet(HANDLE h_obj, DWORD *dw_mask) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *p_list = NULL;
+ BOOL bret = FALSE;
+
+ if ((NULL != h_obj) && (NULL != dw_mask)) {
+ *dw_mask = 0;
+ FunctionLock();
+ bret = FindList(&p_list, h_obj);
+ if (TRUE == bret) {
+ /* Exists in the list */
+ if (NULL != p_list) {
+ *dw_mask = p_list->dw_wait_mask;
+ bret = TRUE;
+ } else {
+ /* The list pointer is expected to be in the list but cannot be retrieved. */
+ bret = FALSE;
+ }
+ } else {
+ /* Not exist in the list */
+ bret = FALSE;
+ }
+ FunctionUnlock();
+ } else {
+ /* Parameter error */
+ bret = FALSE;
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief SerialObjectDel<BR>
+ Delete Timeout and Mask Setting
+@outline SerialObjectDel<BR>
+ Delete Timeout and Mask Setting
+@type Completion return type
+
+@param[in] HANDLE h_obj : Handle from which the setting is to be deleted
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL SerialObjectDel(HANDLE h_obj) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *p_list = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != h_obj) {
+ FunctionLock();
+ bret = FindList(&p_list, h_obj);
+ if (TRUE == bret) {
+ /* Already exists in the list */
+ if (NULL != p_list) {
+ bret = DelList(p_list);
+ if (TRUE == bret) {
+ free(p_list);
+ } else {
+ /* Failed to delete */
+ }
+ } else {
+ /* The list pointer is expected to be in the list but cannot be retrieved. */
+ bret = FALSE;
+ }
+ } else {
+ /* Not exist in the list */
+ }
+ FunctionUnlock();
+ } else {
+ /* Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* Private APIs
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/****************************************************************************
+@brief FindList<BR>
+ Searching for a Handle in the List
+@outline FindList<BR>
+ Searching for a Handle in the List
+@type Completion return type
+
+@param[out] SERIAL_TABLE** p_list : Found list pointer
+@param[in] HANDLE h_obj : Handle to look for
+
+@return BOOL
+@retval TRUE : Normal (p_list != NULL)
+@retval FALSE : Error (p_list == NULL)
+*****************************************************************************/
+static BOOL FindList(SERIAL_TABLE **p_list, HANDLE h_obj) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *pNow = NULL;
+ BOOL bret = FALSE;
+
+ if ((NULL != h_obj) && (NULL != p_list)) {
+ /* Search list */
+ pNow = g_pst_serial_table;
+ while (NULL != pNow) {
+ /* h_obj and pNow->h_handle are pointer type.*/
+ if ((int64_t)h_obj == (int64_t)pNow->h_handle) {
+ *p_list = pNow;
+ bret = TRUE;
+ break;
+ }
+ pNow = pNow->next;
+ }
+ } else {
+ bret = FALSE; /* Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief AddList<BR>
+ Append data to the end of the list
+@outline AddList<BR>
+ Append data to the end of the list
+@type Completion return type
+
+@param[in] SERIAL_TABLE* p_list : Data to add
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+static BOOL AddList(SERIAL_TABLE *p_add_list) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *pNow = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != p_add_list) {
+ /* Add unregistered data */
+ if (NULL == g_pst_serial_table) {
+ g_pst_serial_table = p_add_list;
+ bret = TRUE;
+ } else {
+ /* Add to end of list */
+ pNow = g_pst_serial_table;
+ while (NULL != pNow) {
+ if (NULL == pNow->next) {
+ pNow->next = p_add_list;
+ bret = TRUE;
+ break;
+ }
+ pNow = pNow->next;
+ }
+ }
+ } else {
+ bret = FALSE; /* Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief DelList<BR>
+ Remove Specified Data from a List
+@outline DelList<BR>
+ Remove Specified Data from a List
+@type Completion return type
+
+@param[in,out] SERIAL_TABLE* h_del_obj :
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+static BOOL DelList(SERIAL_TABLE *h_del_obj) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ SERIAL_TABLE *pNow = NULL;
+ SERIAL_TABLE *pBef = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != h_del_obj) {
+ /* Add to end of list */
+ pNow = g_pst_serial_table;
+ while (NULL != pNow) {
+ if (h_del_obj == pNow) {
+ if (NULL == pBef) {
+ /* Delete first data */
+ g_pst_serial_table = pNow->next;
+ } else {
+ /* Others */
+ pBef->next = h_del_obj->next;
+ }
+ bret = TRUE;
+ break;
+ }
+ pBef = pNow;
+ pNow = pNow->next;
+ }
+ } else {
+ bret = FALSE; /* Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief FunctionLock<BR>
+ Start locking g_pst_serial_table
+@outline FunctionLock<BR>
+ Start locking g_pst_serial_table
+@type Completion return type
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+static BOOL FunctionLock(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL bret = FALSE;
+ if (EOK == pthread_mutex_lock(&g_func_lock_mutex)) {
+ bret = TRUE;
+ }
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/***************************************************************************
+@brief FunctionUnlock<BR>
+ Terminate locking of g_pst_serial_table
+@outline FunctionUnlock<BR>
+ Terminate locking of g_pst_serial_table
+@type Completion return type
+
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+static BOOL FunctionUnlock(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL bret = FALSE;
+ if (EOK == pthread_mutex_unlock(&g_func_lock_mutex)) {
+ bret = TRUE;
+ }
+ return bret;
+}
+// LCOV_EXCL_STOP
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbSram.cpp b/vehicleservice/positioning_base_library/library/src/_pbSram.cpp
new file mode 100755
index 0000000..f31e16f
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbSram.cpp
@@ -0,0 +1,316 @@
+/*
+ * @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 : _pbSram.cpp
+ System name : 05 Integration Platform
+ Subsystem name : System common functions
+ Title : System APIs
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ Function prototype declarations
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ RET_API SramDMWt(u_int32 mode);
+ RET_API SramDMWrkWt(u_int8 id, void *pbuf, u_int32 off, u_int16 size);
+ RET_API SramDMWrkRd(u_int8 id, u_int32 off, void *pbuf, u_int16 size);
+
+#ifdef __cplusplus
+}
+#endif
+
+/*
+ External function prototype declarations
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+extern RET_API CreateAsyncWtThread(void);
+
+/*
+ Global Variable Definitions
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+extern int g_n_api_set_id; /* ID variable for PSL registration */
+extern void *g_adr_diagmem_wrktop; /* Diag memory temporary work area top address */
+
+#ifdef CEPC_EM /* Physical area (pseudo area) setting for CEPC and EM */
+
+/* Allocation size of temporary work for diagnosis memory */
+#define SIZE_DIAGMEM_WRK 0x00001000
+
+#endif
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramSetup
+ * ABSTRACT : SRAM Access-Initialization Process
+ * NOTE : When called by _sys_SramInit when _CWORD64_api.dll is attached, the SRAM physical area
+ * is mapped to the shared area so that the SRAM physical area can be accessed.
+ * The first call after system startup checks the result of the previous SRAM write processing.
+ * If the power is off during system startup, the system performs continuous write processing.
+ * (Before the _CWORD100_ modularization of SRAM access functions,
+ * they were used to open ports, but now they do not need to be opened.)
+ * ARGUMENT : u_int32 mount_flg HDD mount status flag
+ * u_int32 *mount_sts HDD mount status return pointer
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramSetup(u_int32 mount_flg, u_int32 *mount_sts) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramWt
+ * ABSTRACT : SRAM write process
+ * NOTE : Write the content of the buffer to the offset-position of the area of the specified SRAM ID.
+ * Temporary buffer is used for SRAM writing, and recovery from writing is considered.
+ * Therefore, the transfer data size must be less than or equal to the temporary buffer size.
+ * ARGUMENT : u_int8 id SRAM area id
+ * void *pbuf Source buffer pointer
+ * u_int32 off Destination SRAM offsets (bytes)
+ * u_int16 size Transfer data size (bytes)
+ * RETURN : RET_API
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramWt(u_int8 id, void *pbuf, u_int32 off, u_int16 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramFil
+ * ABSTRACT : SRAM memory-fill process
+ * NOTE : Fill with the specified patterns from the offset position of
+ * the area of the specified SRAM ID.
+ * Temporary buffer is used for SRAM writing, and recovery from writing is considered.
+ * Therefore, it is effective that the fill size is less than or equal to the temporary buffer size.
+ * ARGUMENT : u_int8 id SRAM area id
+ * u_int32 off Fill destination SRAM offset (bytes)
+ * u_int8 pat Fill pattern
+ * u_int16 size Fill size (bytes)
+ *
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramFil(u_int8 id, u_int32 off, u_int8 pat, u_int16 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+
+ ret_sts = PbSramFil32(id, off, pat, (u_int32)size);
+
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbSramFil32
+ * ABSTRACT : SRAM memory-fill process
+ * NOTE : Fill with the specified patterns from the offset position of
+ * the area of the specified SRAM ID.
+ * Temporary buffer is used for SRAM writing, and recovery from writing is considered.
+ * Therefore, it is effective that the fill size is less than or equal to the temporary buffer size.
+ * ARGUMENT : u_int8 id SRAM area id
+ * u_int32 off Fill destination SRAM offset (bytes)
+ * u_int8 pat Fill pattern
+ * u_int32 size Fill size (bytes)
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbSramFil32(u_int8 id, u_int32 off, u_int8 pat, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramRd
+ * ABSTRACT : SRAM read process
+ * NOTE : Write content in the area specified SRAM ID and offset position to buffer.
+ * ARGUMENT : u_int8 id SRAM area ID
+ * u_int32 off Source SRAM Offset (bytes)
+ * void *pbuf Destination buffer pointer
+ * u_int16 size Transfer data size (bytes)
+ * RETURN : RET_API
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramRd(u_int8 id, u_int32 off, void *pbuf, u_int16 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+
+ ret_sts = PbSramRd32(id, off, pbuf, (u_int32)size);
+
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbSramRd32
+ * ABSTRACT : SRAM read process
+ * NOTE : Write content in the area specified SRAM ID and offset position to buffer.
+ * ARGUMENT : u_int8 id SRAM area ID
+ * u_int32 off Source SRAM Offset (bytes)
+ * void *pbuf Destination buffer pointer
+ * u_int32 size Transfer data size(bytes)
+ * RETURN : RET_API
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbSramRd32(u_int8 id, u_int32 off, void *pbuf, u_int32 size) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramSz
+ * ABSTRACT : Acquisition of SRAM ID size
+ * NOTE : Get the effective area size of the specified SRAM ID.
+ * ARGUMENT : u_int8 id SRAM area ID
+ * u_int16 *psize Size (bytes)
+ * RETURN : RET_API
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramSz(u_int8 id, u_int16 *psize) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ u_int32 size32 = 0;
+
+ ret_sts = PbSramSz32(id, &size32);
+ if (ret_sts == RET_NORMAL) {
+ if (size32 <= 0x0000FFFF) {
+ *psize = (u_int16)size32;
+ } else {
+ /* When the size of the specified ID is u_int16 or greater */
+ ret_sts = RET_ERRPARAM;
+ }
+ }
+
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : PbSramSz32
+ * ABSTRACT : Acquisition of SRAM ID size
+ * NOTE : Get the effective area size of the specified SRAM ID.
+ * ARGUMENT : u_int8 id SRAM area ID
+ * u_int32 *psize Size (bytes)
+ * RETURN : RET_API
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+PbSramSz32(u_int8 id, u_int32 *psize) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramRWChk
+ * ABSTRACT : SRAM read/write check processing
+ * NOTE : Checking whether SRAM can be read/written correctly
+ * ARGUMENT : None
+ * RETURN : RET_API
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramRWChk(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_NORMAL; /* Result */
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : AsyncFWt
+ * ABSTRACT : Asynchronous Data HDD Backup Processing
+ * NOTE :
+ * ARGUMENT : void
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API AsyncFWt(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ /* _CWORD121_ compliant ret_sts = Backup_AsyncForcibleWrite(); */
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramWtAccOff
+ * ABSTRACT : Asynchronous Data HDD Backup Process at ACC-OFF
+ * NOTE : Saving Asynchronous Data to Hard Drives at ACC-OFF
+ * ARGUMENT : void
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API SramWtAccOff(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ /* _CWORD121_ compliant ret_sts = Backup_AccOffNotify(); */
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : DataWtWaitHDDSpinup
+ * ABSTRACT : HDD spin-up completion wait data save processing
+ * NOTE : Save to the HDD
+ * ARGUMENT : u_int16 para Startup Identification Value
+ * RETURN : RET_API defined
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+DataWtWaitHDDSpinup(u_int16 para) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_NORMAL; /* Result */
+ return ret_sts;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : SramLoadFromExtDev
+ * ABSTRACT : SRAM recovery processing
+ * NOTE : Restore Static data stored as a file on an externally attached device
+ * and the registry data to the HDD.
+ * ARGUMENT : u_int32 device Device where the file to be restored resides
+ * SD card:EXTDEV_STRAGECARD
+ * PC card:EXTDEV_PCCARD
+ * RET_API *err Error code
+ * RETURN : Return only RET_ERROR (Just perform reset without returning of this function when normal end)
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+RET_API
+SramLoadFromExtDev(ANA_RET_API *err) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_sts = RET_OSERROR;
+ return(ret_sts);
+}
+// LCOV_EXCL_STOP
+
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : _pbSram.cpp
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbSum.cpp b/vehicleservice/positioning_base_library/library/src/_pbSum.cpp
new file mode 100755
index 0000000..2964db7
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbSum.cpp
@@ -0,0 +1,95 @@
+/*
+ * @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 : _pbSum.cpp
+ System name :
+ Subsystem name : System common functions
+ Title : System APIs Asynchronous Data HDD Backup Processing
+ --------------------------------------------------------------------------------------
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include <vehicle_service/positioning_base_library.h>
+
+/*
+ Function prototype declarations
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * MODULE : Sum()
+ * ABSTRACT : SUM calculation process
+ * NOTE : Calculate the SUM value for the specified size from the SUM calculation start address.
+ * ARGUMENT : void *p SUM calculation start address
+ * int32 size Size (bytes)
+ * u_int8 type Calculation width Byte :sizeof(u_char)
+ * Word :sizeof(u_int16)
+ * Long-word:sizeof(u_int32)
+ * NOTE : Calculate the SUM value from the SUM calculation start address by the size specified by the calculation width.
+ * RETURN : u_int32 SUM value
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+u_int32 Sum(void *p, int32 size, u_int8 type) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ u_int32 sum = 0; /* SUM value */
+ u_int32 loop_cnt; /* Loop counter */
+ u_int32 loop_num; /* Number of loops */
+
+ /* Pointer size check */
+ if ((p == NULL) || (size == 0)) {
+ /* nop */
+ } else {
+ /* When the calculation width is "Long word" */
+ if (type == sizeof(int32)) {
+ u_int32 * ptr32 = reinterpret_cast<u_int32 *>(p); /* Long word pointer */
+
+ /* Calculate the number of processes and loop for the number of Times to compute the Sum value. */
+ loop_num = static_cast<u_int32>(size / sizeof(u_int32));
+ for (loop_cnt = 0; loop_cnt < loop_num; loop_cnt++) {
+ sum += *ptr32;
+ ptr32++;
+ }
+ } else if (type == sizeof(int16)) {
+ /* For "Word" */
+ u_int16 * ptr16 = reinterpret_cast<u_int16 *>(p); /* Word pointer */
+
+ loop_num = static_cast<u_int32>(size / sizeof(u_int16));
+ for (loop_cnt = 0; loop_cnt < loop_num; loop_cnt++) {
+ sum += *ptr16;
+ ptr16++;
+ }
+ } else if (type == sizeof(char)) {
+ /* For "Byte" */
+ u_char * ptr8 = reinterpret_cast<u_char *>(p); /* Byte pointer */
+
+ loop_num = static_cast<u_int32>(size / sizeof(u_char));
+ for (loop_cnt = 0; loop_cnt < loop_num; loop_cnt++) {
+ sum += *ptr8;
+ ptr8++;
+ }
+ } else {
+ /* For other than above */
+ /* No processing */
+ }
+ }
+ return sum;
+}
+// LCOV_EXCL_STOP
+
+/*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ End of File : Sum.cpp
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*/
+
diff --git a/vehicleservice/positioning_base_library/library/src/_pbTimer.cpp b/vehicleservice/positioning_base_library/library/src/_pbTimer.cpp
new file mode 100755
index 0000000..f36711f
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbTimer.cpp
@@ -0,0 +1,1115 @@
+/*
+ * @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
+ * _pbTimer.cpp
+ */
+/*---------------------------------------------------------------------------------*
+ * Include Files *
+ *---------------------------------------------------------------------------------*/
+#include <native_service/frameworkunified_framework_if.h>
+
+#include <native_service/ns_message_center_if.h>
+
+#include <vehicle_service/positioning_base_library.h>
+#include "TimerEntryDrv_If.h"
+#include "DEV_TimerEntryDrv_if.h"
+
+#include <native_service/ns_timer_if.h>
+#include "WPF_STD_private.h"
+
+
+/*---------------------------------------------------------------------------------*
+ * Define *
+ *---------------------------------------------------------------------------------*/
+#define MAX_CTRL_TIMER_NUM (8)
+
+#define CID_TIMER_1 (0x1000)
+#define CID_TIMER_2 (0x1001)
+#define CID_TIMER_3 (0x1002)
+#define CID_TIMER_4 (0x1003)
+#define CID_TIMER_5 (0x1004)
+#define CID_TIMER_6 (0x1005)
+#define CID_TIMER_7 (0x1006)
+#define CID_TIMER_8 (0x1007)
+
+#define TIMER_MAKE_DEFAULT_MESSAGE(x) \
+ (x)->Header.signo = 0; \
+ (x)->Header.hdr.sndpno = 0; \
+ (x)->Header.hdr.respno = 0; \
+ (x)->Header.hdr.cid = CID_TIMER_TOUT; \
+ (x)->Header.hdr.msgbodysize = \
+ static_cast<uint16_t>(sizeof(TimerToutMsg) - sizeof(T_APIMSG_MSGBUF_HEADER)); \
+ (x)->Header.hdr.rid = 0; \
+ (x)->Header.hdr.reserve = 0; \
+ (x)->TimerSeq = 0;
+
+/*---------------------------------------------------------------------------------*
+ * Structure *
+ *---------------------------------------------------------------------------------*/
+/*!
+ @brief Timer control information
+*/
+typedef struct {
+ CID cid; /**< Command ID */
+ HANDLE h_timer; /**< Timer handle */
+ TimerToutMsg msg_buf; /**< Message buffer */
+ uint16_t size; /**< Message size */
+ PNO pno; /**< Process number */
+ uint16_t seq_no; /**< Timer Sequence Number */
+ uint8_t type; /**< Timer type */
+ uint32_t time_out; /**< Timeout */
+} TIMER_CTRL_INFO;
+
+/*---------------------------------------------------------------------------------*
+ * Local Function Prototype *
+ *---------------------------------------------------------------------------------*/
+/* Timer control table manipulation functions */
+static void TimerSetCidOfCtrlTbl(u_int32 idx, CID cid); /* Set timer CID */
+static CID TimerGetCidOfCtrlTbl(u_int32 idx); /* Get timer CID */
+static void TimerSetPnoOfCtrlTbl(u_int32 idx, PNO pno); /* Set PNO */
+static PNO TimerGetPnoOfCtrlTbl(u_int32 idx); /* Get PNO */
+static void TimerSetSizeOfCtrlTbl(u_int32 idx, u_int16 size); /* Set message size */
+static TimerToutMsg* TimerGetMsgBufOfCtrlTbl(u_int32 idx); /* Get message buffer */
+static void TimerSetTimerHandleOfCtrlTbl(u_int32 idx, HANDLE handle); /* Set timer handle */
+static HANDLE TimerGetTimerHandleOfCtrlTbl(u_int32 idx); /* Get timer handle */
+static void TimerSetTypeOfCtrlTbl(u_int32 idx, u_int8 type); /* Set timer type */
+static u_int8 TimerGetTypeOfCtrlTbl(u_int32 idx); /* Get timer type */
+static void TimerSetSeqNoOfCtrlTbl(u_int32 idx, u_int16 seq_no); /* Set timer Sequence Number */
+static u_int16 TimerGetSeqNoOfCtrlTbl(u_int32 idx); /* Get timer sequence number */
+static void TimerSetTimeOutOfCtrlTbl(u_int32 idx, u_int32 time_out); /* Set timeout */
+static u_int32 TimerGetTimeOutOfCtrlTbl(u_int32 idx); /* Get timeout */
+static u_int32 TimerSearchEmptyOfCtrlTbl(void); /* Search unused area */
+static u_int32 TimerSearchTimerOfCtrlTbl(PNO snd_pno, u_int16 timer_seq, u_int8 time_type); /* Search specified timer */
+static void TimerClearSettingOfCtrlTbl(u_int32 idx); /* Clear timer information */
+
+/* Mutex handling Functions for accessing Timer Control Table */
+static void TimerCreateMutex(void); /* Create Mutex */
+static void TimerDeleteMutex(void); /* Delete Mutex */
+static void TimerLockMutex(void); /* Get Mutex */
+static void TimerUnlockMutex(void); /* Release Mutex */
+
+/* Callback function resources */
+static EFrameworkunifiedStatus TimerCallback1(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback2(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback3(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback4(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback5(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback6(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback7(HANDLE h_app);
+static EFrameworkunifiedStatus TimerCallback8(HANDLE h_app);
+
+static void TimerCallbackComProc(const uint8_t id);
+
+/*---------------------------------------------------------------------------------*
+ * Grobal Values *
+ *---------------------------------------------------------------------------------*/
+/**
+ Timer control table
+ Note : Access to this instance shall be made through the operation module.
+*/
+static TIMER_CTRL_INFO g_timer_ctrl_tbl[MAX_CTRL_TIMER_NUM]; // NOLINT(readability/nolint) global class instance
+
+/** Timer control table lock Mutex handle */
+static HANDLE g_h_mtx = NULL;
+
+/** Timer event destination handle */
+static HANDLE g_h_service;
+
+
+/** Dispatcher Registration Callback Table */
+static const FrameworkunifiedProtocolCallbackHandler kTimerPcbhs[] = {
+ {CID_TIMER_1, &TimerCallback1 },
+ {CID_TIMER_2, &TimerCallback2 },
+ {CID_TIMER_3, &TimerCallback3 },
+ {CID_TIMER_4, &TimerCallback4 },
+ {CID_TIMER_5, &TimerCallback5 },
+ {CID_TIMER_6, &TimerCallback6 },
+ {CID_TIMER_7, &TimerCallback7 },
+ {CID_TIMER_8, &TimerCallback8 },
+}; // LCOV_EXCL_BR_LINE 11:unexpected branch
+
+/*---------------------------------------------------------------------------------*
+ * Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Timer function initialization
+ *
+ * @return RET_NORMAL Normal completion
+ * @return RET_ERROR ABEND
+ */
+RET_API TimerInit(HANDLE h_app) {
+ RET_API ret_api = RET_NORMAL;
+ u_int32 idx;
+ HANDLE h_timer;
+ EFrameworkunifiedStatus estatus;
+ NSTimerInfo timer_info;
+ HANDLE* p_h_service = &g_h_service;
+
+ if (h_app == NULL) { // LCOV_EXCL_BR_LINE 6: h_app cannot be Null
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!! [h_app=%p]", h_app);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 6: h_app cannot be Null
+ } else {
+ memset(&timer_info, 0x00, sizeof(timer_info));
+
+ /* Create Mutex */
+ TimerCreateMutex(); // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Register callback function for timer control */
+ // LCOV_EXCL_BR_LINE 4: nsfw error
+ estatus = FrameworkunifiedAttachCallbacksToDispatcher(h_app, "NS_ANY_SRC", kTimerPcbhs, _countof(kTimerPcbhs)); // LCOV_EXCL_BR_LINE 4: nsfw error // NOLINT(whitespace/line_length)
+ if (estatus != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ /* When registration fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "FrameworkunifiedAttachCallbacksToDispatcher ERROR [status:%d]", estatus);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 4: nsfw error
+ }
+
+ /* Initialization of timer control table */
+ for (idx = 0; idx < MAX_CTRL_TIMER_NUM; idx++) {
+ TimerSetCidOfCtrlTbl(idx, static_cast<CID>(kTimerPcbhs[idx].iCmd)); /* Set timer control CID */ // LCOV_EXCL_BR_LINE 200: no branch // NOLINT(whitespace/line_length)
+
+ /* Initialize timeout */
+ TimerSetTimeOutOfCtrlTbl(idx, 0); // LCOV_EXCL_BR_LINE 200: no branch
+
+ *p_h_service = McOpenSender("Positioning"); /* Be intended for use only in Positioning */ // LCOV_EXCL_BR_LINE 4: nsfw error // NOLINT(whitespace/line_length)
+
+ /* Create Timer Resource */
+ timer_info.iCmd = TimerGetCidOfCtrlTbl(idx); /* Only CID needs to be set. */ // LCOV_EXCL_BR_LINE 200: no branch
+ h_timer = NS_TimerCreate(timer_info, CALLBACK_MESSAGE, (HANDLE)*p_h_service); // LCOV_EXCL_BR_LINE 4: nsfw error // NOLINT(whitespace/line_length)
+ if (h_timer == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When an error occurs */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "NS_TimerCreate ERROR [h_timer:%p, hService:%p]", h_timer, *p_h_service);
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ /* If successful */
+ /* Set Handle information */
+ TimerSetTimerHandleOfCtrlTbl(idx, h_timer); // LCOV_EXCL_BR_LINE 200: no branch
+ }
+ }
+ }
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Terminate timer function
+ *
+ * @return Normal completion
+ */
+RET_API TimerTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ RET_API ret_api = RET_NORMAL;
+ u_int32 idx;
+ HANDLE h_timer;
+ EFrameworkunifiedStatus estatus;
+ HANDLE* p_h_service = &g_h_service;
+
+ /* If a control Mutex has not been created, it is determined that the Timer function has not been initialized (non Positioning processes) and the process terminates with an error. */
+ if (g_h_mtx == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_h_mtx is NULL!!");
+ ret_api = RET_ERROR;
+ } else {
+ /* Delete timer control information */
+ for (idx = 0; idx < MAX_CTRL_TIMER_NUM; idx++) {
+ h_timer = TimerGetTimerHandleOfCtrlTbl(idx);
+ if (h_timer != NULL) {
+ /* Delete timer */
+ estatus = NS_TimerDelete(h_timer);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ /* When an error occurs */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \
+ "NS_TimerDelete ERROR [estatus:%d, h_timer:%p]", estatus, h_timer);
+ }
+ TimerSetTimerHandleOfCtrlTbl(idx, NULL);
+ }
+
+ TimerClearSettingOfCtrlTbl(idx);
+ }
+
+ /* Mutex deletion */
+ TimerDeleteMutex();
+ }
+
+ /* Delete transmission handle */
+ estatus = McClose(*p_h_service);
+ if (estatus != eFrameworkunifiedStatusOK) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "McClose ERROR [estatus:%d, hService:%p]", \
+ estatus, *p_h_service);
+ }
+
+ return ret_api;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Fixed period/asynchronous timer start instruction
+ *
+ * @param[in] snd_pno Requesting process number
+ * @param[in] timer_seq Timer sequence number
+ * @param[in] TimerType Timer type
+ * @param[in] time_out Timeout value [10ms]
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERROR Message transmission error<br>
+ * RET_ERRPARAM Parameter error
+ */
+RET_API _pb_ReqTimerStart(PNO snd_pno, u_int16 timer_seq, // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ u_int8 time_type, u_int32 time_out) {
+ RET_API ret_api = RET_NORMAL; /* Return value of this module */
+ u_int32 idx;
+ TimerToutMsg *p_msg;
+ EFrameworkunifiedStatus estatus;
+ HANDLE h_timer;
+ NSTimerInfo timer_info;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ /* If a control Mutex has not been created, it is determined that the Timer function has not been initialized (non Positioning processes) and the process terminates with an error. */
+ if (g_h_mtx == NULL) { // LCOV_EXCL_BR_LINE 6: g_h_mtx cannot be null
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_h_mtx is NULL!!");
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 6: g_h_mtx cannot be null
+ } else {
+ /* Parameter study */
+ if ((time_type != TIMER_TYPE_SYN) && (time_type != TIMER_TYPE_USN)) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [time_type:%d]", time_type);
+ ret_api = RET_ERRPARAM; /* Timer type error */
+ }
+
+ if (time_out == 0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR [time_out:%d]", time_out);
+ ret_api = RET_ERRPARAM; /* Timer setting value error */
+ }
+
+ /* When a timer of the same process number, sequence number, or type is already registered, creation of the timer is not allowed. */
+ idx = TimerSearchTimerOfCtrlTbl(snd_pno, timer_seq, time_type);
+ if (idx != MAX_CTRL_TIMER_NUM) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "TimerSearchTimerOfCtrlTbl ERROR!! " \
+ "[snd_pno:%d, timer_seq:%d, TimeType:%d]", snd_pno, timer_seq, time_type);
+ ret_api = RET_ERRPARAM; /* Invalid timer value */
+ }
+
+ /* Parameter normal */
+ if (ret_api == RET_NORMAL) {
+ TimerLockMutex(); /* Get Mutex */
+
+ /* Get free space in timer control table */
+ idx = TimerSearchEmptyOfCtrlTbl(); // LCOV_EXCL_BR_LINE 200: no branch
+ if (idx == MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 200: idx can not be MAX_CTRL_TIMER_NUM
+ // LCOV_EXCL_START 200: idx can not be MAX_CTRL_TIMER_NUM
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When there is no free space */
+ /* Be impossible by design */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "TimerSearchEmptyCtrlTbl ERROR!! " \
+ "[idx = %d]", idx);
+ _pb_Exit();
+ /* don't arrive here. */
+ // LCOV_EXCL_STOP
+ }
+
+ /* Get message buffer address */
+ p_msg = TimerGetMsgBufOfCtrlTbl(idx);
+
+ TIMER_MAKE_DEFAULT_MESSAGE(p_msg); /* Set message data to be send */
+ p_msg->TimerSeq = timer_seq; /* Timer sequence number */
+
+ /* Set callback function information in timer control table */
+ TimerSetPnoOfCtrlTbl(idx, snd_pno); // LCOV_EXCL_BR_LINE 200: no branch
+ TimerSetSizeOfCtrlTbl(idx, sizeof(TimerToutMsg)); // LCOV_EXCL_BR_LINE 200: no branch
+ TimerSetTypeOfCtrlTbl(idx, time_type); // LCOV_EXCL_BR_LINE 200: no branch
+ TimerSetSeqNoOfCtrlTbl(idx, timer_seq); // LCOV_EXCL_BR_LINE 200: no branch
+ TimerSetTimeOutOfCtrlTbl(idx, time_out); // LCOV_EXCL_BR_LINE 200: no branch
+
+ /* Set timer value */
+ timer_info.t_sec = (uint32_t)((10 * time_out) / 1000);
+ /* Coverity CID: 21979 compliant */
+ timer_info.t_nsec = ((10 * (uint64_t)time_out) - ((uint64_t)(timer_info.t_sec) * 1000)) * 1000 * 1000;
+ timer_info.iCmd = TimerGetCidOfCtrlTbl(idx);
+ timer_info.rpt_sec = 0;
+ timer_info.rpt_nsec = 0;
+ if (time_type == TIMER_TYPE_SYN) {
+ timer_info.rpt_sec = timer_info.t_sec;
+ timer_info.rpt_nsec = timer_info.t_nsec;
+ }
+
+ h_timer = TimerGetTimerHandleOfCtrlTbl(idx);
+
+ /* Start timer */
+ estatus = NS_TimerSetTime(h_timer, timer_info); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if ((h_timer == NULL) || (estatus != eFrameworkunifiedStatusOK)) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When an error occurs */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "NS_TimerSetTime ERROR " \
+ "[estatus:%d, h_timer:%p]", estatus, h_timer);
+
+ TimerClearSettingOfCtrlTbl(idx); /* Clear timer information */
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ /* If successful */
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### TIMER TABLE INFORMATION # " \
+ "(++) idx:%d cid:%d h_timer:%p pno:%d seq_no:%d type:%d time_out:%d", \
+ idx, g_timer_ctrl_tbl[idx].cid, g_timer_ctrl_tbl[idx].h_timer, g_timer_ctrl_tbl[idx].pno, \
+ g_timer_ctrl_tbl[idx].seq_no, g_timer_ctrl_tbl[idx].type, g_timer_ctrl_tbl[idx].time_out);
+ }
+
+ TimerUnlockMutex(); /* Release Mutex */ // LCOV_EXCL_BR_LINE 200: no branch
+ }
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return ret_api;
+}
+
+/**
+ * @brief
+ * Timer stop instruction
+ *
+ * @param[in] snd_pno Requesting process number
+ * @param[in] timer_seq Timer sequence number
+ * @param[in] time_r_type Timer type<br>
+ * TIMER_TYPE_SYN Fixed-period timer<br>
+ * TIMER_TYPE_USN Asynchronous timer<br>
+ * TIMER_TYPE_ALM Alerm with specified time <br>
+ *
+ * @return RET_NORMAL Normal completion<br>
+ * RET_ERROR Message transmission error<br>
+ * RET_ERRPARAM Parameter error
+ */
+RET_API _pb_TimerStop(PNO snd_pno, u_int16 timer_seq, // NOLINT(readability/nolint) WPF_SYSAPI.h API
+ u_int8 time_type) {
+ RET_API ret_api = RET_NORMAL; /* Return value of this module */
+ u_int32 idx;
+ EFrameworkunifiedStatus estatus;
+ HANDLE h_timer;
+ const NSTimerInfo timer_info = {0};
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ /* If a control Mutex has not been created, it is determined that the Timer function has not been initialized (non Positioning processes) and the process terminates with an error. */
+ if (g_h_mtx == NULL) { // LCOV_EXCL_BR_LINE 6: g_h_mtx cannot be NULL
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_h_mtx is NULL!!");
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ ret_api = RET_ERROR; // LCOV_EXCL_LINE 6: g_h_mtx cannot be NULL
+ } else {
+ TimerLockMutex(); /* Get Mutex */ // LCOV_EXCL_BR_LINE 200: no branch
+
+ idx = TimerSearchTimerOfCtrlTbl(snd_pno, timer_seq, time_type);
+ if (idx == MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 200: idx can not be MAX_CTRL_TIMER_NUM
+ /* When the specified timer is not set */
+ /* nop */
+ } else {
+ h_timer = TimerGetTimerHandleOfCtrlTbl(idx);
+
+ /* Stop timer */
+ estatus = NS_TimerSetTime(h_timer, timer_info); // LCOV_EXCL_BR_LINE 4: nsfw error
+ if (estatus != eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error
+ // LCOV_EXCL_START 4: nsfw error
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ /* When deletion fails */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "NS_TimerSetTime ERROR " \
+ "[estatus:%d, h_timer:%p]", estatus, h_timer);
+ ret_api = RET_ERROR;
+ // LCOV_EXCL_STOP
+ } else {
+ /* If successful */
+ /* Clear timer information */
+ TimerClearSettingOfCtrlTbl(idx); // LCOV_EXCL_BR_LINE 200: no branch
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### TIMER TABLE INFORMATION # " \
+ "(--) idx:%d cid:%d h_timer:%p pno:%d seq_no:%d type:%d time_out:%d", \
+ idx, g_timer_ctrl_tbl[idx].cid, g_timer_ctrl_tbl[idx].h_timer, g_timer_ctrl_tbl[idx].pno, \
+ g_timer_ctrl_tbl[idx].seq_no, g_timer_ctrl_tbl[idx].type, g_timer_ctrl_tbl[idx].time_out);
+ }
+ }
+
+ TimerUnlockMutex(); /* Release Mutex */ // LCOV_EXCL_BR_LINE 200: no branch
+ }
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return ret_api;
+}
+
+/*---------------------------------------------------------------------------------*
+ * Local Function *
+ *---------------------------------------------------------------------------------*/
+/**
+ * @brief
+ * Timer CID setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Control table accessor
+ * @param[in] cid Command ID
+ */
+static void TimerSetCidOfCtrlTbl(u_int32 idx, CID cid) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].cid = cid;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timer CID acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ *
+ * @return Command ID
+ */
+static CID TimerGetCidOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_timer_ctrl_tbl[idx].cid;
+}
+
+/**
+ * @brief
+ * PNO setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ * @param[in] pno Process number
+ */
+static void TimerSetPnoOfCtrlTbl(u_int32 idx, PNO pno) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR " \
+ "[idx:%d, pno:%d]", idx, pno);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].pno = pno;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * PNO acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ *
+ * @return Process number
+ */
+static PNO TimerGetPnoOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_timer_ctrl_tbl[idx].pno;
+}
+
+/**
+ * @brief
+ * Message size setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ * @param[in] size Message size
+ */
+static void TimerSetSizeOfCtrlTbl(u_int32 idx, u_int16 size) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR " \
+ "[idx:%d, size:%d]", idx, size);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].size = size;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Message buffer acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ *
+ * @return Pointer to message storage area
+ */
+static TimerToutMsg* TimerGetMsgBufOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return &(g_timer_ctrl_tbl[idx].msg_buf);
+}
+
+/**
+ * @brief
+ * Timer handle setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ * @param[in] handle Timer handle
+ */
+static void TimerSetTimerHandleOfCtrlTbl(u_int32 idx, HANDLE handle) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR " \
+ "[idx:%d, handle:%p]", idx, handle);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].h_timer = handle;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timer handle acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ *
+ * @return Timer handle
+ */
+static HANDLE TimerGetTimerHandleOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_timer_ctrl_tbl[idx].h_timer;
+}
+
+/**
+ * @brief
+ * Timer type setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ * @param[in] type Timer type
+ */
+static void TimerSetTypeOfCtrlTbl(u_int32 idx, u_int8 type) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR " \
+ "[idx:%d, type:%d]", idx, type);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].type = type;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timer type acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ *
+ * @return Timer handle
+ */
+static u_int8 TimerGetTypeOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_timer_ctrl_tbl[idx].type;
+}
+
+/**
+ * @brief
+ * Timer sequence number setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ * @param[in] seq_no Timer Sequence Number
+ */
+static void TimerSetSeqNoOfCtrlTbl(u_int32 idx, u_int16 seq_no) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR " \
+ "[idx:%d, seq_no:%d]", idx, seq_no);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].seq_no = seq_no;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timer sequence number acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table accessor
+ */
+static u_int16 TimerGetSeqNoOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_timer_ctrl_tbl[idx].seq_no;
+}
+
+/**
+ * @brief
+ * Timeout setting (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table access Index
+ * @param[in] time_out Timeout
+ */
+static void TimerSetTimeOutOfCtrlTbl(u_int32 idx, u_int32 time_out) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d, " \
+ "time_out:%d]", idx, time_out);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6: idx cannot greater
+ /* don't arrive here. */
+ } else {
+ g_timer_ctrl_tbl[idx].time_out = time_out;
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timeout acquisition (Timer control table)
+ *
+ * If an invalid value is specified for an argument, the system assumes that it is a design problem and calls _pb_Exit().
+ *
+ * @param[in] idx Timer control table access Index
+ *
+ * @return Timeout value
+ */
+static u_int32 TimerGetTimeOutOfCtrlTbl(u_int32 idx) {
+ /* check index */
+ if (idx >= MAX_CTRL_TIMER_NUM) { // LCOV_EXCL_BR_LINE 6: idx cannot greater
+ /* forbidden */
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argment ERROR [idx:%d]", idx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 6:idx cannot greater
+ /* don't arrive here. */
+ }
+
+ return g_timer_ctrl_tbl[idx].time_out;
+}
+
+/**
+ * @brief
+ * Retreaval of unused area in the timer control table (Timer control table)
+ *
+ * Return the lowest-numbered index for accessing unused space in the Timer control table.
+ * If the mutex is not registered, the maximum timer management value (MAX_CTRL_MUTEX_NUM)
+ * is returned.
+ *
+ * @return Table accessor
+ */
+static u_int32 TimerSearchEmptyOfCtrlTbl(void) {
+ u_int32 idx;
+ u_int32 time_out;
+
+ for (idx = 0; idx < MAX_CTRL_TIMER_NUM; idx++) {
+ time_out = TimerGetTimeOutOfCtrlTbl(idx);
+
+ /* For unused space */
+ if (time_out == 0) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+/**
+ * @brief
+ * Retrieval of specified timer for in the timer control table (Timer control table)
+ *
+ * Retrieve whether the specified timer is already registered in the timer control table.
+ * If it is registered, the access index is returned. If it is not registered,
+ * Return the maximum value of timer management (MAX_CTRL_TIMER_NUM).
+ *
+ * @param[in] snd_pno Process number
+ * @param[in] TimerSeq Timer sequence number
+ * @param[in] TimeType Timer type
+ *
+ * @return Index for access(If it is registered)<br>
+ * Maximum mutex management value (Not registered)
+ */
+static u_int32 TimerSearchTimerOfCtrlTbl(PNO snd_pno, u_int16 TimerSeq, u_int8 TimeType) {
+ u_int32 idx;
+ PNO pno;
+ u_int16 seq_no;
+ u_int8 type;
+
+ for (idx = 0; idx < MAX_CTRL_TIMER_NUM; idx++) {
+ pno = TimerGetPnoOfCtrlTbl(idx);
+ seq_no = TimerGetSeqNoOfCtrlTbl(idx);
+ type = TimerGetTypeOfCtrlTbl(idx);
+
+ /* If there is a match */
+ if ((pno == snd_pno) && (seq_no == TimerSeq) && (type == TimeType)) {
+ break;
+ }
+ }
+
+ return idx;
+}
+
+/**
+ * @brief
+ * Clear timer setting information
+ *
+ * @param[in] idx Timer control table accessor
+ */
+static void TimerClearSettingOfCtrlTbl(u_int32 idx) {
+ void *p_msg;
+
+ /* Delete timer information */
+ TimerSetPnoOfCtrlTbl(idx, 0);
+ TimerSetSizeOfCtrlTbl(idx, 0);
+ TimerSetTypeOfCtrlTbl(idx, 0);
+ TimerSetSeqNoOfCtrlTbl(idx, 0);
+ TimerSetTimeOutOfCtrlTbl(idx, 0);
+ p_msg = TimerGetMsgBufOfCtrlTbl(idx);
+ memset(p_msg, 0x00, sizeof(TimerToutMsg));
+
+ return;
+}
+
+/**
+ * @brief
+ * Create Mutex for accessing the timer control table
+ */
+static void TimerCreateMutex(void) {
+ g_h_mtx = _pb_CreateMutex(NULL, 0, "Timer_Mutex");
+ if (g_h_mtx == NULL) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateMutex ERROR " \
+ "[g_h_mtx:%p]", g_h_mtx);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Delete Mutex for accessing timer control table
+ */
+static void TimerDeleteMutex(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ DWORD ret;
+
+ ret = PbDeleteMutex(g_h_mtx);
+ if (ret != WAIT_OBJECT_0) {
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbDeleteMutex ERROR " \
+ "[ret:%lu, g_h_mtx:%p]", ret, g_h_mtx);
+ _pb_Exit();
+ /* don't arrive here. */
+ }
+
+ return;
+}
+// LCOV_EXCL_STOP
+
+/**
+ * @brief
+ * Get Mutex for accessing timer control table
+ */
+static void TimerLockMutex(void) {
+ DWORD ret;
+
+ ret = PbMutexLock(g_h_mtx, INFINITE); // LCOV_EXCL_BR_LINE 200: lock will not failed
+ if (ret != WAIT_OBJECT_0) { // LCOV_EXCL_BR_LINE 200: lock will not failed
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbMutexLock ERROR " \
+ "[ret:%lu, g_h_mtx:%p]", ret, g_h_mtx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: lock will not failed
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Release Mutex for accessing timer control table
+ */
+static void TimerUnlockMutex(void) {
+ BOOL ret;
+
+ ret = PbMutexUnlock(g_h_mtx); // LCOV_EXCL_BR_LINE 200: unlock will not failed
+ if (ret != TRUE) { // LCOV_EXCL_BR_LINE 200: unlock will not failed
+ FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PbMutexUnlock ERROR " \
+ "[ret:%d, g_h_mtx:%p]", ret, g_h_mtx);
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ _pb_Exit(); // LCOV_EXCL_LINE 200: unlock will not failed
+ /* don't arrive here. */
+ }
+
+ return;
+}
+
+/**
+ * @brief
+ * Timer Expiration Callback Functions
+ *
+ * For setting the timer creation function (NS_TimerCreate)<br>
+ * TimerCallback1 ... TimerCallback8
+ *
+ * @param[in] h_app Application handle
+ *
+ * @return eFrameworkunifiedStatusOK Normal completion
+ */
+static EFrameworkunifiedStatus TimerCallback1(HANDLE h_app) {
+ static const u_int8 ID = 0;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback2(HANDLE h_app) {
+ static const u_int8 ID = 1;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback3(HANDLE h_app) {
+ static const u_int8 ID = 2;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback4(HANDLE h_app) {
+ static const u_int8 ID = 3;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback5(HANDLE h_app) {
+ static const u_int8 ID = 4;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback6(HANDLE h_app) {
+ static const u_int8 ID = 5;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback7(HANDLE h_app) {
+ static const u_int8 ID = 6;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static EFrameworkunifiedStatus TimerCallback8(HANDLE h_app) {
+ static const u_int8 ID = 7;
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "+");
+
+ TimerCallbackComProc(ID);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "-");
+
+ return eFrameworkunifiedStatusOK;
+}
+
+static void TimerCallbackComProc(const uint8_t id) {
+ uint8_t type;
+
+ TimerLockMutex(); /* Get Mutex */
+
+ /* Message is sent to the thread specified when the timer is created. */
+ (void)_pb_SndMsg(g_timer_ctrl_tbl[id].pno, g_timer_ctrl_tbl[id].size, &(g_timer_ctrl_tbl[id].msg_buf), 0);
+
+ type = TimerGetTypeOfCtrlTbl(id);
+ if (type == TIMER_TYPE_USN) {
+ /* One-shot timer */
+ /* Clear timer information */
+ TimerClearSettingOfCtrlTbl(id);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_20, __FUNCTION__, "### TIMER TABLE INFORMATION # " \
+ "(--) idx:%d cid:%d h_timer:%p pno:%d seq_no:%d type:%d time_out:%d", \
+ id, g_timer_ctrl_tbl[id].cid, g_timer_ctrl_tbl[id].h_timer, g_timer_ctrl_tbl[id].pno, \
+ g_timer_ctrl_tbl[id].seq_no, g_timer_ctrl_tbl[id].type, g_timer_ctrl_tbl[id].time_out);
+ }
+
+ TimerUnlockMutex(); /* Release Mutex */
+
+ return;
+}
+
+/**
+ * @brief
+ * Get dump information
+ *
+ * @param[out] p_buf Dump info
+ */
+void _pb_GetDebugTimerMngTbl(void* p_buf) {
+ static uint8_t buf[DEBUG_DUMP_MAX_SIZE];
+ static uint8_t buf_tmp[256];
+ uint32_t i;
+
+ if (p_buf != NULL) {
+ memset(&buf, 0x00, sizeof(buf));
+ snprintf(reinterpret_cast<char *>(&(buf)), sizeof(buf), "Timer");
+ for (i = 0; i < MAX_CTRL_TIMER_NUM; i++) {
+ memset(&buf_tmp[0], 0x00, sizeof(buf_tmp));
+ snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp),
+ "\n [%d] cid:%05d, hTim:%10p, sz:%05d, pno:0x%04x, seq:0x%04x, typ:%03d, tOut:%10d",
+ i,
+ g_timer_ctrl_tbl[i].cid,
+ g_timer_ctrl_tbl[i].h_timer,
+ g_timer_ctrl_tbl[i].size,
+ g_timer_ctrl_tbl[i].pno,
+ g_timer_ctrl_tbl[i].seq_no,
+ g_timer_ctrl_tbl[i].type,
+ g_timer_ctrl_tbl[i].time_out);
+ strncat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&buf_tmp[0]), \
+ strlen(reinterpret_cast<char *>(&buf_tmp[0])));
+ }
+ memcpy(p_buf, &buf[0], sizeof(buf));
+ }
+} // LCOV_EXCL_BR_LINE 10:The final line
diff --git a/vehicleservice/positioning_base_library/library/src/_pbWaitforsingleobject.cpp b/vehicleservice/positioning_base_library/library/src/_pbWaitforsingleobject.cpp
new file mode 100755
index 0000000..2111b3a
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/_pbWaitforsingleobject.cpp
@@ -0,0 +1,358 @@
+/*
+ * @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 waitforsingleobject.cpp
+@detail Functions that implement waitforsingleobject in PosixBasedOS001<BR>
+ Functions to register/delete a table to determine the handle and its type
+*****************************************************************************/
+
+#include "_pbWaitforsingleobject.h"
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+#include "_pbInternalProc.h"
+
+typedef struct HandleTypeTable {
+ HANDLE h_handle; /* Registration handle */
+ HANDLE_KIND l_kind; /* Type of Mutex/Semaphre/Event... */
+ struct HandleTypeTable *next;
+} HANDLE_TYPE;
+
+static HANDLE_TYPE *g_pst_handle_kind_table = NULL;
+static pthread_mutex_t g_func_lock_mutex = PTHREAD_MUTEX_INITIALIZER; /* Consider replacing it later */
+
+/* Prototype declarations */
+static BOOL FindList(HANDLE_TYPE **p_list, HANDLE h_obj);
+static BOOL AddList(HANDLE_TYPE *p_add_list);
+static BOOL DelList(HANDLE_TYPE *h_del_obj);
+static BOOL FunctionLock(void);
+static BOOL FunctionUnlock(void);
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* Public APIs
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* _sys Internally Used APIs
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/****************************************************************************
+@brief WaitObjectInit<BR>
+ Initialization processing for each process
+@outline WaitObjectInit<BR>
+ Initialization processing for each process
+@type Completion return type
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL WaitObjectInit(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ g_pst_handle_kind_table = NULL;
+ return TRUE;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief WaitObjectTerm<BR>
+ Termination processing for each process
+@outline WaitObjectTerm<BR>
+ Termination processing for each process
+@type Completion return type
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+BOOL WaitObjectTerm(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ if (NULL != g_pst_handle_kind_table) {
+ /* Should be Deleted a List? */
+ }
+ return TRUE;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief WaitObjectAdd<BR>
+ Register a handle and a handle-type in a list
+@outline WaitObjectAdd<BR>
+ Register a handle and a handle-type in a list
+@type Completion return type
+@param[in] HANDLE h_obj : Handle to register
+@param[in] HANDLE_KIND l_kind : Handle type
+
+@return BOOL
+@retval TRUE : Normal
+ FALSE : Error
+*****************************************************************************/
+BOOL WaitObjectAdd(HANDLE h_obj, HANDLE_KIND l_kind) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL bret = FALSE;
+ HANDLE_TYPE *p_add_list = NULL;
+
+ if ((NULL != h_obj)
+ && (PB_HANDLE_INVAL < l_kind)
+ && (PB_HANDLE_KIND_MAX > l_kind)) {
+ FunctionLock();
+ bret = FindList(&p_add_list, h_obj);
+ if (TRUE == bret) {
+ /* Handle already registered */
+ if (l_kind == p_add_list->l_kind) {
+ /* re-register the same item */
+ bret = TRUE;
+ } else {
+ /* An attempt was made to re-register the same handle with different type */
+ bret = FALSE; /** Consider whether to win or not later */
+ }
+ } else {
+ p_add_list = reinterpret_cast<HANDLE_TYPE*>(malloc(sizeof(HANDLE_TYPE)));
+ if (NULL == p_add_list) {
+ /* Memory acquisition failed */
+ bret = FALSE;
+ } else {
+ memset(p_add_list, 0, sizeof(HANDLE_TYPE));
+ p_add_list->h_handle = h_obj;
+ p_add_list->l_kind = l_kind;
+ p_add_list->next = NULL;
+ bret = AddList(p_add_list);
+ if (FALSE == bret) {
+ /* Registration failure */
+ free(p_add_list);
+ bret = FALSE;
+ } else {
+ bret = TRUE;
+ }
+ }
+ }
+
+ FunctionUnlock();
+
+ } else {
+ bret = FALSE; /** Parameter error */
+ }
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief WaitObjectDel<BR>
+ Remove handle and handle-type from the list
+@outline WaitObjectDel<BR>
+ Remove handle and handle-type from the list
+@type Completion return type
+@param[in] HANDLE h_obj : Handle to delete
+
+@return BOOL
+@retval TRUE : Normal
+ FALSE : Error
+*****************************************************************************/
+BOOL WaitObjectDel(HANDLE h_obj) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL bret = FALSE;
+ HANDLE_TYPE *p_del_list = NULL;
+
+ if (NULL != h_obj) {
+ FunctionLock();
+ bret = FindList(&p_del_list, h_obj);
+ if (TRUE == bret) {
+ /* handle already registered */
+ if (TRUE == DelList(p_del_list)) {
+ free(p_del_list);
+ bret = TRUE;
+ } else {
+ bret = FALSE;
+ }
+ } else {
+ bret = FALSE; /* no handles */
+ }
+
+ FunctionUnlock();
+
+ } else {
+ bret = FALSE; /* Parameter error */
+ }
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* Private API
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/****************************************************************************
+@brief FindList<BR>
+ Searching for a Handle in the List
+@outline FindList<BR>
+ Searching for a Handle in the List
+@type Completion return type
+@param[out] HANDLE_TYPE** p_list : Found list pointer
+@param[in] HANDLE h_obj : Handle to look for
+
+@return BOOL
+@retval TRUE : Normal (p_list != NULL)
+ FALSE : Error (p_list == NULL)
+*****************************************************************************/
+static BOOL FindList(HANDLE_TYPE **p_list, HANDLE h_obj) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ HANDLE_TYPE *p_now = NULL;
+ BOOL bret = FALSE;
+
+ if ((NULL != h_obj) && (NULL != p_list)) {
+ /* Search list */
+ p_now = g_pst_handle_kind_table;
+ while (NULL != p_now) {
+ /* h_obj and p_now->h_handle are pointer type.*/
+ if ((int64_t)h_obj == (int64_t)p_now->h_handle) {
+ *p_list = p_now;
+ bret = TRUE;
+ break;
+ }
+ p_now = p_now->next;
+ }
+ } else {
+ bret = FALSE; /** Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief AddList<BR>
+ Append data to the end of the list
+@outline AddList<BR>
+ Append data to the end of the list
+@type Completion return type
+@param[in] HANDLE_TYPE* p_list : Data to add
+
+@return BOOL
+@retval TRUE : Normal
+ FALSE : Error
+*****************************************************************************/
+static BOOL AddList(HANDLE_TYPE *p_add_list) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ HANDLE_TYPE *p_now = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != p_add_list) {
+ /* Add unregistered data */
+ if (NULL == g_pst_handle_kind_table) {
+ g_pst_handle_kind_table = p_add_list;
+ bret = TRUE;
+ } else {
+ /* Add to end of list */
+ p_now = g_pst_handle_kind_table;
+ while (NULL != p_now) {
+ if (NULL == p_now->next) {
+ p_now->next = p_add_list;
+ bret = TRUE;
+ break;
+ }
+ p_now = p_now->next;
+ }
+ }
+ } else {
+ bret = FALSE; /** Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief DelList<BR>
+ Remove specified data from a List
+@outline DelList<BR>
+ Remove specified data from a List
+@type Completion return type
+@param[in,out] HANDLE_TYPE* h_del_obj :
+
+@return BOOL
+@retval TRUE : Normal
+ FALSE : End
+*****************************************************************************/
+static BOOL DelList(HANDLE_TYPE *h_del_obj) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ HANDLE_TYPE *p_now = NULL;
+ HANDLE_TYPE *pBef = NULL;
+ BOOL bret = FALSE;
+
+ if (NULL != h_del_obj) {
+ /* Add to end of list */
+ p_now = g_pst_handle_kind_table;
+ while (NULL != p_now) {
+ if (h_del_obj == p_now) {
+ if (NULL == pBef) {
+ /* Delete first */
+ g_pst_handle_kind_table = p_now->next;
+ } else {
+ /* Others */
+ pBef->next = h_del_obj->next;
+ }
+ bret = TRUE;
+ break;
+ }
+ pBef = p_now;
+ p_now = p_now->next;
+ }
+ } else {
+ bret = FALSE; /** Parameter error */
+ }
+
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief FunctionLock<BR>
+ Start locking of g_pst_handle_kind_table
+@outline FunctionLock<BR>
+ Start locking of g_pst_handle_kind_table
+@type Completion return type
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+static BOOL FunctionLock(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL bret = FALSE;
+ if (EOK == pthread_mutex_lock(&g_func_lock_mutex)) {
+ bret = TRUE;
+ }
+ return bret;
+}
+// LCOV_EXCL_STOP
+
+/****************************************************************************
+@brief FunctionUnlock<BR>
+ Terminate locking of g_pst_handle_kind_table
+@outline FunctionUnlock<BR>
+ Terminate locking of g_pst_handle_kind_table
+@type Completion return type
+@return BOOL
+@retval TRUE : Normal
+@retval FALSE : Error
+*****************************************************************************/
+static BOOL FunctionUnlock(void) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ BOOL bret = FALSE;
+ if (EOK == pthread_mutex_unlock(&g_func_lock_mutex)) {
+ bret = TRUE;
+ }
+ return bret;
+}
+// LCOV_EXCL_STOP
+
diff --git a/vehicleservice/positioning_base_library/library/src/memcpy_64p_sync.cpp b/vehicleservice/positioning_base_library/library/src/memcpy_64p_sync.cpp
new file mode 100755
index 0000000..204c516
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/memcpy_64p_sync.cpp
@@ -0,0 +1,25 @@
+/*
+ * @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.
+ */
+
+#include <vehicle_service/positioning_base_library.h>
+
+
+#include "WPF_STD_private.h"
+void* Memcpy64pSync(void* dest, const void* src, size_t count) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return _pb_memcpy(dest, src, count);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/positioning_base_library/library/src/memset_64p_sync.cpp b/vehicleservice/positioning_base_library/library/src/memset_64p_sync.cpp
new file mode 100755
index 0000000..ad6c11e
--- /dev/null
+++ b/vehicleservice/positioning_base_library/library/src/memset_64p_sync.cpp
@@ -0,0 +1,25 @@
+/*
+ * @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.
+ */
+
+#include <string.h>
+#include <vehicle_service/positioning_base_library.h>
+#include "WPF_STD_private.h"
+
+void* Memset64pSync(void* dest, int c, size_t count) { // LCOV_EXCL_START 8:dead code
+ AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
+ return _pb_memset(dest, c, count);
+}
+// LCOV_EXCL_STOP
diff --git a/vehicleservice/vehicle_service.mk b/vehicleservice/vehicle_service.mk
new file mode 100755
index 0000000..40d337f
--- /dev/null
+++ b/vehicleservice/vehicle_service.mk
@@ -0,0 +1,42 @@
+#############################################################
+#
+# Common Makefile for vehicle_service
+# Copyright (C) 2017-2019 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.
+#
+#############################################################
+
+CURRENT_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
+
+#############################################################
+# COMPONENT_NAME must not be blank and be named snake_case
+
+COMPONENT_NAME := vehicle_service
+
+#############################################################
+
+#############################################################
+# You can add several flags and libraries.
+# When you add -I or -L path, DO NOT USE relative path.
+# Instead, use $(CURRENT_DIR) variable
+# that indicates the path this .mk file is stored.
+
+COMPONENT_CFLAGS :=
+COMPONENT_CXXFLAGS :=
+COMPONENT_LDLIBS :=
+COMPONENT_LDFLAGS :=
+
+##############################################################
+
+include $(SDKTARGETSYSROOT)/usr/agl/share/agl.mk