NMEA report indication to ULP

Enabled NMEA report indication to to ulp

Change-Id: Ia27fe0d805f53bf17c86f7c27eaaedd960101370
CRs-Fixed: 1055201
This commit is contained in:
Naresh Munagala 2016-08-10 17:14:18 +05:30
parent 0ac11fcd84
commit dcd5af2915
6 changed files with 35 additions and 5 deletions

View file

@ -112,6 +112,12 @@ public:
(void)aidingData; (void)aidingData;
return false; return false;
} }
inline virtual bool reportNmea(const char* nmea, int length)
{
(void)nmea;
(void)length;
return false;
}
}; };
} // namespace loc_core } // namespace loc_core

View file

@ -78,6 +78,7 @@ extern "C" {
#define ULP_LOCATION_IS_FROM_EXT_DR 0X0080 #define ULP_LOCATION_IS_FROM_EXT_DR 0X0080
#define ULP_MIN_INTERVAL_INVALID 0xffffffff #define ULP_MIN_INTERVAL_INVALID 0xffffffff
#define ULP_MAX_NMEA_STRING_SIZE 201
/*Emergency SUPL*/ /*Emergency SUPL*/
#define GPS_NI_TYPE_EMERGENCY_SUPL 4 #define GPS_NI_TYPE_EMERGENCY_SUPL 4
@ -110,6 +111,14 @@ typedef struct {
unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE]; unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE];
} UlpLocation; } UlpLocation;
typedef struct {
/** set to sizeof(UlpNmea) */
size_t size;
char nmea_str[ULP_MAX_NMEA_STRING_SIZE];
unsigned int len;
} UlpNmea;
/** AGPS type */ /** AGPS type */
typedef int16_t AGpsExtType; typedef int16_t AGpsExtType;
#define AGPS_TYPE_INVALID -1 #define AGPS_TYPE_INVALID -1

View file

@ -6,7 +6,11 @@ AM_CFLAGS = \
$(LOCPLA_CFLAGS) \ $(LOCPLA_CFLAGS) \
-fno-short-enums \ -fno-short-enums \
-D__func__=__PRETTY_FUNCTION__ \ -D__func__=__PRETTY_FUNCTION__ \
-DTARGET_USES_QCOM_BSP -DTARGET_USES_QCOM_BSP \
-std=c++11
AM_CPPFLAGS = \
-std=c++11
libloc_eng_so_la_h_sources = \ libloc_eng_so_la_h_sources = \
loc_eng_dmn_conn_glue_msg.h \ loc_eng_dmn_conn_glue_msg.h \

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -433,10 +433,17 @@ void LocEngAdapter::reportStatus(GpsStatusValue status)
} }
} }
inline void LocInternalAdapter::reportNmea(const char* nmea, int length)
void LocEngAdapter::reportNmea(const char* nmea, int length)
{ {
sendMsg(new LocEngReportNmea(mOwner, nmea, length)); sendMsg(new LocEngReportNmea(mLocEngAdapter->getOwner(), nmea, length));
}
inline void LocEngAdapter::reportNmea(const char* nmea, int length)
{
if (!mUlp->reportNmea(nmea, length)) {
//Report it to HAL
mInternalAdapter->reportNmea(nmea, length);
}
} }
inline inline

View file

@ -63,6 +63,7 @@ public:
virtual void stopFixInt(); virtual void stopFixInt();
virtual void getZppInt(); virtual void getZppInt();
virtual void setUlpProxy(UlpProxyBase* ulp); virtual void setUlpProxy(UlpProxyBase* ulp);
virtual void reportNmea(const char* nmea, int length);
}; };
typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp);

View file

@ -156,6 +156,9 @@ void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_dat
int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000;
if (loc_eng_data_p->nmea_cb != NULL) if (loc_eng_data_p->nmea_cb != NULL)
loc_eng_data_p->nmea_cb(now, pNmea, length); loc_eng_data_p->nmea_cb(now, pNmea, length);
loc_eng_data_p->adapter->getUlpProxy()->reportNmea(pNmea, length);
LOC_LOGD("NMEA <%s", pNmea); LOC_LOGD("NMEA <%s", pNmea);
} }