summaryrefslogtreecommitdiffstats
path: root/vehicleservice/positioning/server/src/ServiceInterface
diff options
context:
space:
mode:
Diffstat (limited to 'vehicleservice/positioning/server/src/ServiceInterface')
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp211
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp138
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp147
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp279
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp64
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/Makefile54
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp102
-rw-r--r--vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp364
8 files changed, 1359 insertions, 0 deletions
diff --git a/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp
new file mode 100644
index 00000000..da5dba2c
--- /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 100644
index 00000000..52fd4cf0
--- /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 100644
index 00000000..b776ff07
--- /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 100644
index 00000000..800429f5
--- /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 100644
index 00000000..195555e3
--- /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 100644
index 00000000..fba98e8c
--- /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 100644
index 00000000..99d9a527
--- /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 100644
index 00000000..0ef5e15b
--- /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;
+}
+