diff options
Diffstat (limited to 'vehicleservice/positioning/client/include/vehicle_service')
5 files changed, 3694 insertions, 0 deletions
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_ |