Merge f5e6e2eeee
on remote branch
Change-Id: I89b0b79894c93b407e6d125c6861bb060da9e241
This commit is contained in:
commit
72993211dd
13 changed files with 73 additions and 22 deletions
|
@ -79,7 +79,7 @@ void LocAdapterBase::
|
|||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSv(GpsSvStatus &svStatus,
|
||||
reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
DEFAULT_IMPL()
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(GpsSvStatus &svStatus,
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
|
|
|
@ -253,15 +253,16 @@ void LocApiBase::reportPosition(UlpLocation &location,
|
|||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportSv(GpsSvStatus &svStatus,
|
||||
void LocApiBase::reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
{
|
||||
// print the SV info before delivering
|
||||
LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used"
|
||||
" in fix mask: %x\n sv: prn snr elevation azimuth",
|
||||
LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use"
|
||||
" mask: %x/%x/%x\n sv: prn snr elevation azimuth",
|
||||
svStatus.num_svs, svStatus.ephemeris_mask,
|
||||
svStatus.almanac_mask, svStatus.used_in_fix_mask);
|
||||
svStatus.almanac_mask, svStatus.gps_used_in_fix_mask,
|
||||
svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask);
|
||||
for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) {
|
||||
LOC_LOGV(" %d: %d %f %f %f",
|
||||
i,
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask =
|
||||
LOC_POS_TECH_MASK_DEFAULT);
|
||||
void reportSv(GpsSvStatus &svStatus,
|
||||
void reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
LocPosTechMask loc_technology_mask) {
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportSv(GpsSvStatus &svStatus,
|
||||
inline virtual bool reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt) {
|
||||
return false;
|
||||
|
|
|
@ -306,6 +306,47 @@ typedef struct GpsExtLocation_s {
|
|||
uint32_t sources_used;
|
||||
} GpsExtLocation;
|
||||
|
||||
/** Represents SV status. */
|
||||
typedef struct {
|
||||
/** set to sizeof(GnssSvStatus) */
|
||||
size_t size;
|
||||
|
||||
/** Number of SVs currently visible. */
|
||||
int num_svs;
|
||||
|
||||
/** Contains an array of SV information. */
|
||||
GpsSvInfo sv_list[GPS_MAX_SVS];
|
||||
|
||||
/** Represents a bit mask indicating which SVs
|
||||
* have ephemeris data.
|
||||
*/
|
||||
uint32_t ephemeris_mask;
|
||||
|
||||
/** Represents a bit mask indicating which SVs
|
||||
* have almanac data.
|
||||
*/
|
||||
uint32_t almanac_mask;
|
||||
|
||||
/**
|
||||
* Represents a bit mask indicating which GPS SVs
|
||||
* were used for computing the most recent position fix.
|
||||
*/
|
||||
uint32_t gps_used_in_fix_mask;
|
||||
|
||||
/**
|
||||
* Represents a bit mask indicating which GLONASS SVs
|
||||
* were used for computing the most recent position fix.
|
||||
*/
|
||||
uint32_t glo_used_in_fix_mask;
|
||||
|
||||
/**
|
||||
* Represents a bit mask indicating which BDS SVs
|
||||
* were used for computing the most recent position fix.
|
||||
*/
|
||||
uint64_t bds_used_in_fix_mask;
|
||||
|
||||
} GnssSvStatus;
|
||||
|
||||
enum loc_sess_status {
|
||||
LOC_SESS_SUCCESS,
|
||||
LOC_SESS_INTERMEDIATE,
|
||||
|
|
|
@ -797,7 +797,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re
|
|||
|
||||
void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
||||
{
|
||||
GpsSvStatus SvStatus = {0};
|
||||
GnssSvStatus SvStatus = {0};
|
||||
GpsLocationExtended locationExtended = {0};
|
||||
locationExtended.size = sizeof(locationExtended);
|
||||
int num_svs_max = 0;
|
||||
|
@ -823,7 +823,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
|||
{
|
||||
if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS)
|
||||
{
|
||||
SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus);
|
||||
SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvInfo);
|
||||
SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn;
|
||||
|
||||
// We only have the data field to report gps eph and alm mask
|
||||
|
@ -842,7 +842,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
|||
if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) &&
|
||||
(sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK))
|
||||
{
|
||||
SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->prn-1));
|
||||
SvStatus.gps_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1));
|
||||
}
|
||||
}
|
||||
// SBAS: GPS RPN: 120-151,
|
||||
|
@ -855,6 +855,12 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
|||
// In extended measurement report, we follow nmea standard, which is 65-96
|
||||
else if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GLONASS)
|
||||
{
|
||||
if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) &&
|
||||
(sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK))
|
||||
{
|
||||
SvStatus.glo_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1));
|
||||
}
|
||||
|
||||
SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn + (65-1);
|
||||
}
|
||||
// Unsupported SV system
|
||||
|
|
|
@ -199,14 +199,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location,
|
|||
}
|
||||
}
|
||||
|
||||
void LocInternalAdapter::reportSv(GpsSvStatus &svStatus,
|
||||
void LocInternalAdapter::reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt){
|
||||
sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus,
|
||||
locationExtended, svExt));
|
||||
}
|
||||
|
||||
void LocEngAdapter::reportSv(GpsSvStatus &svStatus,
|
||||
void LocEngAdapter::reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(GpsSvStatus &svStatus,
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportStatus(GpsStatusValue status);
|
||||
|
@ -268,7 +268,7 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(GpsSvStatus &svStatus,
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
|
|
|
@ -827,7 +827,7 @@ void LocEngReportPosition::send() const {
|
|||
|
||||
// case LOC_ENG_MSG_REPORT_SV:
|
||||
LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter,
|
||||
GpsSvStatus &sv,
|
||||
GnssSvStatus &sv,
|
||||
GpsLocationExtended &locExtended,
|
||||
void* svExt) :
|
||||
LocMsg(), mAdapter(adapter), mSvStatus(sv),
|
||||
|
|
|
@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg {
|
|||
|
||||
struct LocEngReportSv : public LocMsg {
|
||||
LocAdapterBase* mAdapter;
|
||||
const GpsSvStatus mSvStatus;
|
||||
const GnssSvStatus mSvStatus;
|
||||
const GpsLocationExtended mLocationExtended;
|
||||
const void* mSvExt;
|
||||
LocEngReportSv(LocAdapterBase* adapter,
|
||||
GpsSvStatus &sv,
|
||||
GnssSvStatus &sv,
|
||||
GpsLocationExtended &locExtended,
|
||||
void* svExtended);
|
||||
virtual void proc() const;
|
||||
|
|
|
@ -604,7 +604,7 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
||||
const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended)
|
||||
const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
||||
|
@ -790,7 +790,9 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
|
||||
}//if
|
||||
|
||||
if (svStatus.used_in_fix_mask == 0)
|
||||
if (svStatus.gps_used_in_fix_mask == 0 &&
|
||||
svStatus.glo_used_in_fix_mask == 0 &&
|
||||
svStatus.bds_used_in_fix_mask == 0)
|
||||
{ // No sv used, so there will be no position report, so send
|
||||
// blank NMEA sentences
|
||||
strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence));
|
||||
|
@ -812,7 +814,7 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
else
|
||||
{ // cache the used in fix mask, as it will be needed to send $GPGSA
|
||||
// during the position report
|
||||
loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask;
|
||||
loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask;
|
||||
|
||||
// For RPC, the DOP are sent during sv report, so cache them
|
||||
// now to be sent during position report.
|
||||
|
|
|
@ -31,12 +31,13 @@
|
|||
#define LOC_ENG_NMEA_H
|
||||
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
#define NMEA_SENTENCE_MAX_LENGTH 200
|
||||
|
||||
void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
|
||||
int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended);
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended);
|
||||
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea);
|
||||
|
||||
#endif // LOC_ENG_NMEA_H
|
||||
|
|
Loading…
Reference in a new issue