Browse Source

location client api: cleanup

1: javadoc style documentation
2: move ClientCallbacks from api header file to impl,
   as this is not used by any public APIs

Change-Id: I0864fd8963fc3027a434fe7c63b2f8cfd23978d6
CRs-fixed: 2583836
caf-8.1-sodp-port
Wei Chen 2 years ago
parent
commit
7f0fc8d4db
  1. 2051
      client_api/inc/LocationClientApi.h
  2. 0
      client_api/mkclientapidoc.sh
  3. 12
      client_api/src/LocationClientApi.cpp
  4. 28
      client_api/src/LocationClientApiImpl.cpp
  5. 11
      client_api/src/LocationClientApiImpl.h
  6. 7
      qapi/src/qapi_location.cpp

2051
client_api/inc/LocationClientApi.h

File diff suppressed because it is too large

0
client_api/mkclientapidoc.sh

12
client_api/src/LocationClientApi.cpp

@ -479,9 +479,13 @@ void LocationClientApi::getGnssEnergyConsumed(
GnssEnergyConsumedCb gnssEnergyConsumedCallback,
ResponseCb responseCallback) {
if (mApiImpl) {
if (mApiImpl && gnssEnergyConsumedCallback) {
mApiImpl->getGnssEnergyConsumed(gnssEnergyConsumedCallback,
responseCallback);
} else {
if (responseCallback) {
responseCallback(LOCATION_RESPONSE_NOT_SUPPORTED);
}
}
}
@ -489,9 +493,13 @@ void LocationClientApi::updateLocationSystemInfoListener(
LocationSystemInfoCb locSystemInfoCallback,
ResponseCb responseCallback) {
if (mApiImpl) {
if (mApiImpl && locSystemInfoCallback) {
mApiImpl->updateLocationSystemInfoListener(
locSystemInfoCallback, responseCallback);
} else {
if (responseCallback) {
responseCallback(LOCATION_RESPONSE_NOT_SUPPORTED);
}
}
}

28
client_api/src/LocationClientApiImpl.cpp

@ -767,7 +767,8 @@ static GnssData parseGnssData(const ::GnssDataNotification &halGnssData) {
for (int sig = GNSS_LOC_SIGNAL_TYPE_GPS_L1CA;
sig < GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES; sig++) {
gnssData.gnssDataMask[sig] = halGnssData.gnssDataMask[sig];
gnssData.gnssDataMask[sig] =
(location_client::GnssDataMask) halGnssData.gnssDataMask[sig];
gnssData.jammerInd[sig] = halGnssData.jammerInd[sig];
gnssData.agc[sig] = halGnssData.agc[sig];
if (0 != gnssData.gnssDataMask[sig]) {
@ -786,12 +787,14 @@ static GnssMeasurements parseGnssMeasurements(const ::GnssMeasurementsNotificati
for (int meas = 0; meas < halGnssMeasurements.count; meas++) {
GnssMeasurementsData measurement;
measurement.flags = halGnssMeasurements.measurements[meas].flags;
measurement.flags = (GnssMeasurementsDataFlagsMask)
halGnssMeasurements.measurements[meas].flags;
measurement.svId = halGnssMeasurements.measurements[meas].svId;
measurement.svType =
(location_client::GnssSvType)halGnssMeasurements.measurements[meas].svType;
measurement.timeOffsetNs = halGnssMeasurements.measurements[meas].timeOffsetNs;
measurement.stateMask = halGnssMeasurements.measurements[meas].stateMask;
measurement.stateMask = (GnssMeasurementsStateMask)
halGnssMeasurements.measurements[meas].stateMask;
measurement.receivedSvTimeNs = halGnssMeasurements.measurements[meas].receivedSvTimeNs;
measurement.receivedSvTimeUncertaintyNs =
halGnssMeasurements.measurements[meas].receivedSvTimeUncertaintyNs;
@ -801,7 +804,8 @@ static GnssMeasurements parseGnssMeasurements(const ::GnssMeasurementsNotificati
halGnssMeasurements.measurements[meas].pseudorangeRateMps;
measurement.pseudorangeRateUncertaintyMps =
halGnssMeasurements.measurements[meas].pseudorangeRateUncertaintyMps;
measurement.adrStateMask = halGnssMeasurements.measurements[meas].adrStateMask;
measurement.adrStateMask = (GnssMeasurementsAdrStateMask)
halGnssMeasurements.measurements[meas].adrStateMask;
measurement.adrMeters = halGnssMeasurements.measurements[meas].adrMeters;
measurement.adrUncertaintyMeters =
halGnssMeasurements.measurements[meas].adrUncertaintyMeters;
@ -819,7 +823,8 @@ static GnssMeasurements parseGnssMeasurements(const ::GnssMeasurementsNotificati
gnssMeasurements.measurements.push_back(measurement);
}
gnssMeasurements.clock.flags = halGnssMeasurements.clock.flags;
gnssMeasurements.clock.flags =
(GnssMeasurementsClockFlagsMask) halGnssMeasurements.clock.flags;
gnssMeasurements.clock.leapSecond = halGnssMeasurements.clock.leapSecond;
gnssMeasurements.clock.timeNs = halGnssMeasurements.clock.timeNs;
gnssMeasurements.clock.timeUncertaintyNs = halGnssMeasurements.clock.timeUncertaintyNs;
@ -854,16 +859,16 @@ static LocationResponse parseLocationError(::LocationError error) {
static LocationSystemInfo parseLocationSystemInfo(
const::LocationSystemInfo &halSystemInfo) {
LocationSystemInfo systemInfo = {0};
LocationSystemInfo systemInfo = {};
systemInfo.systemInfoMask = (location_client::LocationSystemInfoMask)
halSystemInfo.systemInfoMask;
if (halSystemInfo.systemInfoMask & LOCATION_SYS_INFO_LEAP_SECOND) {
systemInfo.systemInfoMask |= LOCATION_SYS_INFO_LEAP_SECOND;
systemInfo.leapSecondSysInfo.leapSecondInfoMask = (location_client::LeapSecondSysInfoMask)
halSystemInfo.leapSecondSysInfo.leapSecondInfoMask;
if (halSystemInfo.leapSecondSysInfo.leapSecondInfoMask &
LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT) {
systemInfo.leapSecondSysInfo.leapSecondInfoMask |=
LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT;
LeapSecondChangeInfo &clientInfo =
systemInfo.leapSecondSysInfo.leapSecondChangeInfo;
const::LeapSecondChangeInfo &halInfo =
@ -876,11 +881,8 @@ static LocationSystemInfo parseLocationSystemInfo(
if (halSystemInfo.leapSecondSysInfo.leapSecondInfoMask &
LEAP_SECOND_SYS_INFO_CURRENT_LEAP_SECONDS_BIT) {
systemInfo.leapSecondSysInfo.leapSecondInfoMask |=
LEAP_SECOND_SYS_INFO_CURRENT_LEAP_SECONDS_BIT;
systemInfo.leapSecondSysInfo.leapSecondCurrent =
halSystemInfo.leapSecondSysInfo.leapSecondCurrent;
}
}

11
client_api/src/LocationClientApiImpl.h

@ -90,6 +90,17 @@ enum ReportCbEnumType {
REPORT_CB_ENGINE_INFO = 2,
};
struct ClientCallbacks {
CapabilitiesCb capabilitycb;
ResponseCb responsecb;
CollectiveResponseCb collectivecb;
LocationCb locationcb;
BatchingCb batchingcb;
GeofenceBreachCb gfbreachcb;
GnssReportCbs gnssreportcbs;
EngineReportCbs engreportcbs;
};
typedef std::function<void(
uint32_t response
)> PingTestCb;

7
qapi/src/qapi_location.cpp

@ -300,6 +300,13 @@ static void loc_passive_response_callback(
LOC_LOGv("loc_passive_response_callback!");
}
struct ClientCallbacks {
CapabilitiesCb capabilitycb;
ResponseCb responsecb;
CollectiveResponseCb collectivecb;
LocationCb locationcb;
};
static ClientCallbacks gLocationCallbacks = {
location_capabilities_callback,
location_response_callback,

Loading…
Cancel
Save