Fix to use explicit sized structures
Cross processor communication needs explicit sized structures. Avoid using platform defined values like size_t which may vary from 32-bit to 64-bit. Also use explicitly defined timespec32_t structure that will only use uint32_t fields. CRs-Fixed: 2428163 Change-Id: Ida72f53ac672d9c9b86879bb9861cecefe6f8c6d
This commit is contained in:
parent
9fc8d7444d
commit
980dbf59b6
3 changed files with 26 additions and 21 deletions
|
@ -1636,7 +1636,7 @@ GnssAdapter::gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config)
|
||||||
void
|
void
|
||||||
GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset)
|
GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset)
|
||||||
{
|
{
|
||||||
LOC_LOGd("size %zu constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64
|
LOC_LOGd("size %" PRIu32" constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64
|
||||||
", sendReset %d",
|
", sendReset %d",
|
||||||
mGnssSvTypeConfig.size, mGnssSvTypeConfig.blacklistedSvTypesMask,
|
mGnssSvTypeConfig.size, mGnssSvTypeConfig.blacklistedSvTypesMask,
|
||||||
mGnssSvTypeConfig.enabledSvTypesMask, sendReset);
|
mGnssSvTypeConfig.enabledSvTypesMask, sendReset);
|
||||||
|
|
|
@ -35,7 +35,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <loc_gps.h>
|
#include <loc_gps.h>
|
||||||
#include <LocationAPI.h>
|
#include <LocationAPI.h>
|
||||||
#include <time.h>
|
|
||||||
|
struct timespec32_t {
|
||||||
|
uint32_t tv_sec; /* seconds */
|
||||||
|
uint32_t tv_nsec; /* and nanoseconds */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
|
@ -132,7 +137,7 @@ typedef enum {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(UlpLocation) */
|
/** set to sizeof(UlpLocation) */
|
||||||
size_t size;
|
uint32_t size;
|
||||||
LocGpsLocation gpsLocation;
|
LocGpsLocation gpsLocation;
|
||||||
/* Provider indicator for HYBRID or GPS */
|
/* Provider indicator for HYBRID or GPS */
|
||||||
uint16_t position_source;
|
uint16_t position_source;
|
||||||
|
@ -142,7 +147,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(UlpNmea) */
|
/** set to sizeof(UlpNmea) */
|
||||||
size_t size;
|
uint32_t size;
|
||||||
char nmea_str[ULP_MAX_NMEA_STRING_SIZE];
|
char nmea_str[ULP_MAX_NMEA_STRING_SIZE];
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
} UlpNmea;
|
} UlpNmea;
|
||||||
|
@ -208,7 +213,7 @@ typedef struct {
|
||||||
/** GPS extended callback structure. */
|
/** GPS extended callback structure. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(LocGpsCallbacks) */
|
/** set to sizeof(LocGpsCallbacks) */
|
||||||
size_t size;
|
uint32_t size;
|
||||||
loc_gps_set_capabilities set_capabilities_cb;
|
loc_gps_set_capabilities set_capabilities_cb;
|
||||||
loc_gps_acquire_wakelock acquire_wakelock_cb;
|
loc_gps_acquire_wakelock acquire_wakelock_cb;
|
||||||
loc_gps_release_wakelock release_wakelock_cb;
|
loc_gps_release_wakelock release_wakelock_cb;
|
||||||
|
@ -232,7 +237,7 @@ typedef struct {
|
||||||
/** Represents the status of AGPS. */
|
/** Represents the status of AGPS. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(AGpsExtStatus) */
|
/** set to sizeof(AGpsExtStatus) */
|
||||||
size_t size;
|
uint32_t size;
|
||||||
|
|
||||||
AGpsExtType type;
|
AGpsExtType type;
|
||||||
LocAGpsStatusValue status;
|
LocAGpsStatusValue status;
|
||||||
|
@ -458,7 +463,7 @@ typedef enum {
|
||||||
}LocReliability;
|
}LocReliability;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct timespec apTimeStamp;
|
struct timespec32_t apTimeStamp;
|
||||||
/*boottime received from pps-ktimer*/
|
/*boottime received from pps-ktimer*/
|
||||||
float apTimeStampUncertaintyMs;
|
float apTimeStampUncertaintyMs;
|
||||||
/* timestamp uncertainty in milli seconds */
|
/* timestamp uncertainty in milli seconds */
|
||||||
|
@ -685,7 +690,7 @@ typedef struct {
|
||||||
/** Represents gps location extended. */
|
/** Represents gps location extended. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(GpsLocationExtended) */
|
/** set to sizeof(GpsLocationExtended) */
|
||||||
size_t size;
|
uint32_t size;
|
||||||
/** Contains GpsLocationExtendedFlags bits. */
|
/** Contains GpsLocationExtendedFlags bits. */
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
/** Contains the Altitude wrt mean sea level */
|
/** Contains the Altitude wrt mean sea level */
|
||||||
|
@ -1058,7 +1063,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
float clockDrift;
|
float clockDrift;
|
||||||
/**< Receiver clock Drift \n
|
/**< Receiver clock Drift \n
|
||||||
- Units: meter per sec \n
|
- Units: meter per sec \n
|
||||||
|
@ -1072,7 +1077,7 @@ typedef struct
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
uint8_t leapSec;
|
uint8_t leapSec;
|
||||||
/**< GPS time leap second delta to UTC time \n
|
/**< GPS time leap second delta to UTC time \n
|
||||||
- Units: sec \n
|
- Units: sec \n
|
||||||
|
@ -1093,7 +1098,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
uint32_t validMask;
|
uint32_t validMask;
|
||||||
/* Validity mask as per Gnss_LocInterSystemBiasValidMaskType */
|
/* Validity mask as per Gnss_LocInterSystemBiasValidMaskType */
|
||||||
|
|
||||||
|
@ -1110,7 +1115,7 @@ typedef struct
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
||||||
size_t size;
|
uint32_t size;
|
||||||
|
|
||||||
uint8_t systemRtc_valid;
|
uint8_t systemRtc_valid;
|
||||||
/**< Validity indicator for System RTC */
|
/**< Validity indicator for System RTC */
|
||||||
|
@ -1156,7 +1161,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
uint32_t svMs;
|
uint32_t svMs;
|
||||||
/**< Satellite time milisecond.\n
|
/**< Satellite time milisecond.\n
|
||||||
For GPS, BDS, GAL range of 0 thru (604800000-1) \n
|
For GPS, BDS, GAL range of 0 thru (604800000-1) \n
|
||||||
|
@ -1216,7 +1221,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
Gnss_LocSvSystemEnumType gnssSystem;
|
Gnss_LocSvSystemEnumType gnssSystem;
|
||||||
// 0 signal type mask indicates invalid value
|
// 0 signal type mask indicates invalid value
|
||||||
GnssSignalTypeMask gnssSignalTypeMask;
|
GnssSignalTypeMask gnssSignalTypeMask;
|
||||||
|
@ -1389,7 +1394,7 @@ typedef uint64_t GpsSvMeasHeaderFlags;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
// see defines in GNSS_SV_MEAS_HEADER_HAS_XXX_XXX
|
// see defines in GNSS_SV_MEAS_HEADER_HAS_XXX_XXX
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
|
|
||||||
|
@ -1433,7 +1438,7 @@ typedef struct
|
||||||
} GnssSvMeasurementHeader;
|
} GnssSvMeasurementHeader;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t size;
|
uint32_t size;
|
||||||
bool isNhz;
|
bool isNhz;
|
||||||
GnssSvMeasurementHeader svMeasSetHeader;
|
GnssSvMeasurementHeader svMeasSetHeader;
|
||||||
uint32_t svMeasCount;
|
uint32_t svMeasCount;
|
||||||
|
@ -1473,7 +1478,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
uint16_t gnssSvId;
|
uint16_t gnssSvId;
|
||||||
/* GPS: 1-32, GLO: 65-96, 0: Invalid,
|
/* GPS: 1-32, GLO: 65-96, 0: Invalid,
|
||||||
SBAS: 120-151, BDS:201-237,GAL:301 to 336
|
SBAS: 120-151, BDS:201-237,GAL:301 to 336
|
||||||
|
@ -2034,7 +2039,7 @@ typedef enum {
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t size;
|
uint32_t size;
|
||||||
Gnss_SrnTech srnTechType; /* SRN Technology type in request */
|
Gnss_SrnTech srnTechType; /* SRN Technology type in request */
|
||||||
bool srnRequest; /* scan - start(true) or stop(false) */
|
bool srnRequest; /* scan - start(true) or stop(false) */
|
||||||
bool e911Mode; /* If in E911 emergency */
|
bool e911Mode; /* If in E911 emergency */
|
||||||
|
@ -2054,7 +2059,7 @@ typedef enum {
|
||||||
/* This SV Type config is injected directly to GNSS Adapter
|
/* This SV Type config is injected directly to GNSS Adapter
|
||||||
* bypassing Location API */
|
* bypassing Location API */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t size; // set to sizeof(GnssSvTypeConfig)
|
uint32_t size; // set to sizeof(GnssSvTypeConfig)
|
||||||
// Enabled Constellations
|
// Enabled Constellations
|
||||||
GnssSvTypesMask enabledSvTypesMask;
|
GnssSvTypesMask enabledSvTypesMask;
|
||||||
// Disabled Constellations
|
// Disabled Constellations
|
||||||
|
@ -2141,7 +2146,7 @@ enum OdcpiRequestType {
|
||||||
ODCPI_REQUEST_TYPE_STOP
|
ODCPI_REQUEST_TYPE_STOP
|
||||||
};
|
};
|
||||||
struct OdcpiRequestInfo {
|
struct OdcpiRequestInfo {
|
||||||
size_t size;
|
uint32_t size;
|
||||||
OdcpiRequestType type;
|
OdcpiRequestType type;
|
||||||
uint32_t tbfMillis;
|
uint32_t tbfMillis;
|
||||||
bool isEmergencyMode;
|
bool isEmergencyMode;
|
||||||
|
|
|
@ -548,7 +548,7 @@ typedef uint8_t LocGnssConstellationType;
|
||||||
/** Represents a location. */
|
/** Represents a location. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** set to sizeof(LocGpsLocation) */
|
/** set to sizeof(LocGpsLocation) */
|
||||||
size_t size;
|
uint32_t size;
|
||||||
/** Contains LocGpsLocationFlags bits. */
|
/** Contains LocGpsLocationFlags bits. */
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
/** The spoof mask */
|
/** The spoof mask */
|
||||||
|
|
Loading…
Reference in a new issue