sm8250-common: import location from LA.UM.9.12.r1-13500.01-SMxx50.QSSI12.0
Change-Id: If93ba9b50dc3bb07a4ba81694187e99f58dd172c
This commit is contained in:
parent
72410cf795
commit
64ab05b033
103 changed files with 92521 additions and 0 deletions
1292
location/location_api_msg_proto/LocationApiDataTypes.proto
Normal file
1292
location/location_api_msg_proto/LocationApiDataTypes.proto
Normal file
File diff suppressed because it is too large
Load diff
591
location/location_api_msg_proto/LocationApiMsg.proto
Normal file
591
location/location_api_msg_proto/LocationApiMsg.proto
Normal file
|
|
@ -0,0 +1,591 @@
|
|||
/* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// LocationApiMsg.proto
|
||||
// Location Api messages definition - structs, enums etc
|
||||
// ============================================================================
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "LocationApiDataTypes.proto";
|
||||
|
||||
// ============================================================================
|
||||
// Proto file versioning
|
||||
// ============================================================================
|
||||
enum LocationApiMsgVersion {
|
||||
LOCAPI_MSG_VER_INVALID = 0;
|
||||
// Major changes - compatibility breakage. Bump the first byte of version i.e. 1.x to 2.0
|
||||
LOCAPI_MSG_VER_MAJOR = 1;
|
||||
// Minor - New features / API addition, new message/elemtent addition.
|
||||
// Bump the last byte of version i.e. x.2 to x.3
|
||||
// Minor version 4: GTP Single shot WWAN change
|
||||
LOCAPI_MSG_VER_MINOR = 4;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Enumerations
|
||||
// ============================================================================
|
||||
|
||||
// List of message IDs supported by Location Remote API
|
||||
enum PBELocMsgID {
|
||||
PB_E_LOCAPI_UNDEFINED_MSG_ID = 0;
|
||||
|
||||
// registration
|
||||
PB_E_LOCAPI_CLIENT_REGISTER_MSG_ID = 1;
|
||||
PB_E_LOCAPI_CLIENT_DEREGISTER_MSG_ID = 2;
|
||||
PB_E_LOCAPI_CAPABILILTIES_MSG_ID = 3;
|
||||
PB_E_LOCAPI_HAL_READY_MSG_ID = 4;
|
||||
|
||||
// tracking session
|
||||
PB_E_LOCAPI_START_TRACKING_MSG_ID = 5;
|
||||
PB_E_LOCAPI_STOP_TRACKING_MSG_ID = 6;
|
||||
PB_E_LOCAPI_UPDATE_CALLBACKS_MSG_ID = 7;
|
||||
PB_E_LOCAPI_UPDATE_TRACKING_OPTIONS_MSG_ID = 8;
|
||||
|
||||
// control
|
||||
// >> this message id has been deprecated
|
||||
PB_E_LOCAPI_CONTROL_UPDATE_CONFIG_MSG_ID = 9; // this message id has been deprecated
|
||||
PB_E_LOCAPI_CONTROL_DELETE_AIDING_DATA_MSG_ID = 10; // this message id has been deprecated
|
||||
PB_E_LOCAPI_CONTROL_UPDATE_NETWORK_AVAILABILITY_MSG_ID = 11;
|
||||
|
||||
// Position reports
|
||||
PB_E_LOCAPI_LOCATION_MSG_ID = 12;
|
||||
PB_E_LOCAPI_LOCATION_INFO_MSG_ID = 13;
|
||||
PB_E_LOCAPI_SATELLITE_VEHICLE_MSG_ID = 14;
|
||||
PB_E_LOCAPI_NMEA_MSG_ID = 15;
|
||||
PB_E_LOCAPI_DATA_MSG_ID = 16;
|
||||
|
||||
// Get API to retrieve info from GNSS engine
|
||||
PB_E_LOCAPI_GET_GNSS_ENGERY_CONSUMED_MSG_ID = 17;
|
||||
|
||||
PB_E_LOCAPI_LOCATION_SYSTEM_INFO_MSG_ID = 18;
|
||||
|
||||
// engine position report
|
||||
PB_E_LOCAPI_ENGINE_LOCATIONS_INFO_MSG_ID = 19;
|
||||
|
||||
// batching session
|
||||
PB_E_LOCAPI_START_BATCHING_MSG_ID = 20;
|
||||
PB_E_LOCAPI_STOP_BATCHING_MSG_ID = 21;
|
||||
PB_E_LOCAPI_UPDATE_BATCHING_OPTIONS_MSG_ID = 22;
|
||||
|
||||
//batching reports
|
||||
PB_E_LOCAPI_BATCHING_MSG_ID = 23;
|
||||
|
||||
// geofence session
|
||||
PB_E_LOCAPI_ADD_GEOFENCES_MSG_ID = 24;
|
||||
PB_E_LOCAPI_REMOVE_GEOFENCES_MSG_ID = 25;
|
||||
PB_E_LOCAPI_MODIFY_GEOFENCES_MSG_ID = 26;
|
||||
PB_E_LOCAPI_PAUSE_GEOFENCES_MSG_ID = 27;
|
||||
PB_E_LOCAPI_RESUME_GEOFENCES_MSG_ID = 28;
|
||||
|
||||
//geofence breach
|
||||
PB_E_LOCAPI_GEOFENCE_BREACH_MSG_ID = 29;
|
||||
|
||||
// Measurement reports
|
||||
PB_E_LOCAPI_MEAS_MSG_ID = 30;
|
||||
|
||||
// Terrestria fix request/response msg
|
||||
PB_E_LOCAPI_GET_SINGLE_TERRESTRIAL_POS_REQ_MSG_ID = 31;
|
||||
PB_E_LOCAPI_GET_SINGLE_TERRESTRIAL_POS_RESP_MSG_ID = 32;
|
||||
|
||||
// ping
|
||||
PB_E_LOCAPI_PINGTEST_MSG_ID = 99;
|
||||
|
||||
// integration API config request
|
||||
PB_E_INTAPI_CONFIG_CONSTRAINTED_TUNC_MSG_ID = 200;
|
||||
PB_E_INTAPI_CONFIG_POSITION_ASSISTED_CLOCK_ESTIMATOR_MSG_ID = 201;
|
||||
PB_E_INTAPI_CONFIG_SV_CONSTELLATION_MSG_ID = 202;
|
||||
PB_E_INTAPI_CONFIG_AIDING_DATA_DELETION_MSG_ID = 203;
|
||||
PB_E_INTAPI_CONFIG_LEVER_ARM_MSG_ID = 204;
|
||||
PB_E_INTAPI_CONFIG_ROBUST_LOCATION_MSG_ID = 205;
|
||||
PB_E_INTAPI_CONFIG_MIN_GPS_WEEK_MSG_ID = 206;
|
||||
PB_E_INTAPI_CONFIG_DEAD_RECKONING_ENGINE_MSG_ID = 207;
|
||||
PB_E_INTAPI_CONFIG_MIN_SV_ELEVATION_MSG_ID = 208;
|
||||
PB_E_INTAPI_CONFIG_CONSTELLATION_SECONDARY_BAND_MSG_ID = 209;
|
||||
PB_E_INTAPI_CONFIG_ENGINE_RUN_STATE_MSG_ID = 210;
|
||||
PB_E_INTAPI_CONFIG_USER_CONSENT_TERRESTRIAL_POSITIONING_MSG_ID = 211;
|
||||
|
||||
// integration API config retrieval request/response
|
||||
PB_E_INTAPI_GET_ROBUST_LOCATION_CONFIG_REQ_MSG_ID = 300;
|
||||
PB_E_INTAPI_GET_ROBUST_LOCATION_CONFIG_RESP_MSG_ID = 301;
|
||||
|
||||
PB_E_INTAPI_GET_MIN_GPS_WEEK_REQ_MSG_ID = 302;
|
||||
PB_E_INTAPI_GET_MIN_GPS_WEEK_RESP_MSG_ID = 303;
|
||||
|
||||
PB_E_INTAPI_GET_MIN_SV_ELEVATION_REQ_MSG_ID = 304;
|
||||
PB_E_INTAPI_GET_MIN_SV_ELEVATION_RESP_MSG_ID = 305;
|
||||
|
||||
PB_E_INTAPI_GET_CONSTELLATION_SECONDARY_BAND_CONFIG_REQ_MSG_ID = 306;
|
||||
PB_E_INTAPI_GET_CONSTELLATION_SECONDARY_BAND_CONFIG_RESP_MSG_ID = 307;
|
||||
}
|
||||
|
||||
enum PBClientType {
|
||||
PB_LOCATION_CLIENT_TYPE_INVALID = 0;
|
||||
PB_LOCATION_CLIENT_API = 1;
|
||||
PB_LOCATION_INTEGRATION_API = 2;
|
||||
}
|
||||
|
||||
enum PBLocationCallbacksMask {
|
||||
PB_E_LOC_CB_INVALID = 0;
|
||||
/**< Register for DBT location report */
|
||||
PB_E_LOC_CB_DISTANCE_BASED_TRACKING_BIT = 1;
|
||||
/**< Register for GNSS Location */
|
||||
PB_E_LOC_CB_GNSS_LOCATION_INFO_BIT = 2;
|
||||
/**< Register for GNSS SV */
|
||||
PB_E_LOC_CB_GNSS_SV_BIT = 4;
|
||||
/**< Register for GNSS NMEA */
|
||||
PB_E_LOC_CB_GNSS_NMEA_BIT = 8;
|
||||
/**< Register for GNSS DATA */
|
||||
PB_E_LOC_CB_GNSS_DATA_BIT = 16;
|
||||
/**< Register for Location system info */
|
||||
PB_E_LOC_CB_SYSTEM_INFO_BIT = 32;
|
||||
/**< Register for Batching */
|
||||
PB_E_LOC_CB_BATCHING_BIT = 64;
|
||||
/**< Register for Batching Status*/
|
||||
PB_E_LOC_CB_BATCHING_STATUS_BIT = 128;
|
||||
/**< Register for Geofence Breach */
|
||||
PB_E_LOC_CB_GEOFENCE_BREACH_BIT = 256;
|
||||
/**< Register for multiple engine reports */
|
||||
PB_E_LOC_CB_ENGINE_LOCATIONS_INFO_BIT = 512;
|
||||
/**< Register for simple location */
|
||||
PB_E_LOC_CB_SIMPLE_LOCATION_INFO_BIT = 1024;
|
||||
/**< Register for GNSS Measurements */
|
||||
PB_E_LOC_CB_GNSS_MEAS_BIT = 2048;
|
||||
}
|
||||
|
||||
enum PBEngineInfoCallbacksMask {
|
||||
PB_E_ENGINE_INFO_CB_INVALID = 0;
|
||||
/**< GNSS energy consumed */
|
||||
// gnss energy consumed, once the info is delivered,
|
||||
// this bit will be cleared
|
||||
PB_E_ENGINE_INFO_CB_GNSS_ENERGY_CONSUMED_BIT = 1;
|
||||
}
|
||||
|
||||
enum PBGeofenceBreachTypeMask {
|
||||
PB_GEOFENCE_BREACH_INVALID = 0;
|
||||
PB_GEOFENCE_BREACH_ENTER_BIT = 1;
|
||||
PB_GEOFENCE_BREACH_EXIT_BIT = 2;
|
||||
PB_GEOFENCE_BREACH_DWELL_IN_BIT = 4;
|
||||
PB_GEOFENCE_BREACH_DWELL_OUT_BIT = 8;
|
||||
}
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Messages
|
||||
// ============================================================================
|
||||
|
||||
//*******************************
|
||||
// Common data structure
|
||||
//*******************************
|
||||
message PBLocAPINmeaSerializedPayload {
|
||||
uint64 timestamp = 1;
|
||||
string nmea = 2;
|
||||
}
|
||||
|
||||
message PBLocAPIBatchNotification {
|
||||
PBBatchingStatus status = 1;
|
||||
repeated PBLocation location = 2;
|
||||
}
|
||||
|
||||
message PBLocAPIGeofenceBreachNotification {
|
||||
uint64 timestamp = 1;
|
||||
//type of breach - PBGeofenceBreachTypeMask
|
||||
uint32 breachtype = 2;
|
||||
//location associated with breach
|
||||
PBLocation location = 3;
|
||||
repeated uint32 id = 4;
|
||||
}
|
||||
|
||||
message PBGeofenceOption {
|
||||
// bitwise OR of PBGeofenceBreachTypeMask
|
||||
uint32 breachTypeMask = 1;
|
||||
// in milliseconds
|
||||
uint32 responsiveness = 2;
|
||||
// in seconds
|
||||
uint32 dwellTime = 3;
|
||||
}
|
||||
|
||||
message PBGeofenceInfo {
|
||||
// in degrees
|
||||
double latitude = 1;
|
||||
// in degrees
|
||||
double longitude = 2;
|
||||
// in meters
|
||||
double radius = 3;
|
||||
}
|
||||
|
||||
message PBGeofencePayload {
|
||||
uint32 gfClientId = 1;
|
||||
PBGeofenceOption gfOption = 2;
|
||||
PBGeofenceInfo gfInfo = 3;
|
||||
}
|
||||
|
||||
message PBGeofencesAddedReqPayload {
|
||||
repeated PBGeofencePayload gfPayload = 1;
|
||||
}
|
||||
|
||||
message PBGeofencesReqClientIdPayload {
|
||||
repeated uint32 gfIds = 1;
|
||||
}
|
||||
|
||||
message PBGeofenceResponse {
|
||||
uint32 clientId = 1;
|
||||
PBLocationError error = 2;
|
||||
}
|
||||
|
||||
message PBCollectiveResPayload {
|
||||
repeated PBGeofenceResponse resp = 1;
|
||||
}
|
||||
|
||||
//********************************************
|
||||
// IPC message structure - client registration
|
||||
//********************************************
|
||||
// defintion for message with msg id of PB_E_LOCAPI_CLIENT_REGISTER_MSG_ID
|
||||
message PBLocAPIClientRegisterReqMsg {
|
||||
PBClientType mClientType = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_CLIENT_DEREGISTER_MSG_ID
|
||||
// LocAPIClientDeregisterReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_CAPABILILTIES_MSG_ID
|
||||
message PBLocAPICapabilitiesIndMsg
|
||||
{
|
||||
// Bitwise OR of PBLocationCapabilitiesMask
|
||||
uint64 capabilitiesMask = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_HAL_READY_MSG_ID
|
||||
// LocAPIHalReadyIndMsg - no struct member.
|
||||
|
||||
//*****************************************
|
||||
// IPC message structure - generic response
|
||||
//*****************************************
|
||||
message PBLocAPIGenericRespMsg {
|
||||
PBLocationError err = 1;
|
||||
}
|
||||
|
||||
message PBLocAPICollectiveRespMsg {
|
||||
PBCollectiveResPayload collectiveRes = 1;
|
||||
}
|
||||
|
||||
//*********************************
|
||||
// IPC message structure - tracking
|
||||
//*********************************
|
||||
// defintion for message with msg id of PB_E_LOCAPI_START_TRACKING_MSG_ID
|
||||
message PBLocAPIStartTrackingReqMsg {
|
||||
PBLocationOptions locOptions = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of E_LOCAPI_STOP_TRACKING_MSG_ID
|
||||
// LocAPIStopTrackingReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_UPDATE_CALLBACKS_MSG_ID
|
||||
message PBLocAPIUpdateCallbacksReqMsg {
|
||||
// bitwise OR of PBLocationCallbacksMask
|
||||
uint32 locationCallbacks = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_UPDATE_TRACKING_OPTIONS_MSG_ID
|
||||
message PBLocAPIUpdateTrackingOptionsReqMsg {
|
||||
PBLocationOptions locOptions = 1;
|
||||
}
|
||||
|
||||
//*********************************
|
||||
// IPC message structure - batching
|
||||
//*********************************
|
||||
// defintion for message with msg id of PB_E_LOCAPI_START_BATCHING_MSG_ID
|
||||
message PBLocAPIStartBatchingReqMsg {
|
||||
uint32 intervalInMs = 1;
|
||||
uint32 distanceInMeters = 2;
|
||||
PBBatchingMode batchingMode = 3;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_STOP_BATCHING_MSG_ID
|
||||
// LocAPIStopBatchingReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_UPDATE_BATCHING_OPTIONS_MSG_ID
|
||||
message PBLocAPIUpdateBatchingOptionsReqMsg {
|
||||
uint32 intervalInMs = 1;
|
||||
uint32 distanceInMeters = 2;
|
||||
PBBatchingMode batchingMode = 3;
|
||||
}
|
||||
|
||||
//*********************************
|
||||
// IPC message structure - geofence
|
||||
//*********************************
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_ADD_GEOFENCES_MSG_ID
|
||||
message PBLocAPIAddGeofencesReqMsg {
|
||||
PBGeofencesAddedReqPayload geofences = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_REMOVE_GEOFENCES_MSG_ID
|
||||
message PBLocAPIRemoveGeofencesReqMsg {
|
||||
PBGeofencesReqClientIdPayload gfClientIds = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_MODIFY_GEOFENCES_MSG_ID
|
||||
message PBLocAPIModifyGeofencesReqMsg {
|
||||
PBGeofencesAddedReqPayload geofences = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_PAUSE_GEOFENCES_MSG_ID
|
||||
message PBLocAPIPauseGeofencesReqMsg {
|
||||
PBGeofencesReqClientIdPayload gfClientIds = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_RESUME_GEOFENCES_MSG_ID
|
||||
message PBLocAPIResumeGeofencesReqMsg {
|
||||
PBGeofencesReqClientIdPayload gfClientIds = 1;
|
||||
}
|
||||
|
||||
//*********************************
|
||||
// IPC message structure - control
|
||||
//*********************************
|
||||
// defintion for message with msg id of PB_E_LOCAPI_CONTROL_UPDATE_NETWORK_AVAILABILITY_MSG_ID
|
||||
message PBLocAPIUpdateNetworkAvailabilityReqMsg {
|
||||
bool mAvailability = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_GET_GNSS_ENGERY_CONSUMED_MSG_ID
|
||||
// LocAPIGetGnssEnergyConsumedReqMsg - no struct member.
|
||||
|
||||
//************************************
|
||||
// IPC message structure - indications
|
||||
//************************************
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_LOCATION_MSG_ID
|
||||
message PBLocAPILocationIndMsg {
|
||||
PBLocation locationNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_BATCHING_MSG_ID
|
||||
message PBLocAPIBatchingIndMsg {
|
||||
PBLocAPIBatchNotification batchNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_GEOFENCE_BREACH_MSG_ID
|
||||
message PBLocAPIGeofenceBreachIndMsg {
|
||||
PBLocAPIGeofenceBreachNotification gfBreachNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_LOCATION_INFO_MSG_ID
|
||||
message PBLocAPILocationInfoIndMsg {
|
||||
PBGnssLocationInfoNotification gnssLocationInfoNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_ENGINE_LOCATIONS_INFO_MSG_ID
|
||||
message PBLocAPIEngineLocationsInfoIndMsg {
|
||||
// max array size - PBLocApiOutputEngineType::PB_LOC_OUTPUT_ENGINE_COUNT
|
||||
repeated PBGnssLocationInfoNotification engineLocationsInfo = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_SATELLITE_VEHICLE_MSG_ID
|
||||
message PBLocAPISatelliteVehicleIndMsg {
|
||||
PBLocApiGnssSvNotification gnssSvNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_NMEA_MSG_ID
|
||||
message PBLocAPINmeaIndMsg {
|
||||
PBLocAPINmeaSerializedPayload gnssNmeaNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_DATA_MSG_ID
|
||||
message PBLocAPIDataIndMsg {
|
||||
PBGnssDataNotification gnssDataNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_MEAS_MSG_ID
|
||||
message PBLocAPIMeasIndMsg {
|
||||
PBGnssMeasurementsNotification gnssMeasurementsNotification = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_GET_TOTAL_ENGERY_CONSUMED_BY_GPS_ENGINE_MSG_ID
|
||||
message PBLocAPIGnssEnergyConsumedIndMsg {
|
||||
uint64 totalGnssEnergyConsumedSinceFirstBoot = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_LOCATION_SYSTEM_INFO_MSG_ID
|
||||
message PBLocAPILocationSystemInfoIndMsg {
|
||||
PBLocationSystemInfo locationSystemInfo = 1;
|
||||
}
|
||||
|
||||
//*******************************************************************
|
||||
// IPC message structure - Single-shot Terrestrial fix
|
||||
//*******************************************************************
|
||||
message PBLocAPIGetSingleTerrestrialPosReqMsg {
|
||||
uint32 timeoutMsec = 1;
|
||||
PBTerrestrialTechMask techMask = 2;
|
||||
float horQoS = 3;
|
||||
};
|
||||
|
||||
message PBLocAPIGetSingleTerrestrialPosRespMsg {
|
||||
PBLocationError errorCode = 1;
|
||||
PBLocation location = 2;
|
||||
};
|
||||
|
||||
//*******************************************************************
|
||||
// IPC message structure - Location Integration API Configure Request
|
||||
//*******************************************************************
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_CONSTRAINTED_TUNC_MSG_ID
|
||||
message PBLocConfigConstrainedTuncReqMsg {
|
||||
bool mEnable = 1;
|
||||
float mTuncConstraint = 2;
|
||||
uint32 mEnergyBudget = 3;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_POSITION_ASSISTED_CLOCK_ESTIMATOR_MSG_ID
|
||||
message PBLocConfigPositionAssistedClockEstimatorReqMsg {
|
||||
bool mEnable = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_SV_CONSTELLATION_MSG_ID
|
||||
message PBLocConfigSvConstellationReqMsg {
|
||||
PBGnssSvTypeConfig mConstellationEnablementConfig = 1;
|
||||
PBGnssSvIdConfig mBlacklistSvConfig = 2;
|
||||
bool mResetToDefault = 3;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_CONSTELLATION_SECONDARY_BAND_MSG_ID
|
||||
message PBLocConfigConstellationSecondaryBandReqMsg {
|
||||
PBGnssSvTypeConfig mSecondaryBandConfig = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_LOCAPI_CONTROL_DELETE_AIDING_DATA_MSG_ID
|
||||
message PBLocConfigAidingDataDeletionReqMsg {
|
||||
PBAidingData mAidingData = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_LEVER_ARM_MSG_ID
|
||||
message PBLocConfigLeverArmReqMsg {
|
||||
PBLIALeverArmConfigInfo mLeverArmConfigInfo = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_ROBUST_LOCATION_MSG_ID
|
||||
message PBLocConfigRobustLocationReqMsg {
|
||||
bool mEnable = 1;
|
||||
bool mEnableForE911 = 2;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_MIN_GPS_WEEK_MSG_ID
|
||||
message PBLocConfigMinGpsWeekReqMsg {
|
||||
uint32 mMinGpsWeek = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_DEAD_RECKONING_ENGINE_MSG_ID
|
||||
message PBLocConfigDrEngineParamsReqMsg {
|
||||
PBDeadReckoningEngineConfig mDreConfig = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_MIN_SV_ELEVATION_MSG_ID
|
||||
message PBLocConfigMinSvElevationReqMsg {
|
||||
uint32 mMinSvElevation = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_CONFIG_ENGINE_RUN_STATE_MSG_ID
|
||||
message PBLocConfigEngineRunStateReqMsg {
|
||||
PBLocApiPositioningEngineMask mEngType = 1;
|
||||
PBLocEngineRunState mEngState = 2;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of
|
||||
// PB_E_INTAPI_CONFIG_USER_CONSENT_TERRESTRIAL_POSITIONING_MSG_ID
|
||||
message PBLocConfigUserConsentTerrestrialPositioningReqMsg {
|
||||
bool userConsent = 1;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// IPC message structure - Location Integration API Get request/response message
|
||||
//******************************************************************************
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_GET_ROBUST_LOCATION_CONFIG_REQ_MSG_ID
|
||||
// LocConfigGetRobustLocationConfigReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_GET_ROBUST_LOCATION_CONFIG_RESP_MSG_ID
|
||||
message PBLocConfigGetRobustLocationConfigRespMsg {
|
||||
PBGnssConfigRobustLocation mRobustLoationConfig = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_GET_MIN_GPS_WEEK_REQ_MSG_ID
|
||||
// LocConfigGetMinGpsWeekReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_GET_MIN_SV_ELEVATION_RESP_MSG_ID
|
||||
message PBLocConfigGetMinGpsWeekRespMsg {
|
||||
uint32 mMinGpsWeek = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_GET_MIN_SV_ELEVATION_REQ_MSG_ID
|
||||
// LocConfigGetMinSvElevationReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of PB_E_INTAPI_GET_MIN_SV_ELEVATION_RESP_MSG_ID
|
||||
message PBLocConfigGetMinSvElevationRespMsg {
|
||||
uint32 mMinSvElevation = 1;
|
||||
}
|
||||
|
||||
// defintion for message with msg id of
|
||||
// PB_E_INTAPI_GET_CONSTELLATION_SECONDARY_BAND_CONFIG_REQ_MSG_ID
|
||||
// LocConfigGetConstellationSecondaryBandConfigReqMsg - no struct member.
|
||||
|
||||
// defintion for message with msg id of
|
||||
// PB_E_INTAPI_GET_CONSTELLATION_SECONDARY_BAND_CONFIG_RESP_MSG_ID
|
||||
message PBLocConfigGetConstltnSecondaryBandConfigRespMsg {
|
||||
PBGnssSvTypeConfig mSecondaryBandConfig = 1;
|
||||
}
|
||||
|
||||
//*****************************
|
||||
// IPC message structure - ping
|
||||
//*****************************
|
||||
// defintion for message with msg id of PB_E_LOCAPI_PINGTEST_MSG_ID
|
||||
message PBLocAPIPingTestReqMsg {
|
||||
uint32 numberOfPing = 1;
|
||||
repeated uint32 data = 2;
|
||||
}
|
||||
|
||||
message PBLocAPIPingTestIndMsg {
|
||||
uint32 numberOfPing = 1;
|
||||
repeated uint32 data = 2;
|
||||
}
|
||||
|
||||
//*******************************
|
||||
// IPC message header structure
|
||||
//*******************************
|
||||
message PBLocAPIMsgHeader {
|
||||
/**< Processor string*/
|
||||
string mSocketName = 1;
|
||||
/**< LocationMsgID */
|
||||
PBELocMsgID msgId = 2;
|
||||
/**< Location remote API message version */
|
||||
uint32 msgVersion = 3;
|
||||
/**< Message payload */
|
||||
bytes payload = 4;
|
||||
/**< payload size */
|
||||
uint32 payloadSize = 5;
|
||||
|
||||
}
|
||||
9
location/location_api_msg_proto/Makefile.am
Normal file
9
location/location_api_msg_proto/Makefile.am
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
library_includedir = $(pkgincludedir)
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = location-api-msg-proto.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
||||
72
location/location_api_msg_proto/configure.ac
Normal file
72
location/location_api_msg_proto/configure.ac
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
# configure.ac -- Autoconf script for gps location-api-msg-proto
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
# Requires autoconf tool later than 2.61
|
||||
AC_PREREQ(2.61)
|
||||
# Initialize the location-api-msg-proto package version 1.0.0
|
||||
AC_INIT([location-api-msg-proto],1.0.0)
|
||||
# Does not strictly follow GNU Coding standards
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
# Disables auto rebuilding of configure, Makefile.ins
|
||||
AM_MAINTAINER_MODE
|
||||
# Verifies the --srcdir is correct by checking for the path
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
# defines some macros variable to be included by source
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
AC_ARG_WITH([glib],
|
||||
AC_HELP_STRING([--with-glib],
|
||||
[enable glib, building HLOS systems which use glib]))
|
||||
|
||||
PKG_CHECK_MODULES([GPSUTILS], [gps-utils])
|
||||
AC_SUBST([GPSUTILS_CFLAGS])
|
||||
AC_SUBST([GPSUTILS_LIBS])
|
||||
|
||||
AC_ARG_WITH([external_ap],
|
||||
AC_HELP_STRING([--with-external_ap=@<:@dir@:>@],
|
||||
[Using External Application Processor]),
|
||||
[],
|
||||
with_external_ap=no)
|
||||
|
||||
if test "x$with_external_ap" != "xno"; then
|
||||
CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_EXTERNAL_AP, test "x${with_external_ap}" = "xyes")
|
||||
|
||||
if (test "x${with_glib}" = "xyes"); then
|
||||
AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GThread >= 2.16 is required))
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GLib >= 2.16 is required))
|
||||
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
|
||||
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
|
||||
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
|
||||
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
src/Makefile \
|
||||
location-api-msg-proto.pc
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
38
location/location_api_msg_proto/location-api-msg-proto.pc.in
Normal file
38
location/location_api_msg_proto/location-api-msg-proto.pc.in
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: location-api-msg-proto
|
||||
Description: location api msg protobuf library
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -llocation_api_msg_proto
|
||||
Cflags: -I${includedir} -I${includedir}/location-api-msg-proto
|
||||
159
location/location_api_msg_proto/location_api_msg_protobuf_gen.sh
Executable file
159
location/location_api_msg_proto/location_api_msg_protobuf_gen.sh
Executable file
|
|
@ -0,0 +1,159 @@
|
|||
#/bin/bash
|
||||
##################################################################################################
|
||||
## Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
##
|
||||
## Redistribution and use in source and binary forms, with or without
|
||||
## modification, are permitted provided that the following conditions are
|
||||
## met:
|
||||
## * Redistributions of source code must retain the above copyright
|
||||
## notice, this list of conditions and the following disclaimer.
|
||||
## * Redistributions in binary form must reproduce the above
|
||||
## copyright notice, this list of conditions and the following
|
||||
## disclaimer in the documentation and/or other materials provided
|
||||
## with the distribution.
|
||||
## * Neither the name of The Linux Foundation nor the names of its
|
||||
## contributors may be used to endorse or promote products derived
|
||||
## from this software without specific prior written permission.
|
||||
##
|
||||
## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
## BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
## BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
## OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
## IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
##################################################################################################
|
||||
|
||||
##################################################################################################
|
||||
##
|
||||
## location_api_msg_protobuf_gen.sh
|
||||
## Description:
|
||||
## Util script to compile the proto files using protoc to generate the header and C file.
|
||||
## This is intended to be run once you have made a full build and if any changes are made to proto
|
||||
## files or if any new proto files are added. This relieves the burden of developer in finding the
|
||||
## path to protobuf work folder and running those commands.
|
||||
##
|
||||
## This script is also used in pre compile stage to compile the proto files so that the generated
|
||||
## C and header file are based on the protoc compiler for that workspace (LV or LE).
|
||||
##
|
||||
## For more details, pls refer the below link
|
||||
## - https://developers.google.com/protocol-buffers/docs/reference/cpp-generated
|
||||
##
|
||||
## Note:
|
||||
## 1. Add any new .proto files to "src_proto_files" array
|
||||
## 2. If protobuf package version is updated, update the values in this script too (variable -
|
||||
## protobuf_package_ver).
|
||||
##
|
||||
##################################################################################################
|
||||
|
||||
echo;
|
||||
echo "location_api_msg_protobuf_gen.sh"
|
||||
echo "********************************"
|
||||
# find workspace path
|
||||
wsp_path=`repo info platform/hardware/qcom/gps 2>&1|grep -o "Mount path:.*"|sed 's/Mount path: //'|sed 's/hardware\/qcom\/gps//'`
|
||||
echo "Workspace path is: $wsp_path"
|
||||
# find manifest
|
||||
manifest_info=`repo info . 2>/dev/null|grep "Manifest merge branch"|sed 's/Manifest merge branch: refs\/[a-z]*\///'`
|
||||
echo "Manifest branch/AU is: $manifest_info"
|
||||
|
||||
if [ "$wsp_path" == "" ]
|
||||
then
|
||||
## this happens when this script runs as part of bitbake compilation in do_compile_prepend
|
||||
echo "Wsp path is NULL"
|
||||
if [ "$WORKSPACE" != "" ];then
|
||||
# LE targets has root path in $WORKSPACE
|
||||
wsp_path=$WORKSPACE"/"
|
||||
elif [ "$SRC_DIR_ROOT" != "" ];then
|
||||
# LV targets has root path in $SRC_DIR_ROOT
|
||||
wsp_path=$SRC_DIR_ROOT"/"
|
||||
else
|
||||
## Compiling in <ROOT>/poky/build/tmp-glibc/work/sa415m-oe-linux-gnueabi/eng-hub-msg-proto/git-r1/gps-noship/eng-hub-msg-proto/
|
||||
## 9 level up - <ROOT> of workspace
|
||||
wsp_path="../../../../../../../../../"
|
||||
fi
|
||||
echo "do_compile_prepend: Wsp path is $wsp_path"
|
||||
fi
|
||||
|
||||
## LV target
|
||||
## - <ROOT>/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
|
||||
## SRCREV = "48cb18e5c419ddd23d9badcfe4e9df7bde1979b2"
|
||||
## PV .= "+git${SRCPV}"
|
||||
## eg: protobuf_package_ver="3.6.1+gitAUTOINC+48cb18e5c4-r0"
|
||||
## Output path - <WSP>/poky/build/tmp-glibc/work/x86_64-linux/protobuf-native/
|
||||
|
||||
## LE target
|
||||
## - <ROOT>/poky/meta-qti-bsp/recipes-devtools/protobuf/protobuf_3.3.0.bb
|
||||
## SRCREV = "a6189acd18b00611c1dc7042299ad75486f08a1a"
|
||||
## PV = "3.3.0+git${SRCPV}"
|
||||
## eg: protobuf_package_ver="3.3.0+gitAUTOINC+a6189acd18-r0"
|
||||
## Output path - <WSP>/poky/build/tmp-glibc/work/x86_64-linux/protobuf-native/
|
||||
|
||||
## EAP target
|
||||
## - <ROOT>/sources/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.5.1.bb
|
||||
## SRCREV = "106ffc04be1abf3ff3399f54ccf149815b287dd9"
|
||||
## PV = "3.5.1+git${SRCPV}"
|
||||
## eg: protobuf_package_ver="3.5.1+gitAUTOINC+106ffc04be-r0"
|
||||
## Output path is different - <WSP>/build/tmp/work/x86_64-linux/protobuf-native/
|
||||
|
||||
## LE-PDK target
|
||||
## - <ROOT>/poky/meta-qti-bsp/recipes-devtools/protobuf/protobuf_3.3.0.bb
|
||||
## SRCREV = "a6189acd18b00611c1dc7042299ad75486f08a1a"
|
||||
## PV = "3.3.0+git${SRCPV}"
|
||||
## eg: protobuf_package_ver="3.3.0+gitAUTOINC+a6189acd18-r0"
|
||||
## <WSP> will be "<ROOT>/src"
|
||||
## Output path - eg: <WSP>/../build-qti-distro-fullstack-perf/tmp-glibc/work/x86_64-linux/protobuf-native
|
||||
|
||||
# protobuf native out path default - for LE/LV
|
||||
protobuf_protoc_path=$wsp_path"poky/build/tmp-glibc/sysroots-components/x86_64/protobuf-native/usr/bin/protoc"
|
||||
|
||||
# find protoc path based on target type
|
||||
if [ -e $wsp_path"sources/meta-qti-eap/recipes-location/location/gps-utils_git.bb" ]
|
||||
then
|
||||
manifest_info="LE-EAP"
|
||||
protobuf_protoc_path=$wsp_path"build/tmp/sysroots-components/x86_64/protobuf-native/usr/bin/protoc"
|
||||
elif [ -e "$wsp_path/../poky/qti-conf/set_bb_env.sh" ]
|
||||
then
|
||||
manifest_info="LE-PDK"
|
||||
# find build folder and select first one if multiple build folders
|
||||
build_folders=(`ls $wsp_path/../|grep build-`)
|
||||
if [ ${#build_folders[@]} -eq 0 ]; then
|
||||
echo "ERROR!! No build folders found..."
|
||||
exit 1
|
||||
fi
|
||||
echo "LE PDK - Using build folder ${build_folders[0]}"
|
||||
protobuf_protoc_path=$wsp_path"../"${build_folders[0]}"/tmp-glibc/sysroots-components/x86_64/protobuf-native/usr/bin/protoc"
|
||||
elif [ -e $wsp_path"meta-qti-bsp/meta-qti-base/recipes-location/location/gps-utils_git.bb" ]
|
||||
then
|
||||
manifest_info="LV"
|
||||
else
|
||||
manifest_info="LE"
|
||||
fi
|
||||
|
||||
echo "Target is $manifest_info"
|
||||
echo "Binary protoc path is : $protobuf_protoc_path"
|
||||
if ! [ -e $protobuf_protoc_path ]
|
||||
then
|
||||
echo "ERROR!! Protoc - $protobuf_protoc_path - is not found..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## array of .proto files. Add any new .proto files to this array.
|
||||
src_proto_files=(LocationApiDataTypes.proto LocationApiMsg.proto)
|
||||
|
||||
for src_file in ${src_proto_files[@]}; do
|
||||
echo -e "\nProcessing $src_file"
|
||||
## protoc --cpp_out=. EHMsg.proto
|
||||
echo " >> Running protoc"
|
||||
cmd=$protobuf_protoc_path' --proto_path=. --cpp_out=src '$src_file
|
||||
eval $cmd
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "SUCCESS !!! protoc compilation"
|
||||
else
|
||||
echo "ERROR!! protoc compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
3146
location/location_api_msg_proto/src/LocationApiMsg.cpp
Normal file
3146
location/location_api_msg_proto/src/LocationApiMsg.cpp
Normal file
File diff suppressed because it is too large
Load diff
1322
location/location_api_msg_proto/src/LocationApiMsg.h
Normal file
1322
location/location_api_msg_proto/src/LocationApiMsg.h
Normal file
File diff suppressed because it is too large
Load diff
5348
location/location_api_msg_proto/src/LocationApiPbMsgConv.cpp
Normal file
5348
location/location_api_msg_proto/src/LocationApiPbMsgConv.cpp
Normal file
File diff suppressed because it is too large
Load diff
787
location/location_api_msg_proto/src/LocationApiPbMsgConv.h
Normal file
787
location/location_api_msg_proto/src/LocationApiPbMsgConv.h
Normal file
|
|
@ -0,0 +1,787 @@
|
|||
/* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef LOCATION_API_PBMSGCONV_H
|
||||
#define LOCATION_API_PBMSGCONV_H
|
||||
|
||||
#include <LocationApiMsg.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace loc_util;
|
||||
|
||||
#define LocApiPb_LOGd(fmt, ...) if (mPbDebugLogEnabled) { LOC_LOGd(fmt, ##__VA_ARGS__); }
|
||||
#define LocApiPb_LOGv(fmt, ...) if (mPbVerboseLogEnabled) { LOC_LOGv(fmt, ##__VA_ARGS__); }
|
||||
|
||||
// LocationApiPbMsgConv - Class which handles conversion of rigid struct to protobuf
|
||||
// messages and vice versa. This will be to serialize/deserialize message using protobuf to
|
||||
// send across process or processor boundaries between different modules.
|
||||
class LocationApiPbMsgConv {
|
||||
public:
|
||||
LocationApiPbMsgConv();
|
||||
virtual ~LocationApiPbMsgConv() {}
|
||||
|
||||
// STRUCTURE CONVERSION
|
||||
// ********************
|
||||
// **** helper function for structure conversion to protobuf format
|
||||
// GnssSvTypeConfig to PBGnssSvTypeConfig
|
||||
int convertGnssSvTypeConfigToPB(const GnssSvTypeConfig &gnssSvTypeCfg,
|
||||
PBGnssSvTypeConfig *pbGnssSvTypeCfg) const;
|
||||
// GnssSvIdConfig to PBGnssSvIdConfig
|
||||
int convertGnssSvIdConfigToPB(const GnssSvIdConfig &gnssSvIdCfg,
|
||||
PBGnssSvIdConfig *pbgnssSvIdCfg) const;
|
||||
// GnssAidingData to PBAidingData
|
||||
int convertGnssAidingDataToPB(const GnssAidingData &gnssAidData,
|
||||
PBAidingData *pbGnssAidData) const;
|
||||
// LeverArmConfigInfo to PBLIALeverArmConfigInfo
|
||||
int convertLeverArmConfigInfoToPB(const LeverArmConfigInfo &leverArmCfgInfo,
|
||||
PBLIALeverArmConfigInfo *pbLeverArmCfgInfo) const;
|
||||
// DeadReckoningEngineConfig to PBDeadReckoningEngineConfig
|
||||
int convertDeadReckoningEngineConfigToPB(const DeadReckoningEngineConfig &drEngConfig,
|
||||
PBDeadReckoningEngineConfig *pbDrEngConfig) const;
|
||||
// LocationOptions to PBLocationOptions
|
||||
int convertLocationOptionsToPB(const LocationOptions &locOpt,
|
||||
PBLocationOptions *pbLocOpt) const;
|
||||
// GeofencesAddedReqPayload to PBGeofencesAddedReqPayload
|
||||
int convertGfAddedReqPayloadToPB(const GeofencesAddedReqPayload &gfAddReqPayload,
|
||||
PBGeofencesAddedReqPayload *pbGfAddReqPayload) const;
|
||||
// GeofencesReqClientIdPayload to PBGeofencesReqClientIdPayload
|
||||
int convertGfReqClientIdPayloadToPB(const GeofencesReqClientIdPayload &gfReqClntIdPayload,
|
||||
PBGeofencesReqClientIdPayload *pbgfReqClntIdPayload) const;
|
||||
// CollectiveResPayload to PBCollectiveResPayload
|
||||
int convertCollectiveResPayloadToPB(const CollectiveResPayload &collctResPload,
|
||||
PBCollectiveResPayload *pbCollctResPload) const;
|
||||
// LocAPIBatchNotification to PBLocAPIBatchNotification
|
||||
int convertLocAPIBatchingNotifMsgToPB(const LocAPIBatchNotification &locApiBatchNotifMsg,
|
||||
PBLocAPIBatchNotification *pbLocApiBatchNotifMsg) const;
|
||||
// LocAPIGeofenceBreachNotification to PBLocAPIGeofenceBreachNotification
|
||||
int convertLocAPIGfBreachNotifToPB(const LocAPIGeofenceBreachNotification &locApiGfBreachNotif,
|
||||
PBLocAPIGeofenceBreachNotification *pbLocApiGfBreachNotif) const;
|
||||
// GnssConfigRobustLocation to PBGnssConfigRobustLocation
|
||||
int convertGnssConfigRobustLocationToPB(const GnssConfigRobustLocation &gnssCfgRbstLoc,
|
||||
PBGnssConfigRobustLocation *pbGnssCfgRbstLoc) const;
|
||||
// Location to PBLocation
|
||||
int convertLocationToPB(const Location &location, PBLocation *pbLocation) const;
|
||||
// GnssLocationInfoNotification to PBGnssLocationInfoNotification
|
||||
int convertGnssLocInfoNotifToPB(const GnssLocationInfoNotification &gnssLocInfoNotif,
|
||||
PBGnssLocationInfoNotification *pbgnssLocInfoNotif) const;
|
||||
// GnssSvNotification to PBLocApiGnssSvNotification
|
||||
int convertGnssSvNotifToPB(const GnssSvNotification &gnssSvNotif,
|
||||
PBLocApiGnssSvNotification *pbGnssSvNotif) const;
|
||||
// LocAPINmeaSerializedPayload to PBLocAPINmeaSerializedPayload
|
||||
int convertLocAPINmeaSerializedPayloadToPB(
|
||||
const LocAPINmeaSerializedPayload &locAPINmeaSerPload,
|
||||
PBLocAPINmeaSerializedPayload *pbLocAPINmeaSerPload) const;
|
||||
// GnssDataNotification to PBGnssDataNotification
|
||||
int convertGnssDataNotifToPB(const GnssDataNotification &gnssDataNotif,
|
||||
PBGnssDataNotification *pbGnssDataNotif) const;
|
||||
// GnssMeasurementsNotification to PBGnssMeasurementsNotification
|
||||
int convertGnssMeasNotifToPB(const GnssMeasurementsNotification &gnssMeasNotif,
|
||||
PBGnssMeasurementsNotification *pbGnssMeasNotif) const;
|
||||
// LocationSystemInfo to PBLocationSystemInfo
|
||||
int convertLocSysInfoToPB(const LocationSystemInfo &locSysInfo,
|
||||
PBLocationSystemInfo *pbLocSysInfo) const;
|
||||
|
||||
// Memory cleanup - Free up memory after PB conversion and serializing data
|
||||
inline void freeUpPBLocAPIStartTrackingReqMsg(PBLocAPIStartTrackingReqMsg &pbLocApiStartTrack)
|
||||
const {
|
||||
// PBLocationOptions locOptions = 1;
|
||||
pbLocApiStartTrack.clear_locoptions();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIUpdateTrackingOptionsReqMsg(
|
||||
PBLocAPIUpdateTrackingOptionsReqMsg &pbLocApiUpdtTrackOpt) const {
|
||||
// PBLocationOptions locOptions = 1;
|
||||
pbLocApiUpdtTrackOpt.clear_locoptions();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPICollectiveRespMsg(PBLocAPICollectiveRespMsg &pbLocApiCollctvRspMsg)
|
||||
const {
|
||||
// PBCollectiveResPayload - repeated PBGeofenceResponse resp = 1;
|
||||
PBCollectiveResPayload cllctResPayld = pbLocApiCollctvRspMsg.collectiveres();
|
||||
cllctResPayld.clear_resp();
|
||||
|
||||
// PBCollectiveResPayload collectiveRes = 1;
|
||||
pbLocApiCollctvRspMsg.clear_collectiveres();
|
||||
}
|
||||
|
||||
void freeUpPBLocAPIAddGeofencesReqMsg(PBLocAPIAddGeofencesReqMsg &pbLocApiAddGfReqMsg)
|
||||
const {
|
||||
// PBGeofencePayload - PBGeofenceOption gfOption = 2;
|
||||
// PBGeofencePayload - PBGeofenceInfo gfInfo = 3;
|
||||
// PBGeofencesAddedReqPayload - repeated PBGeofencePayload gfPayload = 1;
|
||||
PBGeofencesAddedReqPayload gfAddReqPload = pbLocApiAddGfReqMsg.geofences();
|
||||
uint32_t gfCount = gfAddReqPload.gfpayload_size();
|
||||
for (uint32_t i=0; i < gfCount; i++) {
|
||||
PBGeofencePayload pbGfPayload = gfAddReqPload.gfpayload(i);
|
||||
pbGfPayload.clear_gfoption();
|
||||
pbGfPayload.clear_gfinfo();
|
||||
}
|
||||
gfAddReqPload.clear_gfpayload();
|
||||
|
||||
// PBGeofencesAddedReqPayload geofences = 1;
|
||||
pbLocApiAddGfReqMsg.clear_geofences();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIRemoveGeofencesReqMsg(PBLocAPIRemoveGeofencesReqMsg &pbLocApiRemGf)
|
||||
const {
|
||||
// PBGeofencesReqClientIdPayload gfClientIds = 1;
|
||||
pbLocApiRemGf.clear_gfclientids();
|
||||
}
|
||||
|
||||
void freeUpPBLocAPIModifyGeofencesReqMsg(PBLocAPIModifyGeofencesReqMsg &pbLocApiModGf)
|
||||
const {
|
||||
// PBGeofencePayload - PBGeofenceOption gfOption = 2;
|
||||
// PBGeofencePayload - PBGeofenceInfo gfInfo = 3;
|
||||
// PBGeofencesAddedReqPayload - repeated PBGeofencePayload gfPayload = 1;
|
||||
PBGeofencesAddedReqPayload gfModReqPload = pbLocApiModGf.geofences();
|
||||
uint32_t gfCount = gfModReqPload.gfpayload_size();
|
||||
for (uint32_t i=0; i < gfCount; i++) {
|
||||
PBGeofencePayload pbGfPayload = gfModReqPload.gfpayload(i);
|
||||
pbGfPayload.clear_gfoption();
|
||||
pbGfPayload.clear_gfinfo();
|
||||
}
|
||||
gfModReqPload.clear_gfpayload();
|
||||
|
||||
// PBGeofencesAddedReqPayload geofences = 1;
|
||||
pbLocApiModGf.clear_geofences();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIPauseGeofencesReqMsg(PBLocAPIPauseGeofencesReqMsg &pbLocApiPauseGf)
|
||||
const {
|
||||
// PBGeofencesReqClientIdPayload gfClientIds = 1;
|
||||
pbLocApiPauseGf.clear_gfclientids();
|
||||
}
|
||||
inline void freeUpPBLocAPIResumeGeofencesReqMsg(PBLocAPIResumeGeofencesReqMsg
|
||||
&pbLocApiResumeGf) const {
|
||||
// PBGeofencesReqClientIdPayload gfClientIds = 1;
|
||||
pbLocApiResumeGf.clear_gfclientids();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPILocationIndMsg(PBLocAPILocationIndMsg &pbLocApiLocInd) const {
|
||||
// PBLocation locationNotification = 1;
|
||||
pbLocApiLocInd.clear_locationnotification();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIBatchingIndMsg(PBLocAPIBatchingIndMsg &pbLocApiBatchInd) const {
|
||||
// PBLocAPIBatchNotification - repeated PBLocation location = 2;
|
||||
PBLocAPIBatchNotification batchNotif = pbLocApiBatchInd.batchnotification();
|
||||
batchNotif.clear_location();
|
||||
|
||||
// PBLocAPIBatchNotification batchNotification = 1;
|
||||
pbLocApiBatchInd.clear_batchnotification();
|
||||
}
|
||||
inline void freeUpPBLocAPIGeofenceBreachIndMsg(PBLocAPIGeofenceBreachIndMsg &pbLocApiGfBreach)
|
||||
const {
|
||||
// PBLocAPIGeofenceBreachNotification - PBLocation location = 3;
|
||||
PBLocAPIGeofenceBreachNotification gfBreachNotif = pbLocApiGfBreach.gfbreachnotification();
|
||||
gfBreachNotif.clear_location();
|
||||
|
||||
// PBLocAPIGeofenceBreachNotification gfBreachNotification = 1;
|
||||
pbLocApiGfBreach.clear_gfbreachnotification();
|
||||
}
|
||||
|
||||
void freeUpPBLocAPILocationInfoIndMsg(PBLocAPILocationInfoIndMsg &pbLocApiLocInfoInd)
|
||||
const {
|
||||
PBGnssLocationInfoNotification gnssLocInfoNotif =
|
||||
pbLocApiLocInfoInd.gnsslocationinfonotification();
|
||||
freeUpPBGnssLocationInfoNotification(gnssLocInfoNotif);
|
||||
|
||||
// PBGnssLocationInfoNotification gnssLocationInfoNotification = 1;
|
||||
pbLocApiLocInfoInd.clear_gnsslocationinfonotification();
|
||||
}
|
||||
|
||||
void freeUpPBLocAPIEngineLocationsInfoIndMsg(PBLocAPIEngineLocationsInfoIndMsg
|
||||
&pbLocApiEngLocInfo) const {
|
||||
uint32_t numEngLocInfo = pbLocApiEngLocInfo.enginelocationsinfo_size();
|
||||
for (uint32_t i=0; i < numEngLocInfo; i++) {
|
||||
PBGnssLocationInfoNotification gnssLocInfoNotif =
|
||||
pbLocApiEngLocInfo.enginelocationsinfo(i);
|
||||
freeUpPBGnssLocationInfoNotification(gnssLocInfoNotif);
|
||||
}
|
||||
|
||||
// repeated PBGnssLocationInfoNotification engineLocationsInfo = 1;
|
||||
pbLocApiEngLocInfo.clear_enginelocationsinfo();
|
||||
}
|
||||
|
||||
void freeUpPBGnssLocationInfoNotification(PBGnssLocationInfoNotification &gnssLocInfoNotif)
|
||||
const {
|
||||
// PBLocApiSystemTimeStructUnion -
|
||||
// - PBLocApiGnssSystemTimeStructType or
|
||||
// - PBLocApiGnssGloTimeStructType
|
||||
// PBLocApiGnssSystemTime - PBLocApiSystemTimeStructUnion u = 2;
|
||||
// PBGnssLocationInfoNotification - PBLocation location = 1;
|
||||
// PBGnssLocationInfoNotification - PBGnssLocationSvUsedInPosition svUsedInPosition = 24;
|
||||
// PBGnssLocationInfoNotification - PBLocApiGnssLocationPositionDynamics bodyFrameData = 26;
|
||||
// PBGnssLocationInfoNotification - PBLocApiGnssSystemTime gnssSystemTime = 27;
|
||||
// PBGnssLocationInfoNotification - repeated PBGnssMeasUsageInfo measUsageInfo = 29;
|
||||
// PBGnssLocationInfoNotification - PBLLAInfo llaVRPBased = 37;
|
||||
// PBGnssLocationInfoNotification - repeated float enuVelocityVRPBased = 38;
|
||||
PBLocApiGnssSystemTime gnssSysTime = gnssLocInfoNotif.gnsssystemtime();
|
||||
PBLocApiSystemTimeStructUnion sysTimeStrctUnion = gnssSysTime.u();
|
||||
switch (gnssSysTime.gnsssystemtimesrc()) {
|
||||
case PB_GNSS_LOC_SV_SYSTEM_GPS:
|
||||
// PBLocApiGnssSystemTimeStructType gpsSystemTime = 1;
|
||||
sysTimeStrctUnion.clear_gpssystemtime();
|
||||
break;
|
||||
case PB_GNSS_LOC_SV_SYSTEM_GALILEO:
|
||||
// PBLocApiGnssSystemTimeStructType galSystemTime = 2;
|
||||
sysTimeStrctUnion.clear_galsystemtime();
|
||||
break;
|
||||
case PB_GNSS_LOC_SV_SYSTEM_BDS:
|
||||
// PBLocApiGnssSystemTimeStructType bdsSystemTime = 3;
|
||||
sysTimeStrctUnion.clear_bdssystemtime();
|
||||
break;
|
||||
case PB_GNSS_LOC_SV_SYSTEM_QZSS:
|
||||
// PBLocApiGnssSystemTimeStructType qzssSystemTime = 4;
|
||||
sysTimeStrctUnion.clear_qzsssystemtime();
|
||||
break;
|
||||
case PB_GNSS_LOC_SV_SYSTEM_GLONASS:
|
||||
// PBLocApiGnssGloTimeStructType gloSystemTime = 5;
|
||||
sysTimeStrctUnion.clear_glosystemtime();
|
||||
break;
|
||||
case PB_GNSS_LOC_SV_SYSTEM_NAVIC:
|
||||
// PBLocApiGnssSystemTimeStructType navicSystemTime = 6;
|
||||
sysTimeStrctUnion.clear_navicsystemtime();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
gnssSysTime.clear_u();
|
||||
gnssLocInfoNotif.clear_location();
|
||||
gnssLocInfoNotif.clear_svusedinposition();
|
||||
gnssLocInfoNotif.clear_bodyframedata();
|
||||
gnssLocInfoNotif.clear_gnsssystemtime();
|
||||
gnssLocInfoNotif.clear_measusageinfo();
|
||||
gnssLocInfoNotif.clear_llavrpbased();
|
||||
gnssLocInfoNotif.clear_enuvelocityvrpbased();
|
||||
return;
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPISatelliteVehicleIndMsg(PBLocAPISatelliteVehicleIndMsg
|
||||
&pbLocApiSatVehInd) const {
|
||||
// PBLocApiGnssSvNotification - repeated PBLocApiGnssSv gnssSvs = 2;
|
||||
PBLocApiGnssSvNotification pbGnssSvNotif = pbLocApiSatVehInd.gnsssvnotification();
|
||||
pbGnssSvNotif.clear_gnsssvs();
|
||||
|
||||
// PBLocApiGnssSvNotification gnssSvNotification = 1;
|
||||
pbLocApiSatVehInd.clear_gnsssvnotification();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPINmeaIndMsg(PBLocAPINmeaIndMsg &pbLocApiNmeaInd) const {
|
||||
// PBLocAPINmeaSerializedPayload - string nmea = 2;
|
||||
PBLocAPINmeaSerializedPayload nmeaSerPayLoad = pbLocApiNmeaInd.gnssnmeanotification();
|
||||
nmeaSerPayLoad.clear_nmea();
|
||||
|
||||
// PBLocAPINmeaSerializedPayload gnssNmeaNotification = 1;
|
||||
pbLocApiNmeaInd.clear_gnssnmeanotification();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIDataIndMsg(PBLocAPIDataIndMsg &pbLocApiDataInd) const {
|
||||
// PBGnssDataNotification - repeated uint64 gnssDataMask = 2;
|
||||
// PBGnssDataNotification - repeated double jammerInd = 3;
|
||||
// PBGnssDataNotification - repeated double agc = 4;
|
||||
PBGnssDataNotification gnssDataNotif = pbLocApiDataInd.gnssdatanotification();
|
||||
gnssDataNotif.clear_gnssdatamask();
|
||||
gnssDataNotif.clear_jammerind();
|
||||
gnssDataNotif.clear_agc();
|
||||
|
||||
// PBGnssDataNotification gnssDataNotification = 1;
|
||||
pbLocApiDataInd.clear_gnssdatanotification();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIMeasIndMsg(PBLocAPIMeasIndMsg &pbLocApiMeasInd) const {
|
||||
// PBGnssMeasurementsNotification - repeated PBGnssMeasurementsData measurements = 1;
|
||||
// PBGnssMeasurementsNotification - PBGnssMeasurementsClock clock = 2;
|
||||
PBGnssMeasurementsNotification gnssMeasNotif =
|
||||
pbLocApiMeasInd.gnssmeasurementsnotification();
|
||||
gnssMeasNotif.clear_measurements();
|
||||
gnssMeasNotif.clear_clock();
|
||||
|
||||
// PBGnssMeasurementsNotification gnssMeasurementsNotification = 1;
|
||||
pbLocApiMeasInd.clear_gnssmeasurementsnotification();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPILocationSystemInfoIndMsg(PBLocAPILocationSystemInfoIndMsg
|
||||
&pbLocApiLocSysInfoInd) const {
|
||||
// PBLeapSecondChangeInfo - PBLocApiGnssSystemTimeStructType gpsTimestampLsChange = 1;
|
||||
// PBLeapSecondSystemInfo- PBLeapSecondChangeInfo leapSecondChangeInfo = 3;
|
||||
// PBLocationSystemInfo - PBLeapSecondSystemInfo leapSecondSysInfo = 2;
|
||||
PBLocationSystemInfo pbLocSysInfo = pbLocApiLocSysInfoInd.locationsysteminfo();
|
||||
PBLeapSecondSystemInfo pbLeapSecSysInfo = pbLocSysInfo.leapsecondsysinfo();
|
||||
PBLeapSecondChangeInfo pbLeapSecChgInfo = pbLeapSecSysInfo.leapsecondchangeinfo();
|
||||
pbLeapSecChgInfo.clear_gpstimestamplschange();
|
||||
pbLeapSecSysInfo.clear_leapsecondchangeinfo();
|
||||
pbLocSysInfo.clear_leapsecondsysinfo();
|
||||
|
||||
// PBLocationSystemInfo locationSystemInfo = 1;
|
||||
pbLocApiLocSysInfoInd.clear_locationsysteminfo();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConfigSvConstellationReqMsg(PBLocConfigSvConstellationReqMsg
|
||||
&pbLocConfSvConst) const {
|
||||
// PBGnssSvTypeConfig mConstellationEnablementConfig = 1;
|
||||
pbLocConfSvConst.clear_mconstellationenablementconfig();
|
||||
// PBGnssSvIdConfig mBlacklistSvConfig = 2;
|
||||
pbLocConfSvConst.clear_mblacklistsvconfig();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConConstllSecBandReqMsg(PBLocConfigConstellationSecondaryBandReqMsg
|
||||
&pbLocCfgConstlSecBandReqMsg) const {
|
||||
// PBGnssSvTypeConfig mSecondaryBandConfig = 1;
|
||||
pbLocCfgConstlSecBandReqMsg.clear_msecondarybandconfig();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConAidingDataDeletionReqMsg(PBLocConfigAidingDataDeletionReqMsg
|
||||
&pbLocConfAidDataDel) const {
|
||||
// PBAidingData mAidingData = 1;
|
||||
pbLocConfAidDataDel.clear_maidingdata();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConfigLeverArmReqMsg(PBLocConfigLeverArmReqMsg &pbLocConfLeverArm)
|
||||
const {
|
||||
// PBLIALeverArmConfigInfo - PBLIALeverArmParams gnssToVRP = 2;
|
||||
// PBLIALeverArmConfigInfo - PBLIALeverArmParams drImuToGnss = 3;
|
||||
// PBLIALeverArmConfigInfo - PBLIALeverArmParams veppImuToGnss = 4;
|
||||
PBLIALeverArmConfigInfo pbLeverArmCfInfo = pbLocConfLeverArm.mleverarmconfiginfo();
|
||||
pbLeverArmCfInfo.clear_gnsstovrp();
|
||||
pbLeverArmCfInfo.clear_drimutognss();
|
||||
pbLeverArmCfInfo.clear_veppimutognss();
|
||||
|
||||
// PBLIALeverArmConfigInfo mLeverArmConfigInfo = 1;
|
||||
pbLocConfLeverArm.clear_mleverarmconfiginfo();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConfDrEngineParamsReqMsg(PBLocConfigDrEngineParamsReqMsg
|
||||
&pbLocCfgDrEngParamReq) const {
|
||||
// PBDeadReckoningEngineConfig - PBLIABodyToSensorMountParams bodyToSensorMountParams = 2;
|
||||
PBDeadReckoningEngineConfig pbDrEngineCfg = pbLocCfgDrEngParamReq.mdreconfig();
|
||||
pbDrEngineCfg.clear_bodytosensormountparams();
|
||||
|
||||
// PBDeadReckoningEngineConfig mDreConfig = 1;
|
||||
pbLocCfgDrEngParamReq.clear_mdreconfig();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConGetRbstLocCfgRespMsg(PBLocConfigGetRobustLocationConfigRespMsg
|
||||
&pbLocConfGetRobustLocConfg) const {
|
||||
// PBGnssConfigRobustLocation - PBGnssConfigRobustLocationVersion version = 4;
|
||||
PBGnssConfigRobustLocation pbGnssCfgRbstLoc =
|
||||
pbLocConfGetRobustLocConfg.mrobustloationconfig();
|
||||
pbGnssCfgRbstLoc.clear_version();
|
||||
|
||||
// PBGnssConfigRobustLocation mRobustLoationConfig = 1;
|
||||
pbLocConfGetRobustLocConfg.clear_mrobustloationconfig();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocConfGetConstllSecBandCfgRespMsg(
|
||||
PBLocConfigGetConstltnSecondaryBandConfigRespMsg &pbLocCfgGetConstlSecBandRespMsg)
|
||||
const {
|
||||
// PBGnssSvTypeConfig mSecondaryBandConfig = 1;
|
||||
pbLocCfgGetConstlSecBandRespMsg.clear_msecondarybandconfig();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIPingTestReqMsg(PBLocAPIPingTestReqMsg &pbLocApiPingTest) const {
|
||||
// repeated uint32 data = 2;
|
||||
pbLocApiPingTest.clear_data();
|
||||
}
|
||||
|
||||
inline void freeUpPBLocAPIPingTestIndMsg(PBLocAPIPingTestIndMsg &pbLocApiPingTestIndMsg)
|
||||
const {
|
||||
// repeated uint32 data = 1;
|
||||
pbLocApiPingTestIndMsg.clear_data();
|
||||
}
|
||||
|
||||
// **** helper function to convert from protobuf struct to normal struct.
|
||||
// PBCollectiveResPayload to CollectiveResPayload
|
||||
int pbConvertToCollectiveResPayload(const PBCollectiveResPayload &pbClctResPayload,
|
||||
CollectiveResPayload &clctResPayload) const;
|
||||
// PBLocationOptions to LocationOptions
|
||||
int pbConvertToLocationOptions(const PBLocationOptions &pbLocOpt,
|
||||
LocationOptions &locOpt) const;
|
||||
// PBGeofencesAddedReqPayload to GeofencesAddedReqPayload
|
||||
int pbConvertToGfAddReqPayload(const PBGeofencesAddedReqPayload &pbGfAddReqPload,
|
||||
GeofencesAddedReqPayload &gfAddReqPload) const;
|
||||
// PBGeofencesReqClientIdPayload to GeofencesReqClientIdPayload
|
||||
int pbConvertToGfReqClientIdPayload(const PBGeofencesReqClientIdPayload &pbGfReqClientIdPload,
|
||||
GeofencesReqClientIdPayload &gfReqClientIdPload) const;
|
||||
// PBLocAPIBatchNotification to LocAPIBatchNotification
|
||||
int pbConvertToLocAPIBatchNotification(const PBLocAPIBatchNotification &pbLocBatchNotif,
|
||||
LocAPIBatchNotification &locBatchNotif) const;
|
||||
// PBLocAPIGeofenceBreachNotification to LocAPIGeofenceBreachNotification
|
||||
int pbConvertToLocAPIGfBreachNotification(
|
||||
const PBLocAPIGeofenceBreachNotification &pbLocApiGfBreachNotif,
|
||||
LocAPIGeofenceBreachNotification &locApiGfBreachNotif) const;
|
||||
// PBGnssLocationInfoNotification to GnssLocationInfoNotification
|
||||
int pbConvertToGnssLocInfoNotif(const PBGnssLocationInfoNotification &pbGnssLocInfoNotif,
|
||||
GnssLocationInfoNotification &gnssLocInfoNotif) const;
|
||||
// PBLocApiGnssSvNotification to GnssSvNotification
|
||||
int pbConvertToGnssSvNotif(const PBLocApiGnssSvNotification &pbGnssSvNotif,
|
||||
GnssSvNotification &gnssSvNotif) const;
|
||||
// PBLocAPINmeaSerializedPayload to LocAPINmeaSerializedPayload
|
||||
int pbConvertToLocAPINmeaSerializedPayload(
|
||||
const PBLocAPINmeaSerializedPayload &pbLocApiNmeaSerPayload,
|
||||
LocAPINmeaSerializedPayload &locApiNmeaSerPayload) const;
|
||||
// PBGnssDataNotification to GnssDataNotification
|
||||
int pbConvertToGnssDataNotification(const PBGnssDataNotification &pbGnssDataNotif,
|
||||
GnssDataNotification &gnssDataNotif) const;
|
||||
// PBGnssMeasurementsNotification to GnssMeasurementsNotification
|
||||
int pbConvertToGnssMeasNotification(const PBGnssMeasurementsNotification &pbGnssMeasNotif,
|
||||
GnssMeasurementsNotification &gnssMeasNotif) const;
|
||||
// PBLocation to Location
|
||||
int pbConvertToLocation(const PBLocation &pbLoc, Location &loc) const;
|
||||
// PBLocationSystemInfo to LocationSystemInfo
|
||||
int pbConvertToLocationSystemInfo(const PBLocationSystemInfo &pbLocSysInfo,
|
||||
LocationSystemInfo &locSysInfo) const;
|
||||
// PBGnssSvTypeConfig to GnssSvTypeConfig
|
||||
int pbConvertToGnssSvTypeConfig(const PBGnssSvTypeConfig &pbGnssSvTypeConfig,
|
||||
GnssSvTypeConfig &gnssSvTypeConfig) const;
|
||||
// PBGnssSvIdConfig to GnssSvIdConfig
|
||||
int pbConvertToGnssSvIdConfig(const PBGnssSvIdConfig &pbGnssSvIdConfig,
|
||||
GnssSvIdConfig &gnssSvIdConfig) const;
|
||||
// PBAidingData to GnssAidingData
|
||||
int pbConvertToGnssAidingData(const PBAidingData &pbGnssAidData,
|
||||
GnssAidingData &gnssAidData) const;
|
||||
// PBLIALeverArmConfigInfo to LeverArmConfigInfo
|
||||
int pbConvertToLeverArmConfigInfo(const PBLIALeverArmConfigInfo &pbLeverArmCfgInfo,
|
||||
LeverArmConfigInfo &leverArmCfgInfo) const;
|
||||
// PBDeadReckoningEngineConfig to DeadReckoningEngineConfig
|
||||
int pbConvertToDeadReckoningEngineConfig(const PBDeadReckoningEngineConfig &pbDrEngConfig,
|
||||
DeadReckoningEngineConfig &drEngConfig) const;
|
||||
// PBGnssConfigRobustLocation to GnssConfigRobustLocation
|
||||
int pbConvertToGnssConfigRobustLocation(const PBGnssConfigRobustLocation &pbGnssCfgRobLoc,
|
||||
GnssConfigRobustLocation &gnssCfgRobLoc) const;
|
||||
|
||||
// MASK CONVERSION
|
||||
// ***************
|
||||
// **** helper function for mask conversion to protobuf masks
|
||||
// LocationCallbacksMask to PBLocationCallbacksMask
|
||||
uint32_t getPBMaskForLocationCallbacksMask(const uint32_t &locCbMask) const;
|
||||
// LocationCapabilitiesMask to PBLocationCapabilitiesMask
|
||||
uint64_t getPBMaskForLocationCapabilitiesMask(const uint64_t &locCapabMask) const;
|
||||
|
||||
// **** helper function for mask conversion from protobuf masks to normal rigid values
|
||||
// PBLocationCapabilitiesMask to LocationCapabilitiesMask
|
||||
uint64_t getLocationCapabilitiesMaskFromPB(const uint64_t &pbLocCapabMask) const;
|
||||
// PBLocationCallbacksMask to LocationCallbacksMask
|
||||
uint32_t getLocationCallbacksMaskFromPB(const uint32_t &pbLocCbMask) const;
|
||||
|
||||
// ENUM CONVERSION
|
||||
// **** helper function for enum conversion from protobuf enums to normal format.
|
||||
ELocMsgID getEnumForPBELocMsgID(const PBELocMsgID &pbLocMsgId) const;
|
||||
ClientType getEnumForPBClientType(const PBClientType &pbClntTyp) const;
|
||||
LocationError getEnumForPBLocationError(const PBLocationError &pbLocErr) const;
|
||||
BatchingMode getEnumForPBBatchingMode(const PBBatchingMode &pbBatchMode) const;
|
||||
|
||||
// PositioningEngineMask to/from PB PositioningEngineMask
|
||||
uint32_t getPBMaskForPositioningEngineMask(const uint32_t &posEngMask) const;
|
||||
uint32_t getEnumForPBPositioningEngineMask(const uint32_t &pbPosEngMask) const;
|
||||
|
||||
// LocEngineRunState to/from PB LocEngineRunState
|
||||
LocEngineRunState getEnumForPBLocEngineRunState
|
||||
(const PBLocEngineRunState &pbLocEngRunState) const;
|
||||
uint32_t getPBEnumForLocEngineRunState(const LocEngineRunState& locEngineRunState) const;
|
||||
|
||||
// LocEngineRunState to/from PB LocEngineRunState
|
||||
uint32_t getTerrestrialTechMaskFromPB(const uint32_t &pbTerrestrialTechMask) const;
|
||||
uint32_t getPBMaskForTerrestrialTechMask(const uint32_t& terrestrialTechMask) const;
|
||||
|
||||
// **** helper function for enum conversion from normal format to protobuf enums.
|
||||
PBBatchingMode getPBEnumForBatchingMode(const BatchingMode &batchMode) const;
|
||||
PBLocationError getPBEnumForLocationError(const LocationError &locErr) const;
|
||||
PBELocMsgID getPBEnumForELocMsgID(const ELocMsgID &eLocMsgId) const;
|
||||
PBClientType getPBEnumForClientType(const ClientType &clientTyp) const;
|
||||
|
||||
private:
|
||||
bool mPbDebugLogEnabled;
|
||||
bool mPbVerboseLogEnabled;
|
||||
|
||||
// RIGID TO PROTOBUF FORMAT
|
||||
// ************************
|
||||
// **** helper function for structure conversion to protobuf format
|
||||
// LeverArmParams to PBLIALeverArmParams
|
||||
int convertLeverArmParamsToPB(const LeverArmParams &leverArmParams,
|
||||
PBLIALeverArmParams *pbLeverArmParams) const;
|
||||
// LeapSecondSystemInfo to PBLeapSecondSystemInfo
|
||||
int convertLeapSecondSystemInfoToPB(const LeapSecondSystemInfo &leapSecSysInfo,
|
||||
PBLeapSecondSystemInfo *pbLeapSecSysInfo) const;
|
||||
// LeapSecondChangeInfo to PBLeapSecondChangeInfo
|
||||
int convertLeapSecChgInfoToPB(const LeapSecondChangeInfo &leapSecChngInfo,
|
||||
PBLeapSecondChangeInfo *pbLeapSecChngInfo) const;
|
||||
// GnssSystemTimeStructType to PBLocApiGnssSystemTimeStructType
|
||||
int convertGnssSystemTimeStructTypeToPB(const GnssSystemTimeStructType &gnssSysTimeStructType,
|
||||
PBLocApiGnssSystemTimeStructType *pbGnssSysTimeStructType) const;
|
||||
// GnssGloTimeStructType to PBLocApiGnssGloTimeStructType
|
||||
int convertGnssGloTimeStructTypeToPB(const GnssGloTimeStructType &gnssGloTime,
|
||||
PBLocApiGnssGloTimeStructType *pbgnssGloTime) const;
|
||||
// GnssMeasurementsData to PBGnssMeasurementsData
|
||||
int convertGnssMeasDataToPB(const GnssMeasurementsData &gnssMeasData,
|
||||
PBGnssMeasurementsData *pbGnssMeasData) const;
|
||||
// GnssMeasurementsClock to PBGnssMeasurementsClock
|
||||
int convertGnssMeasClockToPB(const GnssMeasurementsClock &gnssMeasClock,
|
||||
PBGnssMeasurementsClock *pbGnssMeasClock) const;
|
||||
// GnssSv to PBLocApiGnssSv
|
||||
int convertGnssSvToPB(const GnssSv &gnssSv, PBLocApiGnssSv *pbGnssSv) const;
|
||||
// GnssLocationSvUsedInPosition to PBGnssLocationSvUsedInPosition
|
||||
int convertGnssLocSvUsedInPosToPB(const GnssLocationSvUsedInPosition &gnssLocSvUsedInPos,
|
||||
PBGnssLocationSvUsedInPosition *pbGnssLocSvUsedInPos) const;
|
||||
// GnssSystemTime to PBLocApiGnssSystemTime
|
||||
int convertGnssSystemTimeToPB(const GnssSystemTime &gnssSysTime,
|
||||
PBLocApiGnssSystemTime *pbGnssSysTime) const;
|
||||
// GnssLocationPositionDynamics & GnssLocationPositionDynamicsExt to
|
||||
// PBLocApiGnssLocationPositionDynamics
|
||||
int convertGnssLocationPositionDynamicsToPB(
|
||||
const GnssLocationPositionDynamics &gnssLocPosDyn,
|
||||
const GnssLocationPositionDynamicsExt &gnssLocPosDynExt,
|
||||
PBLocApiGnssLocationPositionDynamics *pbGnssLocPosDyn) const;
|
||||
// LLAInfo to PBLLAInfo
|
||||
int convertLLAInfoToPB(const LLAInfo &llaInfo, PBLLAInfo *pbLlaInfo) const;
|
||||
// GnssMeasUsageInfo to PBGnssMeasUsageInfo
|
||||
int convertGnssMeasUsageInfoToPB(const GnssMeasUsageInfo &gnssMeasUsageInfo,
|
||||
PBGnssMeasUsageInfo *pbGnssMeasUsageInfo) const;
|
||||
// SystemTimeStructUnion to PBLocApiSystemTimeStructUnion
|
||||
int convertSystemTimeStructUnionToPB(const Gnss_LocSvSystemEnumType &gnssLocSvSysEnumType,
|
||||
const SystemTimeStructUnion &sysTimeStructUnion,
|
||||
PBLocApiSystemTimeStructUnion *pbSysTimeStructUnion) const;
|
||||
// GeofenceInfo to PBGeofenceInfo
|
||||
int convertGeofenceInfoToPB(const GeofenceInfo &gfInfo, PBGeofenceInfo *pbGfInfo) const;
|
||||
// GeofenceOption to PBGeofenceOption
|
||||
int convertGeofenceOptionToPB(const GeofenceOption &gfOpt, PBGeofenceOption *pbGfOpt) const;
|
||||
// BodyToSensorMountParams to PBLIABodyToSensorMountParams
|
||||
int convertBodyToSensorMountParamsToPB(const BodyToSensorMountParams &bodyToSensorMntParams,
|
||||
PBLIABodyToSensorMountParams *pbBodyToSensorMntParams) const;
|
||||
|
||||
// **** helper function for mask conversion to protobuf masks
|
||||
// LeverArmTypeMask to PBLIALeverArmTypeMask
|
||||
uint32_t getPBMaskForLeverArmTypeMask(const uint32_t &leverArmTypeMask) const;
|
||||
// LocReqEngineTypeMask to PBLocReqEngineTypeMask
|
||||
uint32_t getPBMaskForLocReqEngineTypeMask(const uint32_t &locReqEngTypeMask) const;
|
||||
// GnssConfigRobustLocationValidMask to PBGnssConfigRobustLocationValidMask
|
||||
uint32_t getPBMaskForGnssCfgRobustLocValidMask(
|
||||
const uint32_t &gnssCfgRobustLocValidMask) const;
|
||||
// LocationSystemInfoMask to PBLocationSystemInfoMask
|
||||
uint32_t getPBMaskForLocSysInfoMask(const uint32_t &locSysInfoMask) const;
|
||||
// GnssDataMask to PBGnssDataMask
|
||||
uint64_t getPBMaskForGnssDataMask(const uint64_t &gnssDataMask) const;
|
||||
// GnssAidingDataSvMask to PBLocApiGnssAidingDataSvMask
|
||||
uint32_t getPBMaskForGnssAidingDataSvMask(const uint32_t &gnssAidDataSvMask) const;
|
||||
// LeapSecondSysInfoMask to PBLeapSecondSysInfoMask
|
||||
uint32_t getPBMaskForLeapSecondSysInfoMask(const uint32_t &leapSecSysInfoMask) const;
|
||||
// GnssSystemTimeStructTypeFlags to PBGnssSystemTimeStructTypeFlag
|
||||
uint32_t getPBMaskForGnssSystemTimeStructTypeFlags(
|
||||
const uint32_t &gnssSysTimeStructTypeFlg) const;
|
||||
// LocationFlagsMask to PBLocationFlagsMask
|
||||
uint32_t getPBMaskForLocationFlagsMask(const uint32_t &locFlagsMask) const;
|
||||
// LocationTechnologyMask to PBLocationTechnologyMask
|
||||
uint32_t getPBMaskForLocationTechnologyMask(const uint32_t &locTechMask) const;
|
||||
// GnssLocationInfoFlagMask (lower 32 bits) to PBGnssLocationInfoFlagMask
|
||||
uint32_t getPBMaskForGnssLocationInfoFlagMask(const uint64_t &gnssLocInfoFlagMask) const;
|
||||
// GnssLocationInfoFlagMask (upper 32 bits) to PBGnssLocationInfoExtFlagMask
|
||||
uint32_t getPBMaskForGnssLocationInfoExtFlagMask(const uint64_t &gnssLocInfoFlagMask) const;
|
||||
// GnssLocationNavSolutionMask to PBGnssLocationNavSolutionMask
|
||||
uint32_t getPBMaskForGnssLocationNavSolutionMask(const uint32_t &gnssLocNavSolnMask) const;
|
||||
// DrCalibrationStatusMask to PBLocApiDrCalibrationStatusMask
|
||||
uint32_t getPBMaskForDrCalibrationStatusMask(const uint32_t &drCalibStatusMask) const;
|
||||
// GnssMeasurementsDataFlagsMask to PBGnssMeasurementsDataFlagsMask
|
||||
uint32_t getPBMaskForGnssMeasurementsDataFlagsMask(
|
||||
const uint32_t &gnssMeasDataFlagsMask) const;
|
||||
// GnssMeasurementsStateMask to PBGnssMeasurementsStateMask
|
||||
uint32_t getPBMaskForGnssMeasurementsStateMask(const uint32_t &gnssMeasStateMask) const;
|
||||
// GnssMeasurementsAdrStateMask to PBGnssMeasurementsAdrStateMask
|
||||
uint32_t getPBMaskForGnssMeasurementsAdrStateMask(const uint32_t &gnssMeasAdrStateMask) const;
|
||||
// GnssLocationPosDataMask/GnssLocationPosDataMaskExt to PBLocApiGnssLocationPosDataMask
|
||||
uint32_t getPBMaskForGnssLocationPosDataMask(const uint32_t &gnssLocPosDataMask,
|
||||
const uint32_t &gnssLocPosDataMaskExt) const;
|
||||
// GnssMeasurementsClockFlagsMask to PBGnssMeasurementsClockFlagsMask
|
||||
uint32_t getPBMaskForGnssMeasurementsClockFlagsMask(
|
||||
const uint32_t &gnssMeasClockFlagsMask) const;
|
||||
// GnssGloTimeStructTypeFlags to PBGnssGloTimeStructTypeFlags
|
||||
uint32_t getPBMaskForGnssGloTimeStructTypeFlags(
|
||||
const uint32_t &gnssGloTimeStructTypeFlags) const;
|
||||
// GnssSvOptionsMask to PBLocApiGnssSvOptionsMask
|
||||
uint32_t getPBMaskForGnssSvOptionsMask(const uint32_t &gnssSvOptMask) const;
|
||||
// GnssSignalTypeMask to PBGnssSignalTypeMask
|
||||
uint32_t getPBMaskForGnssSignalTypeMask(const uint32_t &gnssSignalTypeMask) const;
|
||||
// GeofenceBreachTypeMask to PBGeofenceBreachTypeMask
|
||||
uint32_t getPBMaskForGeofenceBreachTypeMask(const uint32_t &gfBreachTypeMask) const;
|
||||
// DeadReckoningEngineConfigValidMask to PBDeadReckoningEngineConfigValidMask
|
||||
uint64_t getPBMaskForDeadReckoningEngineConfigValidMask(
|
||||
const uint64_t &drEngCfgValidMask) const;
|
||||
// DrEngineAidingDataMask to PBDrEngineAidingDataMask
|
||||
uint32_t getPBMaskForDrEngineAidingDataMask(const uint32_t &drEngAidDataMask) const;
|
||||
// DrSolutionStatusMask to PBDrSolutionStatusMask
|
||||
uint32_t getPBMaskForDrSolutionStatusMask(const uint32_t &drSolnStatusMask) const;
|
||||
|
||||
// **** helper function for enum conversion to protobuf enums
|
||||
PBGnssSuplMode getPBEnumForGnssSuplMode(const GnssSuplMode &gnssSuplMode) const;
|
||||
PBBatchingStatus getPBEnumForBatchingStatus(const BatchingStatus &batchStatus) const;
|
||||
PBLocationReliability getPBEnumForLocationReliability(
|
||||
const LocationReliability &locReliab) const;
|
||||
PBLocApiOutputEngineType getPBEnumForLocOutputEngineType(
|
||||
const LocOutputEngineType &locOpEng) const;
|
||||
PBGnssMeasurementsMultipathIndicator getPBEnumForGnssMeasMultiPathIndic(
|
||||
const GnssMeasurementsMultipathIndicator &gnssMeasMultiPathIndic) const;
|
||||
PBLocApiGnss_LocSvSystemEnumType getPBEnumForGnssLocSvSystem(
|
||||
const Gnss_LocSvSystemEnumType &gnssLocSvSysEnumType) const;
|
||||
// PBLocationSessionStatus from/to loc_sess_status
|
||||
PBLocationSessionStatus getPBEnumForLocSessionStatus(const loc_sess_status &status) const;
|
||||
|
||||
// ** Special enum conversion
|
||||
// GnssSvType to PBLocApiGnss_LocSvSystemEnumType
|
||||
PBLocApiGnss_LocSvSystemEnumType getPBGnssLocSvSysEnumFromGnssSvType(
|
||||
const GnssSvType &gnssSvType) const;
|
||||
|
||||
// PROTOBUF TO LOCAL FORMAT
|
||||
// ************************
|
||||
// **** helper function for mask conversion from protobuf masks to normal rigid values
|
||||
// PBLIALeverArmTypeMask to LeverArmTypeMask
|
||||
uint32_t getLeverArmTypeMaskFromPB(const uint32_t &pbLeverTypeMask) const;
|
||||
// PBGnssSvTypesMask to GnssSvTypesMask
|
||||
uint64_t getGnssSvTypesMaskFromPB(const uint64_t &pbGnssSvTypesMask) const;
|
||||
// PBLocApiGnssAidingDataSvMask to GnssAidingDataSvMask
|
||||
uint32_t getGnssAidingDataSvMaskFromPB(const uint32_t &pbGnssAidDataSvMask) const;
|
||||
// PBLocReqEngineTypeMask to LocReqEngineTypeMask
|
||||
uint32_t getLocReqEngineTypeMaskFromPB(const uint32_t &pbLocReqEngTypeMask) const;
|
||||
// PBLocationSystemInfoMask to LocationSystemInfoMask
|
||||
uint32_t getLocationSystemInfoMaskFromPB(const uint32_t &pbLocSysInfoMask) const;
|
||||
// PBGnssDataMask to GnssDataMask
|
||||
uint64_t getGnssDataMaskFromPB(const uint64_t &pbGnssDataMask) const;
|
||||
// PBLeapSecondSysInfoMask to LeapSecondSysInfoMask
|
||||
uint32_t getLeapSecSysInfoMaskFromPB(const uint32_t &pbLeapSecSysInfoMask) const;
|
||||
// PBLocApiGnssSystemTimeStructTypeFlags to GnssSystemTimeStructTypeFlags
|
||||
uint32_t getGnssSystemTimeStructTypeFlagsFromPB(const uint32_t &pbGnssSysTimeStrctType) const;
|
||||
// PBGnssSignalTypeMask to GnssSignalTypeMask
|
||||
uint32_t getGnssSignalTypeMaskFromPB(const uint32_t &pbGnssSignalTypeMask) const;
|
||||
// PBLocApiGnssSvOptionsMask to GnssSvOptionsMask
|
||||
uint32_t getGnssSvOptionsMaskFromPB(const uint32_t &pbGnssSvOptMask) const;
|
||||
// PBGeofenceBreachTypeMask to GeofenceBreachTypeMask
|
||||
uint32_t getGfBreachTypeMaskFromPB(const uint32_t &pbGfBreackTypMask) const;
|
||||
// PBLocationFlagsMask to LocationFlagsMask
|
||||
uint32_t getLocationFlagsMaskFromPB(const uint32_t &pbLocFlagsMask) const;
|
||||
// PBLocationTechnologyMask to LocationTechnologyMask
|
||||
uint32_t getLocationTechnologyMaskFromPB(const uint32_t &pbLocTechMask) const;
|
||||
// PBGnssMeasurementsClockFlagsMask to GnssMeasurementsClockFlagsMask
|
||||
uint32_t getGnssMeasurementsClockFlagsMaskFromPB(const uint32_t &pbGnssMeasClockFlgMask) const;
|
||||
// PBGnssMeasurementsDataFlagsMask to GnssMeasurementsDataFlagsMask
|
||||
uint32_t getGnssMeasurementsDataFlagsMaskFromPB(const uint32_t &pbGnssMeasDataFlgMask) const;
|
||||
// PBGnssMeasurementsAdrStateMask to GnssMeasurementsAdrStateMask
|
||||
uint32_t getGnssMeasurementsAdrStateMaskFromPB(const uint32_t &pbGnssMeasAdrStateMask) const;
|
||||
// PBGnssLocationInfoFlagMask to GnssLocationInfoFlagMask
|
||||
uint64_t getGnssLocationInfoFlagMaskFromPB(const uint32_t &pbGnssLocInfoFlagMask,
|
||||
const uint32_t &pbGnssLocInfoExtFlagMask) const;
|
||||
// PBGnssLocationNavSolutionMask to GnssLocationNavSolutionMask
|
||||
uint32_t getGnssLocationNavSolutionMaskFromPB(const uint32_t &pbGnssLocNavSoln) const;
|
||||
// PBLocApiDrCalibrationStatusMask to DrCalibrationStatusMask
|
||||
uint32_t getDrCalibrationStatusMaskFromPB(const uint32_t &pbDrCalibStatus) const;
|
||||
// PBLocApiGnssLocationPosDataMask to GnssLocationPosDataMask
|
||||
uint32_t getGnssLocationPosDataMaskFromPB(const uint32_t &pbGnssLocPosDataMask) const;
|
||||
// PBLocApiGnssLocationPosDataMask to GnssLocationPosDataMaskExt
|
||||
uint32_t getGnssLocationPosDataMaskExtFromPB(const uint32_t &pbGnssLocPosDataMask) const;
|
||||
// PBGnssGloTimeStructTypeFlags to GnssGloTimeStructTypeFlags
|
||||
uint32_t getGnssGloTimeStructTypeFlagsFromPB(const uint32_t &pbGnssGloTimeStruct) const;
|
||||
// PBGnssConfigRobustLocationValidMask to GnssConfigRobustLocationValidMask
|
||||
uint32_t getGnssConfigRobustLocationValidMaskFromPB(
|
||||
const uint32_t &pbGnssCfgRobstLocValidMask) const;
|
||||
// PBDeadReckoningEngineConfigValidMask to DeadReckoningEngineConfigValidMask
|
||||
uint64_t getDeadReckoningEngineConfigValidMaskFromPB(const uint64_t &pbDrEngCfgVldMask) const;
|
||||
// PBDrEngineAidingDataMask to DrEngineAidingDataMask
|
||||
uint32_t getDrEngineAidingDataMaskFromPB(const uint32_t &pbDrEngAidDataMask) const;
|
||||
// PBDrSolutionStatusMask to DrSolutionStatusMask
|
||||
uint32_t getDrSolutionStatusMaskFromPB(const uint32_t &pbDrSolnStatusMask) const;
|
||||
|
||||
// **** helper function for enum conversion from protobuf enums to normal format.
|
||||
GnssSuplMode getEnumForPBGnssSuplMode(const PBGnssSuplMode &pbGnssSuplMode) const;
|
||||
BatchingStatus getEnumForPBBatchingStatus(const PBBatchingStatus &pbBatchStat) const;
|
||||
GnssMeasurementsMultipathIndicator getEnumForPBGnssMeasMultipathIndic(
|
||||
const PBGnssMeasurementsMultipathIndicator &pbGnssMeasMultipathIndic) const;
|
||||
LocationReliability getEnumForPBLocReliability(
|
||||
const PBLocationReliability &locReliability) const;
|
||||
Gnss_LocSvSystemEnumType getEnumForPBGnssLocSvSystem(
|
||||
const PBLocApiGnss_LocSvSystemEnumType &pbGnssLocSvSysEnumType) const;
|
||||
LocOutputEngineType getEnumForPBLocOutputEngineType(
|
||||
const PBLocApiOutputEngineType &pbLocOpEngType) const;
|
||||
loc_sess_status getLocSessionStatusFromPB(const PBLocationSessionStatus &pbStatus) const;
|
||||
|
||||
// ** Special enum conversion
|
||||
// PBLocApiGnss_LocSvSystemEnumType to GnssSvType
|
||||
GnssSvType getGnssSvTypeFromPBGnssLocSvSystemEnumType(
|
||||
const PBLocApiGnss_LocSvSystemEnumType &pbGnssLocSvSysEnum) const;
|
||||
|
||||
// **** helper function to convert from protobuf struct to normal struct.
|
||||
// PBLIALeverArmParams to LeverArmParams
|
||||
int pbConvertToLeverArmParams(const PBLIALeverArmParams &pbLeverArmParams,
|
||||
LeverArmParams &leverArmParams) const;
|
||||
// PBLeapSecondSystemInfo to LeapSecondSystemInfo
|
||||
int pbConvertToLeapSecSysInfo(const PBLeapSecondSystemInfo &pbLeapSecSysInfo,
|
||||
LeapSecondSystemInfo &leapSecSysInfo) const;
|
||||
// PBLeapSecondChangeInfo to LeapSecondChangeInfo
|
||||
int pbConvertToLeapSecChgInfo(const PBLeapSecondChangeInfo &pbLeapSecChgInfo,
|
||||
LeapSecondChangeInfo &leapSecChgInfo) const;
|
||||
// PBLocApiGnssSystemTimeStructType to GnssSystemTimeStructType
|
||||
int pbConvertToGnssSystemTimeStructType(
|
||||
const PBLocApiGnssSystemTimeStructType &pbGnssSysTimeStrct,
|
||||
GnssSystemTimeStructType &gnssSysTimeStrct) const;
|
||||
// PBGnssMeasurementsData to GnssMeasurementsData
|
||||
int pbConvertToGnssMeasurementsData(const PBGnssMeasurementsData &pbGnssMeasData,
|
||||
GnssMeasurementsData &gnssMeasData) const;
|
||||
// PBGnssMeasurementsClock to GnssMeasurementsClock
|
||||
int pbConvertToGnssMeasurementsClock(const PBGnssMeasurementsClock &pbGnssMeasClock,
|
||||
GnssMeasurementsClock &gnssMeasClock) const;
|
||||
// PBGnssLocationSvUsedInPosition to GnssLocationSvUsedInPosition
|
||||
int pbConvertToGnssLocationSvUsedInPosition(
|
||||
const PBGnssLocationSvUsedInPosition &pbGnssLocSvUsedInPos,
|
||||
GnssLocationSvUsedInPosition &gnssLocSvUsedInPos) const;
|
||||
// PBLLAInfo to LLAInfo
|
||||
int pbConvertToLLAInfo(const PBLLAInfo &pbLlaInfo, LLAInfo &llaInfo) const;
|
||||
// PBLocApiGnssLocationPositionDynamics to
|
||||
// GnssLocationPositionDynamics & GnssLocationPositionDynamicsExt
|
||||
int pbConvertToGnssLocationPositionDynamics(
|
||||
const PBLocApiGnssLocationPositionDynamics &pbGnssLocPosDyn,
|
||||
GnssLocationPositionDynamics &gnssLocPosDyn,
|
||||
GnssLocationPositionDynamicsExt &gnssLocPosDynExt) const;
|
||||
// PBLocApiGnssSystemTime to GnssSystemTime
|
||||
int pbConvertToGnssSystemTime(const PBLocApiGnssSystemTime &pbGnssSysTime,
|
||||
GnssSystemTime &gnssSysTime) const;
|
||||
// PBGnssMeasUsageInfo to GnssMeasUsageInfo
|
||||
int pbConvertToGnssMeasUsageInfo(const PBGnssMeasUsageInfo &pbGnssMeasUsageInfo,
|
||||
GnssMeasUsageInfo &gnssMeasUsageInfo) const;
|
||||
// PBLocApiSystemTimeStructUnion to SystemTimeStructUnion
|
||||
int pbConvertToSystemTimeStructUnion(const Gnss_LocSvSystemEnumType &gnssLocSvSysEnumType,
|
||||
const PBLocApiSystemTimeStructUnion &pbSysTimeStructUnion,
|
||||
SystemTimeStructUnion &sysTimeStructUnion) const;
|
||||
// PBLocApiGnssGloTimeStructType to GnssGloTimeStructType
|
||||
int pbConvertToGnssGloTimeStructType(const PBLocApiGnssGloTimeStructType &pbGnssGloTime,
|
||||
GnssGloTimeStructType &gnssGloTime) const;
|
||||
// PBGeofenceOption to GeofenceOption
|
||||
int pbConvertToGeofenceOption(const PBGeofenceOption &pbGfOpt, GeofenceOption &gfOpt) const;
|
||||
// PBGeofenceInfo to GeofenceInfo
|
||||
int pbConvertToGeofenceInfo(const PBGeofenceInfo &pbGfInfo, GeofenceInfo &gfInfo) const;
|
||||
// PBLIABodyToSensorMountParams to BodyToSensorMountParams
|
||||
int pbConvertToBodyToSensorMountParams(
|
||||
const PBLIABodyToSensorMountParams &pbBody2SensorMntParam,
|
||||
BodyToSensorMountParams &body2SensorMntParam) const;
|
||||
};
|
||||
|
||||
#endif /* LOCATION_API_PBMSGCONV_H */
|
||||
41
location/location_api_msg_proto/src/Makefile.am
Normal file
41
location/location_api_msg_proto/src/Makefile.am
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
AM_CFLAGS = \
|
||||
-I./ \
|
||||
-D__STDC_FORMAT_MACROS \
|
||||
-Dstrlcpy=g_strlcpy \
|
||||
-Dstrlcat=g_strlcat \
|
||||
$(GPSUTILS_CFLAGS) \
|
||||
-std=c++14
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
requiredlibs = \
|
||||
$(GPSUTILS_LIBS) \
|
||||
-lprotobuf
|
||||
|
||||
liblocation_api_msg_proto_la_SOURCES = \
|
||||
LocationApiDataTypes.pb.cc \
|
||||
LocationApiMsg.pb.cc \
|
||||
LocationApiMsg.cpp \
|
||||
LocationApiPbMsgConv.cpp
|
||||
|
||||
library_include_HEADERS = \
|
||||
LocationApiMsg.h \
|
||||
LocationApiDataTypes.pb.h \
|
||||
LocationApiMsg.pb.h \
|
||||
LocationApiPbMsgConv.h
|
||||
|
||||
if USE_GLIB
|
||||
liblocation_api_msg_proto_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -include glib.h
|
||||
liblocation_api_msg_proto_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
liblocation_api_msg_proto_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -include glib.h
|
||||
else
|
||||
liblocation_api_msg_proto_la_CFLAGS = $(AM_CFLAGS)
|
||||
liblocation_api_msg_proto_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0
|
||||
liblocation_api_msg_proto_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
liblocation_api_msg_proto_la_LIBADD = $(requiredlibs) -ldl -lstdc++
|
||||
|
||||
library_includedir = $(pkgincludedir)
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = liblocation_api_msg_proto.la
|
||||
Loading…
Add table
Add a link
Reference in a new issue