diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-10-22 09:06:18 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-10-22 09:06:18 +0900 |
commit | 00ab09fac9701443fdff616fdcc274809a03d4d7 (patch) | |
tree | 03aa078b69aa17d12c77f7d4b74cf6f3a93ffefd /positioning/server/src/ServiceInterface | |
parent | fa6fa9f4ee5486b30d223914e1a6e50d4d3adf71 (diff) |
vs-positioning branch 0.1sandbox/ToshikazuOhiwa/vs-positioning
Diffstat (limited to 'positioning/server/src/ServiceInterface')
8 files changed, 215 insertions, 298 deletions
diff --git a/positioning/server/src/ServiceInterface/BackupMgrIf.cpp b/positioning/server/src/ServiceInterface/BackupMgrIf.cpp index c5547f58..da5dba2c 100644 --- a/positioning/server/src/ServiceInterface/BackupMgrIf.cpp +++ b/positioning/server/src/ServiceInterface/BackupMgrIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. diff --git a/positioning/server/src/ServiceInterface/ClockIf.cpp b/positioning/server/src/ServiceInterface/ClockIf.cpp index 1017786a..52fd4cf0 100644 --- a/positioning/server/src/ServiceInterface/ClockIf.cpp +++ b/positioning/server/src/ServiceInterface/ClockIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. @@ -26,7 +26,7 @@ *---------------------------------------------------------------------------------*/ #include <vehicle_service/positioning_base_library.h> #include "ClockIf.h" -//#include <vehicle_service/clock_notifications.h> +#include <stub/clock_notifications.h> /*---------------------------------------------------------------------------------* * Definition * @@ -63,11 +63,11 @@ EFrameworkunifiedStatus ClockIfNotifyOnClockAvailability(CbFuncPtr fp_on_cmd) { 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); -// } + 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); } @@ -99,40 +99,40 @@ void ClockIfSetAvailability(BOOL b_is_available) { * @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; -//} +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/positioning/server/src/ServiceInterface/CommUsbIf.cpp b/positioning/server/src/ServiceInterface/CommUsbIf.cpp index ff122e33..b776ff07 100644 --- a/positioning/server/src/ServiceInterface/CommUsbIf.cpp +++ b/positioning/server/src/ServiceInterface/CommUsbIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. @@ -119,11 +119,11 @@ EFrameworkunifiedStatus CommUsbIfNotifyOnCommUSBAvailability(CbFuncPtr fp_on_cmd 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); -// } + 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); } diff --git a/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp b/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp index 1f7b2705..800429f5 100644 --- a/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp +++ b/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. diff --git a/positioning/server/src/ServiceInterface/DiagSrvIf.cpp b/positioning/server/src/ServiceInterface/DiagSrvIf.cpp index f5c45192..195555e3 100644 --- a/positioning/server/src/ServiceInterface/DiagSrvIf.cpp +++ b/positioning/server/src/ServiceInterface/DiagSrvIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. @@ -25,7 +25,6 @@ * Include Files * *---------------------------------------------------------------------------------*/ #include <vehicle_service/positioning_base_library.h> -//#include <stub/DiagCodeAPI.h> #include "DiagSrvIf.h" /*---------------------------------------------------------------------------------* @@ -63,77 +62,3 @@ void DiagSrvIfSetRegistrationPermission(BOOL b_is_true) { return; } - -/** - * @brief - * Registering DiagSrv Services IF-Diag Codes - * - * @param[in] err_id Diag code definition name - * @param[in] positioning_code Positioning Code-Defined Names - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DiagSrvIfDiagPutDiagCode(uint64_t err_id, uint16_t positioning_code) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; -// HANDLE happ; -// DGCODE_RET_API dc_ret_api; -// -// if (g_registration_permission == TRUE) { -// happ = _pb_GetAppHandle(); -// if (happ != NULL) { -// /* Dialog code registration */ -// dc_ret_api = Diag_PutDiagCode(happ, err_id, positioning_code); -// if (dc_ret_api != DGCODE_RET_NORMAL) { -// FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, -// "Diag_PutDiagCode ERROR!! [ret=%d, positioning_code=%u]", dc_ret_api, positioning_code); -// } else { -// estatus = eFrameworkunifiedStatusOK; -// FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, -// "Diag_PutDiagCode CALL [ret=%d, positioning_code=%u]", dc_ret_api, positioning_code); -// } -// } else { -// FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); -// } -// } else { -// FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_registration_permission=FALSE"); -// } - - return estatus; -} - -/** - * @brief - * Deleting DiagSrv Services IF-Diag Codes - * - * @param[in] err_id Diag code definition name - * @param[in] positioning_code Positioning Code-Defined Names - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DiagSrvIfDiagDeleteDiagCode(uint64_t err_id, uint16_t positioning_code) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; -// HANDLE happ; -// DGCODE_RET_API dc_ret_api; -// -// if (g_registration_permission == TRUE) { -// happ = _pb_GetAppHandle(); -// if (happ != NULL) { -// /* Diag code deletion */ -// dc_ret_api = Diag_DeleteDiagCode(happ, err_id, positioning_code); -// if (dc_ret_api != DGCODE_RET_NORMAL) { -// FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, -// "Diag_DeleteDiagCode ERROR!! [ret=%d, positioning_code=%u]", dc_ret_api, positioning_code); -// } else { -// estatus = eFrameworkunifiedStatusOK; -// FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, -// "DiagSrvIfDiagDeleteDiagCode CALL [ret=%d, positioning_code=%u]", dc_ret_api, positioning_code); -// } -// } else { -// FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); -// } -// } else { -// FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_registration_permission=FALSE"); -// } - - return estatus; -} diff --git a/positioning/server/src/ServiceInterface/Makefile b/positioning/server/src/ServiceInterface/Makefile index 92121e93..fba98e8c 100644 --- a/positioning/server/src/ServiceInterface/Makefile +++ b/positioning/server/src/ServiceInterface/Makefile @@ -1,5 +1,5 @@ # -# @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. +# @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. @@ -26,20 +26,12 @@ libPOS_ServiceInterface_SRCS += DiagSrvIf.cpp libPOS_ServiceInterface_SRCS += PSMShadowIf.cpp libPOS_ServiceInterface_SRCS += VehicleIf.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../../../client/src/Vehicle_API/common -CPPFLAGS += -I../../../client/src/POS_sensor_API/common -CPPFLAGS += -I../../../client/src/POS_gps_API -CPPFLAGS += -I../../../client/src/POS_naviinfo_API/common -CPPFLAGS += -I../../../client/src/CanInput_API/common -CPPFLAGS += -I../../../client/src/SensorLocation_API/common #CPPFLAGS += -I../../../../diag_code/library/include diff --git a/positioning/server/src/ServiceInterface/PSMShadowIf.cpp b/positioning/server/src/ServiceInterface/PSMShadowIf.cpp index 68fbcaf4..99d9a527 100644 --- a/positioning/server/src/ServiceInterface/PSMShadowIf.cpp +++ b/positioning/server/src/ServiceInterface/PSMShadowIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION. + * @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. diff --git a/positioning/server/src/ServiceInterface/VehicleIf.cpp b/positioning/server/src/ServiceInterface/VehicleIf.cpp index cebe8b9b..0ef5e15b 100644 --- a/positioning/server/src/ServiceInterface/VehicleIf.cpp +++ b/positioning/server/src/ServiceInterface/VehicleIf.cpp @@ -1,5 +1,5 @@ /* - * @copyright Copyright (c) 2018-2019 TOYOTA MOTOR CORPORATION. + * @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. @@ -25,9 +25,9 @@ * 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 <stub/Vehicle_Sensor_Common_API.h> +#include <stub/Vehicle_API.h> +#include <stub/vehicle_notifications.h> #include "VehicleIf.h" @@ -144,108 +144,108 @@ EFrameworkunifiedStatus VehicleIfDetachCallbacksFromDispatcher(const PUI_32 pui_ 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; + 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; } @@ -265,11 +265,11 @@ EFrameworkunifiedStatus VehicleIfNotifyOnVehicleAvailability(CbFuncPtr fp_on_cmd 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); -// } + 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); } @@ -293,35 +293,35 @@ EFrameworkunifiedStatus VehicleIfNotifyOnVehicleAvailability(CbFuncPtr fp_on_cmd 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; + 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; } @@ -338,27 +338,27 @@ EFrameworkunifiedStatus VehicleIf_GetShiftPosition(uint8_t* pShift, BOOL* pbIsAv 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 */ -// } + 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; } |