Merge "Rename FlpAPIClient and GnssMeasurementAPIClient"
This commit is contained in:
commit
279d118562
10 changed files with 62 additions and 64 deletions
|
@ -17,8 +17,8 @@ LOCAL_SRC_FILES += \
|
||||||
location_api/LocationUtil.cpp \
|
location_api/LocationUtil.cpp \
|
||||||
location_api/GnssAPIClient.cpp \
|
location_api/GnssAPIClient.cpp \
|
||||||
location_api/GeofenceAPIClient.cpp \
|
location_api/GeofenceAPIClient.cpp \
|
||||||
location_api/FlpAPIClient.cpp \
|
location_api/BatchingAPIClient.cpp \
|
||||||
location_api/GnssMeasurementAPIClient.cpp \
|
location_api/MeasurementAPIClient.cpp \
|
||||||
|
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
$(LOCAL_PATH)/location_api \
|
$(LOCAL_PATH)/location_api \
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define LOG_TAG "LocSvc_GnssBatchingInterface"
|
#define LOG_TAG "LocSvc_GnssBatchingInterface"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <FlpAPIClient.h>
|
#include <BatchingAPIClient.h>
|
||||||
#include "GnssBatching.h"
|
#include "GnssBatching.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
@ -59,7 +59,7 @@ Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mApi = new FlpAPIClient(callback);
|
mApi = new BatchingAPIClient(callback);
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
|
@ -81,7 +81,7 @@ Return<uint16_t> GnssBatching::getBatchSize() {
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
} else {
|
} else {
|
||||||
ret = mApi->flpGetBatchSize();
|
ret = mApi->getBatchSize();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
} else {
|
} else {
|
||||||
ret = mApi->flpStartSession(options);
|
ret = mApi->startSession(options);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ Return<void> GnssBatching::flush() {
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
} else {
|
} else {
|
||||||
mApi->flpFlushBatchedLocations();
|
mApi->flushBatchedLocations();
|
||||||
}
|
}
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ Return<bool> GnssBatching::stop() {
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
} else {
|
} else {
|
||||||
ret = mApi->flpStopSession();
|
ret = mApi->stopSession();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ using ::android::hardware::Return;
|
||||||
using ::android::hardware::Void;
|
using ::android::hardware::Void;
|
||||||
using ::android::sp;
|
using ::android::sp;
|
||||||
|
|
||||||
class FlpAPIClient;
|
class BatchingAPIClient;
|
||||||
struct GnssBatching : public IGnssBatching {
|
struct GnssBatching : public IGnssBatching {
|
||||||
GnssBatching();
|
GnssBatching();
|
||||||
~GnssBatching();
|
~GnssBatching();
|
||||||
|
@ -68,7 +68,7 @@ struct GnssBatching : public IGnssBatching {
|
||||||
private:
|
private:
|
||||||
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
|
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
|
||||||
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
|
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
|
||||||
FlpAPIClient* mApi = nullptr;
|
BatchingAPIClient* mApi = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <GnssMeasurementAPIClient.h>
|
#include <MeasurementAPIClient.h>
|
||||||
#include "GnssMeasurement.h"
|
#include "GnssMeasurement.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
@ -41,7 +41,7 @@ void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
|
||||||
|
|
||||||
GnssMeasurement::GnssMeasurement() {
|
GnssMeasurement::GnssMeasurement() {
|
||||||
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this);
|
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this);
|
||||||
mApi = new GnssMeasurementAPIClient();
|
mApi = new MeasurementAPIClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssMeasurement::~GnssMeasurement() {
|
GnssMeasurement::~GnssMeasurement() {
|
||||||
|
@ -74,7 +74,7 @@ Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
mGnssMeasurementCbIface = callback;
|
mGnssMeasurementCbIface = callback;
|
||||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/);
|
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/);
|
||||||
|
|
||||||
return mApi->gnssMeasurementSetCallback(callback);
|
return mApi->measurementSetCallback(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
Return<void> GnssMeasurement::close() {
|
Return<void> GnssMeasurement::close() {
|
||||||
|
@ -87,7 +87,7 @@ Return<void> GnssMeasurement::close() {
|
||||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
mGnssMeasurementCbIface = nullptr;
|
mGnssMeasurementCbIface = nullptr;
|
||||||
}
|
}
|
||||||
mApi->gnssMeasurementClose();
|
mApi->measurementClose();
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ using ::android::hardware::hidl_vec;
|
||||||
using ::android::hardware::hidl_string;
|
using ::android::hardware::hidl_string;
|
||||||
using ::android::sp;
|
using ::android::sp;
|
||||||
|
|
||||||
class GnssMeasurementAPIClient;
|
class MeasurementAPIClient;
|
||||||
struct GnssMeasurement : public IGnssMeasurement {
|
struct GnssMeasurement : public IGnssMeasurement {
|
||||||
GnssMeasurement();
|
GnssMeasurement();
|
||||||
~GnssMeasurement();
|
~GnssMeasurement();
|
||||||
|
@ -64,7 +64,7 @@ struct GnssMeasurement : public IGnssMeasurement {
|
||||||
private:
|
private:
|
||||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||||
GnssMeasurementAPIClient* mApi;
|
MeasurementAPIClient* mApi;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_NDDEBUG 0
|
#define LOG_NDDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_FlpAPIClient"
|
#define LOG_TAG "LocSvc_BatchingAPIClient"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <loc_cfg.h>
|
#include <loc_cfg.h>
|
||||||
|
|
||||||
#include "LocationUtil.h"
|
#include "LocationUtil.h"
|
||||||
#include "FlpAPIClient.h"
|
#include "BatchingAPIClient.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
|
@ -45,7 +45,7 @@ namespace implementation {
|
||||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||||
LocationCapabilitiesMask mask);
|
LocationCapabilitiesMask mask);
|
||||||
|
|
||||||
FlpAPIClient::FlpAPIClient(const sp<IGnssBatchingCallback>& callback) :
|
BatchingAPIClient::BatchingAPIClient(const sp<IGnssBatchingCallback>& callback) :
|
||||||
LocationAPIClientBase(),
|
LocationAPIClientBase(),
|
||||||
mGnssBatchingCbIface(callback),
|
mGnssBatchingCbIface(callback),
|
||||||
mDefaultId(42),
|
mDefaultId(42),
|
||||||
|
@ -74,18 +74,18 @@ FlpAPIClient::FlpAPIClient(const sp<IGnssBatchingCallback>& callback) :
|
||||||
locAPISetCallbacks(locationCallbacks);
|
locAPISetCallbacks(locationCallbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlpAPIClient::~FlpAPIClient()
|
BatchingAPIClient::~BatchingAPIClient()
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
int FlpAPIClient::flpGetBatchSize()
|
int BatchingAPIClient::getBatchSize()
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
return locAPIGetBatchSize();
|
return locAPIGetBatchSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
int FlpAPIClient::flpStartSession(const IGnssBatching::Options& opts)
|
int BatchingAPIClient::startSession(const IGnssBatching::Options& opts)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||||
|
@ -102,7 +102,7 @@ int FlpAPIClient::flpStartSession(const IGnssBatching::Options& opts)
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FlpAPIClient::flpUpdateSessionOptions(const IGnssBatching::Options& opts)
|
int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||||
|
@ -120,7 +120,7 @@ int FlpAPIClient::flpUpdateSessionOptions(const IGnssBatching::Options& opts)
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FlpAPIClient::flpStopSession()
|
int BatchingAPIClient::stopSession()
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: ", __FUNCTION__);
|
LOC_LOGD("%s]: ", __FUNCTION__);
|
||||||
int retVal = -1;
|
int retVal = -1;
|
||||||
|
@ -130,25 +130,25 @@ int FlpAPIClient::flpStopSession()
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlpAPIClient::flpGetBatchedLocation(int last_n_locations)
|
void BatchingAPIClient::getBatchedLocation(int last_n_locations)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations);
|
LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations);
|
||||||
locAPIGetBatchedLocations(last_n_locations);
|
locAPIGetBatchedLocations(last_n_locations);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlpAPIClient::flpFlushBatchedLocations()
|
void BatchingAPIClient::flushBatchedLocations()
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
locAPIGetBatchedLocations(SIZE_MAX);
|
locAPIGetBatchedLocations(SIZE_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlpAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask);
|
LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask);
|
||||||
mLocationCapabilitiesMask = capabilitiesMask;
|
mLocationCapabilitiesMask = capabilitiesMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlpAPIClient::onBatchingCb(size_t count, Location* location)
|
void BatchingAPIClient::onBatchingCb(size_t count, Location* location)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
|
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
|
||||||
if (mGnssBatchingCbIface != nullptr && count > 0) {
|
if (mGnssBatchingCbIface != nullptr && count > 0) {
|
|
@ -27,8 +27,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FLP_API_CLINET_H
|
#ifndef BATCHING_API_CLINET_H
|
||||||
#define FLP_API_CLINET_H
|
#define BATCHING_API_CLINET_H
|
||||||
|
|
||||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||||
#include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
|
#include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
|
||||||
|
@ -36,27 +36,25 @@
|
||||||
|
|
||||||
#include <LocationAPIClientBase.h>
|
#include <LocationAPIClientBase.h>
|
||||||
|
|
||||||
#define FLP_CONF_FILE "/etc/flp.conf"
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
namespace gnss {
|
namespace gnss {
|
||||||
namespace V1_0 {
|
namespace V1_0 {
|
||||||
namespace implementation {
|
namespace implementation {
|
||||||
|
|
||||||
class FlpAPIClient : public LocationAPIClientBase
|
class BatchingAPIClient : public LocationAPIClientBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FlpAPIClient(const sp<IGnssBatchingCallback>& callback);
|
BatchingAPIClient(const sp<IGnssBatchingCallback>& callback);
|
||||||
~FlpAPIClient();
|
~BatchingAPIClient();
|
||||||
int flpGetBatchSize();
|
int getBatchSize();
|
||||||
int flpStartSession(const IGnssBatching::Options& options);
|
int startSession(const IGnssBatching::Options& options);
|
||||||
int flpUpdateSessionOptions(const IGnssBatching::Options& options);
|
int updateSessionOptions(const IGnssBatching::Options& options);
|
||||||
int flpStopSession();
|
int stopSession();
|
||||||
void flpGetBatchedLocation(int last_n_locations);
|
void getBatchedLocation(int last_n_locations);
|
||||||
void flpFlushBatchedLocations();
|
void flushBatchedLocations();
|
||||||
|
|
||||||
inline LocationCapabilitiesMask flpGetCapabilities() { return mLocationCapabilitiesMask; }
|
inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; }
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||||
|
@ -74,4 +72,4 @@ private:
|
||||||
} // namespace gnss
|
} // namespace gnss
|
||||||
} // namespace hardware
|
} // namespace hardware
|
||||||
} // namespace android
|
} // namespace android
|
||||||
#endif // FLP_API_CLINET_H
|
#endif // BATCHING_API_CLINET_H
|
|
@ -28,13 +28,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_NDDEBUG 0
|
#define LOG_NDDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_GnssMeasurementAPIClient"
|
#define LOG_TAG "LocSvc_MeasurementAPIClient"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <loc_cfg.h>
|
#include <loc_cfg.h>
|
||||||
|
|
||||||
#include "LocationUtil.h"
|
#include "LocationUtil.h"
|
||||||
#include "GnssMeasurementAPIClient.h"
|
#include "MeasurementAPIClient.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
|
@ -48,7 +48,7 @@ static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||||
IGnssMeasurementCallback::GnssMeasurement& out);
|
IGnssMeasurementCallback::GnssMeasurement& out);
|
||||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
||||||
|
|
||||||
GnssMeasurementAPIClient::GnssMeasurementAPIClient() :
|
MeasurementAPIClient::MeasurementAPIClient() :
|
||||||
mGnssMeasurementCbIface(nullptr),
|
mGnssMeasurementCbIface(nullptr),
|
||||||
mLocationCapabilitiesMask(0)
|
mLocationCapabilitiesMask(0)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ GnssMeasurementAPIClient::GnssMeasurementAPIClient() :
|
||||||
mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssMeasurementAPIClient::~GnssMeasurementAPIClient()
|
MeasurementAPIClient::~MeasurementAPIClient()
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
pthread_cond_destroy(&mCond);
|
pthread_cond_destroy(&mCond);
|
||||||
|
@ -73,7 +73,7 @@ GnssMeasurementAPIClient::~GnssMeasurementAPIClient()
|
||||||
|
|
||||||
// for GpsInterface
|
// for GpsInterface
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||||
GnssMeasurementAPIClient::gnssMeasurementSetCallback(const sp<IGnssMeasurementCallback>& callback)
|
MeasurementAPIClient::measurementSetCallback(const sp<IGnssMeasurementCallback>& callback)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ GnssMeasurementAPIClient::gnssMeasurementSetCallback(const sp<IGnssMeasurementCa
|
||||||
}
|
}
|
||||||
|
|
||||||
// for GpsMeasurementInterface
|
// for GpsMeasurementInterface
|
||||||
void GnssMeasurementAPIClient::gnssMeasurementClose() {
|
void MeasurementAPIClient::measurementClose() {
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
pthread_mutex_lock(&mLock);
|
pthread_mutex_lock(&mLock);
|
||||||
mGnssMeasurementCbIface = nullptr;
|
mGnssMeasurementCbIface = nullptr;
|
||||||
|
@ -126,7 +126,7 @@ void GnssMeasurementAPIClient::gnssMeasurementClose() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
void GnssMeasurementAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
void MeasurementAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask);
|
LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask);
|
||||||
mLocationCapabilitiesMask = capabilitiesMask;
|
mLocationCapabilitiesMask = capabilitiesMask;
|
||||||
|
@ -135,7 +135,7 @@ void GnssMeasurementAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabil
|
||||||
pthread_mutex_unlock(&mLock);
|
pthread_mutex_unlock(&mLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GnssMeasurementAPIClient::onGnssMeasurementsCb(
|
void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||||
GnssMeasurementsNotification gnssMeasurementsNotification)
|
GnssMeasurementsNotification gnssMeasurementsNotification)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssMeasurementsNotification.count);
|
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssMeasurementsNotification.count);
|
|
@ -27,8 +27,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GNSS_MEASUREMENT_API_CLINET_H
|
#ifndef MEASUREMENT_API_CLINET_H
|
||||||
#define GNSS_MEASUREMENT_API_CLINET_H
|
#define MEASUREMENT_API_CLINET_H
|
||||||
|
|
||||||
|
|
||||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||||
|
@ -45,18 +45,18 @@ namespace implementation {
|
||||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||||
using ::android::sp;
|
using ::android::sp;
|
||||||
|
|
||||||
class GnssMeasurementAPIClient : public LocationAPIClientBase
|
class MeasurementAPIClient : public LocationAPIClientBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GnssMeasurementAPIClient();
|
MeasurementAPIClient();
|
||||||
virtual ~GnssMeasurementAPIClient();
|
virtual ~MeasurementAPIClient();
|
||||||
GnssMeasurementAPIClient(const GnssMeasurementAPIClient&) = delete;
|
MeasurementAPIClient(const MeasurementAPIClient&) = delete;
|
||||||
GnssMeasurementAPIClient& operator=(const GnssMeasurementAPIClient&) = delete;
|
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||||
|
|
||||||
// for GpsMeasurementInterface
|
// for GpsMeasurementInterface
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> gnssMeasurementSetCallback(
|
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||||
const sp<IGnssMeasurementCallback>& callback);
|
const sp<IGnssMeasurementCallback>& callback);
|
||||||
void gnssMeasurementClose();
|
void measurementClose();
|
||||||
|
|
||||||
// callbacks we are interested in
|
// callbacks we are interested in
|
||||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||||
|
@ -78,4 +78,4 @@ private:
|
||||||
} // namespace gnss
|
} // namespace gnss
|
||||||
} // namespace hardware
|
} // namespace hardware
|
||||||
} // namespace android
|
} // namespace android
|
||||||
#endif // GNSS_MEASUREMENT_API_CLINET_H
|
#endif // MEASUREMENT_API_CLINET_H
|
|
@ -33,7 +33,7 @@
|
||||||
#include <loc_cfg.h>
|
#include <loc_cfg.h>
|
||||||
#include "LocationAPIClientBase.h"
|
#include "LocationAPIClientBase.h"
|
||||||
|
|
||||||
#define FLP_CONF_FILE "/etc/flp.conf"
|
#define BATCHING_CONF_FILE "/etc/flp.conf"
|
||||||
|
|
||||||
LocationAPIClientBase::LocationAPIClientBase() :
|
LocationAPIClientBase::LocationAPIClientBase() :
|
||||||
mTrackingCallback(nullptr),
|
mTrackingCallback(nullptr),
|
||||||
|
@ -183,11 +183,11 @@ void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options
|
||||||
int32_t LocationAPIClientBase::locAPIGetBatchSize()
|
int32_t LocationAPIClientBase::locAPIGetBatchSize()
|
||||||
{
|
{
|
||||||
if (mBatchSize == -1) {
|
if (mBatchSize == -1) {
|
||||||
const loc_param_s_type flp_conf_param_table[] =
|
const loc_param_s_type batching_conf_param_table[] =
|
||||||
{
|
{
|
||||||
{"BATCH_SIZE", &mBatchSize, nullptr, 'n'},
|
{"BATCH_SIZE", &mBatchSize, nullptr, 'n'},
|
||||||
};
|
};
|
||||||
UTIL_READ_CONF(FLP_CONF_FILE, flp_conf_param_table);
|
UTIL_READ_CONF(BATCHING_CONF_FILE, batching_conf_param_table);
|
||||||
if (mBatchSize < 0) {
|
if (mBatchSize < 0) {
|
||||||
// set mBatchSize to 0 if we got an illegal value from config file
|
// set mBatchSize to 0 if we got an illegal value from config file
|
||||||
mBatchSize = 0;
|
mBatchSize = 0;
|
||||||
|
|
Loading…
Reference in a new issue