Merge "Adds ZPP Feature Implementation"
This commit is contained in:
commit
50a76390ba
8 changed files with 75 additions and 0 deletions
|
@ -73,6 +73,7 @@ public:
|
|||
inline virtual void setPositionModeInt(LocPosMode& posMode) {}
|
||||
virtual void startFixInt() {}
|
||||
virtual void stopFixInt() {}
|
||||
virtual void getZppInt() {}
|
||||
virtual void reportPosition(UlpLocation &location,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* locationExt,
|
||||
|
|
|
@ -445,6 +445,10 @@ enum loc_api_adapter_err LocApiBase::
|
|||
getZppFix(GpsLocation & zppLoc)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
int LocApiBase::
|
||||
initDataServiceClient()
|
||||
DEFAULT_IMPL(-1)
|
||||
|
|
|
@ -187,6 +187,8 @@ public:
|
|||
setAGLONASSProtocol(unsigned long aGlonassProtocol);
|
||||
virtual enum loc_api_adapter_err
|
||||
getZppFix(GpsLocation & zppLoc);
|
||||
virtual enum loc_api_adapter_err
|
||||
getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
|
||||
virtual int initDataServiceClient();
|
||||
virtual int openAndStartDataCall();
|
||||
virtual void stopDataCall();
|
||||
|
|
|
@ -56,6 +56,8 @@ extern "C" {
|
|||
#define ULP_LOCATION_IS_FROM_HYBRID 0x0001
|
||||
/** Position source is GNSS only */
|
||||
#define ULP_LOCATION_IS_FROM_GNSS 0x0002
|
||||
/** Position source is ZPP only */
|
||||
#define ULP_LOCATION_IS_FROM_ZPP 0x0004
|
||||
|
||||
#define ULP_MIN_INTERVAL_INVALID 0xffffffff
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@ void LocInternalAdapter::startFixInt() {
|
|||
void LocInternalAdapter::stopFixInt() {
|
||||
sendMsg(new LocEngStopFix(mLocEngAdapter));
|
||||
}
|
||||
void LocInternalAdapter::getZppInt() {
|
||||
sendMsg(new LocEngGetZpp(mLocEngAdapter));
|
||||
}
|
||||
void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) {
|
||||
struct LocSetUlpProxy : public LocMsg {
|
||||
LocAdapterBase* mAdapter;
|
||||
|
|
|
@ -62,6 +62,7 @@ public:
|
|||
virtual void setPositionModeInt(LocPosMode& posMode);
|
||||
virtual void startFixInt();
|
||||
virtual void stopFixInt();
|
||||
virtual void getZppInt();
|
||||
virtual void setUlpProxy(UlpProxyBase* ulp);
|
||||
};
|
||||
|
||||
|
@ -239,6 +240,11 @@ public:
|
|||
{
|
||||
mLocApi->closeDataCall();
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask)
|
||||
{
|
||||
return mLocApi->getZppFix(zppLoc, tech_mask);
|
||||
}
|
||||
|
||||
virtual void handleEngineDownEvent();
|
||||
virtual void handleEngineUpEvent();
|
||||
|
|
|
@ -182,6 +182,7 @@ static void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) ;
|
|||
|
||||
static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data);
|
||||
static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data);
|
||||
static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data);
|
||||
|
||||
static void deleteAidingData(loc_eng_data_s_type &logEng);
|
||||
static AgpsStateMachine*
|
||||
|
@ -300,6 +301,28 @@ void LocEngPositionMode::send() const {
|
|||
mAdapter->sendMsg(this);
|
||||
}
|
||||
|
||||
LocEngGetZpp::LocEngGetZpp(LocEngAdapter* adapter) :
|
||||
LocMsg(), mAdapter(adapter)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline void LocEngGetZpp::proc() const
|
||||
{
|
||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
|
||||
loc_eng_get_zpp_handler(*locEng);
|
||||
}
|
||||
inline void LocEngGetZpp::locallog() const
|
||||
{
|
||||
LOC_LOGV("LocEngGetZpp");
|
||||
}
|
||||
inline void LocEngGetZpp::log() const
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
void LocEngGetZpp::send() const {
|
||||
mAdapter->sendMsg(this);
|
||||
}
|
||||
|
||||
// case LOC_ENG_MSG_SET_TIME:
|
||||
struct LocEngSetTime : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
|
@ -1920,6 +1943,32 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
|
||||
UlpLocation location;
|
||||
LocPosTechMask tech_mask = LOC_POS_TECH_MASK_DEFAULT;
|
||||
GpsLocationExtended locationExtended;
|
||||
memset(&locationExtended, 0, sizeof (GpsLocationExtended));
|
||||
locationExtended.size = sizeof(locationExtended);
|
||||
memset(&location, 0, sizeof location);
|
||||
|
||||
ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask);
|
||||
//Mark the location source as from ZPP
|
||||
location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO;
|
||||
location.position_source = ULP_LOCATION_IS_FROM_ZPP;
|
||||
|
||||
loc_eng_data.adapter->getUlpProxy()->reportPosition(location,
|
||||
locationExtended,
|
||||
NULL,
|
||||
LOC_SESS_SUCCESS,
|
||||
tech_mask);
|
||||
|
||||
EXIT_LOG(%d, ret_val);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
Callback function passed to Data Services State Machine
|
||||
This becomes part of the state machine's servicer and
|
||||
|
|
|
@ -280,6 +280,14 @@ struct LocEngUp : public LocMsg {
|
|||
virtual void log() const;
|
||||
};
|
||||
|
||||
struct LocEngGetZpp : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
LocEngGetZpp(LocEngAdapter* adapter);
|
||||
virtual void proc() const;
|
||||
void locallog() const;
|
||||
virtual void log() const;
|
||||
void send() const;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue