diff options
author | Helmut Schmidt <Helmut.3.Schmidt@continental-corporation.com> | 2015-11-30 13:00:38 +0100 |
---|---|---|
committer | Helmut Schmidt <Helmut.3.Schmidt@continental-corporation.com> | 2015-11-30 13:00:38 +0100 |
commit | bc8be1b92e65f295c84f90141bcbefcd45ae3090 (patch) | |
tree | 3e97cc738b52bbb16e974dfae18626850a70c813 /sensors-service/api | |
parent | 9d2766a3c3caa53900401e2adb44d4132a42ce08 (diff) | |
download | positioning-bc8be1b92e65f295c84f90141bcbefcd45ae3090.tar.gz |
GT-3206 SNS API: Extend API to provide sensor status information + a bit GNSS POC update
Diffstat (limited to 'sensors-service/api')
-rw-r--r-- | sensors-service/api/acceleration.h | 32 | ||||
-rw-r--r-- | sensors-service/api/gyroscope.h | 32 | ||||
-rw-r--r-- | sensors-service/api/sns-status.h | 61 | ||||
-rw-r--r-- | sensors-service/api/vehicle-speed.h | 33 | ||||
-rw-r--r-- | sensors-service/api/wheel.h | 31 |
5 files changed, 189 insertions, 0 deletions
diff --git a/sensors-service/api/acceleration.h b/sensors-service/api/acceleration.h index 62764b4..f68e506 100644 --- a/sensors-service/api/acceleration.h +++ b/sensors-service/api/acceleration.h @@ -19,6 +19,7 @@ #define INCLUDED_GENIVI_ACCELERATION #include "sns-meta-data.h" +#include "sns-status.h" #include <stdbool.h> #ifdef __cplusplus @@ -164,6 +165,13 @@ typedef struct { typedef void (*AccelerationCallback)(const TAccelerationData accelerationData[], uint16_t numElements); /** + * Callback type for acceleration sensor status. + * Use this type of callback if you want to register for acceleration sensor status updates data. + * @param status the acceleration sensor status + */ +typedef void (*AccelerationStatusCallback)(const TSensorStatus *status); + +/** * Initialization of the acceleration sensor service. * Must be called before using the acceleration sensor service to set up the service. * @return True if initialization has been successfull. @@ -218,6 +226,30 @@ bool snsAccelerationRegisterCallback(AccelerationCallback callback); */ bool snsAccelerationDeregisterCallback(AccelerationCallback callback); +/** + * Method to get the acceleration sensor status at a specific point in time. + * @param status After calling the method the current acceleration sensor status is written into status + * @return Is true if data can be provided and false otherwise, e.g. missing initialization + */ +bool snsAccelerationGetStatus(TSensorStatus* status); + +/** + * Register acceleration sensor status callback. + * This is the recommended method for continuously monitoring the acceleration sensor status. + * The callback will be invoked when new acceleration sensor status data is available. + * @param callback The callback which should be registered. + * @return True if callback has been registered successfully. + */ +bool snsAccelerationRegisterStatusCallback(AccelerationStatusCallback callback); + +/** + * Deregister acceleration sensor status callback. + * After calling this method no new acceleration sensor status updates will be delivered to the client. + * @param callback The callback which should be deregistered. + * @return True if callback has been deregistered successfully. + */ +bool snsAccelerationDeregisterStatusCallback(AccelerationStatusCallback callback); + #ifdef __cplusplus } #endif diff --git a/sensors-service/api/gyroscope.h b/sensors-service/api/gyroscope.h index 3425b25..18669b0 100644 --- a/sensors-service/api/gyroscope.h +++ b/sensors-service/api/gyroscope.h @@ -19,6 +19,7 @@ #define INCLUDE_GENIVI_GYROSCOPE #include "sns-meta-data.h" +#include "sns-status.h" #include <stdbool.h> #ifdef __cplusplus @@ -163,6 +164,13 @@ typedef struct { typedef void (*GyroscopeCallback)(const TGyroscopeData gyroData[], uint16_t numElements); /** + * Callback type for gyroscope status. + * Use this type of callback if you want to register for gyroscope status updates data. + * @param status the gyroscope status + */ +typedef void (*GyroscopeStatusCallback)(const TSensorStatus *status); + +/** * Initialization of the gyroscope sensor service. * Must be called before using the gyroscope sensor service to set up the service. * @return True if initialization has been successfull. @@ -220,6 +228,30 @@ bool snsGyroscopeRegisterCallback(GyroscopeCallback callback); */ bool snsGyroscopeDeregisterCallback(GyroscopeCallback callback); +/** + * Method to get the gyroscope status at a specific point in time. + * @param status After calling the method the current gyroscope status is written into status + * @return Is true if data can be provided and false otherwise, e.g. missing initialization + */ +bool snsGyroscopeGetStatus(TSensorStatus* status); + +/** + * Register gyroscope status callback. + * This is the recommended method for continuously monitoring the gyroscope status. + * The callback will be invoked when new gyroscope status data is available. + * @param callback The callback which should be registered. + * @return True if callback has been registered successfully. + */ +bool snsGyroscopeRegisterStatusCallback(GyroscopeStatusCallback callback); + +/** + * Deregister gyroscope status callback. + * After calling this method no new gyroscope status updates will be delivered to the client. + * @param callback The callback which should be deregistered. + * @return True if callback has been deregistered successfully. + */ +bool snsGyroscopeDeregisterStatusCallback(GyroscopeStatusCallback callback); + #ifdef __cplusplus } #endif diff --git a/sensors-service/api/sns-status.h b/sensors-service/api/sns-status.h new file mode 100644 index 0000000..ec0972c --- /dev/null +++ b/sensors-service/api/sns-status.h @@ -0,0 +1,61 @@ +/************************************************************************** + * @licence app begin@ + * + * SPDX-License-Identifier: MPL-2.0 + * + * \ingroup SensorsService + * \brief Compliance Level: Abstract Component + * \copyright Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH + * + * \license + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * @licence end@ + **************************************************************************/ + +#ifndef INCLUDE_GENIVI_SNS_STATUS +#define INCLUDE_GENIVI_SNS_STATUS + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Enumeration to describe the status of the GNSS receiver + */ +typedef enum { + SENSOR_STATUS_NOTAVAILABLE = 0, /**< Sensor is not available at all, based on configuration data. */ + SENSOR_STATUS_INITIALIZING = 1, /**< Initial status when the connection to the Sensor is set up for the first time. */ + SENSOR_STATUS_AVAILABLE = 2, /**< Sensor is available and running as expected. */ + SENSOR_STATUS_RESTARTING = 3, /**< Sensor is restarted, i.e. due to communication loss. */ + SENSOR_STATUS_FAILURE = 4, /**< Sensor is not operating properly. Restarting did not help. */ + SENSOR_STATUS_OUTOFSERVICE = 5 /**< Sensor is temporarily not available, due to some known external condition, vehicle bus or external ECU providing he signal being off. */ +} ESensorStatus; + +/** + * TGNSSStatus::validityBits provides information about the currently valid signals of the TSensorStatus struct. + * It is a or'ed bitmask of the EGNSSStatusValidityBits values. + */ +typedef enum { + SENSOR_STATUS_STATUS_VALID = 0x00000001 /**< Validity bit for field TSensorStatus::status. */ +} ESensorStatusValidityBits; + +/** + * Container for GNSS status information + */ +typedef struct { + uint64_t timestamp; /**< Timestamp of the GNSS status transition [ms]. + All sensor/GNSS timestamps must be based on the same time source. */ + ESensorStatus status; /**< Status of the sensor receiver */ + uint32_t validityBits; /**< Bit mask indicating the validity of each corresponding value. + [bitwise or'ed @ref ESensorStatusValidityBits values]. + Must be checked before usage. */ +} TSensorStatus; + +#ifdef __cplusplus +} +#endif + +#endif //#ifndef INCLUDE_GENIVI_SNS_STATUS diff --git a/sensors-service/api/vehicle-speed.h b/sensors-service/api/vehicle-speed.h index ade85d9..c5897e5 100644 --- a/sensors-service/api/vehicle-speed.h +++ b/sensors-service/api/vehicle-speed.h @@ -19,6 +19,7 @@ #define INCLUDED_GENIVI_VEHICLESPEED #include "sns-meta-data.h" +#include "sns-status.h" #include <stdbool.h> #ifdef __cplusplus @@ -57,6 +58,14 @@ typedef struct { */ typedef void (*VehicleSpeedCallback)(const TVehicleSpeedData vehicleSpeedData[], uint16_t numElements); + +/** + * Callback type for vehicle speed sensor status. + * Use this type of callback if you want to register for vehicle speed sensor status updates data. + * @param status the vehicle speed sensor status + */ +typedef void (*VehicleSpeedStatusCallback)(const TSensorStatus *status); + /** * Initialization of the vehicle speed sensor service. * Must be called before using the vehicle speed sensor service to set up the service. @@ -102,6 +111,30 @@ bool snsVehicleSpeedRegisterCallback(VehicleSpeedCallback callback); */ bool snsVehicleSpeedDeregisterCallback(VehicleSpeedCallback callback); +/** + * Method to get the vehicle speed sensor status at a specific point in time. + * @param status After calling the method the current vehicle speed sensor status is written into status + * @return Is true if data can be provided and false otherwise, e.g. missing initialization + */ +bool snsVehicleSpeedGetStatus(TSensorStatus* status); + +/** + * Register vehicle speed sensor status callback. + * This is the recommended method for continuously monitoring the vehicle speed sensor status. + * The callback will be invoked when new vehicle speed sensor status data is available. + * @param callback The callback which should be registered. + * @return True if callback has been registered successfully. + */ +bool snsVehicleSpeedRegisterStatusCallback(VehicleSpeedStatusCallback callback); + +/** + * Deregister vehicle speed sensor status callback. + * After calling this method no new vehicle speed sensor status updates will be delivered to the client. + * @param callback The callback which should be deregistered. + * @return True if callback has been deregistered successfully. + */ +bool snsVehicleSpeedDeregisterStatusCallback(VehicleSpeedStatusCallback callback); + #ifdef __cplusplus } #endif diff --git a/sensors-service/api/wheel.h b/sensors-service/api/wheel.h index 77ea17a..3a42d84 100644 --- a/sensors-service/api/wheel.h +++ b/sensors-service/api/wheel.h @@ -19,6 +19,7 @@ #define INCLUDE_GENIVI_WHEEL #include "sns-meta-data.h" +#include "sns-status.h" #include <stdbool.h> #ifdef __cplusplus @@ -221,6 +222,13 @@ typedef struct { typedef void (*WheelCallback)(const TWheelData wheelData[], uint16_t numElements); /** + * Callback type for wheel sensor status. + * Use this type of callback if you want to register for wheel sensor status updates data. + * @param status the wheel sensor status + */ +typedef void (*WheelStatusCallback)(const TSensorStatus *status); + +/** * Initialization of the wheel sensor service. * Must be called before using the wheel sensor service to set up the service. * @return True if initialization has been successfull. @@ -273,6 +281,29 @@ bool snsWheelRegisterCallback(WheelCallback callback); */ bool snsWheelDeregisterCallback(WheelCallback callback); +/** + * Method to get the wheel sensor status at a specific point in time. + * @param status After calling the method the current wheel sensor status is written into status + * @return Is true if data can be provided and false otherwise, e.g. missing initialization + */ +bool snsWheelGetStatus(TSensorStatus* status); + +/** + * Register wheel sensor status callback. + * This is the recommended method for continuously monitoring the wheel sensor status. + * The callback will be invoked when new wheel sensor status data is available. + * @param callback The callback which should be registered. + * @return True if callback has been registered successfully. + */ +bool snsWheelRegisterStatusCallback(WheelStatusCallback callback); + +/** + * Deregister wheel sensor status callback. + * After calling this method no new wheel sensor status updates will be delivered to the client. + * @param callback The callback which should be deregistered. + * @return True if callback has been deregistered successfully. + */ +bool snsWheelDeregisterStatusCallback(WheelStatusCallback callback); #ifdef __cplusplus } |