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::
|
void LocAdapterBase::
|
||||||
reportSv(GpsSvStatus &svStatus,
|
reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt)
|
void* svExt)
|
||||||
DEFAULT_IMPL()
|
DEFAULT_IMPL()
|
||||||
|
|
|
@ -92,7 +92,7 @@ public:
|
||||||
void* locationExt,
|
void* locationExt,
|
||||||
enum loc_sess_status status,
|
enum loc_sess_status status,
|
||||||
LocPosTechMask loc_technology_mask);
|
LocPosTechMask loc_technology_mask);
|
||||||
virtual void reportSv(GpsSvStatus &svStatus,
|
virtual void reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt);
|
void* svExt);
|
||||||
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
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,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt)
|
void* svExt)
|
||||||
{
|
{
|
||||||
// print the SV info before delivering
|
// print the SV info before delivering
|
||||||
LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used"
|
LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use"
|
||||||
" in fix mask: %x\n sv: prn snr elevation azimuth",
|
" mask: %x/%x/%x\n sv: prn snr elevation azimuth",
|
||||||
svStatus.num_svs, svStatus.ephemeris_mask,
|
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++) {
|
for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) {
|
||||||
LOC_LOGV(" %d: %d %f %f %f",
|
LOC_LOGV(" %d: %d %f %f %f",
|
||||||
i,
|
i,
|
||||||
|
|
|
@ -113,7 +113,7 @@ public:
|
||||||
enum loc_sess_status status,
|
enum loc_sess_status status,
|
||||||
LocPosTechMask loc_technology_mask =
|
LocPosTechMask loc_technology_mask =
|
||||||
LOC_POS_TECH_MASK_DEFAULT);
|
LOC_POS_TECH_MASK_DEFAULT);
|
||||||
void reportSv(GpsSvStatus &svStatus,
|
void reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt);
|
void* svExt);
|
||||||
void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
LocPosTechMask loc_technology_mask) {
|
LocPosTechMask loc_technology_mask) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
inline virtual bool reportSv(GpsSvStatus &svStatus,
|
inline virtual bool reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt) {
|
void* svExt) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -306,6 +306,47 @@ typedef struct GpsExtLocation_s {
|
||||||
uint32_t sources_used;
|
uint32_t sources_used;
|
||||||
} GpsExtLocation;
|
} 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 {
|
enum loc_sess_status {
|
||||||
LOC_SESS_SUCCESS,
|
LOC_SESS_SUCCESS,
|
||||||
LOC_SESS_INTERMEDIATE,
|
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)
|
void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
||||||
{
|
{
|
||||||
GpsSvStatus SvStatus = {0};
|
GnssSvStatus SvStatus = {0};
|
||||||
GpsLocationExtended locationExtended = {0};
|
GpsLocationExtended locationExtended = {0};
|
||||||
locationExtended.size = sizeof(locationExtended);
|
locationExtended.size = sizeof(locationExtended);
|
||||||
int num_svs_max = 0;
|
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)
|
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;
|
SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn;
|
||||||
|
|
||||||
// We only have the data field to report gps eph and alm mask
|
// 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) &&
|
if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) &&
|
||||||
(sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK))
|
(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,
|
// 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
|
// In extended measurement report, we follow nmea standard, which is 65-96
|
||||||
else if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GLONASS)
|
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);
|
SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn + (65-1);
|
||||||
}
|
}
|
||||||
// Unsupported SV system
|
// Unsupported SV system
|
||||||
|
|
|
@ -199,14 +199,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocInternalAdapter::reportSv(GpsSvStatus &svStatus,
|
void LocInternalAdapter::reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt){
|
void* svExt){
|
||||||
sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus,
|
sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus,
|
||||||
locationExtended, svExt));
|
locationExtended, svExt));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocEngAdapter::reportSv(GpsSvStatus &svStatus,
|
void LocEngAdapter::reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt)
|
void* svExt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
void* locationExt,
|
void* locationExt,
|
||||||
enum loc_sess_status status,
|
enum loc_sess_status status,
|
||||||
LocPosTechMask loc_technology_mask);
|
LocPosTechMask loc_technology_mask);
|
||||||
virtual void reportSv(GpsSvStatus &svStatus,
|
virtual void reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt);
|
void* svExt);
|
||||||
virtual void reportStatus(GpsStatusValue status);
|
virtual void reportStatus(GpsStatusValue status);
|
||||||
|
@ -268,7 +268,7 @@ public:
|
||||||
void* locationExt,
|
void* locationExt,
|
||||||
enum loc_sess_status status,
|
enum loc_sess_status status,
|
||||||
LocPosTechMask loc_technology_mask);
|
LocPosTechMask loc_technology_mask);
|
||||||
virtual void reportSv(GpsSvStatus &svStatus,
|
virtual void reportSv(GnssSvStatus &svStatus,
|
||||||
GpsLocationExtended &locationExtended,
|
GpsLocationExtended &locationExtended,
|
||||||
void* svExt);
|
void* svExt);
|
||||||
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||||
|
|
|
@ -827,7 +827,7 @@ void LocEngReportPosition::send() const {
|
||||||
|
|
||||||
// case LOC_ENG_MSG_REPORT_SV:
|
// case LOC_ENG_MSG_REPORT_SV:
|
||||||
LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter,
|
LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter,
|
||||||
GpsSvStatus &sv,
|
GnssSvStatus &sv,
|
||||||
GpsLocationExtended &locExtended,
|
GpsLocationExtended &locExtended,
|
||||||
void* svExt) :
|
void* svExt) :
|
||||||
LocMsg(), mAdapter(adapter), mSvStatus(sv),
|
LocMsg(), mAdapter(adapter), mSvStatus(sv),
|
||||||
|
|
|
@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg {
|
||||||
|
|
||||||
struct LocEngReportSv : public LocMsg {
|
struct LocEngReportSv : public LocMsg {
|
||||||
LocAdapterBase* mAdapter;
|
LocAdapterBase* mAdapter;
|
||||||
const GpsSvStatus mSvStatus;
|
const GnssSvStatus mSvStatus;
|
||||||
const GpsLocationExtended mLocationExtended;
|
const GpsLocationExtended mLocationExtended;
|
||||||
const void* mSvExt;
|
const void* mSvExt;
|
||||||
LocEngReportSv(LocAdapterBase* adapter,
|
LocEngReportSv(LocAdapterBase* adapter,
|
||||||
GpsSvStatus &sv,
|
GnssSvStatus &sv,
|
||||||
GpsLocationExtended &locExtended,
|
GpsLocationExtended &locExtended,
|
||||||
void* svExtended);
|
void* svExtended);
|
||||||
virtual void proc() const;
|
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,
|
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();
|
ENTRY_LOG();
|
||||||
|
|
||||||
|
@ -790,7 +790,9 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
||||||
|
|
||||||
}//if
|
}//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
|
{ // No sv used, so there will be no position report, so send
|
||||||
// blank NMEA sentences
|
// blank NMEA sentences
|
||||||
strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence));
|
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
|
else
|
||||||
{ // cache the used in fix mask, as it will be needed to send $GPGSA
|
{ // cache the used in fix mask, as it will be needed to send $GPGSA
|
||||||
// during the position report
|
// 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
|
// For RPC, the DOP are sent during sv report, so cache them
|
||||||
// now to be sent during position report.
|
// now to be sent during position report.
|
||||||
|
|
|
@ -31,12 +31,13 @@
|
||||||
#define LOC_ENG_NMEA_H
|
#define LOC_ENG_NMEA_H
|
||||||
|
|
||||||
#include <hardware/gps.h>
|
#include <hardware/gps.h>
|
||||||
|
#include <gps_extended.h>
|
||||||
|
|
||||||
#define NMEA_SENTENCE_MAX_LENGTH 200
|
#define NMEA_SENTENCE_MAX_LENGTH 200
|
||||||
|
|
||||||
void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
|
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);
|
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);
|
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
|
#endif // LOC_ENG_NMEA_H
|
||||||
|
|
Loading…
Reference in a new issue