sm7325-common: Update GPS from LA.UM.9.14.r1-24900-LAHAINA.QSSI14.0
Change-Id: If51ee4e4952e4d80fee116e7f7e07ab22a17522a
This commit is contained in:
parent
f7473f4acb
commit
c7eb5ab0ba
@ -15,19 +15,3 @@ GNSS_CFLAGS = [
|
|||||||
"-Wno-error=switch",
|
"-Wno-error=switch",
|
||||||
"-Wno-error=date-time",
|
"-Wno-error=date-time",
|
||||||
]
|
]
|
||||||
|
|
||||||
/* Activate the following for debug purposes only,
|
|
||||||
comment out for production */
|
|
||||||
GNSS_SANITIZE_DIAG = {
|
|
||||||
/*
|
|
||||||
diag: {
|
|
||||||
cfi: true,
|
|
||||||
misc_undefined: [
|
|
||||||
"bounds",
|
|
||||||
"null",
|
|
||||||
"unreachable",
|
|
||||||
"integer",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
@ -36,6 +36,4 @@ endif
|
|||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||||
|
|
||||||
GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address
|
|
||||||
|
|
||||||
endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||||
|
@ -83,8 +83,11 @@ void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
|
|||||||
}
|
}
|
||||||
st.ipV4Addr = status.ipV4Addr;
|
st.ipV4Addr = status.ipV4Addr;
|
||||||
|
|
||||||
if (mAGnssCbIface != nullptr) {
|
mMutex.lock();
|
||||||
auto r = mAGnssCbIface->agnssStatusIpV4Cb(st);
|
auto aGnssCbIface = mAGnssCbIface;
|
||||||
|
mMutex.unlock();
|
||||||
|
if (aGnssCbIface != nullptr) {
|
||||||
|
auto r = aGnssCbIface->agnssStatusIpV4Cb(st);
|
||||||
if (!r.isOk()) {
|
if (!r.isOk()) {
|
||||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||||
}
|
}
|
||||||
@ -101,7 +104,9 @@ Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save the interface
|
// Save the interface
|
||||||
|
mMutex.lock();
|
||||||
mAGnssCbIface = callback;
|
mAGnssCbIface = callback;
|
||||||
|
mMutex.unlock();
|
||||||
|
|
||||||
AgpsCbInfo cbInfo = {};
|
AgpsCbInfo cbInfo = {};
|
||||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
#include <android/hardware/gnss/1.0/IAGnss.h>
|
#include <android/hardware/gnss/1.0/IAGnss.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
#include <gps_extended_c.h>
|
#include <gps_extended_c.h>
|
||||||
@ -67,6 +68,7 @@ struct AGnss : public IAGnss {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Gnss* mGnss = nullptr;
|
Gnss* mGnss = nullptr;
|
||||||
|
std::mutex mMutex;
|
||||||
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "Gnss.h"
|
#include "Gnss.h"
|
||||||
#include "AGnssRil.h"
|
#include "AGnssRil.h"
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
|
|
||||||
typedef void* (getLocationInterface)();
|
typedef void* (getLocationInterface)();
|
||||||
|
|
||||||
@ -58,29 +58,29 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||||||
|
|
||||||
// for XTRA
|
// for XTRA
|
||||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||||
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case IAGnssRil::NetworkType::MOBILE:
|
case IAGnssRil::NetworkType::MOBILE:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
|
typeout = loc_core::TYPE_MOBILE;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::WIFI:
|
case IAGnssRil::NetworkType::WIFI:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
|
typeout = loc_core::TYPE_WIFI;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::MMS:
|
case IAGnssRil::NetworkType::MMS:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS;
|
typeout = loc_core::TYPE_MMS;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::SUPL:
|
case IAGnssRil::NetworkType::SUPL:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL;
|
typeout = loc_core::TYPE_SUPL;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::DUN:
|
case IAGnssRil::NetworkType::DUN:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN;
|
typeout = loc_core::TYPE_DUN;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::HIPRI:
|
case IAGnssRil::NetworkType::HIPRI:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI;
|
typeout = loc_core::TYPE_HIPRI;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::WIMAX:
|
case IAGnssRil::NetworkType::WIMAX:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
typeout = loc_core::TYPE_WIMAX;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
@ -89,16 +89,16 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||||||
switch(networkType)
|
switch(networkType)
|
||||||
{
|
{
|
||||||
case NetworkType_BLUETOOTH:
|
case NetworkType_BLUETOOTH:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
|
typeout = loc_core::TYPE_BLUETOOTH;
|
||||||
break;
|
break;
|
||||||
case NetworkType_ETHERNET:
|
case NetworkType_ETHERNET:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
|
typeout = loc_core::TYPE_ETHERNET;
|
||||||
break;
|
break;
|
||||||
case NetworkType_PROXY:
|
case NetworkType_PROXY:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
|
typeout = loc_core::TYPE_PROXY;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
typeout = loc_core::TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3,8 +3,6 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
|
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
@ -59,8 +57,6 @@ include $(BUILD_SHARED_LIBRARY)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
|
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml
|
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
|
@ -18,11 +18,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <MeasurementAPIClient.h>
|
#include <GnssMeasurement.h>
|
||||||
#include "GnssMeasurement.h"
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -52,44 +56,47 @@ GnssMeasurement::~GnssMeasurement() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||||
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface, GNSS_POWER_MODE_INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode) {
|
||||||
|
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (myCallback != callback) {
|
||||||
|
if (nullptr == callback) {
|
||||||
|
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||||
|
mApi->measurementSetCallback(callback);
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
if (nullptr != myCallback) {
|
||||||
|
myCallback->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
|
}
|
||||||
|
myCallback = callback;
|
||||||
|
myCallback->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||||
|
ret = mApi->measurementSetCallback(callback, powerMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mGnssMeasurementCbIface = callback;
|
return ret;
|
||||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback(callback);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Return<void> GnssMeasurement::close() {
|
Return<void> GnssMeasurement::close() {
|
||||||
if (mApi == nullptr) {
|
if (mApi != nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
mApi->measurementSetCallback<V1_0::IGnssMeasurementCallback>(nullptr);
|
||||||
return Void();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
if (mGnssMeasurementCbIface != nullptr) {
|
||||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
mGnssMeasurementCbIface = nullptr;
|
mGnssMeasurementCbIface = nullptr;
|
||||||
}
|
}
|
||||||
mApi->measurementClose();
|
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
|
||||||
|
|
||||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||||
#include <hidl/MQDescriptor.h>
|
#include <hidl/MQDescriptor.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
|
#include "MeasurementAPIClient.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -62,7 +68,9 @@ struct GnssMeasurement : public IGnssMeasurement {
|
|||||||
sp<GnssMeasurement> mGnssMeasurement;
|
sp<GnssMeasurement> mGnssMeasurement;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode);
|
||||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||||
MeasurementAPIClient* mApi;
|
MeasurementAPIClient* mApi;
|
||||||
|
@ -63,19 +63,6 @@ MeasurementAPIClient::~MeasurementAPIClient()
|
|||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for GpsInterface
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
mGnssMeasurementCbIface = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||||
MeasurementAPIClient::startTracking()
|
MeasurementAPIClient::startTracking()
|
||||||
{
|
{
|
||||||
@ -83,16 +70,6 @@ MeasurementAPIClient::startTracking()
|
|||||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||||
|
|
||||||
locationCallbacks.trackingCb = nullptr;
|
|
||||||
locationCallbacks.batchingCb = nullptr;
|
|
||||||
locationCallbacks.geofenceBreachCb = nullptr;
|
|
||||||
locationCallbacks.geofenceStatusCb = nullptr;
|
|
||||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
|
||||||
locationCallbacks.gnssNiCb = nullptr;
|
|
||||||
locationCallbacks.gnssSvCb = nullptr;
|
|
||||||
locationCallbacks.gnssNmeaCb = nullptr;
|
|
||||||
|
|
||||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
if (mGnssMeasurementCbIface != nullptr) {
|
||||||
locationCallbacks.gnssMeasurementsCb =
|
locationCallbacks.gnssMeasurementsCb =
|
||||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||||
@ -109,7 +86,7 @@ MeasurementAPIClient::startTracking()
|
|||||||
options.mode = GNSS_SUPL_MODE_STANDALONE;
|
options.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||||
|
|
||||||
mTracking = true;
|
mTracking = true;
|
||||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
LOC_LOGd();
|
||||||
locAPIStartTracking(options);
|
locAPIStartTracking(options);
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,15 @@ public:
|
|||||||
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||||
|
|
||||||
// for GpsMeasurementInterface
|
// for GpsMeasurementInterface
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
template <typename T>
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback);
|
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||||
|
const sp<T>& callback, GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID) {
|
||||||
|
mMutex.lock();
|
||||||
|
setCallbackLocked(callback);
|
||||||
|
mMutex.unlock();
|
||||||
|
|
||||||
|
return startTracking();
|
||||||
|
}
|
||||||
void measurementClose();
|
void measurementClose();
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking();
|
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking();
|
||||||
|
|
||||||
@ -62,6 +69,9 @@ public:
|
|||||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
inline void setCallbackLocked(const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface = callback;
|
||||||
|
}
|
||||||
virtual ~MeasurementAPIClient();
|
virtual ~MeasurementAPIClient();
|
||||||
|
|
||||||
std::mutex mMutex;
|
std::mutex mMutex;
|
||||||
|
@ -83,8 +83,11 @@ void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
|
|||||||
}
|
}
|
||||||
st.ipV4Addr = status.ipV4Addr;
|
st.ipV4Addr = status.ipV4Addr;
|
||||||
|
|
||||||
if (mAGnssCbIface != nullptr) {
|
mMutex.lock();
|
||||||
auto r = mAGnssCbIface->agnssStatusIpV4Cb(st);
|
auto aGnssCbIface = mAGnssCbIface;
|
||||||
|
mMutex.unlock();
|
||||||
|
if (aGnssCbIface != nullptr) {
|
||||||
|
auto r = aGnssCbIface->agnssStatusIpV4Cb(st);
|
||||||
if (!r.isOk()) {
|
if (!r.isOk()) {
|
||||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||||
}
|
}
|
||||||
@ -101,7 +104,9 @@ Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save the interface
|
// Save the interface
|
||||||
|
mMutex.lock();
|
||||||
mAGnssCbIface = callback;
|
mAGnssCbIface = callback;
|
||||||
|
mMutex.unlock();
|
||||||
|
|
||||||
AgpsCbInfo cbInfo = {};
|
AgpsCbInfo cbInfo = {};
|
||||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
#include <android/hardware/gnss/1.0/IAGnss.h>
|
#include <android/hardware/gnss/1.0/IAGnss.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
#include <gps_extended_c.h>
|
#include <gps_extended_c.h>
|
||||||
@ -67,6 +68,7 @@ struct AGnss : public IAGnss {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Gnss* mGnss = nullptr;
|
Gnss* mGnss = nullptr;
|
||||||
|
std::mutex mMutex;
|
||||||
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "Gnss.h"
|
#include "Gnss.h"
|
||||||
#include "AGnssRil.h"
|
#include "AGnssRil.h"
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
|
|
||||||
typedef void* (getLocationInterface)();
|
typedef void* (getLocationInterface)();
|
||||||
|
|
||||||
@ -58,29 +58,29 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||||||
|
|
||||||
// for XTRA
|
// for XTRA
|
||||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||||
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case IAGnssRil::NetworkType::MOBILE:
|
case IAGnssRil::NetworkType::MOBILE:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
|
typeout = loc_core::TYPE_MOBILE;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::WIFI:
|
case IAGnssRil::NetworkType::WIFI:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
|
typeout = loc_core::TYPE_WIFI;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::MMS:
|
case IAGnssRil::NetworkType::MMS:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS;
|
typeout = loc_core::TYPE_MMS;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::SUPL:
|
case IAGnssRil::NetworkType::SUPL:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL;
|
typeout = loc_core::TYPE_SUPL;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::DUN:
|
case IAGnssRil::NetworkType::DUN:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN;
|
typeout = loc_core::TYPE_DUN;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::HIPRI:
|
case IAGnssRil::NetworkType::HIPRI:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI;
|
typeout = loc_core::TYPE_HIPRI;
|
||||||
break;
|
break;
|
||||||
case IAGnssRil::NetworkType::WIMAX:
|
case IAGnssRil::NetworkType::WIMAX:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
typeout = loc_core::TYPE_WIMAX;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
@ -89,16 +89,16 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||||||
switch(networkType)
|
switch(networkType)
|
||||||
{
|
{
|
||||||
case NetworkType_BLUETOOTH:
|
case NetworkType_BLUETOOTH:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
|
typeout = loc_core::TYPE_BLUETOOTH;
|
||||||
break;
|
break;
|
||||||
case NetworkType_ETHERNET:
|
case NetworkType_ETHERNET:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
|
typeout = loc_core::TYPE_ETHERNET;
|
||||||
break;
|
break;
|
||||||
case NetworkType_PROXY:
|
case NetworkType_PROXY:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
|
typeout = loc_core::TYPE_PROXY;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
typeout = loc_core::TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3,8 +3,6 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti
|
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
@ -60,8 +58,6 @@ include $(BUILD_SHARED_LIBRARY)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti
|
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml
|
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
|
@ -380,7 +380,8 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
|
|||||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||||
odcpiRequestCb(odcpiRequest);
|
odcpiRequestCb(odcpiRequest);
|
||||||
};
|
};
|
||||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||||
}
|
}
|
||||||
return setCallback(callback);
|
return setCallback(callback);
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <MeasurementAPIClient.h>
|
|
||||||
#include "GnssMeasurement.h"
|
#include "GnssMeasurement.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
@ -52,37 +56,42 @@ GnssMeasurement::~GnssMeasurement() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||||
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface, GNSS_POWER_MODE_INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode) {
|
||||||
|
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (myCallback != callback) {
|
||||||
|
if (nullptr == callback) {
|
||||||
|
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||||
|
mApi->measurementSetCallback(callback);
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
if (nullptr != myCallback) {
|
||||||
|
myCallback->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
|
}
|
||||||
|
myCallback = callback;
|
||||||
|
myCallback->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||||
|
ret = mApi->measurementSetCallback(callback, powerMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mGnssMeasurementCbIface = callback;
|
return ret;
|
||||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback(callback);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Return<void> GnssMeasurement::close() {
|
Return<void> GnssMeasurement::close() {
|
||||||
if (mApi == nullptr) {
|
if (mApi != nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
mApi->measurementSetCallback<V1_0::IGnssMeasurementCallback>(nullptr);
|
||||||
return Void();
|
mApi->measurementSetCallback<V1_1::IGnssMeasurementCallback>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
if (mGnssMeasurementCbIface != nullptr) {
|
||||||
@ -93,7 +102,6 @@ Return<void> GnssMeasurement::close() {
|
|||||||
mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
mGnssMeasurementCbIface_1_1 = nullptr;
|
mGnssMeasurementCbIface_1_1 = nullptr;
|
||||||
}
|
}
|
||||||
mApi->measurementClose();
|
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
@ -101,30 +109,8 @@ Return<void> GnssMeasurement::close() {
|
|||||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
||||||
const sp<IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
const sp<IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface_1_1,
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
|
||||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (nullptr == mApi) {
|
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
mGnssMeasurementCbIface_1_1 = callback;
|
|
||||||
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
GnssPowerMode powerMode = enableFullTracking?
|
|
||||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback_1_1(callback, powerMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
|
@ -18,12 +18,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||||
|
|
||||||
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
#include <android/hardware/gnss/1.1/IGnssMeasurement.h>
|
||||||
#include <hidl/MQDescriptor.h>
|
#include <hidl/MQDescriptor.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
|
#include "MeasurementAPIClient.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -67,7 +73,9 @@ struct GnssMeasurement : public IGnssMeasurement {
|
|||||||
sp<GnssMeasurement> mGnssMeasurement;
|
sp<GnssMeasurement> mGnssMeasurement;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode);
|
||||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
||||||
|
@ -66,34 +66,6 @@ MeasurementAPIClient::~MeasurementAPIClient()
|
|||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for GpsInterface
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
mGnssMeasurementCbIface = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback_1_1(
|
|
||||||
const sp<IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
|
||||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
mGnssMeasurementCbIface_1_1 = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking(powerMode, timeBetweenMeasurement);
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||||
MeasurementAPIClient::startTracking(
|
MeasurementAPIClient::startTracking(
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||||
@ -102,16 +74,6 @@ MeasurementAPIClient::startTracking(
|
|||||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||||
|
|
||||||
locationCallbacks.trackingCb = nullptr;
|
|
||||||
locationCallbacks.batchingCb = nullptr;
|
|
||||||
locationCallbacks.geofenceBreachCb = nullptr;
|
|
||||||
locationCallbacks.geofenceStatusCb = nullptr;
|
|
||||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
|
||||||
locationCallbacks.gnssNiCb = nullptr;
|
|
||||||
locationCallbacks.gnssSvCb = nullptr;
|
|
||||||
locationCallbacks.gnssNmeaCb = nullptr;
|
|
||||||
|
|
||||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
|
||||||
if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) {
|
if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) {
|
||||||
locationCallbacks.gnssMeasurementsCb =
|
locationCallbacks.gnssMeasurementsCb =
|
||||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||||
@ -132,7 +94,7 @@ MeasurementAPIClient::startTracking(
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTracking = true;
|
mTracking = true;
|
||||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
LOC_LOGd("(powermode: %d) (tbm %d)", (int)powerMode, timeBetweenMeasurement);
|
||||||
locAPIStartTracking(options);
|
locAPIStartTracking(options);
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -53,12 +53,15 @@ public:
|
|||||||
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||||
|
|
||||||
// for GpsMeasurementInterface
|
// for GpsMeasurementInterface
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
template <typename T>
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback);
|
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_1_1(
|
const sp<T>& callback, GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID) {
|
||||||
const sp<IGnssMeasurementCallback>& callback,
|
mMutex.lock();
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
setCallbackLocked(callback);
|
||||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
mMutex.unlock();
|
||||||
|
|
||||||
|
return startTracking(powerMode);
|
||||||
|
}
|
||||||
void measurementClose();
|
void measurementClose();
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||||
@ -68,6 +71,12 @@ public:
|
|||||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
inline void setCallbackLocked(const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface = callback;
|
||||||
|
}
|
||||||
|
inline void setCallbackLocked(const sp<V1_1::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface_1_1 = callback;
|
||||||
|
}
|
||||||
virtual ~MeasurementAPIClient();
|
virtual ~MeasurementAPIClient();
|
||||||
|
|
||||||
std::mutex mMutex;
|
std::mutex mMutex;
|
||||||
|
@ -84,8 +84,11 @@ void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAGnssCbIface != nullptr) {
|
mMutex.lock();
|
||||||
auto r = mAGnssCbIface->agnssStatusCb(aType, aStatus);
|
auto aGnssCbIface = mAGnssCbIface;
|
||||||
|
mMutex.unlock();
|
||||||
|
if (aGnssCbIface != nullptr) {
|
||||||
|
auto r = aGnssCbIface->agnssStatusCb(aType, aStatus);
|
||||||
if (!r.isOk()) {
|
if (!r.isOk()) {
|
||||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||||
}
|
}
|
||||||
@ -103,7 +106,9 @@ Return<void> AGnss::setCallback(const sp<V2_0::IAGnssCallback>& callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save the interface
|
// Save the interface
|
||||||
|
mMutex.lock();
|
||||||
mAGnssCbIface = callback;
|
mAGnssCbIface = callback;
|
||||||
|
mMutex.unlock();
|
||||||
|
|
||||||
AgpsCbInfo cbInfo = {};
|
AgpsCbInfo cbInfo = {};
|
||||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
#include <android/hardware/gnss/2.0/IAGnss.h>
|
#include <android/hardware/gnss/2.0/IAGnss.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
#include <gps_extended_c.h>
|
#include <gps_extended_c.h>
|
||||||
@ -65,6 +66,7 @@ struct AGnss : public V2_0::IAGnss {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Gnss* mGnss = nullptr;
|
Gnss* mGnss = nullptr;
|
||||||
|
std::mutex mMutex;
|
||||||
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "Gnss.h"
|
#include "Gnss.h"
|
||||||
#include "AGnssRil.h"
|
#include "AGnssRil.h"
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
|
|
||||||
typedef void* (getLocationInterface)();
|
typedef void* (getLocationInterface)();
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti
|
LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
@ -72,8 +70,6 @@ include $(BUILD_SHARED_LIBRARY)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@2.0-service-qti
|
LOCAL_MODULE := android.hardware.gnss@2.0-service-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml
|
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
|
@ -446,7 +446,8 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
|
|||||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||||
odcpiRequestCb(odcpiRequest);
|
odcpiRequestCb(odcpiRequest);
|
||||||
};
|
};
|
||||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssAPIClient* api = getApi();
|
GnssAPIClient* api = getApi();
|
||||||
@ -579,7 +580,8 @@ Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) {
|
|||||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||||
odcpiRequestCb(odcpiRequest);
|
odcpiRequestCb(odcpiRequest);
|
||||||
};
|
};
|
||||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssAPIClient* api = getApi();
|
GnssAPIClient* api = getApi();
|
||||||
|
@ -18,11 +18,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include "GnssMeasurement.h"
|
#include "GnssMeasurement.h"
|
||||||
#include "MeasurementAPIClient.h"
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -54,32 +58,41 @@ GnssMeasurement::~GnssMeasurement() {
|
|||||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface, GNSS_POWER_MODE_INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode) {
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (myCallback != callback) {
|
||||||
|
if (nullptr == callback) {
|
||||||
|
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||||
|
mApi->measurementSetCallback(callback);
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
if (nullptr != myCallback) {
|
||||||
|
myCallback->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
|
}
|
||||||
|
myCallback = callback;
|
||||||
|
myCallback->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||||
|
ret = mApi->measurementSetCallback(callback, powerMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearInterfaces();
|
return ret;
|
||||||
|
|
||||||
mGnssMeasurementCbIface = callback;
|
|
||||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback(callback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GnssMeasurement::clearInterfaces() {
|
void GnssMeasurement::clearInterfaces() {
|
||||||
|
if (mApi != nullptr) {
|
||||||
|
mApi->measurementSetCallback<V1_0::IGnssMeasurementCallback>(nullptr);
|
||||||
|
mApi->measurementSetCallback<V1_1::IGnssMeasurementCallback>(nullptr);
|
||||||
|
mApi->measurementSetCallback<V2_0::IGnssMeasurementCallback>(nullptr);
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
if (mGnssMeasurementCbIface != nullptr) {
|
||||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
mGnssMeasurementCbIface = nullptr;
|
mGnssMeasurementCbIface = nullptr;
|
||||||
@ -109,63 +122,15 @@ Return<void> GnssMeasurement::close() {
|
|||||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
||||||
const sp<V1_1::IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
const sp<V1_1::IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface_1_1,
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
|
||||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (nullptr == mApi) {
|
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearInterfaces();
|
|
||||||
|
|
||||||
mGnssMeasurementCbIface_1_1 = callback;
|
|
||||||
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
GnssPowerMode powerMode = enableFullTracking?
|
|
||||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback_1_1(callback, powerMode);
|
|
||||||
}
|
}
|
||||||
// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow.
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_0(
|
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_0(
|
||||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
||||||
bool enableFullTracking) {
|
bool enableFullTracking) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface_2_0,
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
|
||||||
if (mGnssMeasurementCbIface_2_0 != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (nullptr == mApi) {
|
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearInterfaces();
|
|
||||||
|
|
||||||
mGnssMeasurementCbIface_2_0 = callback;
|
|
||||||
mGnssMeasurementCbIface_2_0->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
GnssPowerMode powerMode = enableFullTracking ?
|
|
||||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback_2_0(callback, powerMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
|
@ -18,12 +18,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H
|
#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H
|
#define ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H
|
||||||
|
|
||||||
#include <android/hardware/gnss/2.0/IGnssMeasurement.h>
|
#include <android/hardware/gnss/2.0/IGnssMeasurement.h>
|
||||||
#include <hidl/MQDescriptor.h>
|
#include <hidl/MQDescriptor.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
|
#include "MeasurementAPIClient.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -69,7 +75,9 @@ struct GnssMeasurement : public V2_0::IGnssMeasurement {
|
|||||||
sp<GnssMeasurement> mGnssMeasurement;
|
sp<GnssMeasurement> mGnssMeasurement;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode);
|
||||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||||
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
||||||
|
@ -82,52 +82,6 @@ void MeasurementAPIClient::clearInterfaces()
|
|||||||
mGnssMeasurementCbIface_2_0 = nullptr;
|
mGnssMeasurementCbIface_2_0 = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for GpsInterface
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback_1_1(
|
|
||||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
|
||||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface_1_1 = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking(powerMode, timeBetweenMeasurement);
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback_2_0(
|
|
||||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
|
||||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface_2_0 = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking(powerMode, timeBetweenMeasurement);
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||||
MeasurementAPIClient::startTracking(
|
MeasurementAPIClient::startTracking(
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||||
@ -136,16 +90,6 @@ MeasurementAPIClient::startTracking(
|
|||||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||||
|
|
||||||
locationCallbacks.trackingCb = nullptr;
|
|
||||||
locationCallbacks.batchingCb = nullptr;
|
|
||||||
locationCallbacks.geofenceBreachCb = nullptr;
|
|
||||||
locationCallbacks.geofenceStatusCb = nullptr;
|
|
||||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
|
||||||
locationCallbacks.gnssNiCb = nullptr;
|
|
||||||
locationCallbacks.gnssSvCb = nullptr;
|
|
||||||
locationCallbacks.gnssNmeaCb = nullptr;
|
|
||||||
|
|
||||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
|
||||||
if (mGnssMeasurementCbIface_2_0 != nullptr ||
|
if (mGnssMeasurementCbIface_2_0 != nullptr ||
|
||||||
mGnssMeasurementCbIface_1_1 != nullptr ||
|
mGnssMeasurementCbIface_1_1 != nullptr ||
|
||||||
mGnssMeasurementCbIface != nullptr) {
|
mGnssMeasurementCbIface != nullptr) {
|
||||||
@ -168,7 +112,7 @@ MeasurementAPIClient::startTracking(
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTracking = true;
|
mTracking = true;
|
||||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
LOC_LOGd("(powermode: %d) (tbm %d)", (int)powerMode, timeBetweenMeasurement);
|
||||||
locAPIStartTracking(options);
|
locAPIStartTracking(options);
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||||
}
|
}
|
||||||
@ -177,6 +121,7 @@ MeasurementAPIClient::startTracking(
|
|||||||
void MeasurementAPIClient::measurementClose() {
|
void MeasurementAPIClient::measurementClose() {
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
mTracking = false;
|
mTracking = false;
|
||||||
|
clearInterfaces();
|
||||||
locAPIStopTracking();
|
locAPIStopTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <android/hardware/gnss/2.0/IGnssMeasurement.h>
|
#include <android/hardware/gnss/2.0/IGnssMeasurement.h>
|
||||||
//#include <android/hardware/gnss/1.1/IGnssMeasurementCallback.h>
|
|
||||||
#include <LocationAPIClientBase.h>
|
#include <LocationAPIClientBase.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
#include <gps_extended_c.h>
|
#include <gps_extended_c.h>
|
||||||
@ -53,16 +52,15 @@ public:
|
|||||||
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||||
|
|
||||||
// for GpsMeasurementInterface
|
// for GpsMeasurementInterface
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
template <typename T>
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback);
|
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_1_1(
|
const sp<T>& callback, GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID) {
|
||||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
mMutex.lock();
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
setCallbackLocked(callback);
|
||||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
mMutex.unlock();
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_2_0(
|
|
||||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
return startTracking(powerMode);
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
}
|
||||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
|
||||||
void measurementClose();
|
void measurementClose();
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||||
@ -72,6 +70,15 @@ public:
|
|||||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
inline void setCallbackLocked(const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface = callback;
|
||||||
|
}
|
||||||
|
inline void setCallbackLocked(const sp<V1_1::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface_1_1 = callback;
|
||||||
|
}
|
||||||
|
inline void setCallbackLocked(const sp<V2_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface_2_0 = callback;
|
||||||
|
}
|
||||||
virtual ~MeasurementAPIClient();
|
virtual ~MeasurementAPIClient();
|
||||||
|
|
||||||
std::mutex mMutex;
|
std::mutex mMutex;
|
||||||
|
@ -51,9 +51,6 @@ void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) {
|
|||||||
V2_0::IAGnssCallback::AGnssType aType;
|
V2_0::IAGnssCallback::AGnssType aType;
|
||||||
IAGnssCallback::AGnssStatusValue aStatus;
|
IAGnssCallback::AGnssStatusValue aStatus;
|
||||||
|
|
||||||
// cache the AGps Type
|
|
||||||
mType = type;
|
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case LOC_AGPS_TYPE_SUPL:
|
case LOC_AGPS_TYPE_SUPL:
|
||||||
aType = IAGnssCallback::AGnssType::SUPL;
|
aType = IAGnssCallback::AGnssType::SUPL;
|
||||||
@ -87,8 +84,13 @@ void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAGnssCbIface != nullptr) {
|
mMutex.lock();
|
||||||
auto r = mAGnssCbIface->agnssStatusCb(aType, aStatus);
|
// cache the AGps Type
|
||||||
|
mType = type;
|
||||||
|
auto aGnssCbIface = mAGnssCbIface;
|
||||||
|
mMutex.unlock();
|
||||||
|
if (aGnssCbIface != nullptr) {
|
||||||
|
auto r = aGnssCbIface->agnssStatusCb(aType, aStatus);
|
||||||
if (!r.isOk()) {
|
if (!r.isOk()) {
|
||||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||||
}
|
}
|
||||||
@ -106,7 +108,9 @@ Return<void> AGnss::setCallback(const sp<V2_0::IAGnssCallback>& callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save the interface
|
// Save the interface
|
||||||
|
mMutex.lock();
|
||||||
mAGnssCbIface = callback;
|
mAGnssCbIface = callback;
|
||||||
|
mMutex.unlock();
|
||||||
|
|
||||||
AgpsCbInfo cbInfo = {};
|
AgpsCbInfo cbInfo = {};
|
||||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
#include <android/hardware/gnss/2.0/IAGnss.h>
|
#include <android/hardware/gnss/2.0/IAGnss.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
#include <gps_extended_c.h>
|
#include <gps_extended_c.h>
|
||||||
@ -66,6 +67,7 @@ struct AGnss : public V2_0::IAGnss {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Gnss* mGnss = nullptr;
|
Gnss* mGnss = nullptr;
|
||||||
|
std::mutex mMutex;
|
||||||
sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr;
|
sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr;
|
||||||
|
|
||||||
AGpsExtType mType;
|
AGpsExtType mType;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "Gnss.h"
|
#include "Gnss.h"
|
||||||
#include "AGnssRil.h"
|
#include "AGnssRil.h"
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
|
|
||||||
typedef void* (getLocationInterface)();
|
typedef void* (getLocationInterface)();
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@2.1-impl-qti
|
LOCAL_MODULE := android.hardware.gnss@2.1-impl-qti
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
@ -74,8 +72,6 @@ include $(BUILD_SHARED_LIBRARY)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := android.hardware.gnss@2.1-service-qti
|
LOCAL_MODULE := android.hardware.gnss@2.1-service-qti
|
||||||
|
|
||||||
# activate the following line for debug purposes only, comment out for production
|
|
||||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
|
||||||
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.1-service-qti.xml
|
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.1-service-qti.xml
|
||||||
LOCAL_VENDOR_MODULE := true
|
LOCAL_VENDOR_MODULE := true
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||||
|
@ -459,7 +459,8 @@ Return<bool> Gnss::setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) {
|
|||||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||||
odcpiRequestCb(odcpiRequest);
|
odcpiRequestCb(odcpiRequest);
|
||||||
};
|
};
|
||||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssAPIClient* api = getApi();
|
GnssAPIClient* api = getApi();
|
||||||
@ -610,7 +611,8 @@ Return<bool> Gnss::setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) {
|
|||||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||||
odcpiRequestCb(odcpiRequest);
|
odcpiRequestCb(odcpiRequest);
|
||||||
};
|
};
|
||||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssAPIClient* api = getApi();
|
GnssAPIClient* api = getApi();
|
||||||
@ -748,7 +750,8 @@ Return<bool> Gnss::setCallback_2_1(const sp<V2_1::IGnssCallback>& callback) {
|
|||||||
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
|
||||||
odcpiRequestCb(odcpiRequest);
|
odcpiRequestCb(odcpiRequest);
|
||||||
};
|
};
|
||||||
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
|
gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
(EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssAPIClient* api = getApi();
|
GnssAPIClient* api = getApi();
|
||||||
|
@ -18,11 +18,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include "GnssMeasurement.h"
|
#include "GnssMeasurement.h"
|
||||||
#include "MeasurementAPIClient.h"
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -54,32 +58,44 @@ GnssMeasurement::~GnssMeasurement() {
|
|||||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface, GNSS_POWER_MODE_INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode) {
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (mApi == nullptr) {
|
if (mApi == nullptr) {
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearInterfaces();
|
if (myCallback != callback) {
|
||||||
|
if (nullptr == callback) {
|
||||||
|
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||||
|
mApi->measurementSetCallback(callback);
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
if (nullptr != myCallback) {
|
||||||
|
myCallback->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
|
}
|
||||||
|
myCallback = callback;
|
||||||
|
myCallback->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
||||||
|
ret = mApi->measurementSetCallback(callback, powerMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mGnssMeasurementCbIface = callback;
|
return ret;
|
||||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback(callback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GnssMeasurement::clearInterfaces() {
|
void GnssMeasurement::clearInterfaces() {
|
||||||
|
if (mApi != nullptr) {
|
||||||
|
mApi->measurementSetCallback<V1_0::IGnssMeasurementCallback>(nullptr);
|
||||||
|
mApi->measurementSetCallback<V1_1::IGnssMeasurementCallback>(nullptr);
|
||||||
|
mApi->measurementSetCallback<V2_0::IGnssMeasurementCallback>(nullptr);
|
||||||
|
mApi->measurementSetCallback<V2_1::IGnssMeasurementCallback>(nullptr);
|
||||||
|
}
|
||||||
if (mGnssMeasurementCbIface != nullptr) {
|
if (mGnssMeasurementCbIface != nullptr) {
|
||||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||||
mGnssMeasurementCbIface = nullptr;
|
mGnssMeasurementCbIface = nullptr;
|
||||||
@ -113,95 +129,24 @@ Return<void> GnssMeasurement::close() {
|
|||||||
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow.
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
Return<GnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_1_1(
|
||||||
const sp<V1_1::IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
const sp<V1_1::IGnssMeasurementCallback>& callback, bool enableFullTracking) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface_1_1,
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
|
||||||
if (mGnssMeasurementCbIface_1_1 != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (nullptr == mApi) {
|
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearInterfaces();
|
|
||||||
|
|
||||||
mGnssMeasurementCbIface_1_1 = callback;
|
|
||||||
mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
GnssPowerMode powerMode = enableFullTracking?
|
|
||||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback_1_1(callback, powerMode);
|
|
||||||
}
|
|
||||||
// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow.
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_0(
|
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_0(
|
||||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
||||||
bool enableFullTracking) {
|
bool enableFullTracking) {
|
||||||
|
return setCallback(callback, mGnssMeasurementCbIface_2_0,
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
|
||||||
if (mGnssMeasurementCbIface_2_0 != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (nullptr == mApi) {
|
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearInterfaces();
|
|
||||||
|
|
||||||
mGnssMeasurementCbIface_2_0 = callback;
|
|
||||||
mGnssMeasurementCbIface_2_0->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
GnssPowerMode powerMode = enableFullTracking ?
|
|
||||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback_2_0(callback, powerMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods from ::android::hardware::gnss::V2_1::IGnssMeasurement follow.
|
// Methods from ::android::hardware::gnss::V2_1::IGnssMeasurement follow.
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_1(
|
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback_2_1(
|
||||||
const sp<::android::hardware::gnss::V2_1::IGnssMeasurementCallback>& callback,
|
const sp<::android::hardware::gnss::V2_1::IGnssMeasurementCallback>& callback,
|
||||||
bool enableFullTracking) {
|
bool enableFullTracking) {
|
||||||
Return<GnssMeasurement::GnssMeasurementStatus> ret =
|
return setCallback(callback, mGnssMeasurementCbIface_2_1,
|
||||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
enableFullTracking ? GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2);
|
||||||
if (mGnssMeasurementCbIface_2_1 != nullptr) {
|
|
||||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback == nullptr) {
|
|
||||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (nullptr == mApi) {
|
|
||||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearInterfaces();
|
|
||||||
|
|
||||||
mGnssMeasurementCbIface_2_1 = callback;
|
|
||||||
mGnssMeasurementCbIface_2_1->linkToDeath(mGnssMeasurementDeathRecipient, 0);
|
|
||||||
|
|
||||||
GnssPowerMode powerMode = enableFullTracking ?
|
|
||||||
GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2;
|
|
||||||
|
|
||||||
return mApi->measurementSetCallback_2_1(callback, powerMode);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
|
@ -18,12 +18,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
#ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
||||||
#define ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
#define ANDROID_HARDWARE_GNSS_V2_1_GNSSMEASUREMENT_H
|
||||||
|
|
||||||
#include <android/hardware/gnss/2.1/IGnssMeasurement.h>
|
#include <android/hardware/gnss/2.1/IGnssMeasurement.h>
|
||||||
#include <hidl/MQDescriptor.h>
|
#include <hidl/MQDescriptor.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
|
#include "MeasurementAPIClient.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -74,7 +80,9 @@ struct GnssMeasurement : public V2_1::IGnssMeasurement {
|
|||||||
sp<GnssMeasurement> mGnssMeasurement;
|
sp<GnssMeasurement> mGnssMeasurement;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
template <typename T>
|
||||||
|
Return<IGnssMeasurement::GnssMeasurementStatus> setCallback(
|
||||||
|
const sp<T>& callback, sp<T>& myCallback, GnssPowerMode powerMode);
|
||||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||||
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||||
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
sp<V1_1::IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1 = nullptr;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti
|
service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti
|
||||||
class hal
|
class hal
|
||||||
user gps
|
user gps
|
||||||
group system gps radio vendor_qti_diag
|
group system gps radio vendor_qti_diag inet
|
||||||
|
@ -95,65 +95,6 @@ void MeasurementAPIClient::clearInterfaces()
|
|||||||
mGnssMeasurementCbIface_2_1 = nullptr;
|
mGnssMeasurementCbIface_2_1 = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for GpsInterface
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCallback>& callback)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback_1_1(
|
|
||||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
|
||||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface_1_1 = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking(powerMode, timeBetweenMeasurement);
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
|
||||||
MeasurementAPIClient::measurementSetCallback_2_0(
|
|
||||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
|
||||||
{
|
|
||||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
|
||||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface_2_0 = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking(powerMode, timeBetweenMeasurement);
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> MeasurementAPIClient::measurementSetCallback_2_1(
|
|
||||||
const sp<V2_1::IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) {
|
|
||||||
LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)",
|
|
||||||
__FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement);
|
|
||||||
|
|
||||||
mMutex.lock();
|
|
||||||
clearInterfaces();
|
|
||||||
mGnssMeasurementCbIface_2_1 = callback;
|
|
||||||
mMutex.unlock();
|
|
||||||
|
|
||||||
return startTracking(powerMode, timeBetweenMeasurement);
|
|
||||||
}
|
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||||
MeasurementAPIClient::startTracking(
|
MeasurementAPIClient::startTracking(
|
||||||
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
GnssPowerMode powerMode, uint32_t timeBetweenMeasurement)
|
||||||
@ -162,16 +103,6 @@ MeasurementAPIClient::startTracking(
|
|||||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||||
|
|
||||||
locationCallbacks.trackingCb = nullptr;
|
|
||||||
locationCallbacks.batchingCb = nullptr;
|
|
||||||
locationCallbacks.geofenceBreachCb = nullptr;
|
|
||||||
locationCallbacks.geofenceStatusCb = nullptr;
|
|
||||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
|
||||||
locationCallbacks.gnssNiCb = nullptr;
|
|
||||||
locationCallbacks.gnssSvCb = nullptr;
|
|
||||||
locationCallbacks.gnssNmeaCb = nullptr;
|
|
||||||
|
|
||||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
|
||||||
if (mGnssMeasurementCbIface_2_1 != nullptr ||
|
if (mGnssMeasurementCbIface_2_1 != nullptr ||
|
||||||
mGnssMeasurementCbIface_2_0 != nullptr ||
|
mGnssMeasurementCbIface_2_0 != nullptr ||
|
||||||
mGnssMeasurementCbIface_1_1 != nullptr ||
|
mGnssMeasurementCbIface_1_1 != nullptr ||
|
||||||
@ -195,7 +126,8 @@ MeasurementAPIClient::startTracking(
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTracking = true;
|
mTracking = true;
|
||||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
LOC_LOGd("(powermode: %d) (tbm %d)", (int)powerMode, timeBetweenMeasurement);
|
||||||
|
|
||||||
locAPIStartTracking(options);
|
locAPIStartTracking(options);
|
||||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||||
}
|
}
|
||||||
@ -204,6 +136,7 @@ MeasurementAPIClient::startTracking(
|
|||||||
void MeasurementAPIClient::measurementClose() {
|
void MeasurementAPIClient::measurementClose() {
|
||||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||||
mTracking = false;
|
mTracking = false;
|
||||||
|
clearInterfaces();
|
||||||
locAPIStopTracking();
|
locAPIStopTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <android/hardware/gnss/2.1/IGnssMeasurement.h>
|
#include <android/hardware/gnss/2.1/IGnssMeasurement.h>
|
||||||
//#include <android/hardware/gnss/1.1/IGnssMeasurementCallback.h>
|
|
||||||
#include <android/hardware/gnss/2.1/IGnssMeasurementCallback.h>
|
#include <android/hardware/gnss/2.1/IGnssMeasurementCallback.h>
|
||||||
#include <LocationAPIClientBase.h>
|
#include <LocationAPIClientBase.h>
|
||||||
#include <hidl/Status.h>
|
#include <hidl/Status.h>
|
||||||
@ -54,20 +53,16 @@ public:
|
|||||||
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||||
|
|
||||||
// for GpsMeasurementInterface
|
// for GpsMeasurementInterface
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
template <typename T>
|
||||||
const sp<V1_0::IGnssMeasurementCallback>& callback);
|
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_1_1(
|
const sp<T>& callback, GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID) {
|
||||||
const sp<V1_1::IGnssMeasurementCallback>& callback,
|
mMutex.lock();
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
setCallbackLocked(callback);
|
||||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
mMutex.unlock();
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_2_0(
|
|
||||||
const sp<V2_0::IGnssMeasurementCallback>& callback,
|
return startTracking(powerMode);
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
}
|
||||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
|
||||||
Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_2_1(
|
|
||||||
const sp<V2_1::IGnssMeasurementCallback>& callback,
|
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
|
||||||
uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS);
|
|
||||||
void measurementClose();
|
void measurementClose();
|
||||||
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(
|
||||||
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID,
|
||||||
@ -77,6 +72,18 @@ public:
|
|||||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
inline void setCallbackLocked(const sp<V1_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface = callback;
|
||||||
|
}
|
||||||
|
inline void setCallbackLocked(const sp<V1_1::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface_1_1 = callback;
|
||||||
|
}
|
||||||
|
inline void setCallbackLocked(const sp<V2_0::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface_2_0 = callback;
|
||||||
|
}
|
||||||
|
inline void setCallbackLocked(const sp<V2_1::IGnssMeasurementCallback>& callback) {
|
||||||
|
mGnssMeasurementCbIface_2_1 = callback;
|
||||||
|
}
|
||||||
virtual ~MeasurementAPIClient();
|
virtual ~MeasurementAPIClient();
|
||||||
|
|
||||||
std::mutex mMutex;
|
std::mutex mMutex;
|
||||||
|
@ -22,6 +22,7 @@ cc_library_shared {
|
|||||||
"LocContext.cpp",
|
"LocContext.cpp",
|
||||||
"loc_core_log.cpp",
|
"loc_core_log.cpp",
|
||||||
"data-items/DataItemsFactoryProxy.cpp",
|
"data-items/DataItemsFactoryProxy.cpp",
|
||||||
|
"data-items/DataItemConcreteTypes.cpp",
|
||||||
"SystemStatusOsObserver.cpp",
|
"SystemStatusOsObserver.cpp",
|
||||||
"SystemStatus.cpp",
|
"SystemStatus.cpp",
|
||||||
],
|
],
|
||||||
|
@ -26,6 +26,43 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
#define LOG_NDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_CtxBase"
|
#define LOG_TAG "LocSvc_CtxBase"
|
||||||
|
|
||||||
@ -51,6 +88,7 @@ bool ContextBase::sGnssMeasurementSupported = false;
|
|||||||
uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
|
uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||||
GnssNMEARptRate ContextBase::sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
|
GnssNMEARptRate ContextBase::sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
|
||||||
LocationCapabilitiesMask ContextBase::sQwesFeatureMask = 0;
|
LocationCapabilitiesMask ContextBase::sQwesFeatureMask = 0;
|
||||||
|
LocationCapabilitiesMask ContextBase::sHwCapabilitiesMask = 0;
|
||||||
|
|
||||||
const loc_param_s_type ContextBase::mGps_conf_table[] =
|
const loc_param_s_type ContextBase::mGps_conf_table[] =
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,42 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
#ifndef __LOC_CONTEXT_BASE__
|
#ifndef __LOC_CONTEXT_BASE__
|
||||||
#define __LOC_CONTEXT_BASE__
|
#define __LOC_CONTEXT_BASE__
|
||||||
|
|
||||||
@ -158,7 +194,10 @@ public:
|
|||||||
return mLBSProxy->getIzatDevId();
|
return mLBSProxy->getIzatDevId();
|
||||||
}
|
}
|
||||||
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
|
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
|
||||||
|
inline bool checkFeatureStatus(int* fids,
|
||||||
|
LocFeatureStatus* status, uint32_t idCount, bool directQwesCall = false) const {
|
||||||
|
return mLocApiProxy->checkFeatureStatus(fids, status, idCount, directQwesCall);
|
||||||
|
}
|
||||||
static loc_gps_cfg_s_type mGps_conf;
|
static loc_gps_cfg_s_type mGps_conf;
|
||||||
static loc_sap_cfg_s_type mSap_conf;
|
static loc_sap_cfg_s_type mSap_conf;
|
||||||
static bool sIsEngineCapabilitiesKnown;
|
static bool sIsEngineCapabilitiesKnown;
|
||||||
@ -167,6 +206,7 @@ public:
|
|||||||
static bool sGnssMeasurementSupported;
|
static bool sGnssMeasurementSupported;
|
||||||
static GnssNMEARptRate sNmeaReportRate;
|
static GnssNMEARptRate sNmeaReportRate;
|
||||||
static LocationCapabilitiesMask sQwesFeatureMask;
|
static LocationCapabilitiesMask sQwesFeatureMask;
|
||||||
|
static LocationHwCapabilitiesMask sHwCapabilitiesMask;
|
||||||
|
|
||||||
void readConfig();
|
void readConfig();
|
||||||
static uint32_t getCarrierCapabilities();
|
static uint32_t getCarrierCapabilities();
|
||||||
@ -273,6 +313,27 @@ public:
|
|||||||
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_VPE;
|
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_VPE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case LOCATION_QWES_FEATURE_TYPE_DGNSS:
|
||||||
|
if (itr->second) {
|
||||||
|
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_DGNSS;
|
||||||
|
} else {
|
||||||
|
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_DGNSS;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LOCATION_QWES_FEATURE_TYPE_RSSI_POSITIONING:
|
||||||
|
if (itr->second) {
|
||||||
|
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING;
|
||||||
|
} else {
|
||||||
|
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LOCATION_QWES_FEATURE_TYPE_RTT_POSITIONING:
|
||||||
|
if (itr->second) {
|
||||||
|
sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING;
|
||||||
|
} else {
|
||||||
|
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +371,19 @@ public:
|
|||||||
return (ContextBase::sQwesFeatureMask);
|
return (ContextBase::sQwesFeatureMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
set HW feature status info
|
||||||
|
*/
|
||||||
|
static inline void setHwCapabilities(const LocationHwCapabilitiesMask& mask) {
|
||||||
|
sHwCapabilitiesMask |= mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
get HW feature status info
|
||||||
|
*/
|
||||||
|
static inline LocationHwCapabilitiesMask getHwCapabilitiesMask() {
|
||||||
|
return (ContextBase::sHwCapabilitiesMask);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LocApiResponse: LocMsg {
|
struct LocApiResponse: LocMsg {
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#endif
|
#endif
|
||||||
|
#include <ContextBase.h>
|
||||||
|
|
||||||
namespace loc_core {
|
namespace loc_core {
|
||||||
|
|
||||||
@ -148,6 +149,7 @@ typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, boo
|
|||||||
// callback function to report back dr and ppe position and sv report
|
// callback function to report back dr and ppe position and sv report
|
||||||
typedef EngineHubProxyBase* (getEngHubProxyFn)(
|
typedef EngineHubProxyBase* (getEngHubProxyFn)(
|
||||||
const MsgTask * msgTask,
|
const MsgTask * msgTask,
|
||||||
|
const ContextBase * context,
|
||||||
IOsObserver* osObserver,
|
IOsObserver* osObserver,
|
||||||
GnssAdapterReportEnginePositionsEventCb positionEventCb,
|
GnssAdapterReportEnginePositionsEventCb positionEventCb,
|
||||||
GnssAdapterReportSvEventCb svEventCb,
|
GnssAdapterReportSvEventCb svEventCb,
|
||||||
|
@ -26,6 +26,43 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
#define LOG_NDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_LocAdapterBase"
|
#define LOG_TAG "LocSvc_LocAdapterBase"
|
||||||
|
|
||||||
@ -322,6 +359,19 @@ LocAdapterBase::getCapabilities()
|
|||||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_EDGNSS)) {
|
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_EDGNSS)) {
|
||||||
mask |= LOCATION_CAPABILITIES_EDGNSS_BIT;
|
mask |= LOCATION_CAPABILITIES_EDGNSS_BIT;
|
||||||
}
|
}
|
||||||
|
if ((ContextBase::getQwesFeatureStatus() & LOCATION_CAPABILITIES_QWES_PPE)) {
|
||||||
|
mask |= LOCATION_CAPABILITIES_QWES_PPE;
|
||||||
|
}
|
||||||
|
//Get QWES feature status mask
|
||||||
|
mask |= ContextBase::getQwesFeatureStatus();
|
||||||
|
//Get HW feature status mask
|
||||||
|
LocationHwCapabilitiesMask hwMask = ContextBase::getHwCapabilitiesMask();
|
||||||
|
if ((hwMask & LOCATION_WIFI_CAPABILITY_RTT) != 0) {
|
||||||
|
mask |= LOCATION_CAPABILITIES_WIFI_RTT_POSITIONING;
|
||||||
|
}
|
||||||
|
if ((hwMask & LOCATION_WIFI_CAPABILITY_RSSI) != 0) {
|
||||||
|
mask |= LOCATION_CAPABILITIES_WIFI_RSSI_POSITIONING;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__);
|
LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__);
|
||||||
}
|
}
|
||||||
|
@ -489,6 +489,8 @@ void LocApiBase::reportQwesCapabilities
|
|||||||
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap
|
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
//Set Qwes feature status map in ContextBase
|
||||||
|
ContextBase::setQwesFeatureStatus(featureMap);
|
||||||
// loop through adapters, and deliver to all adapters.
|
// loop through adapters, and deliver to all adapters.
|
||||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportQwesCapabilities(featureMap));
|
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportQwesCapabilities(featureMap));
|
||||||
}
|
}
|
||||||
@ -1034,7 +1036,7 @@ bool ElapsedRealtimeEstimator::getCurrentTime(
|
|||||||
struct timespec sinceBootTime;
|
struct timespec sinceBootTime;
|
||||||
struct timespec sinceBootTimeTest;
|
struct timespec sinceBootTimeTest;
|
||||||
bool clockGetTimeSuccess = false;
|
bool clockGetTimeSuccess = false;
|
||||||
const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 15000;
|
const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 2000000; // 2 milli-seconds
|
||||||
const uint32_t MAX_GET_TIME_COUNT = 20;
|
const uint32_t MAX_GET_TIME_COUNT = 20;
|
||||||
/* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption
|
/* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption
|
||||||
or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */
|
or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */
|
||||||
|
@ -26,6 +26,44 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LOC_API_BASE_H
|
#ifndef LOC_API_BASE_H
|
||||||
#define LOC_API_BASE_H
|
#define LOC_API_BASE_H
|
||||||
|
|
||||||
@ -102,6 +140,8 @@ public:
|
|||||||
inline virtual double getGloRfLoss(uint32_t left,
|
inline virtual double getGloRfLoss(uint32_t left,
|
||||||
uint32_t center, uint32_t right, uint8_t gloFrequency) { return 0.0; }
|
uint32_t center, uint32_t right, uint8_t gloFrequency) { return 0.0; }
|
||||||
inline virtual float getGeoidalSeparation(double latitude, double longitude) { return 0.0; }
|
inline virtual float getGeoidalSeparation(double latitude, double longitude) { return 0.0; }
|
||||||
|
inline virtual bool checkFeatureStatus(int* fids, LocFeatureStatus* status,
|
||||||
|
uint32_t idCount, bool directQwesCall = false) {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
class LocApiBase {
|
class LocApiBase {
|
||||||
@ -136,14 +176,17 @@ protected:
|
|||||||
}
|
}
|
||||||
bool isInSession();
|
bool isInSession();
|
||||||
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
|
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
|
||||||
bool isMaster();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool isMaster();
|
||||||
inline void sendMsg(const LocMsg* msg) const {
|
inline void sendMsg(const LocMsg* msg) const {
|
||||||
if (nullptr != mMsgTask) {
|
if (nullptr != mMsgTask) {
|
||||||
mMsgTask->sendMsg(msg);
|
mMsgTask->sendMsg(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
inline MsgTask* getMsgTask() const {
|
||||||
|
return mMsgTask;
|
||||||
|
}
|
||||||
inline void destroy() {
|
inline void destroy() {
|
||||||
close();
|
close();
|
||||||
struct LocKillMsg : public LocMsg {
|
struct LocKillMsg : public LocMsg {
|
||||||
|
@ -22,7 +22,8 @@ libloc_core_la_h_sources = \
|
|||||||
EngineHubProxyBase.h \
|
EngineHubProxyBase.h \
|
||||||
data-items/DataItemId.h \
|
data-items/DataItemId.h \
|
||||||
data-items/IDataItemCore.h \
|
data-items/IDataItemCore.h \
|
||||||
data-items/DataItemConcreteTypesBase.h \
|
data-items/DataItemConcreteTypes.h \
|
||||||
|
data-items/DataItemsFactoryProxy.h \
|
||||||
observer/IDataItemObserver.h \
|
observer/IDataItemObserver.h \
|
||||||
observer/IDataItemSubscription.h \
|
observer/IDataItemSubscription.h \
|
||||||
observer/IFrameworkActionReq.h \
|
observer/IFrameworkActionReq.h \
|
||||||
@ -37,6 +38,7 @@ libloc_core_la_c_sources = \
|
|||||||
LocContext.cpp \
|
LocContext.cpp \
|
||||||
loc_core_log.cpp \
|
loc_core_log.cpp \
|
||||||
data-items/DataItemsFactoryProxy.cpp \
|
data-items/DataItemsFactoryProxy.cpp \
|
||||||
|
data-items/DataItemConcreteTypes.cpp \
|
||||||
SystemStatusOsObserver.cpp \
|
SystemStatusOsObserver.cpp \
|
||||||
SystemStatus.cpp
|
SystemStatus.cpp
|
||||||
|
|
||||||
|
@ -26,6 +26,43 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "LocSvc_SystemStatus"
|
#define LOG_TAG "LocSvc_SystemStatus"
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
@ -40,7 +77,7 @@
|
|||||||
#include <DataItemsFactoryProxy.h>
|
#include <DataItemsFactoryProxy.h>
|
||||||
#include <SystemStatus.h>
|
#include <SystemStatus.h>
|
||||||
#include <SystemStatusOsObserver.h>
|
#include <SystemStatusOsObserver.h>
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
|
|
||||||
namespace loc_core
|
namespace loc_core
|
||||||
{
|
{
|
||||||
@ -748,18 +785,17 @@ SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer)
|
bool SystemStatusTimeAndClock::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mGpsWeek != ((const SystemStatusTimeAndClock&)peer).mGpsWeek) ||
|
||||||
if ((mGpsWeek != peer.mGpsWeek) ||
|
(mGpsTowMs != ((const SystemStatusTimeAndClock&)peer).mGpsTowMs) ||
|
||||||
(mGpsTowMs != peer.mGpsTowMs) ||
|
(mTimeValid != ((const SystemStatusTimeAndClock&)peer).mTimeValid) ||
|
||||||
(mTimeValid != peer.mTimeValid) ||
|
(mTimeSource != ((const SystemStatusTimeAndClock&)peer).mTimeSource) ||
|
||||||
(mTimeSource != peer.mTimeSource) ||
|
(mTimeUnc != ((const SystemStatusTimeAndClock&)peer).mTimeUnc) ||
|
||||||
(mTimeUnc != peer.mTimeUnc) ||
|
(mClockFreqBias != ((const SystemStatusTimeAndClock&)peer).mClockFreqBias) ||
|
||||||
(mClockFreqBias != peer.mClockFreqBias) ||
|
(mClockFreqBiasUnc != ((const SystemStatusTimeAndClock&)peer).mClockFreqBiasUnc) ||
|
||||||
(mClockFreqBiasUnc != peer.mClockFreqBiasUnc) ||
|
(mLeapSeconds != ((const SystemStatusTimeAndClock&)peer).mLeapSeconds) ||
|
||||||
(mLeapSeconds != peer.mLeapSeconds) ||
|
(mLeapSecUnc != ((const SystemStatusTimeAndClock&)peer).mLeapSecUnc) ||
|
||||||
(mLeapSecUnc != peer.mLeapSecUnc) ||
|
(mTimeUncNs != ((const SystemStatusTimeAndClock&)peer).mTimeUncNs)) {
|
||||||
(mTimeUncNs != peer.mTimeUncNs)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -790,9 +826,8 @@ SystemStatusXoState::SystemStatusXoState(const SystemStatusPQWM1& nmea) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusXoState::equals(const SystemStatusXoState& peer)
|
bool SystemStatusXoState::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if (mXoState != ((const SystemStatusXoState&)peer).mXoState) {
|
||||||
if (mXoState != peer.mXoState) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -832,27 +867,26 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusRfAndParams::equals(const SystemStatusRfAndParams& peer)
|
bool SystemStatusRfAndParams::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mPgaGain != ((const SystemStatusRfAndParams&)peer).mPgaGain) ||
|
||||||
if ((mPgaGain != peer.mPgaGain) ||
|
(mGpsBpAmpI != ((const SystemStatusRfAndParams&)peer).mGpsBpAmpI) ||
|
||||||
(mGpsBpAmpI != peer.mGpsBpAmpI) ||
|
(mGpsBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGpsBpAmpQ) ||
|
||||||
(mGpsBpAmpQ != peer.mGpsBpAmpQ) ||
|
(mAdcI != ((const SystemStatusRfAndParams&)peer).mAdcI) ||
|
||||||
(mAdcI != peer.mAdcI) ||
|
(mAdcQ != ((const SystemStatusRfAndParams&)peer).mAdcQ) ||
|
||||||
(mAdcQ != peer.mAdcQ) ||
|
(mJammerGps != ((const SystemStatusRfAndParams&)peer).mJammerGps) ||
|
||||||
(mJammerGps != peer.mJammerGps) ||
|
(mJammerGlo != ((const SystemStatusRfAndParams&)peer).mJammerGlo) ||
|
||||||
(mJammerGlo != peer.mJammerGlo) ||
|
(mJammerBds != ((const SystemStatusRfAndParams&)peer).mJammerBds) ||
|
||||||
(mJammerBds != peer.mJammerBds) ||
|
(mJammerGal != ((const SystemStatusRfAndParams&)peer).mJammerGal) ||
|
||||||
(mJammerGal != peer.mJammerGal) ||
|
(mAgcGps != ((const SystemStatusRfAndParams&)peer).mAgcGps) ||
|
||||||
(mAgcGps != peer.mAgcGps) ||
|
(mAgcGlo != ((const SystemStatusRfAndParams&)peer).mAgcGlo) ||
|
||||||
(mAgcGlo != peer.mAgcGlo) ||
|
(mAgcBds != ((const SystemStatusRfAndParams&)peer).mAgcBds) ||
|
||||||
(mAgcBds != peer.mAgcBds) ||
|
(mAgcGal != ((const SystemStatusRfAndParams&)peer).mAgcGal) ||
|
||||||
(mAgcGal != peer.mAgcGal) ||
|
(mGloBpAmpI != ((const SystemStatusRfAndParams&)peer).mGloBpAmpI) ||
|
||||||
(mGloBpAmpI != peer.mGloBpAmpI) ||
|
(mGloBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGloBpAmpQ) ||
|
||||||
(mGloBpAmpQ != peer.mGloBpAmpQ) ||
|
(mBdsBpAmpI != ((const SystemStatusRfAndParams&)peer).mBdsBpAmpI) ||
|
||||||
(mBdsBpAmpI != peer.mBdsBpAmpI) ||
|
(mBdsBpAmpQ != ((const SystemStatusRfAndParams&)peer).mBdsBpAmpQ) ||
|
||||||
(mBdsBpAmpQ != peer.mBdsBpAmpQ) ||
|
(mGalBpAmpI != ((const SystemStatusRfAndParams&)peer).mGalBpAmpI) ||
|
||||||
(mGalBpAmpI != peer.mGalBpAmpI) ||
|
(mGalBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGalBpAmpQ)) {
|
||||||
(mGalBpAmpQ != peer.mGalBpAmpQ)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -888,9 +922,8 @@ SystemStatusErrRecovery::SystemStatusErrRecovery(const SystemStatusPQWM1& nmea)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusErrRecovery::equals(const SystemStatusErrRecovery& peer)
|
bool SystemStatusErrRecovery::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if (mRecErrorRecovery != ((const SystemStatusErrRecovery&)peer).mRecErrorRecovery) {
|
||||||
if (mRecErrorRecovery != peer.mRecErrorRecovery) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -918,15 +951,14 @@ SystemStatusInjectedPosition::SystemStatusInjectedPosition(const SystemStatusPQW
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusInjectedPosition::equals(const SystemStatusInjectedPosition& peer)
|
bool SystemStatusInjectedPosition::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mEpiValidity != ((const SystemStatusInjectedPosition&)peer).mEpiValidity) ||
|
||||||
if ((mEpiValidity != peer.mEpiValidity) ||
|
(mEpiLat != ((const SystemStatusInjectedPosition&)peer).mEpiLat) ||
|
||||||
(mEpiLat != peer.mEpiLat) ||
|
(mEpiLon != ((const SystemStatusInjectedPosition&)peer).mEpiLon) ||
|
||||||
(mEpiLon != peer.mEpiLon) ||
|
(mEpiAlt != ((const SystemStatusInjectedPosition&)peer).mEpiAlt) ||
|
||||||
(mEpiAlt != peer.mEpiAlt) ||
|
(mEpiHepe != ((const SystemStatusInjectedPosition&)peer).mEpiHepe) ||
|
||||||
(mEpiHepe != peer.mEpiHepe) ||
|
(mEpiAltUnc != ((const SystemStatusInjectedPosition&)peer).mEpiAltUnc) ||
|
||||||
(mEpiAltUnc != peer.mEpiAltUnc) ||
|
(mEpiSrc != ((const SystemStatusInjectedPosition&)peer).mEpiSrc)) {
|
||||||
(mEpiSrc != peer.mEpiSrc)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -959,13 +991,12 @@ SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusBestPosition::equals(const SystemStatusBestPosition& peer)
|
bool SystemStatusBestPosition::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mBestLat != ((const SystemStatusBestPosition&)peer).mBestLat) ||
|
||||||
if ((mBestLat != peer.mBestLat) ||
|
(mBestLon != ((const SystemStatusBestPosition&)peer).mBestLon) ||
|
||||||
(mBestLon != peer.mBestLon) ||
|
(mBestAlt != ((const SystemStatusBestPosition&)peer).mBestAlt) ||
|
||||||
(mBestAlt != peer.mBestAlt) ||
|
(mBestHepe != ((const SystemStatusBestPosition&)peer).mBestHepe) ||
|
||||||
(mBestHepe != peer.mBestHepe) ||
|
(mBestAltUnc != ((const SystemStatusBestPosition&)peer).mBestAltUnc)) {
|
||||||
(mBestAltUnc != peer.mBestAltUnc)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1003,21 +1034,20 @@ SystemStatusXtra::SystemStatusXtra(const SystemStatusPQWP3& nmea) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusXtra::equals(const SystemStatusXtra& peer)
|
bool SystemStatusXtra::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mXtraValidMask != ((const SystemStatusXtra&)peer).mXtraValidMask) ||
|
||||||
if ((mXtraValidMask != peer.mXtraValidMask) ||
|
(mGpsXtraAge != ((const SystemStatusXtra&)peer).mGpsXtraAge) ||
|
||||||
(mGpsXtraAge != peer.mGpsXtraAge) ||
|
(mGloXtraAge != ((const SystemStatusXtra&)peer).mGloXtraAge) ||
|
||||||
(mGloXtraAge != peer.mGloXtraAge) ||
|
(mBdsXtraAge != ((const SystemStatusXtra&)peer).mBdsXtraAge) ||
|
||||||
(mBdsXtraAge != peer.mBdsXtraAge) ||
|
(mGalXtraAge != ((const SystemStatusXtra&)peer).mGalXtraAge) ||
|
||||||
(mGalXtraAge != peer.mGalXtraAge) ||
|
(mQzssXtraAge != ((const SystemStatusXtra&)peer).mQzssXtraAge) ||
|
||||||
(mQzssXtraAge != peer.mQzssXtraAge) ||
|
(mNavicXtraAge != ((const SystemStatusXtra&)peer).mNavicXtraAge) ||
|
||||||
(mNavicXtraAge != peer.mNavicXtraAge) ||
|
(mGpsXtraValid != ((const SystemStatusXtra&)peer).mGpsXtraValid) ||
|
||||||
(mGpsXtraValid != peer.mGpsXtraValid) ||
|
(mGloXtraValid != ((const SystemStatusXtra&)peer).mGloXtraValid) ||
|
||||||
(mGloXtraValid != peer.mGloXtraValid) ||
|
(mBdsXtraValid != ((const SystemStatusXtra&)peer).mBdsXtraValid) ||
|
||||||
(mBdsXtraValid != peer.mBdsXtraValid) ||
|
(mGalXtraValid != ((const SystemStatusXtra&)peer).mGalXtraValid) ||
|
||||||
(mGalXtraValid != peer.mGalXtraValid) ||
|
(mQzssXtraValid != ((const SystemStatusXtra&)peer).mQzssXtraValid) ||
|
||||||
(mQzssXtraValid != peer.mQzssXtraValid) ||
|
(mNavicXtraValid != ((const SystemStatusXtra&)peer).mNavicXtraValid)) {
|
||||||
(mNavicXtraValid != peer.mNavicXtraValid)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1053,13 +1083,12 @@ SystemStatusEphemeris::SystemStatusEphemeris(const SystemStatusPQWP4& nmea) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusEphemeris::equals(const SystemStatusEphemeris& peer)
|
bool SystemStatusEphemeris::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mGpsEpheValid != ((const SystemStatusEphemeris&)peer).mGpsEpheValid) ||
|
||||||
if ((mGpsEpheValid != peer.mGpsEpheValid) ||
|
(mGloEpheValid != ((const SystemStatusEphemeris&)peer).mGloEpheValid) ||
|
||||||
(mGloEpheValid != peer.mGloEpheValid) ||
|
(mBdsEpheValid != ((const SystemStatusEphemeris&)peer).mBdsEpheValid) ||
|
||||||
(mBdsEpheValid != peer.mBdsEpheValid) ||
|
(mGalEpheValid != ((const SystemStatusEphemeris&)peer).mGalEpheValid) ||
|
||||||
(mGalEpheValid != peer.mGalEpheValid) ||
|
(mQzssEpheValid != ((const SystemStatusEphemeris&)peer).mQzssEpheValid)) {
|
||||||
(mQzssEpheValid != peer.mQzssEpheValid)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1102,23 +1131,22 @@ SystemStatusSvHealth::SystemStatusSvHealth(const SystemStatusPQWP5& nmea) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusSvHealth::equals(const SystemStatusSvHealth& peer)
|
bool SystemStatusSvHealth::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mGpsUnknownMask != ((const SystemStatusSvHealth&)peer).mGpsUnknownMask) ||
|
||||||
if ((mGpsUnknownMask != peer.mGpsUnknownMask) ||
|
(mGloUnknownMask != ((const SystemStatusSvHealth&)peer).mGloUnknownMask) ||
|
||||||
(mGloUnknownMask != peer.mGloUnknownMask) ||
|
(mBdsUnknownMask != ((const SystemStatusSvHealth&)peer).mBdsUnknownMask) ||
|
||||||
(mBdsUnknownMask != peer.mBdsUnknownMask) ||
|
(mGalUnknownMask != ((const SystemStatusSvHealth&)peer).mGalUnknownMask) ||
|
||||||
(mGalUnknownMask != peer.mGalUnknownMask) ||
|
(mQzssUnknownMask != ((const SystemStatusSvHealth&)peer).mQzssUnknownMask) ||
|
||||||
(mQzssUnknownMask != peer.mQzssUnknownMask) ||
|
(mGpsGoodMask != ((const SystemStatusSvHealth&)peer).mGpsGoodMask) ||
|
||||||
(mGpsGoodMask != peer.mGpsGoodMask) ||
|
(mGloGoodMask != ((const SystemStatusSvHealth&)peer).mGloGoodMask) ||
|
||||||
(mGloGoodMask != peer.mGloGoodMask) ||
|
(mBdsGoodMask != ((const SystemStatusSvHealth&)peer).mBdsGoodMask) ||
|
||||||
(mBdsGoodMask != peer.mBdsGoodMask) ||
|
(mGalGoodMask != ((const SystemStatusSvHealth&)peer).mGalGoodMask) ||
|
||||||
(mGalGoodMask != peer.mGalGoodMask) ||
|
(mQzssGoodMask != ((const SystemStatusSvHealth&)peer).mQzssGoodMask) ||
|
||||||
(mQzssGoodMask != peer.mQzssGoodMask) ||
|
(mGpsBadMask != ((const SystemStatusSvHealth&)peer).mGpsBadMask) ||
|
||||||
(mGpsBadMask != peer.mGpsBadMask) ||
|
(mGloBadMask != ((const SystemStatusSvHealth&)peer).mGloBadMask) ||
|
||||||
(mGloBadMask != peer.mGloBadMask) ||
|
(mBdsBadMask != ((const SystemStatusSvHealth&)peer).mBdsBadMask) ||
|
||||||
(mBdsBadMask != peer.mBdsBadMask) ||
|
(mGalBadMask != ((const SystemStatusSvHealth&)peer).mGalBadMask) ||
|
||||||
(mGalBadMask != peer.mGalBadMask) ||
|
(mQzssBadMask != ((const SystemStatusSvHealth&)peer).mQzssBadMask)) {
|
||||||
(mQzssBadMask != peer.mQzssBadMask)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1157,9 +1185,8 @@ SystemStatusPdr::SystemStatusPdr(const SystemStatusPQWP6& nmea) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusPdr::equals(const SystemStatusPdr& peer)
|
bool SystemStatusPdr::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if (mFixInfoMask != ((const SystemStatusPdr&)peer).mFixInfoMask) {
|
||||||
if (mFixInfoMask != peer.mFixInfoMask) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1183,12 +1210,11 @@ SystemStatusNavData::SystemStatusNavData(const SystemStatusPQWP7& nmea)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusNavData::equals(const SystemStatusNavData& peer)
|
bool SystemStatusNavData::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
|
||||||
for (uint32_t i=0; i<SV_ALL_NUM; i++) {
|
for (uint32_t i=0; i<SV_ALL_NUM; i++) {
|
||||||
if ((mNav[i].mType != peer.mNav[i].mType) ||
|
if ((mNav[i].mType != ((const SystemStatusNavData&)peer).mNav[i].mType) ||
|
||||||
(mNav[i].mSource != peer.mNav[i].mSource) ||
|
(mNav[i].mSource != ((const SystemStatusNavData&)peer).mNav[i].mSource) ||
|
||||||
(mNav[i].mAgeSec != peer.mNav[i].mAgeSec)) {
|
(mNav[i].mAgeSec != ((const SystemStatusNavData&)peer).mNav[i].mAgeSec)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1215,10 +1241,9 @@ SystemStatusPositionFailure::SystemStatusPositionFailure(const SystemStatusPQWS1
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemStatusPositionFailure::equals(const SystemStatusPositionFailure& peer)
|
bool SystemStatusPositionFailure::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mFixInfoMask != ((const SystemStatusPositionFailure&)peer).mFixInfoMask) ||
|
||||||
if ((mFixInfoMask != peer.mFixInfoMask) ||
|
(mHepeLimit != ((const SystemStatusPositionFailure&)peer).mHepeLimit)) {
|
||||||
(mHepeLimit != peer.mHepeLimit)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1236,11 +1261,13 @@ void SystemStatusPositionFailure::dump()
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
SystemStatusLocation
|
SystemStatusLocation
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
bool SystemStatusLocation::equals(const SystemStatusLocation& peer)
|
bool SystemStatusLocation::equals(const SystemStatusItemBase& peer) {
|
||||||
{
|
if ((mLocation.gpsLocation.latitude !=
|
||||||
if ((mLocation.gpsLocation.latitude != peer.mLocation.gpsLocation.latitude) ||
|
((const SystemStatusLocation&)peer).mLocation.gpsLocation.latitude) ||
|
||||||
(mLocation.gpsLocation.longitude != peer.mLocation.gpsLocation.longitude) ||
|
(mLocation.gpsLocation.longitude !=
|
||||||
(mLocation.gpsLocation.altitude != peer.mLocation.gpsLocation.altitude)) {
|
((const SystemStatusLocation&)peer).mLocation.gpsLocation.longitude) ||
|
||||||
|
(mLocation.gpsLocation.altitude !=
|
||||||
|
((const SystemStatusLocation&)peer).mLocation.gpsLocation.altitude)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1290,8 +1317,10 @@ void SystemStatus::destroyInstance()
|
|||||||
void SystemStatus::resetNetworkInfo() {
|
void SystemStatus::resetNetworkInfo() {
|
||||||
for (int i=0; i<mCache.mNetworkInfo.size(); ++i) {
|
for (int i=0; i<mCache.mNetworkInfo.size(); ++i) {
|
||||||
// Reset all the cached NetworkInfo Items as disconnected
|
// Reset all the cached NetworkInfo Items as disconnected
|
||||||
eventConnectionStatus(false, mCache.mNetworkInfo[i].mType, mCache.mNetworkInfo[i].mRoaming,
|
eventConnectionStatus(false, mCache.mNetworkInfo[i].mDataItem.mType,
|
||||||
mCache.mNetworkInfo[i].mNetworkHandle, mCache.mNetworkInfo[i].mApn);
|
mCache.mNetworkInfo[i].mDataItem.mRoaming,
|
||||||
|
mCache.mNetworkInfo[i].mDataItem.mNetworkHandle,
|
||||||
|
mCache.mNetworkInfo[i].mDataItem.mApn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1496,91 +1525,109 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem)
|
|||||||
{
|
{
|
||||||
case AIRPLANEMODE_DATA_ITEM_ID:
|
case AIRPLANEMODE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mAirplaneMode,
|
ret = setIteminReport(mCache.mAirplaneMode,
|
||||||
SystemStatusAirplaneMode(*(static_cast<AirplaneModeDataItemBase*>(dataitem))));
|
SystemStatusAirplaneMode(*(static_cast<AirplaneModeDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case ENH_DATA_ITEM_ID:
|
case ENH_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mENH,
|
ret = setIteminReport(mCache.mENH,
|
||||||
SystemStatusENH(*(static_cast<ENHDataItemBase*>(dataitem))));
|
SystemStatusENH(*(static_cast<ENHDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case GPSSTATE_DATA_ITEM_ID:
|
case GPSSTATE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mGPSState,
|
ret = setIteminReport(mCache.mGPSState,
|
||||||
SystemStatusGpsState(*(static_cast<GPSStateDataItemBase*>(dataitem))));
|
SystemStatusGpsState(*(static_cast<GPSStateDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case NLPSTATUS_DATA_ITEM_ID:
|
case NLPSTATUS_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mNLPStatus,
|
ret = setIteminReport(mCache.mNLPStatus,
|
||||||
SystemStatusNLPStatus(*(static_cast<NLPStatusDataItemBase*>(dataitem))));
|
SystemStatusNLPStatus(*(static_cast<NLPStatusDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case WIFIHARDWARESTATE_DATA_ITEM_ID:
|
case WIFIHARDWARESTATE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mWifiHardwareState,
|
ret = setIteminReport(mCache.mWifiHardwareState, SystemStatusWifiHardwareState(
|
||||||
SystemStatusWifiHardwareState(*(static_cast<WifiHardwareStateDataItemBase*>(dataitem))));
|
*(static_cast<WifiHardwareStateDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case NETWORKINFO_DATA_ITEM_ID:
|
case NETWORKINFO_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mNetworkInfo,
|
ret = setIteminReport(mCache.mNetworkInfo,
|
||||||
SystemStatusNetworkInfo(*(static_cast<NetworkInfoDataItemBase*>(dataitem))));
|
SystemStatusNetworkInfo(*(static_cast<NetworkInfoDataItem*>(dataitem))));
|
||||||
|
// Update latest mAllTypes/mAllNetworkHandles of original obj to notify clients
|
||||||
|
if (ret) {
|
||||||
|
(static_cast<NetworkInfoDataItem*>(dataitem))->mAllTypes =
|
||||||
|
mCache.mNetworkInfo.back().mDataItem.mAllTypes;
|
||||||
|
memcpy((static_cast<NetworkInfoDataItem*>(dataitem))->mAllNetworkHandles,
|
||||||
|
mCache.mNetworkInfo.back().mDataItem.mAllNetworkHandles, sizeof((
|
||||||
|
static_cast<NetworkInfoDataItem*>(dataitem))->mAllNetworkHandles));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RILSERVICEINFO_DATA_ITEM_ID:
|
case RILSERVICEINFO_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mRilServiceInfo,
|
ret = setIteminReport(mCache.mRilServiceInfo,
|
||||||
SystemStatusServiceInfo(*(static_cast<RilServiceInfoDataItemBase*>(dataitem))));
|
SystemStatusServiceInfo(*(static_cast<RilServiceInfoDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case RILCELLINFO_DATA_ITEM_ID:
|
case RILCELLINFO_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mRilCellInfo,
|
ret = setIteminReport(mCache.mRilCellInfo,
|
||||||
SystemStatusRilCellInfo(*(static_cast<RilCellInfoDataItemBase*>(dataitem))));
|
SystemStatusRilCellInfo(*(static_cast<RilCellInfoDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case SERVICESTATUS_DATA_ITEM_ID:
|
case SERVICESTATUS_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mServiceStatus,
|
ret = setIteminReport(mCache.mServiceStatus,
|
||||||
SystemStatusServiceStatus(*(static_cast<ServiceStatusDataItemBase*>(dataitem))));
|
SystemStatusServiceStatus(*(static_cast<ServiceStatusDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case MODEL_DATA_ITEM_ID:
|
case MODEL_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mModel,
|
ret = setIteminReport(mCache.mModel,
|
||||||
SystemStatusModel(*(static_cast<ModelDataItemBase*>(dataitem))));
|
SystemStatusModel(*(static_cast<ModelDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case MANUFACTURER_DATA_ITEM_ID:
|
case MANUFACTURER_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mManufacturer,
|
ret = setIteminReport(mCache.mManufacturer,
|
||||||
SystemStatusManufacturer(*(static_cast<ManufacturerDataItemBase*>(dataitem))));
|
SystemStatusManufacturer(*(static_cast<ManufacturerDataItem*>(dataitem))));
|
||||||
|
break;
|
||||||
|
case IN_EMERGENCY_CALL_DATA_ITEM_ID:
|
||||||
|
ret = setIteminReport(mCache.mInEmergencyCall,
|
||||||
|
SystemStatusInEmergencyCall(
|
||||||
|
*(static_cast<InEmergencyCallDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case ASSISTED_GPS_DATA_ITEM_ID:
|
case ASSISTED_GPS_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mAssistedGps,
|
ret = setIteminReport(mCache.mAssistedGps,
|
||||||
SystemStatusAssistedGps(*(static_cast<AssistedGpsDataItemBase*>(dataitem))));
|
SystemStatusAssistedGps(*(static_cast<AssistedGpsDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case SCREEN_STATE_DATA_ITEM_ID:
|
case SCREEN_STATE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mScreenState,
|
ret = setIteminReport(mCache.mScreenState,
|
||||||
SystemStatusScreenState(*(static_cast<ScreenStateDataItemBase*>(dataitem))));
|
SystemStatusScreenState(*(static_cast<ScreenStateDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case POWER_CONNECTED_STATE_DATA_ITEM_ID:
|
case POWER_CONNECTED_STATE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mPowerConnectState,
|
ret = setIteminReport(mCache.mPowerConnectState, SystemStatusPowerConnectState(
|
||||||
SystemStatusPowerConnectState(*(static_cast<PowerConnectStateDataItemBase*>(dataitem))));
|
*(static_cast<PowerConnectStateDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case TIMEZONE_CHANGE_DATA_ITEM_ID:
|
case TIMEZONE_CHANGE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mTimeZoneChange,
|
ret = setIteminReport(mCache.mTimeZoneChange,
|
||||||
SystemStatusTimeZoneChange(*(static_cast<TimeZoneChangeDataItemBase*>(dataitem))));
|
SystemStatusTimeZoneChange(*(static_cast<TimeZoneChangeDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case TIME_CHANGE_DATA_ITEM_ID:
|
case TIME_CHANGE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mTimeChange,
|
ret = setIteminReport(mCache.mTimeChange,
|
||||||
SystemStatusTimeChange(*(static_cast<TimeChangeDataItemBase*>(dataitem))));
|
SystemStatusTimeChange(*(static_cast<TimeChangeDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID:
|
case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mWifiSupplicantStatus,
|
ret = setIteminReport(mCache.mWifiSupplicantStatus, SystemStatusWifiSupplicantStatus(
|
||||||
SystemStatusWifiSupplicantStatus(*(static_cast<WifiSupplicantStatusDataItemBase*>(dataitem))));
|
*(static_cast<WifiSupplicantStatusDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case SHUTDOWN_STATE_DATA_ITEM_ID:
|
case SHUTDOWN_STATE_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mShutdownState,
|
ret = setIteminReport(mCache.mShutdownState,
|
||||||
SystemStatusShutdownState(*(static_cast<ShutdownStateDataItemBase*>(dataitem))));
|
SystemStatusShutdownState(*(static_cast<ShutdownStateDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case TAC_DATA_ITEM_ID:
|
case TAC_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mTac,
|
ret = setIteminReport(mCache.mTac,
|
||||||
SystemStatusTac(*(static_cast<TacDataItemBase*>(dataitem))));
|
SystemStatusTac(*(static_cast<TacDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case MCCMNC_DATA_ITEM_ID:
|
case MCCMNC_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mMccMnc,
|
ret = setIteminReport(mCache.mMccMnc,
|
||||||
SystemStatusMccMnc(*(static_cast<MccmncDataItemBase*>(dataitem))));
|
SystemStatusMccMnc(*(static_cast<MccmncDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case BTLE_SCAN_DATA_ITEM_ID:
|
case BTLE_SCAN_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mBtDeviceScanDetail,
|
ret = setIteminReport(mCache.mBtDeviceScanDetail, SystemStatusBtDeviceScanDetail(
|
||||||
SystemStatusBtDeviceScanDetail(*(static_cast<BtDeviceScanDetailsDataItemBase*>(dataitem))));
|
*(static_cast<BtDeviceScanDetailsDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
case BT_SCAN_DATA_ITEM_ID:
|
case BT_SCAN_DATA_ITEM_ID:
|
||||||
ret = setIteminReport(mCache.mBtLeDeviceScanDetail,
|
ret = setIteminReport(mCache.mBtLeDeviceScanDetail, SystemStatusBtleDeviceScanDetail(
|
||||||
SystemStatusBtleDeviceScanDetail(*(static_cast<BtLeDeviceScanDetailsDataItemBase*>(dataitem))));
|
*(static_cast<BtLeDeviceScanDetailsDataItem*>(dataitem))));
|
||||||
|
break;
|
||||||
|
case LOC_FEATURE_STATUS_DATA_ITEM_ID:
|
||||||
|
ret = setIteminReport(mCache.mLocFeatureStatus,
|
||||||
|
SystemStatusLocFeatureStatus(
|
||||||
|
*(static_cast<LocFeatureStatusDataItem*>(dataitem))));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -1739,7 +1786,7 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type,
|
|||||||
// send networkinof dataitem to systemstatus observer clients
|
// send networkinof dataitem to systemstatus observer clients
|
||||||
SystemStatusNetworkInfo s(type, "", "", connected, roaming,
|
SystemStatusNetworkInfo s(type, "", "", connected, roaming,
|
||||||
(uint64_t) networkHandle, apn);
|
(uint64_t) networkHandle, apn);
|
||||||
mSysStatusObsvr.notify({&s});
|
mSysStatusObsvr.notify({&s.mDataItem});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1754,7 +1801,62 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type,
|
|||||||
bool SystemStatus::updatePowerConnectState(bool charging)
|
bool SystemStatus::updatePowerConnectState(bool charging)
|
||||||
{
|
{
|
||||||
SystemStatusPowerConnectState s(charging);
|
SystemStatusPowerConnectState s(charging);
|
||||||
mSysStatusObsvr.notify({&s});
|
mSysStatusObsvr.notify({&s.mDataItem});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
@brief API to update ENH
|
||||||
|
|
||||||
|
@param[In] user consent
|
||||||
|
|
||||||
|
@return true when successfully done
|
||||||
|
******************************************************************************/
|
||||||
|
bool SystemStatus::eventOptInStatus(bool userConsent)
|
||||||
|
{
|
||||||
|
SystemStatusENH s(userConsent, ENHDataItem::FIELD_CONSENT);
|
||||||
|
mSysStatusObsvr.notify({&s.mDataItem});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
@brief API to update Region
|
||||||
|
|
||||||
|
@param[In] region
|
||||||
|
|
||||||
|
@return true when successfully done
|
||||||
|
******************************************************************************/
|
||||||
|
bool SystemStatus::eventRegionStatus(bool region)
|
||||||
|
{
|
||||||
|
SystemStatusENH s(region, ENHDataItem::FIELD_REGION);
|
||||||
|
mSysStatusObsvr.notify({&s.mDataItem});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
@brief API to update Location feature QWES status
|
||||||
|
|
||||||
|
@param[In] Location feature QWES status
|
||||||
|
|
||||||
|
@return true when successfully done
|
||||||
|
******************************************************************************/
|
||||||
|
bool SystemStatus::eventLocFeatureStatus(std::unordered_set<int> fids) {
|
||||||
|
SystemStatusLocFeatureStatus s(fids);
|
||||||
|
mSysStatusObsvr.notify({&s.mDataItem});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
@brief API to notify emergency call
|
||||||
|
|
||||||
|
@param[In] is emergency call
|
||||||
|
|
||||||
|
@return true when successfully done
|
||||||
|
******************************************************************************/
|
||||||
|
bool SystemStatus::eventInEmergencyCall(bool isEmergency)
|
||||||
|
{
|
||||||
|
SystemStatusInEmergencyCall s(isEmergency);
|
||||||
|
mSysStatusObsvr.notify({&s.mDataItem});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
@ -26,6 +26,43 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __SYSTEM_STATUS__
|
#ifndef __SYSTEM_STATUS__
|
||||||
#define __SYSTEM_STATUS__
|
#define __SYSTEM_STATUS__
|
||||||
|
|
||||||
@ -39,7 +76,7 @@
|
|||||||
#include <MsgTask.h>
|
#include <MsgTask.h>
|
||||||
#include <IDataItemCore.h>
|
#include <IDataItemCore.h>
|
||||||
#include <IOsObserver.h>
|
#include <IOsObserver.h>
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
#include <SystemStatusOsObserver.h>
|
#include <SystemStatusOsObserver.h>
|
||||||
|
|
||||||
#include <gps_extended_c.h>
|
#include <gps_extended_c.h>
|
||||||
@ -88,6 +125,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual void dump(void) {};
|
virtual void dump(void) {};
|
||||||
inline virtual bool ignore() { return false; };
|
inline virtual bool ignore() { return false; };
|
||||||
|
virtual bool equals(const SystemStatusItemBase& peer) { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusLocation : public SystemStatusItemBase
|
class SystemStatusLocation : public SystemStatusItemBase
|
||||||
@ -103,7 +141,7 @@ public:
|
|||||||
mValid(true),
|
mValid(true),
|
||||||
mLocation(location),
|
mLocation(location),
|
||||||
mLocationEx(locationEx) {}
|
mLocationEx(locationEx) {}
|
||||||
bool equals(const SystemStatusLocation& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -133,7 +171,7 @@ public:
|
|||||||
mLeapSecUnc(0),
|
mLeapSecUnc(0),
|
||||||
mTimeUncNs(0ULL) {}
|
mTimeUncNs(0ULL) {}
|
||||||
inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea);
|
inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea);
|
||||||
bool equals(const SystemStatusTimeAndClock& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -144,7 +182,7 @@ public:
|
|||||||
inline SystemStatusXoState() :
|
inline SystemStatusXoState() :
|
||||||
mXoState(0) {}
|
mXoState(0) {}
|
||||||
inline SystemStatusXoState(const SystemStatusPQWM1& nmea);
|
inline SystemStatusXoState(const SystemStatusPQWM1& nmea);
|
||||||
bool equals(const SystemStatusXoState& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -191,7 +229,7 @@ public:
|
|||||||
mGalBpAmpI(0),
|
mGalBpAmpI(0),
|
||||||
mGalBpAmpQ(0) {}
|
mGalBpAmpQ(0) {}
|
||||||
inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea);
|
inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea);
|
||||||
bool equals(const SystemStatusRfAndParams& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -202,7 +240,7 @@ public:
|
|||||||
inline SystemStatusErrRecovery() :
|
inline SystemStatusErrRecovery() :
|
||||||
mRecErrorRecovery(0) {};
|
mRecErrorRecovery(0) {};
|
||||||
inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea);
|
inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea);
|
||||||
bool equals(const SystemStatusErrRecovery& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
inline bool ignore() override { return 0 == mRecErrorRecovery; };
|
inline bool ignore() override { return 0 == mRecErrorRecovery; };
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
@ -227,7 +265,7 @@ public:
|
|||||||
mEpiAltUnc(0),
|
mEpiAltUnc(0),
|
||||||
mEpiSrc(0) {}
|
mEpiSrc(0) {}
|
||||||
inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea);
|
inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea);
|
||||||
bool equals(const SystemStatusInjectedPosition& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -249,7 +287,7 @@ public:
|
|||||||
mBestHepe(0),
|
mBestHepe(0),
|
||||||
mBestAltUnc(0) {}
|
mBestAltUnc(0) {}
|
||||||
inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea);
|
inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea);
|
||||||
bool equals(const SystemStatusBestPosition& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -285,7 +323,7 @@ public:
|
|||||||
mQzssXtraValid(0),
|
mQzssXtraValid(0),
|
||||||
mNavicXtraValid(0) {}
|
mNavicXtraValid(0) {}
|
||||||
inline SystemStatusXtra(const SystemStatusPQWP3& nmea);
|
inline SystemStatusXtra(const SystemStatusPQWP3& nmea);
|
||||||
bool equals(const SystemStatusXtra& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -305,7 +343,7 @@ public:
|
|||||||
mGalEpheValid(0ULL),
|
mGalEpheValid(0ULL),
|
||||||
mQzssEpheValid(0) {}
|
mQzssEpheValid(0) {}
|
||||||
inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea);
|
inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea);
|
||||||
bool equals(const SystemStatusEphemeris& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -351,7 +389,7 @@ public:
|
|||||||
mQzssBadMask(0),
|
mQzssBadMask(0),
|
||||||
mNavicBadMask(0) {}
|
mNavicBadMask(0) {}
|
||||||
inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea);
|
inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea);
|
||||||
bool equals(const SystemStatusSvHealth& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -363,7 +401,7 @@ public:
|
|||||||
inline SystemStatusPdr() :
|
inline SystemStatusPdr() :
|
||||||
mFixInfoMask(0) {}
|
mFixInfoMask(0) {}
|
||||||
inline SystemStatusPdr(const SystemStatusPQWP6& nmea);
|
inline SystemStatusPdr(const SystemStatusPQWP6& nmea);
|
||||||
bool equals(const SystemStatusPdr& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -387,7 +425,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline SystemStatusNavData(const SystemStatusPQWP7& nmea);
|
inline SystemStatusNavData(const SystemStatusPQWP7& nmea);
|
||||||
bool equals(const SystemStatusNavData& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -401,153 +439,139 @@ public:
|
|||||||
mFixInfoMask(0),
|
mFixInfoMask(0),
|
||||||
mHepeLimit(0) {}
|
mHepeLimit(0) {}
|
||||||
inline SystemStatusPositionFailure(const SystemStatusPQWS1& nmea);
|
inline SystemStatusPositionFailure(const SystemStatusPQWS1& nmea);
|
||||||
bool equals(const SystemStatusPositionFailure& peer);
|
bool equals(const SystemStatusItemBase& peer) override;
|
||||||
void dump(void) override;
|
void dump(void) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
SystemStatus report data structure - from DataItem observer
|
SystemStatus report data structure - from DataItem observer
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
class SystemStatusAirplaneMode : public SystemStatusItemBase,
|
class SystemStatusAirplaneMode : public SystemStatusItemBase {
|
||||||
public AirplaneModeDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusAirplaneMode(bool mode=false) :
|
AirplaneModeDataItem mDataItem;
|
||||||
AirplaneModeDataItemBase(mode) {}
|
inline SystemStatusAirplaneMode(bool mode=false): mDataItem(mode) {}
|
||||||
inline SystemStatusAirplaneMode(const AirplaneModeDataItemBase& itemBase) :
|
inline SystemStatusAirplaneMode(const AirplaneModeDataItem& itemBase):
|
||||||
AirplaneModeDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusAirplaneMode& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return (mMode == peer.mMode);
|
return mDataItem.mMode == ((const SystemStatusAirplaneMode&)peer).mDataItem.mMode;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusENH : public SystemStatusItemBase,
|
class SystemStatusENH : public SystemStatusItemBase {
|
||||||
public ENHDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusENH(bool enabled=false) :
|
ENHDataItem mDataItem;
|
||||||
ENHDataItemBase(enabled) {}
|
inline SystemStatusENH(bool enabled, ENHDataItem::Fields updateBit = ENHDataItem::FIELD_MAX):
|
||||||
inline SystemStatusENH(const ENHDataItemBase& itemBase) :
|
mDataItem(enabled, updateBit) {}
|
||||||
ENHDataItemBase(itemBase) {}
|
inline SystemStatusENH(const ENHDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusENH& peer) {
|
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& peer) {
|
||||||
return (mEnabled == peer.mEnabled);
|
mDataItem.mEnhFields = ((const SystemStatusENH&)peer).mDataItem.mEnhFields;
|
||||||
|
mDataItem.updateFields();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
|
return mDataItem.mEnhFields == ((const SystemStatusENH&)peer).mDataItem.mEnhFields;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusGpsState : public SystemStatusItemBase,
|
class SystemStatusGpsState : public SystemStatusItemBase {
|
||||||
public GPSStateDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusGpsState(bool enabled=false) :
|
GPSStateDataItem mDataItem;
|
||||||
GPSStateDataItemBase(enabled) {}
|
inline SystemStatusGpsState(bool enabled=false): mDataItem(enabled) {}
|
||||||
inline SystemStatusGpsState(const GPSStateDataItemBase& itemBase) :
|
inline SystemStatusGpsState(const GPSStateDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
GPSStateDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusGpsState& peer) {
|
return mDataItem.mEnabled == ((const SystemStatusGpsState&)peer).mDataItem.mEnabled;
|
||||||
return (mEnabled == peer.mEnabled);
|
|
||||||
}
|
}
|
||||||
inline void dump(void) override {
|
inline void dump(void) override {
|
||||||
LOC_LOGD("GpsState: state=%u", mEnabled);
|
LOC_LOGD("GpsState: state=%u", mDataItem.mEnabled);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusNLPStatus : public SystemStatusItemBase,
|
class SystemStatusNLPStatus : public SystemStatusItemBase {
|
||||||
public NLPStatusDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusNLPStatus(bool enabled=false) :
|
NLPStatusDataItem mDataItem;
|
||||||
NLPStatusDataItemBase(enabled) {}
|
inline SystemStatusNLPStatus(bool enabled=false): mDataItem(enabled) {}
|
||||||
inline SystemStatusNLPStatus(const NLPStatusDataItemBase& itemBase) :
|
inline SystemStatusNLPStatus(const NLPStatusDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
NLPStatusDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusNLPStatus& peer) {
|
return mDataItem.mEnabled == ((const SystemStatusNLPStatus&)peer).mDataItem.mEnabled;
|
||||||
return (mEnabled == peer.mEnabled);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusWifiHardwareState : public SystemStatusItemBase,
|
class SystemStatusWifiHardwareState : public SystemStatusItemBase {
|
||||||
public WifiHardwareStateDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusWifiHardwareState(bool enabled=false) :
|
WifiHardwareStateDataItem mDataItem;
|
||||||
WifiHardwareStateDataItemBase(enabled) {}
|
inline SystemStatusWifiHardwareState(bool enabled=false): mDataItem(enabled) {}
|
||||||
inline SystemStatusWifiHardwareState(const WifiHardwareStateDataItemBase& itemBase) :
|
inline SystemStatusWifiHardwareState(const WifiHardwareStateDataItem& itemBase):
|
||||||
WifiHardwareStateDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusWifiHardwareState& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return (mEnabled == peer.mEnabled);
|
return mDataItem.mEnabled == ((const SystemStatusWifiHardwareState&)peer).mDataItem.mEnabled;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusNetworkInfo : public SystemStatusItemBase,
|
class SystemStatusNetworkInfo : public SystemStatusItemBase {
|
||||||
public NetworkInfoDataItemBase
|
|
||||||
{
|
|
||||||
NetworkInfoDataItemBase* mSrcObjPtr;
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusNetworkInfo(
|
NetworkInfoDataItem mDataItem;
|
||||||
int32_t type = 0,
|
inline SystemStatusNetworkInfo(int32_t type=0, std::string typeName="", string subTypeName="",
|
||||||
std::string typeName = "",
|
bool connected=false, bool roaming=false,
|
||||||
string subTypeName = "",
|
uint64_t networkHandle=NETWORK_HANDLE_UNKNOWN, string apn = "") :
|
||||||
bool connected = false,
|
mDataItem((NetworkType)type, type, typeName,
|
||||||
bool roaming = false,
|
subTypeName, connected && (!roaming), connected, roaming, networkHandle,
|
||||||
uint64_t networkHandle = NETWORK_HANDLE_UNKNOWN,
|
apn) {}
|
||||||
string apn = "") :
|
inline SystemStatusNetworkInfo(const NetworkInfoDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
NetworkInfoDataItemBase(
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
(NetworkType)type,
|
const NetworkInfoDataItem peerDI = ((const SystemStatusNetworkInfo&)peer).mDataItem;
|
||||||
type,
|
bool rtv = (mDataItem.mAllTypes == peerDI.mAllTypes) &&
|
||||||
typeName,
|
(mDataItem.mConnected == peerDI.mConnected);
|
||||||
subTypeName,
|
|
||||||
connected && (!roaming),
|
|
||||||
connected,
|
|
||||||
roaming,
|
|
||||||
networkHandle, apn),
|
|
||||||
mSrcObjPtr(nullptr) {}
|
|
||||||
inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) :
|
|
||||||
NetworkInfoDataItemBase(itemBase),
|
|
||||||
mSrcObjPtr((NetworkInfoDataItemBase*)&itemBase) {
|
|
||||||
mType = (int32_t)itemBase.getType();
|
|
||||||
}
|
|
||||||
inline bool equals(const SystemStatusNetworkInfo& peer) {
|
|
||||||
bool rtv = (peer.mConnected == mConnected);
|
|
||||||
for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) {
|
for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) {
|
||||||
rtv &= (mAllNetworkHandles[i] == peer.mAllNetworkHandles[i]);
|
rtv = (mDataItem.mAllNetworkHandles[i] == peerDI.mAllNetworkHandles[i]) && rtv;
|
||||||
}
|
}
|
||||||
return rtv && !peer.mApn.compare(mApn);
|
rtv = rtv && !peerDI.mApn.compare(mDataItem.mApn);
|
||||||
|
LOC_LOGv("NetworkInfoDataItem quals: %d", rtv);
|
||||||
|
return rtv;
|
||||||
}
|
}
|
||||||
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
|
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
|
||||||
LOC_LOGv("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s",
|
LOC_LOGv("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s",
|
||||||
mAllTypes, mConnected, mType, mApn.c_str());
|
mDataItem.mAllTypes, mDataItem.mConnected, mDataItem.mType,
|
||||||
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;
|
mDataItem.mApn.c_str());
|
||||||
string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mApn;
|
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mDataItem.mAllTypes;
|
||||||
|
string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mDataItem.mApn;
|
||||||
// Replace current with cached table for now and then update
|
// Replace current with cached table for now and then update
|
||||||
memcpy(mAllNetworkHandles,
|
memcpy(mDataItem.mAllNetworkHandles,
|
||||||
(static_cast<SystemStatusNetworkInfo&>(curInfo)).getNetworkHandle(),
|
static_cast<SystemStatusNetworkInfo&>(curInfo).mDataItem.getNetworkHandle(),
|
||||||
sizeof(mAllNetworkHandles));
|
sizeof(mDataItem.mAllNetworkHandles));
|
||||||
// Update the apn for non-mobile type connections.
|
// Update the apn for non-mobile type connections.
|
||||||
if (TYPE_MOBILE != mType && apn.compare("") != 0) {
|
if (TYPE_MOBILE != mDataItem.mType && apn.compare("") != 0) {
|
||||||
mApn = apn;
|
mDataItem.mApn = apn;
|
||||||
}
|
}
|
||||||
if (mConnected) {
|
if (mDataItem.mConnected) {
|
||||||
mAllTypes |= allTypes;
|
mDataItem.mAllTypes |= allTypes;
|
||||||
for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
|
for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
|
||||||
if (mNetworkHandle == mAllNetworkHandles[i].networkHandle) {
|
if (mDataItem.mNetworkHandle ==
|
||||||
|
mDataItem.mAllNetworkHandles[i].networkHandle) {
|
||||||
LOC_LOGD("collate duplicate detected, not updating");
|
LOC_LOGD("collate duplicate detected, not updating");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NETWORK_HANDLE_UNKNOWN == mAllNetworkHandles[i].networkHandle) {
|
if (NETWORK_HANDLE_UNKNOWN ==
|
||||||
mAllNetworkHandles[i].networkHandle = mNetworkHandle;
|
mDataItem.mAllNetworkHandles[i].networkHandle) {
|
||||||
mAllNetworkHandles[i].networkType = (loc_core::NetworkType) mType;
|
mDataItem.mAllNetworkHandles[i].networkHandle =
|
||||||
|
mDataItem.mNetworkHandle;
|
||||||
|
mDataItem.mAllNetworkHandles[i].networkType =
|
||||||
|
(loc_core::NetworkType) mDataItem.mType;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (0 != mAllTypes) {
|
} else if (0 != mDataItem.mAllTypes) {
|
||||||
uint8_t deletedIndex = MAX_NETWORK_HANDLES;
|
uint8_t deletedIndex = MAX_NETWORK_HANDLES;
|
||||||
uint8_t lastValidIndex = 0;
|
uint8_t lastValidIndex = 0;
|
||||||
uint8_t typeCount = 0;
|
uint8_t typeCount = 0;
|
||||||
for (; lastValidIndex < MAX_NETWORK_HANDLES &&
|
for (; lastValidIndex < MAX_NETWORK_HANDLES && NETWORK_HANDLE_UNKNOWN !=
|
||||||
NETWORK_HANDLE_UNKNOWN != mAllNetworkHandles[lastValidIndex].networkHandle;
|
mDataItem.mAllNetworkHandles[lastValidIndex].networkHandle;
|
||||||
++lastValidIndex) {
|
++lastValidIndex) {
|
||||||
// Maintain count for number of network handles still
|
// Maintain count for number of network handles still
|
||||||
// connected for given type
|
// connected for given type
|
||||||
if (mType == (int32_t)mAllNetworkHandles[lastValidIndex].networkType) {
|
if (mDataItem.mType ==
|
||||||
if (mNetworkHandle == mAllNetworkHandles[lastValidIndex].networkHandle) {
|
mDataItem.mAllNetworkHandles[lastValidIndex].networkType) {
|
||||||
|
if (mDataItem.mNetworkHandle ==
|
||||||
|
mDataItem.mAllNetworkHandles[lastValidIndex].networkHandle) {
|
||||||
deletedIndex = lastValidIndex;
|
deletedIndex = lastValidIndex;
|
||||||
} else {
|
} else {
|
||||||
typeCount++;
|
typeCount++;
|
||||||
@ -562,264 +586,273 @@ public:
|
|||||||
if (MAX_NETWORK_HANDLES != deletedIndex) {
|
if (MAX_NETWORK_HANDLES != deletedIndex) {
|
||||||
LOC_LOGd("deletedIndex:%u, lastValidIndex:%u, typeCount:%u",
|
LOC_LOGd("deletedIndex:%u, lastValidIndex:%u, typeCount:%u",
|
||||||
deletedIndex, lastValidIndex, typeCount);
|
deletedIndex, lastValidIndex, typeCount);
|
||||||
mAllNetworkHandles[deletedIndex] = mAllNetworkHandles[lastValidIndex];
|
mDataItem.mAllNetworkHandles[deletedIndex] =
|
||||||
mAllNetworkHandles[lastValidIndex].networkHandle = NETWORK_HANDLE_UNKNOWN;
|
mDataItem.mAllNetworkHandles[lastValidIndex];
|
||||||
mAllNetworkHandles[lastValidIndex].networkType = TYPE_UNKNOWN;
|
mDataItem.mAllNetworkHandles[lastValidIndex].networkHandle =
|
||||||
|
NETWORK_HANDLE_UNKNOWN;
|
||||||
|
mDataItem.mAllNetworkHandles[lastValidIndex].networkType = TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no more handles of given type, set bitmask
|
// If no more handles of given type, set bitmask
|
||||||
if (0 == typeCount) {
|
if (0 == typeCount) {
|
||||||
mAllTypes = (allTypes & (~mAllTypes));
|
mDataItem.mAllTypes = (allTypes & (~mDataItem.mAllTypes));
|
||||||
LOC_LOGD("mAllTypes:%" PRIx64, mAllTypes);
|
LOC_LOGD("mAllTypes:%" PRIx64, mDataItem.mAllTypes);
|
||||||
}
|
|
||||||
} // else (mConnected == false && mAllTypes == 0)
|
|
||||||
// we keep mAllTypes as 0, which means no more connections.
|
|
||||||
|
|
||||||
if (nullptr != mSrcObjPtr) {
|
|
||||||
// this is critical, changing mAllTypes of the original obj
|
|
||||||
mSrcObjPtr->mAllTypes = mAllTypes;
|
|
||||||
memcpy(mSrcObjPtr->mAllNetworkHandles,
|
|
||||||
mAllNetworkHandles,
|
|
||||||
sizeof(mSrcObjPtr->mAllNetworkHandles));
|
|
||||||
}
|
}
|
||||||
|
} // else (mDataItem.mConnected == false && mDataItem.mAllTypes == 0)
|
||||||
|
// we keep mDataItem->mAllTypes as 0, which means no more connections.
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline void dump(void) override {
|
inline void dump(void) override {
|
||||||
LOC_LOGD("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s",
|
LOC_LOGD("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s",
|
||||||
mAllTypes, mConnected, mType, mApn.c_str());
|
mDataItem.mAllTypes, mDataItem.mConnected, mDataItem.mType, mDataItem.mApn.c_str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusServiceInfo : public SystemStatusItemBase,
|
class SystemStatusServiceInfo : public SystemStatusItemBase {
|
||||||
public RilServiceInfoDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusServiceInfo() :
|
RilServiceInfoDataItem mDataItem;
|
||||||
RilServiceInfoDataItemBase() {}
|
inline SystemStatusServiceInfo(): mDataItem() {}
|
||||||
inline SystemStatusServiceInfo(const RilServiceInfoDataItemBase& itemBase) :
|
inline SystemStatusServiceInfo(const RilServiceInfoDataItem& itemBase):
|
||||||
RilServiceInfoDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusServiceInfo& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return static_cast<const RilServiceInfoDataItemBase&>(peer) ==
|
return ((const SystemStatusServiceInfo&)peer).mDataItem == mDataItem;
|
||||||
static_cast<const RilServiceInfoDataItemBase&>(*this);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusRilCellInfo : public SystemStatusItemBase,
|
class SystemStatusRilCellInfo : public SystemStatusItemBase {
|
||||||
public RilCellInfoDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusRilCellInfo() :
|
RilCellInfoDataItem mDataItem;
|
||||||
RilCellInfoDataItemBase() {}
|
inline SystemStatusRilCellInfo(): mDataItem() {}
|
||||||
inline SystemStatusRilCellInfo(const RilCellInfoDataItemBase& itemBase) :
|
inline SystemStatusRilCellInfo(const RilCellInfoDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
RilCellInfoDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusRilCellInfo& peer) {
|
return ((const SystemStatusRilCellInfo&)peer).mDataItem == mDataItem;
|
||||||
return static_cast<const RilCellInfoDataItemBase&>(peer) ==
|
|
||||||
static_cast<const RilCellInfoDataItemBase&>(*this);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusServiceStatus : public SystemStatusItemBase,
|
class SystemStatusServiceStatus : public SystemStatusItemBase {
|
||||||
public ServiceStatusDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusServiceStatus(int32_t mServiceState=0) :
|
ServiceStatusDataItem mDataItem;
|
||||||
ServiceStatusDataItemBase(mServiceState) {}
|
inline SystemStatusServiceStatus(int32_t mServiceState=0): mDataItem(mServiceState) {}
|
||||||
inline SystemStatusServiceStatus(const ServiceStatusDataItemBase& itemBase) :
|
inline SystemStatusServiceStatus(const ServiceStatusDataItem& itemBase):
|
||||||
ServiceStatusDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusServiceStatus& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return (mServiceState == peer.mServiceState);
|
return mDataItem.mServiceState ==
|
||||||
|
((const SystemStatusServiceStatus&)peer).mDataItem.mServiceState;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusModel : public SystemStatusItemBase,
|
class SystemStatusModel : public SystemStatusItemBase {
|
||||||
public ModelDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusModel(string name="") :
|
ModelDataItem mDataItem;
|
||||||
ModelDataItemBase(name) {}
|
inline SystemStatusModel(string name=""): mDataItem(name) {}
|
||||||
inline SystemStatusModel(const ModelDataItemBase& itemBase) :
|
inline SystemStatusModel(const ModelDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
ModelDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusModel& peer) {
|
return mDataItem.mModel == ((const SystemStatusModel&)peer).mDataItem.mModel;
|
||||||
return (mModel == peer.mModel);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusManufacturer : public SystemStatusItemBase,
|
class SystemStatusManufacturer : public SystemStatusItemBase {
|
||||||
public ManufacturerDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusManufacturer(string name="") :
|
ManufacturerDataItem mDataItem;
|
||||||
ManufacturerDataItemBase(name) {}
|
inline SystemStatusManufacturer(string name=""): mDataItem(name) {}
|
||||||
inline SystemStatusManufacturer(const ManufacturerDataItemBase& itemBase) :
|
inline SystemStatusManufacturer(const ManufacturerDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
ManufacturerDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusManufacturer& peer) {
|
return mDataItem.mManufacturer ==
|
||||||
return (mManufacturer == peer.mManufacturer);
|
((const SystemStatusManufacturer&)peer).mDataItem.mManufacturer;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusAssistedGps : public SystemStatusItemBase,
|
class SystemStatusAssistedGps : public SystemStatusItemBase {
|
||||||
public AssistedGpsDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusAssistedGps(bool enabled=false) :
|
AssistedGpsDataItem mDataItem;
|
||||||
AssistedGpsDataItemBase(enabled) {}
|
inline SystemStatusAssistedGps(bool enabled=false): mDataItem(enabled) {}
|
||||||
inline SystemStatusAssistedGps(const AssistedGpsDataItemBase& itemBase) :
|
inline SystemStatusAssistedGps(const AssistedGpsDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
AssistedGpsDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusAssistedGps& peer) {
|
return mDataItem.mEnabled == ((const SystemStatusAssistedGps&)peer).mDataItem.mEnabled;
|
||||||
return (mEnabled == peer.mEnabled);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusScreenState : public SystemStatusItemBase,
|
class SystemStatusScreenState : public SystemStatusItemBase {
|
||||||
public ScreenStateDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusScreenState(bool state=false) :
|
ScreenStateDataItem mDataItem;
|
||||||
ScreenStateDataItemBase(state) {}
|
inline SystemStatusScreenState(bool state=false): mDataItem(state) {}
|
||||||
inline SystemStatusScreenState(const ScreenStateDataItemBase& itemBase) :
|
inline SystemStatusScreenState(const ScreenStateDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
ScreenStateDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusScreenState& peer) {
|
return mDataItem.mState == ((const SystemStatusScreenState&)peer).mDataItem.mState;
|
||||||
return (mState == peer.mState);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusPowerConnectState : public SystemStatusItemBase,
|
class SystemStatusPowerConnectState : public SystemStatusItemBase {
|
||||||
public PowerConnectStateDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusPowerConnectState(bool state=false) :
|
PowerConnectStateDataItem mDataItem;
|
||||||
PowerConnectStateDataItemBase(state) {}
|
inline SystemStatusPowerConnectState(bool state=false): mDataItem(state) {}
|
||||||
inline SystemStatusPowerConnectState(const PowerConnectStateDataItemBase& itemBase) :
|
inline SystemStatusPowerConnectState(const PowerConnectStateDataItem& itemBase):
|
||||||
PowerConnectStateDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusPowerConnectState& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return (mState == peer.mState);
|
return mDataItem.mState == ((const SystemStatusPowerConnectState&)peer).mDataItem.mState;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusTimeZoneChange : public SystemStatusItemBase,
|
class SystemStatusTimeZoneChange : public SystemStatusItemBase {
|
||||||
public TimeZoneChangeDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusTimeZoneChange(
|
TimeZoneChangeDataItem mDataItem;
|
||||||
int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) :
|
inline SystemStatusTimeZoneChange(int64_t currTimeMillis=0ULL, int32_t rawOffset=0,
|
||||||
TimeZoneChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {}
|
int32_t dstOffset=0): mDataItem(currTimeMillis, rawOffset, dstOffset) {}
|
||||||
inline SystemStatusTimeZoneChange(const TimeZoneChangeDataItemBase& itemBase) :
|
inline SystemStatusTimeZoneChange(const TimeZoneChangeDataItem& itemBase):
|
||||||
TimeZoneChangeDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusTimeZoneChange& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return ((mCurrTimeMillis == peer.mCurrTimeMillis) &&
|
return mDataItem.mCurrTimeMillis ==
|
||||||
(mRawOffsetTZ == peer.mRawOffsetTZ) &&
|
((const SystemStatusTimeZoneChange&)peer).mDataItem.mCurrTimeMillis &&
|
||||||
(mDstOffsetTZ == peer.mDstOffsetTZ));
|
mDataItem.mRawOffsetTZ ==
|
||||||
|
((const SystemStatusTimeZoneChange&)peer).mDataItem.mRawOffsetTZ &&
|
||||||
|
mDataItem.mDstOffsetTZ ==
|
||||||
|
((const SystemStatusTimeZoneChange&)peer).mDataItem.mDstOffsetTZ;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusTimeChange : public SystemStatusItemBase,
|
class SystemStatusTimeChange : public SystemStatusItemBase {
|
||||||
public TimeChangeDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
|
TimeChangeDataItem mDataItem;
|
||||||
inline SystemStatusTimeChange(
|
inline SystemStatusTimeChange(
|
||||||
int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0):
|
int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0):
|
||||||
TimeChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {}
|
mDataItem(currTimeMillis, rawOffset, dstOffset) {}
|
||||||
inline SystemStatusTimeChange(const TimeChangeDataItemBase& itemBase) :
|
inline SystemStatusTimeChange(const TimeChangeDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
TimeChangeDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusTimeChange& peer) {
|
return mDataItem.mCurrTimeMillis ==
|
||||||
return ((mCurrTimeMillis == peer.mCurrTimeMillis) &&
|
((const SystemStatusTimeChange&)peer).mDataItem.mCurrTimeMillis &&
|
||||||
(mRawOffsetTZ == peer.mRawOffsetTZ) &&
|
mDataItem.mRawOffsetTZ ==
|
||||||
(mDstOffsetTZ == peer.mDstOffsetTZ));
|
((const SystemStatusTimeChange&)peer).mDataItem.mRawOffsetTZ &&
|
||||||
|
mDataItem.mDstOffsetTZ ==
|
||||||
|
((const SystemStatusTimeChange&)peer).mDataItem.mDstOffsetTZ;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusWifiSupplicantStatus : public SystemStatusItemBase,
|
class SystemStatusWifiSupplicantStatus : public SystemStatusItemBase {
|
||||||
public WifiSupplicantStatusDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusWifiSupplicantStatus() :
|
WifiSupplicantStatusDataItem mDataItem;
|
||||||
WifiSupplicantStatusDataItemBase() {}
|
inline SystemStatusWifiSupplicantStatus(): mDataItem() {}
|
||||||
inline SystemStatusWifiSupplicantStatus(const WifiSupplicantStatusDataItemBase& itemBase) :
|
inline SystemStatusWifiSupplicantStatus(const WifiSupplicantStatusDataItem& itemBase):
|
||||||
WifiSupplicantStatusDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusWifiSupplicantStatus& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return ((mState == peer.mState) &&
|
return mDataItem.mState ==
|
||||||
(mApMacAddressValid == peer.mApMacAddressValid) &&
|
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mState &&
|
||||||
(mWifiApSsidValid == peer.mWifiApSsidValid) &&
|
mDataItem.mApMacAddressValid ==
|
||||||
(mWifiApSsid == peer.mWifiApSsid));
|
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mApMacAddressValid &&
|
||||||
|
mDataItem.mWifiApSsidValid ==
|
||||||
|
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mWifiApSsidValid &&
|
||||||
|
mDataItem.mWifiApSsid ==
|
||||||
|
((const SystemStatusWifiSupplicantStatus&)peer).mDataItem.mWifiApSsid;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusShutdownState : public SystemStatusItemBase,
|
class SystemStatusShutdownState : public SystemStatusItemBase {
|
||||||
public ShutdownStateDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusShutdownState(bool state=false) :
|
ShutdownStateDataItem mDataItem;
|
||||||
ShutdownStateDataItemBase(state) {}
|
inline SystemStatusShutdownState(bool state=false): mDataItem(state) {}
|
||||||
inline SystemStatusShutdownState(const ShutdownStateDataItemBase& itemBase) :
|
inline SystemStatusShutdownState(const ShutdownStateDataItem& itemBase):
|
||||||
ShutdownStateDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusShutdownState& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return (mState == peer.mState);
|
return mDataItem.mState == ((const SystemStatusShutdownState&)peer).mDataItem.mState;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusTac : public SystemStatusItemBase,
|
class SystemStatusTac : public SystemStatusItemBase {
|
||||||
public TacDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusTac(std::string value="") :
|
TacDataItem mDataItem;
|
||||||
TacDataItemBase(value) {}
|
inline SystemStatusTac(std::string value=""): mDataItem(value) {}
|
||||||
inline SystemStatusTac(const TacDataItemBase& itemBase) :
|
inline SystemStatusTac(const TacDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
TacDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusTac& peer) {
|
return mDataItem.mValue == ((const SystemStatusTac&)peer).mDataItem.mValue;
|
||||||
return (mValue == peer.mValue);
|
|
||||||
}
|
}
|
||||||
inline void dump(void) override {
|
inline void dump(void) override {
|
||||||
LOC_LOGD("Tac: value=%s", mValue.c_str());
|
LOC_LOGD("Tac: value=%s", mDataItem.mValue.c_str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusMccMnc : public SystemStatusItemBase,
|
class SystemStatusMccMnc : public SystemStatusItemBase {
|
||||||
public MccmncDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusMccMnc(std::string value="") :
|
MccmncDataItem mDataItem;
|
||||||
MccmncDataItemBase(value) {}
|
inline SystemStatusMccMnc(std::string value=""): mDataItem(value) {}
|
||||||
inline SystemStatusMccMnc(const MccmncDataItemBase& itemBase) :
|
inline SystemStatusMccMnc(const MccmncDataItem& itemBase): mDataItem(itemBase) {}
|
||||||
MccmncDataItemBase(itemBase) {}
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
inline bool equals(const SystemStatusMccMnc& peer) {
|
return mDataItem.mValue == ((const SystemStatusMccMnc&)peer).mDataItem.mValue;
|
||||||
return (mValue == peer.mValue);
|
|
||||||
}
|
}
|
||||||
inline void dump(void) override {
|
inline void dump(void) override {
|
||||||
LOC_LOGD("TacMccMnc value=%s", mValue.c_str());
|
LOC_LOGD("TacMccMnc value=%s", mDataItem.mValue.c_str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusBtDeviceScanDetail : public SystemStatusItemBase,
|
class SystemStatusBtDeviceScanDetail : public SystemStatusItemBase {
|
||||||
public BtDeviceScanDetailsDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusBtDeviceScanDetail() :
|
BtDeviceScanDetailsDataItem mDataItem;
|
||||||
BtDeviceScanDetailsDataItemBase() {}
|
inline SystemStatusBtDeviceScanDetail(): mDataItem() {}
|
||||||
inline SystemStatusBtDeviceScanDetail(const BtDeviceScanDetailsDataItemBase& itemBase) :
|
inline SystemStatusBtDeviceScanDetail(const BtDeviceScanDetailsDataItem& itemBase):
|
||||||
BtDeviceScanDetailsDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusBtDeviceScanDetail& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return ((mApSrnRssi == peer.mApSrnRssi) &&
|
return mDataItem.mApSrnRssi ==
|
||||||
(0 == memcmp(mApSrnMacAddress, peer.mApSrnMacAddress, sizeof(mApSrnMacAddress))) &&
|
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mApSrnRssi &&
|
||||||
(mApSrnTimestamp == peer.mApSrnTimestamp) &&
|
memcmp(mDataItem.mApSrnMacAddress,
|
||||||
(mRequestTimestamp == peer.mRequestTimestamp) &&
|
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mApSrnMacAddress,
|
||||||
(mReceiveTimestamp == peer.mReceiveTimestamp));
|
sizeof(mDataItem.mApSrnMacAddress)) == 0 &&
|
||||||
|
mDataItem.mApSrnTimestamp ==
|
||||||
|
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mApSrnTimestamp &&
|
||||||
|
mDataItem.mRequestTimestamp ==
|
||||||
|
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mRequestTimestamp &&
|
||||||
|
mDataItem.mReceiveTimestamp ==
|
||||||
|
((const SystemStatusBtDeviceScanDetail&)peer).mDataItem.mReceiveTimestamp;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemStatusBtleDeviceScanDetail : public SystemStatusItemBase,
|
class SystemStatusBtleDeviceScanDetail : public SystemStatusItemBase {
|
||||||
public BtLeDeviceScanDetailsDataItemBase
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
inline SystemStatusBtleDeviceScanDetail() :
|
BtLeDeviceScanDetailsDataItem mDataItem;
|
||||||
BtLeDeviceScanDetailsDataItemBase() {}
|
inline SystemStatusBtleDeviceScanDetail(): mDataItem() {}
|
||||||
inline SystemStatusBtleDeviceScanDetail(const BtLeDeviceScanDetailsDataItemBase& itemBase) :
|
inline SystemStatusBtleDeviceScanDetail(const BtLeDeviceScanDetailsDataItem& itemBase):
|
||||||
BtLeDeviceScanDetailsDataItemBase(itemBase) {}
|
mDataItem(itemBase) {}
|
||||||
inline bool equals(const SystemStatusBtleDeviceScanDetail& peer) {
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
return ((mApSrnRssi == peer.mApSrnRssi) &&
|
return mDataItem.mApSrnRssi ==
|
||||||
(0 == memcmp(mApSrnMacAddress, peer.mApSrnMacAddress, sizeof(mApSrnMacAddress))) &&
|
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mApSrnRssi &&
|
||||||
(mApSrnTimestamp == peer.mApSrnTimestamp) &&
|
memcmp(mDataItem.mApSrnMacAddress,
|
||||||
(mRequestTimestamp == peer.mRequestTimestamp) &&
|
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mApSrnMacAddress,
|
||||||
(mReceiveTimestamp == peer.mReceiveTimestamp));
|
sizeof(mDataItem.mApSrnMacAddress)) == 0 &&
|
||||||
|
mDataItem.mApSrnTimestamp ==
|
||||||
|
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mApSrnTimestamp &&
|
||||||
|
mDataItem.mRequestTimestamp ==
|
||||||
|
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mRequestTimestamp &&
|
||||||
|
mDataItem.mReceiveTimestamp ==
|
||||||
|
((const SystemStatusBtleDeviceScanDetail&)peer).mDataItem.mReceiveTimestamp;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class SystemStatusLocFeatureStatus : public SystemStatusItemBase {
|
||||||
|
public:
|
||||||
|
LocFeatureStatusDataItem mDataItem;
|
||||||
|
inline SystemStatusLocFeatureStatus(std::unordered_set<int> fids) : mDataItem(fids) {}
|
||||||
|
inline SystemStatusLocFeatureStatus(const LocFeatureStatusDataItem& itemBase):
|
||||||
|
mDataItem(itemBase) {}
|
||||||
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
|
return mDataItem.mFids ==
|
||||||
|
((const SystemStatusLocFeatureStatus&)peer).mDataItem.mFids;
|
||||||
|
}
|
||||||
|
inline void dump(void) override {
|
||||||
|
string str;
|
||||||
|
mDataItem.stringify(str);
|
||||||
|
LOC_LOGd("Location feature qwes status: %s", str.c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class SystemStatusInEmergencyCall : public SystemStatusItemBase {
|
||||||
|
public:
|
||||||
|
InEmergencyCallDataItem mDataItem;
|
||||||
|
inline SystemStatusInEmergencyCall(bool value = false): mDataItem(value) {}
|
||||||
|
inline SystemStatusInEmergencyCall(const InEmergencyCallDataItem& itemBase):
|
||||||
|
mDataItem(itemBase) {}
|
||||||
|
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||||
|
return mDataItem.mIsEmergency ==
|
||||||
|
((const SystemStatusInEmergencyCall&)peer).mDataItem.mIsEmergency;
|
||||||
|
}
|
||||||
|
inline void dump(void) override {
|
||||||
|
LOC_LOGd("In Emergency Call: %d", mDataItem.mIsEmergency);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -862,6 +895,7 @@ public:
|
|||||||
std::vector<SystemStatusServiceStatus> mServiceStatus;
|
std::vector<SystemStatusServiceStatus> mServiceStatus;
|
||||||
std::vector<SystemStatusModel> mModel;
|
std::vector<SystemStatusModel> mModel;
|
||||||
std::vector<SystemStatusManufacturer> mManufacturer;
|
std::vector<SystemStatusManufacturer> mManufacturer;
|
||||||
|
std::vector<SystemStatusInEmergencyCall> mInEmergencyCall;
|
||||||
std::vector<SystemStatusAssistedGps> mAssistedGps;
|
std::vector<SystemStatusAssistedGps> mAssistedGps;
|
||||||
std::vector<SystemStatusScreenState> mScreenState;
|
std::vector<SystemStatusScreenState> mScreenState;
|
||||||
std::vector<SystemStatusPowerConnectState> mPowerConnectState;
|
std::vector<SystemStatusPowerConnectState> mPowerConnectState;
|
||||||
@ -873,6 +907,7 @@ public:
|
|||||||
std::vector<SystemStatusMccMnc> mMccMnc;
|
std::vector<SystemStatusMccMnc> mMccMnc;
|
||||||
std::vector<SystemStatusBtDeviceScanDetail> mBtDeviceScanDetail;
|
std::vector<SystemStatusBtDeviceScanDetail> mBtDeviceScanDetail;
|
||||||
std::vector<SystemStatusBtleDeviceScanDetail> mBtLeDeviceScanDetail;
|
std::vector<SystemStatusBtleDeviceScanDetail> mBtLeDeviceScanDetail;
|
||||||
|
std::vector<SystemStatusLocFeatureStatus> mLocFeatureStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
@ -918,6 +953,10 @@ public:
|
|||||||
bool roaming, NetworkHandle networkHandle, string& apn);
|
bool roaming, NetworkHandle networkHandle, string& apn);
|
||||||
bool updatePowerConnectState(bool charging);
|
bool updatePowerConnectState(bool charging);
|
||||||
void resetNetworkInfo();
|
void resetNetworkInfo();
|
||||||
|
bool eventOptInStatus(bool userConsent);
|
||||||
|
bool eventRegionStatus(bool region);
|
||||||
|
bool eventLocFeatureStatus(std::unordered_set<int> fids);
|
||||||
|
bool eventInEmergencyCall(bool isEmergency);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
@ -46,9 +46,6 @@ COUT SystemStatusOsObserver::containerTransfer(CINT& inContainer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SystemStatusOsObserver::~SystemStatusOsObserver() {
|
SystemStatusOsObserver::~SystemStatusOsObserver() {
|
||||||
// Close data-item library handle
|
|
||||||
DataItemsFactoryProxy::closeDataItemLibraryHandle();
|
|
||||||
|
|
||||||
// Destroy cache
|
// Destroy cache
|
||||||
for (auto each : mDataItemCache) {
|
for (auto each : mDataItemCache) {
|
||||||
if (nullptr != each.second) {
|
if (nullptr != each.second) {
|
||||||
@ -112,10 +109,10 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
|
|||||||
// Send subscription set to framework
|
// Send subscription set to framework
|
||||||
if (nullptr != mParent->mContext.mSubscriptionObj) {
|
if (nullptr != mParent->mContext.mSubscriptionObj) {
|
||||||
if (mToRequestData) {
|
if (mToRequestData) {
|
||||||
LOC_LOGD("Request Data sent to framework for the following");
|
LOC_LOGd("Request Data sent to framework for the following");
|
||||||
mParent->mContext.mSubscriptionObj->requestData(diItemlist, mParent);
|
mParent->mContext.mSubscriptionObj->requestData(diItemlist, mParent);
|
||||||
} else if (!dataItemsToSubscribe.empty()) {
|
} else if (!dataItemsToSubscribe.empty()) {
|
||||||
LOC_LOGD("Subscribe Request sent to framework for the following");
|
LOC_LOGd("Subscribe Request sent to framework for the following");
|
||||||
mParent->logMe(dataItemsToSubscribe);
|
mParent->logMe(dataItemsToSubscribe);
|
||||||
mParent->mContext.mSubscriptionObj->subscribe(
|
mParent->mContext.mSubscriptionObj->subscribe(
|
||||||
containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
|
containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
|
||||||
@ -177,7 +174,7 @@ void SystemStatusOsObserver::updateSubscription(
|
|||||||
if (nullptr != mParent->mContext.mSubscriptionObj) {
|
if (nullptr != mParent->mContext.mSubscriptionObj) {
|
||||||
// Send subscription set to framework
|
// Send subscription set to framework
|
||||||
if (!dataItemsToSubscribe.empty()) {
|
if (!dataItemsToSubscribe.empty()) {
|
||||||
LOC_LOGD("Subscribe Request sent to framework for the following");
|
LOC_LOGd("Subscribe Request sent to framework for the following");
|
||||||
mParent->logMe(dataItemsToSubscribe);
|
mParent->logMe(dataItemsToSubscribe);
|
||||||
|
|
||||||
mParent->mContext.mSubscriptionObj->subscribe(
|
mParent->mContext.mSubscriptionObj->subscribe(
|
||||||
@ -188,7 +185,7 @@ void SystemStatusOsObserver::updateSubscription(
|
|||||||
|
|
||||||
// Send unsubscribe to framework
|
// Send unsubscribe to framework
|
||||||
if (!dataItemsToUnsubscribe.empty()) {
|
if (!dataItemsToUnsubscribe.empty()) {
|
||||||
LOC_LOGD("Unsubscribe Request sent to framework for the following");
|
LOC_LOGd("Unsubscribe Request sent to framework for the following");
|
||||||
mParent->logMe(dataItemsToUnsubscribe);
|
mParent->logMe(dataItemsToUnsubscribe);
|
||||||
|
|
||||||
mParent->mContext.mSubscriptionObj->unsubscribe(
|
mParent->mContext.mSubscriptionObj->unsubscribe(
|
||||||
@ -230,7 +227,7 @@ void SystemStatusOsObserver::unsubscribe(
|
|||||||
&dataItemsToUnsubscribe, nullptr);
|
&dataItemsToUnsubscribe, nullptr);
|
||||||
|
|
||||||
if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToUnsubscribe.empty()) {
|
if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToUnsubscribe.empty()) {
|
||||||
LOC_LOGD("Unsubscribe Request sent to framework for the following data items");
|
LOC_LOGd("Unsubscribe Request sent to framework for the following data items");
|
||||||
mParent->logMe(dataItemsToUnsubscribe);
|
mParent->logMe(dataItemsToUnsubscribe);
|
||||||
|
|
||||||
// Send unsubscribe to framework
|
// Send unsubscribe to framework
|
||||||
@ -271,7 +268,7 @@ void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client)
|
|||||||
if (!dataItemsToUnsubscribe.empty() &&
|
if (!dataItemsToUnsubscribe.empty() &&
|
||||||
nullptr != mParent->mContext.mSubscriptionObj) {
|
nullptr != mParent->mContext.mSubscriptionObj) {
|
||||||
|
|
||||||
LOC_LOGD("Unsubscribe Request sent to framework for the following data items");
|
LOC_LOGd("Unsubscribe Request sent to framework for the following data items");
|
||||||
mParent->logMe(dataItemsToUnsubscribe);
|
mParent->logMe(dataItemsToUnsubscribe);
|
||||||
|
|
||||||
// Send unsubscribe to framework
|
// Send unsubscribe to framework
|
||||||
@ -347,19 +344,16 @@ void SystemStatusOsObserver::notify(const list<IDataItemCore*>& dlist)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!dlist.empty()) {
|
if (!dlist.empty()) {
|
||||||
vector<IDataItemCore*> dataItemVec(dlist.size());
|
vector<IDataItemCore*> dataItemVec;
|
||||||
|
|
||||||
for (auto each : dlist) {
|
for (auto each : dlist) {
|
||||||
|
|
||||||
IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId());
|
IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each);
|
||||||
if (nullptr == di) {
|
if (nullptr == di) {
|
||||||
LOC_LOGw("Unable to create dataitem:%d", each->getId());
|
LOC_LOGw("Unable to create dataitem:%d", each->getId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy contents into the newly created data item
|
|
||||||
di->copy(each);
|
|
||||||
|
|
||||||
// add this dataitem if updated from last one
|
// add this dataitem if updated from last one
|
||||||
dataItemVec.push_back(di);
|
dataItemVec.push_back(di);
|
||||||
IF_LOC_LOGD {
|
IF_LOC_LOGD {
|
||||||
@ -381,7 +375,7 @@ void SystemStatusOsObserver::notify(const list<IDataItemCore*>& dlist)
|
|||||||
void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
|
void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
|
||||||
{
|
{
|
||||||
if (nullptr == mContext.mFrameworkActionReqObj) {
|
if (nullptr == mContext.mFrameworkActionReqObj) {
|
||||||
LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__);
|
LOC_LOGe("Framework action request object is NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +386,7 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
|
|||||||
// Add reference count as 1 and add dataitem to map
|
// Add reference count as 1 and add dataitem to map
|
||||||
pair<DataItemId, int> cpair(dit, 1);
|
pair<DataItemId, int> cpair(dit, 1);
|
||||||
mActiveRequestCount.insert(cpair);
|
mActiveRequestCount.insert(cpair);
|
||||||
LOC_LOGD("Sending turnOn request");
|
LOC_LOGd("Sending turnOn request");
|
||||||
|
|
||||||
// Send action turn on to framework
|
// Send action turn on to framework
|
||||||
struct HandleTurnOnMsg : public LocMsg {
|
struct HandleTurnOnMsg : public LocMsg {
|
||||||
@ -413,14 +407,14 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut)
|
|||||||
else {
|
else {
|
||||||
// Found in map, update reference count
|
// Found in map, update reference count
|
||||||
citer->second++;
|
citer->second++;
|
||||||
LOC_LOGD("turnOn - Data item:%d Num_refs:%d", dit, citer->second);
|
LOC_LOGd("turnOn - Data item:%d Num_refs:%d", dit, citer->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemStatusOsObserver::turnOff(DataItemId dit)
|
void SystemStatusOsObserver::turnOff(DataItemId dit)
|
||||||
{
|
{
|
||||||
if (nullptr == mContext.mFrameworkActionReqObj) {
|
if (nullptr == mContext.mFrameworkActionReqObj) {
|
||||||
LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__);
|
LOC_LOGe("Framework action request object is NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +423,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit)
|
|||||||
if (citer != mActiveRequestCount.end()) {
|
if (citer != mActiveRequestCount.end()) {
|
||||||
// found
|
// found
|
||||||
citer->second--;
|
citer->second--;
|
||||||
LOC_LOGD("turnOff - Data item:%d Remaining:%d", dit, citer->second);
|
LOC_LOGd("turnOff - Data item:%d Remaining:%d", dit, citer->second);
|
||||||
if(citer->second == 0) {
|
if(citer->second == 0) {
|
||||||
// if this was last reference, remove item from map and turn off module
|
// if this was last reference, remove item from map and turn off module
|
||||||
mActiveRequestCount.erase(citer);
|
mActiveRequestCount.erase(citer);
|
||||||
@ -542,7 +536,7 @@ void SystemStatusOsObserver::sendCachedDataItems(
|
|||||||
if (citer != mDataItemCache.end()) {
|
if (citer != mDataItemCache.end()) {
|
||||||
string dv;
|
string dv;
|
||||||
citer->second->stringify(dv);
|
citer->second->stringify(dv);
|
||||||
LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str());
|
LOC_LOGi("DataItem: %s >> %s", dv.c_str(), clientName.c_str());
|
||||||
dataItems.push_front(citer->second);
|
dataItems.push_front(citer->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -564,27 +558,22 @@ bool SystemStatusOsObserver::updateCache(IDataItemCore* d)
|
|||||||
// handling it, so SystemStatusOsObserver also doesn't.
|
// handling it, so SystemStatusOsObserver also doesn't.
|
||||||
// So it has to be true to proceed.
|
// So it has to be true to proceed.
|
||||||
if (nullptr != d && mSystemStatus->eventDataItemNotify(d)) {
|
if (nullptr != d && mSystemStatus->eventDataItemNotify(d)) {
|
||||||
|
dataItemUpdated = true;
|
||||||
auto citer = mDataItemCache.find(d->getId());
|
auto citer = mDataItemCache.find(d->getId());
|
||||||
if (citer == mDataItemCache.end()) {
|
if (citer == mDataItemCache.end()) {
|
||||||
// New data item; not found in cache
|
// New data item; not found in cache
|
||||||
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId());
|
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d);
|
||||||
if (nullptr != dataitem) {
|
if (nullptr != dataitem) {
|
||||||
// Copy the contents of the data item
|
|
||||||
dataitem->copy(d);
|
|
||||||
// Insert in mDataItemCache
|
// Insert in mDataItemCache
|
||||||
mDataItemCache.insert(std::make_pair(d->getId(), dataitem));
|
mDataItemCache.insert(std::make_pair(d->getId(), dataitem));
|
||||||
dataItemUpdated = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Found in cache; Update cache if necessary
|
// Found in cache; Update cache if necessary
|
||||||
citer->second->copy(d, &dataItemUpdated);
|
citer->second->copyFrom(d);
|
||||||
}
|
|
||||||
|
|
||||||
if (dataItemUpdated) {
|
|
||||||
LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOC_LOGd("DataItem:%d updated:%d", d->getId(), dataItemUpdated);
|
||||||
return dataItemUpdated;
|
return dataItemUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
983
gps/core/data-items/DataItemConcreteTypes.cpp
Normal file
983
gps/core/data-items/DataItemConcreteTypes.cpp
Normal file
@ -0,0 +1,983 @@
|
|||||||
|
/* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above
|
||||||
|
* copyright notice, this list of conditions and the following
|
||||||
|
* disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* * Neither the name of The Linux Foundation, nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "DataItemConcreteTypes.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <log_util.h>
|
||||||
|
|
||||||
|
#define ENH_FIELD_ENABLED "IS_QUALCOMM_ENHANCED_PROVIDER_ENABLED"
|
||||||
|
#define AIRPLANEMODE_FIELD_MODE "IS_AIRPLANE_MODE_ON"
|
||||||
|
#define ENH_FIELD_ENABLED "IS_QUALCOMM_ENHANCED_PROVIDER_ENABLED"
|
||||||
|
#define GPSSTATE_FIELD_ENABLED "IS_GPS_PROVIDER_ENABLED"
|
||||||
|
#define NLPSTATUS_FIELD_ENABLED "IS_NETWORK_PROVIDER_ENABLED"
|
||||||
|
#define WIFIHARDWARESTATE_FIELD_ENABLED "IS_WIFI_HARDWARE_ON"
|
||||||
|
#define SCREENSTATE_FIELD_ENABLED "IS_SCREEN_ON"
|
||||||
|
#define POWERCONNECTSTATE_FIELD_ENABLED "IS_POWER_CONNECTED"
|
||||||
|
#define TIMEZONECHANGE_FIELD_ENABLED "IS_TIMEZONE_CHANGED"
|
||||||
|
#define TIMECHANGE_FIELD_ENABLED "IS_TIME_CHANGED"
|
||||||
|
#define TIMECHANGE_FIELD_CURRENT_TIME_MILLIS "CURR_TIME_MILLIS"
|
||||||
|
#define TIMECHANGE_FIELD_RAW_OFFSET_TZ "RAW_OFFSET_TZ"
|
||||||
|
#define TIMECHANGE_FIELD_DST_OFFSET_TZ "DST_OFFSET_TZ"
|
||||||
|
|
||||||
|
#define SHUTDOWN_FIELD_ENABLED "IS_SHUTDOWN"
|
||||||
|
#define ASSISTEDGPS_FIELD_ENABLED "IS_ASSISTED_GPS_ENABLED"
|
||||||
|
|
||||||
|
#define NETWORKINFO_CARD "ACTIVE_NETWORK_INFO"
|
||||||
|
#define NETWORKINFO_FIELD_TYPE "TYPE"
|
||||||
|
#define NETWORKINFO_FIELD_TYPENAME "TYPE_NAME"
|
||||||
|
#define NETWORKINFO_FIELD_SUBTYPENAME "SUB_TYPE_NAME"
|
||||||
|
#define NETWORKINFO_FIELD_AVAILABLE "IS_AVAILABLE"
|
||||||
|
#define NETWORKINFO_FIELD_CONNECTED "IS_CONNECTED"
|
||||||
|
#define NETWORKINFO_FIELD_ROAMING "IS_ROAMING"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_0 "NETWORK_HANDLE_0"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_1 "NETWORK_HANDLE_1"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_2 "NETWORK_HANDLE_2"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_3 "NETWORK_HANDLE_3"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_4 "NETWORK_HANDLE_4"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_5 "NETWORK_HANDLE_5"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_6 "NETWORK_HANDLE_6"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_7 "NETWORK_HANDLE_7"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_8 "NETWORK_HANDLE_8"
|
||||||
|
#define NETWORKINFO_FIELD_NETWORKHANDLE_9 "NETWORK_HANDLE_9"
|
||||||
|
|
||||||
|
#define SERVICESTATUS_FIELD_STATE "CELL_NETWORK_STATUS"
|
||||||
|
#define MODEL_FIELD_NAME "MODEL"
|
||||||
|
#define MANUFACTURER_FIELD_NAME "MANUFACTURER"
|
||||||
|
#define OSSTATUS_CARD "ACTIVE_NETWORK_INFO"
|
||||||
|
|
||||||
|
#define RILSERVICEINFO_CARD "RIL-SERVICE-INFO"
|
||||||
|
#define RILSERVICEINFO_FIELD_ARIF_TYPE_MASK "SUPPORTED-AIRINTERFACE-TYPE-MASK"
|
||||||
|
#define RILSERVICEINFO_FIELD_CARRIER_ARIF_TYPE "CARRIER-AIRINTERFACE-TYPE"
|
||||||
|
#define RILSERVICEINFO_FIELD_CARRIER_MCC "MOBILE-COUNTRY-CODE"
|
||||||
|
#define RILSERVICEINFO_FIELD_CARRIER_MNC "MOBILE-NETWORK-CODE"
|
||||||
|
#define RILSERVICEINFO_FIELD_CARRIER_NAME "HOME-CARRIER-NAME"
|
||||||
|
|
||||||
|
#define RILCELLINFO_CARD "RIL-CELL-UPDATE"
|
||||||
|
#define RILCELLINFO_FIELD_NETWORK_STATUS "NETWORK-STATUS"
|
||||||
|
#define RILCELLINFO_FIELD_RIL_TECH_TYPE "RIL-TECH-TYPE"
|
||||||
|
#define RILLCELLINFO_FIELD_MCC "MOBILE-COUNTRY-CODE"
|
||||||
|
#define RILLCELLINFO_FIELD_MNC "MOBILE-NETWORK-CODE"
|
||||||
|
#define RILLCELLINFO_FIELD_LAC "LOCATION-AREA-CODE"
|
||||||
|
#define RILLCELLINFO_FIELD_CID "CELL-ID"
|
||||||
|
#define RILLCELLINFO_FIELD_SID "SYSTEM-ID"
|
||||||
|
#define RILLCELLINFO_FIELD_NID "NETWORK-ID"
|
||||||
|
#define RILLCELLINFO_FIELD_BSID "BASE-STATION-ID"
|
||||||
|
#define RILLCELLINFO_FIELD_BSLAT "BASE-STATION-LATITUDE"
|
||||||
|
#define RILLCELLINFO_FIELD_BSLON "BASE-STATION-LONGITUDE"
|
||||||
|
#define RILLCELLINFO_FIELD_UTC_TIME_OFFSET "TIME-ZONE-OFFSET"
|
||||||
|
#define RILLCELLINFO_FIELD_DAYLIGHT_TIMEZONE "IN-DAY-LIGHT-SAVING"
|
||||||
|
#define RILLCELLINFO_FIELD_TAC "TRACKING-AREA-CODE"
|
||||||
|
#define RILLCELLINFO_FIELD_PCI "PHYSICAL-CELL-ID"
|
||||||
|
#define RILLCELLINFO_FIELD_NB_MODE "NB-MODE"
|
||||||
|
#define RILLCELLINFO_FIELD_NB_EARFCN_OFFSET "NB-EARFCN-OFFSET"
|
||||||
|
|
||||||
|
#define WIFI_SUPPLICANT_FIELD_STATE "WIFI-SUPPLICANT-STATE"
|
||||||
|
#define TAC_FIELD_NAME "TAC"
|
||||||
|
#define MCCMNC_FIELD_NAME "MCCMNC"
|
||||||
|
|
||||||
|
#define BTLESCANDETAILS_FIELD_VALID "BTLE_VALID_DEV"
|
||||||
|
#define BTLESCANDETAILS_FIELD_RSSI "BTLE_DEV_RSSI"
|
||||||
|
#define BTLESCANDETAILS_FIELD_MAC "BTLE_DEV_MAC"
|
||||||
|
#define BTLESCANDETAILS_FIELD_SCANREQ "BTLE_SCAN_REQ_TIME"
|
||||||
|
#define BTLESCANDETAILS_FIELD_SCANSTART "BTLE_SCAN_START_TIME"
|
||||||
|
#define BTLESCANDETAILS_FIELD_SCANRECV "BTLE_SCAN_RECV_TIME"
|
||||||
|
#define BTLESCANDETAILS_FIELD_SCANERROR "BTLE_SCAN_ERR"
|
||||||
|
|
||||||
|
#define BTSCANDETAILS_FIELD_VALID "BT_VALID_DEV"
|
||||||
|
#define BTSCANDETAILS_FIELD_RSSI "BT_DEV_RSSI"
|
||||||
|
#define BTSCANDETAILS_FIELD_MAC "BT_DEV_MAC"
|
||||||
|
#define BTSCANDETAILS_FIELD_SCANREQ "BT_SCAN_REQ_TIME"
|
||||||
|
#define BTSCANDETAILS_FIELD_SCANSTART "BT_SCAN_START_TIME"
|
||||||
|
#define BTSCANDETAILS_FIELD_SCANRECV "BT_SCAN_RECV_TIME"
|
||||||
|
#define BTSCANDETAILS_FIELD_SCANERROR "BT_SCAN_ERR"
|
||||||
|
|
||||||
|
#define OEM_GTP_UPLAOD_TRIGGER_READY_FIELD_NAME "OEM-GTP-UPLOAD-TRIGGER-READY"
|
||||||
|
#define BATTERYLEVEL_FIELD_BATTERY_PCT "BATTERY_PCT"
|
||||||
|
|
||||||
|
#define IN_EMERGENCY_CALL_FIELD_NAME "IS_EMERGENCY"
|
||||||
|
#define LOC_FEATURE_STATUS_FIELD_NAME "LOC_FEATURE_STATUS"
|
||||||
|
|
||||||
|
namespace loc_core
|
||||||
|
{
|
||||||
|
// stringify
|
||||||
|
void AirplaneModeDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(AirplaneModeDataItem, AIRPLANEMODE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = AIRPLANEMODE_FIELD_MODE;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mMode) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ENHDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = ENH_FIELD_ENABLED;
|
||||||
|
if (!d->isEnabled()) {
|
||||||
|
Fields field = FIELD_MAX;
|
||||||
|
switch (mFieldUpdate) {
|
||||||
|
case FIELD_CONSENT:
|
||||||
|
valueStr += "_FIELD_CONSENT";
|
||||||
|
field = FIELD_CONSENT;
|
||||||
|
break;
|
||||||
|
case FIELD_REGION:
|
||||||
|
valueStr += "_FIELD_REGION";
|
||||||
|
field = FIELD_REGION;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (((1 << field) & d->mEnhFields) != 0) ? "true" : "false";
|
||||||
|
} else {
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += "true";
|
||||||
|
}
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void GPSStateDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(GPSStateDataItem, GPSSTATE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = GPSSTATE_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mEnabled) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void NLPStatusDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(NLPStatusDataItem, NLPSTATUS_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = NLPSTATUS_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mEnabled) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void WifiHardwareStateDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(WifiHardwareStateDataItem,
|
||||||
|
WIFIHARDWARESTATE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = WIFIHARDWARESTATE_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mEnabled) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void ScreenStateDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ScreenStateDataItem, SCREEN_STATE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = SCREENSTATE_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mState) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void PowerConnectStateDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(PowerConnectStateDataItem,
|
||||||
|
POWER_CONNECTED_STATE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = POWERCONNECTSTATE_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mState) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BatteryLevelDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(BatteryLevelDataItem, BATTERY_LEVEL_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += BATTERYLEVEL_FIELD_BATTERY_PCT;
|
||||||
|
valueStr += ": ";
|
||||||
|
char state [12];
|
||||||
|
snprintf (state, 12, "%d", d->mBatteryPct);
|
||||||
|
valueStr += string (state);
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TimeZoneChangeDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(TimeZoneChangeDataItem, TIMEZONE_CHANGE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = TIMEZONECHANGE_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += "true";
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void TimeChangeDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(TimeChangeDataItem, TIME_CHANGE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = TIMECHANGE_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += "true";
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void ShutdownStateDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ShutdownStateDataItem, SHUTDOWN_STATE_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = SHUTDOWN_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mState) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void AssistedGpsDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(AssistedGpsDataItem, ASSISTED_GPS_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = ASSISTEDGPS_FIELD_ENABLED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mEnabled) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void NetworkInfoDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(NetworkInfoDataItem, NETWORKINFO_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr = NETWORKINFO_CARD;
|
||||||
|
valueStr += "::";
|
||||||
|
valueStr += NETWORKINFO_FIELD_TYPE;
|
||||||
|
valueStr += "s_MASK: ";
|
||||||
|
char type [12];
|
||||||
|
snprintf (type, 12, "%" PRIu64, mAllTypes);
|
||||||
|
valueStr += string (type);
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_TYPENAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mTypeName;
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_SUBTYPENAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mSubTypeName;
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_AVAILABLE;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mAvailable) ? ("true") : ("false");
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_CONNECTED;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mConnected) ? ("true") : ("false");
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_ROAMING;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mRoaming) ? ("true") : ("false");
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_0;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[0].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_1;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[1].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_2;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[2].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_3;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[3].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_4;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[4].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_5;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[5].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_6;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[6].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_7;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[7].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_8;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[8].toString();
|
||||||
|
valueStr += ", ";
|
||||||
|
valueStr += NETWORKINFO_FIELD_NETWORKHANDLE_9;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mAllNetworkHandles[9].toString();
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void ServiceStatusDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ServiceStatusDataItem, SERVICESTATUS_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += SERVICESTATUS_FIELD_STATE;
|
||||||
|
valueStr += ": ";
|
||||||
|
char state [12];
|
||||||
|
snprintf (state, 12, "%d", d->mServiceState);
|
||||||
|
valueStr += string (state);
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void ModelDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ModelDataItem, MODEL_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += MODEL_FIELD_NAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mModel;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void ManufacturerDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ManufacturerDataItem, MANUFACTURER_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += MANUFACTURER_FIELD_NAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mManufacturer;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void WifiSupplicantStatusDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(WifiSupplicantStatusDataItem,
|
||||||
|
WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID);
|
||||||
|
valueStr += "Attach state: ";
|
||||||
|
char t[50];
|
||||||
|
memset (t, '\0', 50);
|
||||||
|
snprintf (t, 50, "%d", d->mState);
|
||||||
|
valueStr += t;
|
||||||
|
|
||||||
|
valueStr += ", Mac address valid: ";
|
||||||
|
valueStr += (d->mApMacAddressValid) ? ("true") : ("false");
|
||||||
|
|
||||||
|
valueStr += ", AP MAC address: ";
|
||||||
|
memset (t, '\0', 50);
|
||||||
|
snprintf(t, 50, "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApMacAddress[0], d->mApMacAddress[1],
|
||||||
|
d->mApMacAddress[2], d->mApMacAddress[3], d->mApMacAddress[4], d->mApMacAddress[5]);
|
||||||
|
valueStr += t;
|
||||||
|
|
||||||
|
valueStr += ", Wifi-Ap SSID Valid: ";
|
||||||
|
valueStr += (d->mWifiApSsidValid) ? ("true") : ("false");
|
||||||
|
|
||||||
|
valueStr += ", SSID: ";
|
||||||
|
valueStr += d->mWifiApSsid;
|
||||||
|
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void TacDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(TacDataItem, TAC_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += TAC_FIELD_NAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mValue;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void MccmncDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(MccmncDataItem, MCCMNC_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += MCCMNC_FIELD_NAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mValue;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void BtLeDeviceScanDetailsDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(BtLeDeviceScanDetailsDataItem, BTLE_SCAN_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_VALID;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mValidSrnData;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_RSSI;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mApSrnRssi;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
char t[10];
|
||||||
|
memset (t, '\0', 10);
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_MAC;
|
||||||
|
valueStr += ": ";
|
||||||
|
snprintf(t, 10, "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApSrnMacAddress[0],
|
||||||
|
d->mApSrnMacAddress[1], d->mApSrnMacAddress[2], d->mApSrnMacAddress[3],
|
||||||
|
d->mApSrnMacAddress[4], d->mApSrnMacAddress[5]);
|
||||||
|
valueStr += t;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_SCANREQ;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mApSrnTimestamp;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_SCANSTART;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mRequestTimestamp;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_SCANRECV;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mReceiveTimestamp;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTLESCANDETAILS_FIELD_SCANERROR;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mErrorCause;
|
||||||
|
valueStr += ", ";
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
void BtDeviceScanDetailsDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(BtDeviceScanDetailsDataItem, BT_SCAN_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_VALID;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mValidSrnData;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_RSSI;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mApSrnRssi;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
char t[10];
|
||||||
|
memset (t, '\0', 10);
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_MAC;
|
||||||
|
valueStr += ": ";
|
||||||
|
snprintf(t, 10, "[%02x:%02x:%02x:%02x:%02x:%02x]", d->mApSrnMacAddress[0],
|
||||||
|
d->mApSrnMacAddress[1], d->mApSrnMacAddress[2], d->mApSrnMacAddress[3],
|
||||||
|
d->mApSrnMacAddress[4], d->mApSrnMacAddress[5]);
|
||||||
|
valueStr += t;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_SCANREQ;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mApSrnTimestamp;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_SCANSTART;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mRequestTimestamp;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_SCANRECV;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mReceiveTimestamp;
|
||||||
|
valueStr += ", ";
|
||||||
|
|
||||||
|
valueStr += BTSCANDETAILS_FIELD_SCANERROR;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += d->mErrorCause;
|
||||||
|
valueStr += ", ";
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy
|
||||||
|
int32_t AirplaneModeDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(AirplaneModeDataItem, AIRPLANEMODE_DATA_ITEM_ID);
|
||||||
|
if (s->mMode == d->mMode) { result = 0; break; }
|
||||||
|
s->mMode = d->mMode;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
void InEmergencyCallDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(
|
||||||
|
InEmergencyCallDataItem, IN_EMERGENCY_CALL_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += IN_EMERGENCY_CALL_FIELD_NAME;
|
||||||
|
valueStr += ": ";
|
||||||
|
valueStr += (d->mIsEmergency) ? ("true") : ("false");
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
int32_t ENHDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
|
||||||
|
if (s->mEnhFields == d->mEnhFields) { result = true; break; }
|
||||||
|
switch (d->mAction) {
|
||||||
|
case SET:
|
||||||
|
s->mEnhFields |= (1 << d->mFieldUpdate);
|
||||||
|
break;
|
||||||
|
case CLEAR:
|
||||||
|
s->mEnhFields &= ~(1 << d->mFieldUpdate);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t GPSStateDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(GPSStateDataItem, GPSSTATE_DATA_ITEM_ID);
|
||||||
|
if (s->mEnabled == d->mEnabled) { result = 0; break; }
|
||||||
|
s->mEnabled = d->mEnabled;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t NLPStatusDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(NLPStatusDataItem, NLPSTATUS_DATA_ITEM_ID);
|
||||||
|
if (s->mEnabled == d->mEnabled) { result = 0; break; }
|
||||||
|
s->mEnabled = d->mEnabled;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t WifiHardwareStateDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(WifiHardwareStateDataItem, WIFIHARDWARESTATE_DATA_ITEM_ID);
|
||||||
|
if (s->mEnabled == d->mEnabled) { result = 0; break; }
|
||||||
|
s->mEnabled = d->mEnabled;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t ScreenStateDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(ScreenStateDataItem, SCREEN_STATE_DATA_ITEM_ID);
|
||||||
|
if (s->mState == d->mState) { result = 0; break; }
|
||||||
|
s->mState = d->mState;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t PowerConnectStateDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(PowerConnectStateDataItem,
|
||||||
|
POWER_CONNECTED_STATE_DATA_ITEM_ID);
|
||||||
|
if (s->mState == d->mState) { result = 0; break; }
|
||||||
|
s->mState = d->mState;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t BatteryLevelDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(BatteryLevelDataItem, BATTERY_LEVEL_DATA_ITEM_ID);
|
||||||
|
if (s->mBatteryPct == d->mBatteryPct) { result = 0; break; }
|
||||||
|
s->mBatteryPct = d->mBatteryPct;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t TimeZoneChangeDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(TimeZoneChangeDataItem, TIMEZONE_CHANGE_DATA_ITEM_ID);
|
||||||
|
if (s->mCurrTimeMillis == d->mCurrTimeMillis &&
|
||||||
|
s->mRawOffsetTZ == d->mRawOffsetTZ &&
|
||||||
|
s->mDstOffsetTZ == d->mDstOffsetTZ) {
|
||||||
|
result = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s->mCurrTimeMillis = d->mCurrTimeMillis;
|
||||||
|
s->mRawOffsetTZ = d->mRawOffsetTZ;
|
||||||
|
s->mDstOffsetTZ = d->mDstOffsetTZ;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t TimeChangeDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(TimeChangeDataItem, TIME_CHANGE_DATA_ITEM_ID);
|
||||||
|
if (s->mCurrTimeMillis == d->mCurrTimeMillis &&
|
||||||
|
s->mRawOffsetTZ == d->mRawOffsetTZ &&
|
||||||
|
s->mDstOffsetTZ == d->mDstOffsetTZ) {
|
||||||
|
result = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s->mCurrTimeMillis = d->mCurrTimeMillis;
|
||||||
|
s->mRawOffsetTZ = d->mRawOffsetTZ;
|
||||||
|
s->mDstOffsetTZ = d->mDstOffsetTZ;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t ShutdownStateDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(ShutdownStateDataItem, SHUTDOWN_STATE_DATA_ITEM_ID);
|
||||||
|
if (s->mState == d->mState) { result = 0; break; }
|
||||||
|
s->mState = d->mState;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t AssistedGpsDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(AssistedGpsDataItem, ASSISTED_GPS_DATA_ITEM_ID);
|
||||||
|
if (s->mEnabled == d->mEnabled) { result = 0; break; }
|
||||||
|
s->mEnabled = d->mEnabled;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t NetworkInfoDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(NetworkInfoDataItem, NETWORKINFO_DATA_ITEM_ID);
|
||||||
|
NetworkType type = ((NetworkInfoDataItem*)d)->getType();
|
||||||
|
if ( (s->mAllTypes == d->mAllTypes) &&
|
||||||
|
(s->getType() == type) && (0 == s->mTypeName.compare(d->mTypeName)) &&
|
||||||
|
(0 == s->mSubTypeName.compare(d->mSubTypeName)) &&
|
||||||
|
(s->mAvailable == d->mAvailable) &&
|
||||||
|
(s->mConnected == d->mConnected) &&
|
||||||
|
(s->mRoaming == d->mRoaming) &&
|
||||||
|
(memcmp(s->mAllNetworkHandles, d->mAllNetworkHandles,
|
||||||
|
sizeof(s->mAllNetworkHandles)) == 0) &&
|
||||||
|
(s->mNetworkHandle == d->mNetworkHandle) ) {
|
||||||
|
result = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
s->mAllTypes = (d->mAllTypes == 0) ? typeToAllTypes(type) : d->mAllTypes;
|
||||||
|
if (s->getType() != type) { s->setType(type);}
|
||||||
|
if (0 != s->mTypeName.compare(d->mTypeName)) { s->mTypeName = d->mTypeName;}
|
||||||
|
if (0 != s->mSubTypeName.compare(d->mSubTypeName)) {s->mSubTypeName = d->mSubTypeName;}
|
||||||
|
if (s->mAvailable != d->mAvailable) {s->mAvailable = d->mAvailable;}
|
||||||
|
if (s->mConnected != d->mConnected) {s->mConnected = d->mConnected;}
|
||||||
|
if (s->mRoaming != d->mRoaming) {s->mRoaming = d->mRoaming;}
|
||||||
|
if (memcmp(s->mAllNetworkHandles, d->mAllNetworkHandles,
|
||||||
|
sizeof(s->mAllNetworkHandles)) != 0) {
|
||||||
|
memcpy(static_cast<void*>(s->mAllNetworkHandles),
|
||||||
|
static_cast<void *>(d->mAllNetworkHandles), sizeof(s->mAllNetworkHandles));
|
||||||
|
}
|
||||||
|
if (s->mNetworkHandle != d->mNetworkHandle) {s->mNetworkHandle = d->mNetworkHandle;}
|
||||||
|
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t ServiceStatusDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(ServiceStatusDataItem, SERVICESTATUS_DATA_ITEM_ID);
|
||||||
|
if (s->mServiceState == d->mServiceState) { result = 0; break; }
|
||||||
|
s->mServiceState = d->mServiceState;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t ModelDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(ModelDataItem, MODEL_DATA_ITEM_ID);
|
||||||
|
if (0 == s->mModel.compare(d->mModel)) { result = 0; break; }
|
||||||
|
s->mModel = d->mModel;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t ManufacturerDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(ManufacturerDataItem, MANUFACTURER_DATA_ITEM_ID);
|
||||||
|
if (0 == s->mManufacturer.compare(d->mManufacturer)) { result = 0; break; }
|
||||||
|
s->mManufacturer = d->mManufacturer;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t WifiSupplicantStatusDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(WifiSupplicantStatusDataItem,
|
||||||
|
WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID);
|
||||||
|
if ( (s->mState == d->mState) &&
|
||||||
|
(s->mApMacAddressValid == d->mApMacAddressValid) &&
|
||||||
|
(s->mWifiApSsidValid == d->mWifiApSsidValid)) {
|
||||||
|
|
||||||
|
// compare mac address
|
||||||
|
if (memcmp(s->mApMacAddress, d->mApMacAddress, sizeof(s->mApMacAddress)) == 0) {
|
||||||
|
|
||||||
|
// compare ssid
|
||||||
|
if (s->mWifiApSsid.compare(d->mWifiApSsid) == 0) {
|
||||||
|
result = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s->mState != d->mState) { s->mState = d->mState;}
|
||||||
|
if (s->mApMacAddressValid != d->mApMacAddressValid) {
|
||||||
|
s->mApMacAddressValid = d->mApMacAddressValid;
|
||||||
|
}
|
||||||
|
if (s->mWifiApSsidValid != d->mWifiApSsidValid) {s->mWifiApSsidValid = d->mWifiApSsidValid;}
|
||||||
|
if (memcmp(s->mApMacAddress, d->mApMacAddress, sizeof(s->mApMacAddress)) != 0) {
|
||||||
|
memcpy(static_cast<void*>(s->mApMacAddress), static_cast<void *>(d->mApMacAddress),
|
||||||
|
sizeof(s->mApMacAddress));
|
||||||
|
}
|
||||||
|
if (s->mWifiApSsid.compare(d->mWifiApSsid) != 0) {
|
||||||
|
s->mWifiApSsid = d->mWifiApSsid;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t TacDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(TacDataItem, TAC_DATA_ITEM_ID);
|
||||||
|
if (0 == s->mValue.compare(d->mValue)) { result = 0; break; }
|
||||||
|
s->mValue = d->mValue;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t MccmncDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(MccmncDataItem, MCCMNC_DATA_ITEM_ID);
|
||||||
|
if (0 == s->mValue.compare(d->mValue)) { result = 0; break; }
|
||||||
|
s->mValue= d->mValue;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t BtLeDeviceScanDetailsDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(BtLeDeviceScanDetailsDataItem, BTLE_SCAN_DATA_ITEM_ID);
|
||||||
|
|
||||||
|
if (s->mValidSrnData != d->mValidSrnData) { s->mValidSrnData = d->mValidSrnData;}
|
||||||
|
if (s->mApSrnRssi != d->mApSrnRssi) { s->mApSrnRssi = d->mApSrnRssi;}
|
||||||
|
if (memcmp(s->mApSrnMacAddress, d->mApSrnMacAddress, sizeof(s->mApSrnMacAddress)) != 0) {
|
||||||
|
memcpy(static_cast<void*>(s->mApSrnMacAddress), static_cast<void*>(d->mApSrnMacAddress),
|
||||||
|
sizeof(s->mApSrnMacAddress));
|
||||||
|
}
|
||||||
|
if (s->mApSrnTimestamp != d->mApSrnTimestamp) {s->mApSrnTimestamp = d->mApSrnTimestamp;}
|
||||||
|
if (s->mRequestTimestamp != d->mRequestTimestamp) {
|
||||||
|
s->mRequestTimestamp = d->mRequestTimestamp;
|
||||||
|
}
|
||||||
|
if (s->mReceiveTimestamp != d->mReceiveTimestamp) {
|
||||||
|
s->mReceiveTimestamp = d->mReceiveTimestamp;
|
||||||
|
}
|
||||||
|
if (s->mErrorCause != d->mErrorCause) {s->mErrorCause = d->mErrorCause;}
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int32_t BtDeviceScanDetailsDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(BtDeviceScanDetailsDataItem, BT_SCAN_DATA_ITEM_ID);
|
||||||
|
|
||||||
|
if (s->mValidSrnData != d->mValidSrnData) { s->mValidSrnData = d->mValidSrnData;}
|
||||||
|
if (s->mApSrnRssi != d->mApSrnRssi) { s->mApSrnRssi = d->mApSrnRssi;}
|
||||||
|
if (memcmp(s->mApSrnMacAddress, d->mApSrnMacAddress, sizeof(s->mApSrnMacAddress)) != 0) {
|
||||||
|
memcpy(static_cast<void*>(s->mApSrnMacAddress), static_cast<void*>(d->mApSrnMacAddress),
|
||||||
|
sizeof(s->mApSrnMacAddress));
|
||||||
|
}
|
||||||
|
if (s->mApSrnTimestamp != d->mApSrnTimestamp) {s->mApSrnTimestamp = d->mApSrnTimestamp;}
|
||||||
|
if (s->mRequestTimestamp != d->mRequestTimestamp) {
|
||||||
|
s->mRequestTimestamp = d->mRequestTimestamp;
|
||||||
|
}
|
||||||
|
if (s->mReceiveTimestamp != d->mReceiveTimestamp) {
|
||||||
|
s->mReceiveTimestamp = d->mReceiveTimestamp;
|
||||||
|
}
|
||||||
|
if (s->mErrorCause != d->mErrorCause) {s->mErrorCause = d->mErrorCause;}
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocFeatureStatusDataItem::stringify(string& valueStr) {
|
||||||
|
int32_t result = 0;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(
|
||||||
|
LocFeatureStatusDataItem, LOC_FEATURE_STATUS_DATA_ITEM_ID);
|
||||||
|
valueStr.clear ();
|
||||||
|
valueStr += LOC_FEATURE_STATUS_FIELD_NAME;
|
||||||
|
valueStr += ": {";
|
||||||
|
for (int item : d->mFids) {
|
||||||
|
valueStr += std::to_string(item) + ", ";
|
||||||
|
}
|
||||||
|
valueStr += "}";
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG_WITH_ERROR("%d", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t LocFeatureStatusDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(
|
||||||
|
LocFeatureStatusDataItem, LOC_FEATURE_STATUS_DATA_ITEM_ID);
|
||||||
|
s->mFids = d->mFids;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t InEmergencyCallDataItem::copyFrom(IDataItemCore* src) {
|
||||||
|
int32_t result = -1;
|
||||||
|
ENTRY_LOG();
|
||||||
|
do {
|
||||||
|
COPIER_ERROR_CHECK_AND_DOWN_CAST(
|
||||||
|
InEmergencyCallDataItem, IN_EMERGENCY_CALL_DATA_ITEM_ID);
|
||||||
|
s->mIsEmergency = d->mIsEmergency;
|
||||||
|
result = 0;
|
||||||
|
} while (0);
|
||||||
|
EXIT_LOG("%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} //namespace loc_core
|
656
gps/core/data-items/DataItemConcreteTypes.h
Normal file
656
gps/core/data-items/DataItemConcreteTypes.h
Normal file
@ -0,0 +1,656 @@
|
|||||||
|
/* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above
|
||||||
|
* copyright notice, this list of conditions and the following
|
||||||
|
* disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* * Neither the name of The Linux Foundation, nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DATAITEM_CONCRETETYPES_H
|
||||||
|
#define DATAITEM_CONCRETETYPES_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <cstring>
|
||||||
|
#include <sstream>
|
||||||
|
#include <DataItemId.h>
|
||||||
|
#include <IDataItemCore.h>
|
||||||
|
#include <gps_extended_c.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <unordered_set>
|
||||||
|
#define MAC_ADDRESS_LENGTH 6
|
||||||
|
// MAC address length in bytes
|
||||||
|
// QMI_LOC_SRN_MAC_ADDR_LENGTH_V02
|
||||||
|
#define SRN_MAC_ADDRESS_LENGTH 6
|
||||||
|
#define WIFI_SUPPLICANT_DEFAULT_STATE 0
|
||||||
|
|
||||||
|
#define TIME_DEFAULT_CURRTIME 0
|
||||||
|
#define TIMEZONE_DEFAULT_RAWOFFSET 0
|
||||||
|
#define TIMEZONE_DEFAULT_DSTOFFSET 0
|
||||||
|
|
||||||
|
#define NETWORKINFO_DEFAULT_TYPE 300
|
||||||
|
#define SERVICESTATUS_DEFAULT_STATE 3 /// OOO
|
||||||
|
|
||||||
|
#define BATTERY_PCT_DEFAULT 50
|
||||||
|
|
||||||
|
#define STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(T, ID) \
|
||||||
|
if (getId() != ID) { result = 1; break; } \
|
||||||
|
T * d = static_cast<T *>(this);
|
||||||
|
|
||||||
|
// macro for copier
|
||||||
|
#define COPIER_ERROR_CHECK_AND_DOWN_CAST(T, ID) \
|
||||||
|
if (src == NULL) { result = 1; break; } \
|
||||||
|
if (getId() != src->getId()) { result = 2; break; } \
|
||||||
|
if (getId() != ID) { result = 3; break; } \
|
||||||
|
T * s = static_cast<T *>(this); \
|
||||||
|
T * d = static_cast<T *>(src);
|
||||||
|
|
||||||
|
|
||||||
|
static constexpr char sDelimit = ':';
|
||||||
|
|
||||||
|
namespace loc_core {
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
enum NetworkType {
|
||||||
|
TYPE_MOBILE = 0,
|
||||||
|
TYPE_WIFI,
|
||||||
|
TYPE_ETHERNET,
|
||||||
|
TYPE_BLUETOOTH,
|
||||||
|
TYPE_MMS,
|
||||||
|
TYPE_SUPL,
|
||||||
|
TYPE_DUN,
|
||||||
|
TYPE_HIPRI,
|
||||||
|
TYPE_WIMAX,
|
||||||
|
TYPE_PROXY,
|
||||||
|
TYPE_UNKNOWN,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct NetworkInfoType {
|
||||||
|
// Unique network handle ID
|
||||||
|
uint64_t networkHandle;
|
||||||
|
// Type of network for corresponding network handle
|
||||||
|
NetworkType networkType;
|
||||||
|
NetworkInfoType() : networkHandle(NETWORK_HANDLE_UNKNOWN), networkType(TYPE_UNKNOWN) {}
|
||||||
|
NetworkInfoType(string strObj) {
|
||||||
|
size_t posDelimit = strObj.find(sDelimit);
|
||||||
|
|
||||||
|
if ( posDelimit != string::npos) {
|
||||||
|
int32_t type = TYPE_UNKNOWN;
|
||||||
|
string handleStr = strObj.substr(0, posDelimit);
|
||||||
|
string typeStr = strObj.substr(posDelimit + 1, strObj.length() - posDelimit - 1);
|
||||||
|
stringstream(handleStr) >> networkHandle;
|
||||||
|
stringstream(typeStr) >> type;
|
||||||
|
networkType = (NetworkType) type;
|
||||||
|
} else {
|
||||||
|
networkHandle = NETWORK_HANDLE_UNKNOWN;
|
||||||
|
networkType = TYPE_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool operator== (const NetworkInfoType& other) {
|
||||||
|
return ((networkHandle == other.networkHandle) && (networkType == other.networkType));
|
||||||
|
}
|
||||||
|
string toString() {
|
||||||
|
string valueStr;
|
||||||
|
valueStr.clear ();
|
||||||
|
char nethandle [32];
|
||||||
|
memset (nethandle, 0, 32);
|
||||||
|
snprintf(nethandle, sizeof(nethandle), "%" PRIu64, networkHandle);
|
||||||
|
valueStr += string(nethandle);
|
||||||
|
valueStr += sDelimit;
|
||||||
|
char type [12];
|
||||||
|
memset (type, 0, 12);
|
||||||
|
snprintf (type, 12, "%u", networkType);
|
||||||
|
valueStr += string (type);
|
||||||
|
return valueStr;
|
||||||
|
}
|
||||||
|
} NetworkInfoType;
|
||||||
|
|
||||||
|
|
||||||
|
class AirplaneModeDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
AirplaneModeDataItem(IDataItemCore* di):
|
||||||
|
AirplaneModeDataItem(((AirplaneModeDataItem*)di)->mMode) {}
|
||||||
|
AirplaneModeDataItem(bool mode = false):
|
||||||
|
mMode(mode) {mId = AIRPLANEMODE_DATA_ITEM_ID;}
|
||||||
|
virtual ~AirplaneModeDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mMode;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class ENHDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
enum Fields { FIELD_CONSENT, FIELD_REGION, FIELD_MAX };
|
||||||
|
enum Actions { NO_OP, SET, CLEAR };
|
||||||
|
ENHDataItem(bool enabled = false, Fields updateBit = FIELD_MAX) :
|
||||||
|
mEnhFields(0), mFieldUpdate(updateBit) {
|
||||||
|
mId = ENH_DATA_ITEM_ID;
|
||||||
|
setAction(enabled ? SET : CLEAR);
|
||||||
|
}
|
||||||
|
virtual ~ENHDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
inline bool isEnabled() const {
|
||||||
|
uint8_t combinedBits = (1 << FIELD_MAX) - 1;
|
||||||
|
return (combinedBits == (mEnhFields & combinedBits));
|
||||||
|
}
|
||||||
|
void setAction(Actions action = NO_OP) {
|
||||||
|
mAction = action;
|
||||||
|
if (NO_OP != mAction) {
|
||||||
|
updateFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void updateFields() {
|
||||||
|
if (FIELD_MAX > mFieldUpdate) {
|
||||||
|
switch (mAction) {
|
||||||
|
case SET:
|
||||||
|
mEnhFields |= (1 << mFieldUpdate);
|
||||||
|
break;
|
||||||
|
case CLEAR:
|
||||||
|
mEnhFields &= ~(1 << mFieldUpdate);
|
||||||
|
break;
|
||||||
|
case NO_OP:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Data members
|
||||||
|
uint32_t mEnhFields;
|
||||||
|
private:
|
||||||
|
Actions mAction;
|
||||||
|
Fields mFieldUpdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GPSStateDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
GPSStateDataItem(bool enabled = false) :
|
||||||
|
mEnabled(enabled) {mId = GPSSTATE_DATA_ITEM_ID;}
|
||||||
|
virtual ~GPSStateDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mEnabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
class NLPStatusDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
NLPStatusDataItem(bool enabled = false) :
|
||||||
|
mEnabled(enabled) {mId = NLPSTATUS_DATA_ITEM_ID;}
|
||||||
|
virtual ~NLPStatusDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mEnabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
class WifiHardwareStateDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
WifiHardwareStateDataItem(bool enabled = false) :
|
||||||
|
mEnabled(enabled) {mId = WIFIHARDWARESTATE_DATA_ITEM_ID;}
|
||||||
|
virtual ~WifiHardwareStateDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mEnabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ScreenStateDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
ScreenStateDataItem(bool state = false) :
|
||||||
|
mState(state) {mId = SCREEN_STATE_DATA_ITEM_ID;}
|
||||||
|
virtual ~ScreenStateDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mState;
|
||||||
|
};
|
||||||
|
|
||||||
|
class PowerConnectStateDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
PowerConnectStateDataItem(bool state = false) :
|
||||||
|
mState(state) {mId = POWER_CONNECTED_STATE_DATA_ITEM_ID;}
|
||||||
|
virtual ~PowerConnectStateDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mState;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TimeZoneChangeDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
TimeZoneChangeDataItem(int64_t currTimeMillis = TIME_DEFAULT_CURRTIME,
|
||||||
|
int32_t rawOffset = TIMEZONE_DEFAULT_RAWOFFSET,
|
||||||
|
int32_t dstOffset = TIMEZONE_DEFAULT_DSTOFFSET) :
|
||||||
|
mCurrTimeMillis (currTimeMillis),
|
||||||
|
mRawOffsetTZ (rawOffset),
|
||||||
|
mDstOffsetTZ (dstOffset) {mId = TIMEZONE_CHANGE_DATA_ITEM_ID;}
|
||||||
|
virtual ~TimeZoneChangeDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
int64_t mCurrTimeMillis;
|
||||||
|
int32_t mRawOffsetTZ;
|
||||||
|
int32_t mDstOffsetTZ;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TimeChangeDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
TimeChangeDataItem(int64_t currTimeMillis = TIME_DEFAULT_CURRTIME,
|
||||||
|
int32_t rawOffset = TIMEZONE_DEFAULT_RAWOFFSET,
|
||||||
|
int32_t dstOffset = TIMEZONE_DEFAULT_DSTOFFSET) :
|
||||||
|
mCurrTimeMillis (currTimeMillis),
|
||||||
|
mRawOffsetTZ (rawOffset),
|
||||||
|
mDstOffsetTZ (dstOffset) {mId = TIME_CHANGE_DATA_ITEM_ID;}
|
||||||
|
virtual ~TimeChangeDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
int64_t mCurrTimeMillis;
|
||||||
|
int32_t mRawOffsetTZ;
|
||||||
|
int32_t mDstOffsetTZ;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ShutdownStateDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
ShutdownStateDataItem(bool state = false) :
|
||||||
|
mState (state) {mId = SHUTDOWN_STATE_DATA_ITEM_ID;}
|
||||||
|
virtual ~ShutdownStateDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mState;
|
||||||
|
};
|
||||||
|
|
||||||
|
class AssistedGpsDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
AssistedGpsDataItem(bool enabled = false) :
|
||||||
|
mEnabled(enabled) {mId = ASSISTED_GPS_DATA_ITEM_ID;}
|
||||||
|
virtual ~AssistedGpsDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mEnabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
class NetworkInfoDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
NetworkInfoDataItem(
|
||||||
|
int32_t type = NETWORKINFO_DEFAULT_TYPE,
|
||||||
|
std::string typeName = "",
|
||||||
|
std::string subTypeName = "",
|
||||||
|
bool available = false,
|
||||||
|
bool connected = false,
|
||||||
|
bool roaming = false,
|
||||||
|
uint64_t networkHandle = NETWORK_HANDLE_UNKNOWN, string apn = ""):
|
||||||
|
NetworkInfoDataItem(getNormalizedType(type), type, typeName, subTypeName, available,
|
||||||
|
connected, roaming, networkHandle, "") {}
|
||||||
|
NetworkInfoDataItem(NetworkType initialType, int32_t type, string typeName,
|
||||||
|
string subTypeName, bool available, bool connected, bool roaming,
|
||||||
|
uint64_t networkHandle, string apn):
|
||||||
|
mAllTypes(typeToAllTypes(initialType)),
|
||||||
|
mType(type),
|
||||||
|
mTypeName(typeName),
|
||||||
|
mSubTypeName(subTypeName),
|
||||||
|
mAvailable(available),
|
||||||
|
mConnected(connected),
|
||||||
|
mRoaming(roaming),
|
||||||
|
mNetworkHandle(networkHandle), mApn(apn) {
|
||||||
|
mId = NETWORKINFO_DATA_ITEM_ID;
|
||||||
|
mAllNetworkHandles[0].networkHandle = networkHandle;
|
||||||
|
mAllNetworkHandles[0].networkType = initialType;
|
||||||
|
}
|
||||||
|
virtual ~NetworkInfoDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
inline uint64_t getAllTypes() { return mAllTypes; }
|
||||||
|
inline NetworkInfoType* getNetworkHandle() {
|
||||||
|
return &mAllNetworkHandles[0];
|
||||||
|
}
|
||||||
|
inline virtual NetworkType getType(void) const {
|
||||||
|
return getNormalizedType(mType);
|
||||||
|
}
|
||||||
|
inline static NetworkType getNormalizedType(int32_t type) {
|
||||||
|
NetworkType typeout = TYPE_UNKNOWN;
|
||||||
|
switch (type) {
|
||||||
|
case 100:
|
||||||
|
typeout = TYPE_WIFI;
|
||||||
|
break;
|
||||||
|
case 101:
|
||||||
|
typeout = TYPE_ETHERNET;
|
||||||
|
break;
|
||||||
|
case 102:
|
||||||
|
typeout = TYPE_BLUETOOTH;
|
||||||
|
break;
|
||||||
|
case 201:
|
||||||
|
typeout = TYPE_MOBILE;
|
||||||
|
break;
|
||||||
|
case 202:
|
||||||
|
typeout = TYPE_DUN;
|
||||||
|
break;
|
||||||
|
case 203:
|
||||||
|
typeout = TYPE_HIPRI;
|
||||||
|
break;
|
||||||
|
case 204:
|
||||||
|
typeout = TYPE_MMS;
|
||||||
|
break;
|
||||||
|
case 205:
|
||||||
|
typeout = TYPE_SUPL;
|
||||||
|
break;
|
||||||
|
case 220:
|
||||||
|
typeout = TYPE_WIMAX;
|
||||||
|
break;
|
||||||
|
case 300:
|
||||||
|
default:
|
||||||
|
typeout = TYPE_UNKNOWN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return typeout;
|
||||||
|
}
|
||||||
|
// Data members
|
||||||
|
uint64_t mAllTypes;
|
||||||
|
int32_t mType;
|
||||||
|
string mTypeName;
|
||||||
|
string mSubTypeName;
|
||||||
|
bool mAvailable;
|
||||||
|
bool mConnected;
|
||||||
|
bool mRoaming;
|
||||||
|
NetworkInfoType mAllNetworkHandles[MAX_NETWORK_HANDLES];
|
||||||
|
uint64_t mNetworkHandle;
|
||||||
|
string mApn;
|
||||||
|
protected:
|
||||||
|
inline uint64_t typeToAllTypes(NetworkType type) {
|
||||||
|
return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1<<type);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
inline void setType(NetworkType type) {
|
||||||
|
switch (type) {
|
||||||
|
case TYPE_WIFI:
|
||||||
|
mType = 100;
|
||||||
|
break;
|
||||||
|
case TYPE_ETHERNET:
|
||||||
|
mType = 101;
|
||||||
|
break;
|
||||||
|
case TYPE_BLUETOOTH:
|
||||||
|
mType = 102;
|
||||||
|
break;
|
||||||
|
case TYPE_MOBILE:
|
||||||
|
mType = 201;
|
||||||
|
break;
|
||||||
|
case TYPE_DUN:
|
||||||
|
mType = 202;
|
||||||
|
break;
|
||||||
|
case TYPE_HIPRI:
|
||||||
|
mType = 203;
|
||||||
|
break;
|
||||||
|
case TYPE_MMS:
|
||||||
|
mType = 204;
|
||||||
|
break;
|
||||||
|
case TYPE_SUPL:
|
||||||
|
mType = 205;
|
||||||
|
break;
|
||||||
|
case TYPE_WIMAX:
|
||||||
|
mType = 220;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mType = 300;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class ServiceStatusDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
ServiceStatusDataItem(int32_t serviceState = SERVICESTATUS_DEFAULT_STATE) :
|
||||||
|
mServiceState (serviceState) {mId = SERVICESTATUS_DATA_ITEM_ID;}
|
||||||
|
virtual ~ServiceStatusDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
int32_t mServiceState;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModelDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
ModelDataItem(const string & name = "") :
|
||||||
|
mModel (name) {mId = MODEL_DATA_ITEM_ID;}
|
||||||
|
virtual ~ModelDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
string mModel;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ManufacturerDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
ManufacturerDataItem(const string & name = "") :
|
||||||
|
mManufacturer (name) {mId = MANUFACTURER_DATA_ITEM_ID;}
|
||||||
|
virtual ~ManufacturerDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
string mManufacturer;
|
||||||
|
};
|
||||||
|
|
||||||
|
class RilServiceInfoDataItem : public IDataItemCore {
|
||||||
|
public:
|
||||||
|
inline RilServiceInfoDataItem() :
|
||||||
|
mData(nullptr) {mId = RILSERVICEINFO_DATA_ITEM_ID;}
|
||||||
|
inline virtual ~RilServiceInfoDataItem() { if (nullptr != mData) free(mData); }
|
||||||
|
virtual void stringify(string& /*valueStr*/) {}
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* src) {
|
||||||
|
memcpy(mData, ((RilServiceInfoDataItem*)src)->mData, mLength);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
inline RilServiceInfoDataItem(const RilServiceInfoDataItem& peer) :
|
||||||
|
RilServiceInfoDataItem() {
|
||||||
|
mLength = peer.mLength;
|
||||||
|
mData = malloc(mLength);
|
||||||
|
memcpy(mData, peer.mData, mLength);
|
||||||
|
peer.setPeerData(*this);
|
||||||
|
}
|
||||||
|
inline virtual bool operator==(const RilServiceInfoDataItem& other) const {
|
||||||
|
return other.mData == mData;
|
||||||
|
}
|
||||||
|
inline virtual void setPeerData(RilServiceInfoDataItem& /*peer*/) const {}
|
||||||
|
void* mData;
|
||||||
|
int mLength;
|
||||||
|
};
|
||||||
|
|
||||||
|
class RilCellInfoDataItem : public IDataItemCore {
|
||||||
|
public:
|
||||||
|
inline RilCellInfoDataItem() :
|
||||||
|
mData(nullptr) {mId = RILCELLINFO_DATA_ITEM_ID;}
|
||||||
|
inline virtual ~RilCellInfoDataItem() { if (nullptr != mData) free(mData); }
|
||||||
|
virtual void stringify(string& /*valueStr*/) {}
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* src) {
|
||||||
|
memcpy(mData, ((RilCellInfoDataItem*)src)->mData, mLength);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
inline RilCellInfoDataItem(const RilCellInfoDataItem& peer) :
|
||||||
|
RilCellInfoDataItem() {
|
||||||
|
mLength = peer.mLength;
|
||||||
|
mData = malloc(mLength);
|
||||||
|
memcpy(mData, peer.mData, mLength);
|
||||||
|
peer.setPeerData(*this);
|
||||||
|
}
|
||||||
|
inline virtual bool operator==(const RilCellInfoDataItem& other) const {
|
||||||
|
return other.mData == mData;
|
||||||
|
}
|
||||||
|
inline virtual void setPeerData(RilCellInfoDataItem& /*peer*/) const {}
|
||||||
|
void* mData;
|
||||||
|
int mLength;
|
||||||
|
};
|
||||||
|
|
||||||
|
class WifiSupplicantStatusDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
WifiSupplicantStatusDataItem() :
|
||||||
|
mState((WifiSupplicantState)WIFI_SUPPLICANT_DEFAULT_STATE),
|
||||||
|
mApMacAddressValid(false),
|
||||||
|
mWifiApSsidValid(false) {
|
||||||
|
mId = WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID;
|
||||||
|
memset (mApMacAddress, 0, sizeof (mApMacAddress));
|
||||||
|
mWifiApSsid.clear();
|
||||||
|
}
|
||||||
|
virtual ~WifiSupplicantStatusDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
typedef enum WifiSupplicantState {
|
||||||
|
DISCONNECTED,
|
||||||
|
INTERFACE_DISABLED,
|
||||||
|
INACTIVE,
|
||||||
|
SCANNING,
|
||||||
|
AUTHENTICATING,
|
||||||
|
ASSOCIATING,
|
||||||
|
ASSOCIATED,
|
||||||
|
FOUR_WAY_HANDSHAKE,
|
||||||
|
GROUP_HANDSHAKE,
|
||||||
|
COMPLETED,
|
||||||
|
DORMANT,
|
||||||
|
UNINITIALIZED,
|
||||||
|
INVALID
|
||||||
|
} WifiSupplicantState;
|
||||||
|
/* Represents whether access point attach state*/
|
||||||
|
WifiSupplicantState mState;
|
||||||
|
/* Represents info on whether ap mac address is valid */
|
||||||
|
bool mApMacAddressValid;
|
||||||
|
/* Represents mac address of the wifi access point*/
|
||||||
|
uint8_t mApMacAddress[MAC_ADDRESS_LENGTH];
|
||||||
|
/* Represents info on whether ap SSID is valid */
|
||||||
|
bool mWifiApSsidValid;
|
||||||
|
/* Represents Wifi SSID string*/
|
||||||
|
string mWifiApSsid;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TacDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
TacDataItem(const string & name = "") :
|
||||||
|
mValue (name) {mId = TAC_DATA_ITEM_ID;}
|
||||||
|
virtual ~TacDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
string mValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
class MccmncDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
MccmncDataItem(const string & name = "") :
|
||||||
|
mValue(name) {mId = MCCMNC_DATA_ITEM_ID;}
|
||||||
|
virtual ~MccmncDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
string mValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SrnDeviceScanDetailsDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
SrnDeviceScanDetailsDataItem(DataItemId Id) :
|
||||||
|
mValidSrnData(false),
|
||||||
|
mApSrnRssi(-1),
|
||||||
|
mApSrnTimestamp(0),
|
||||||
|
mRequestTimestamp(0),
|
||||||
|
mReceiveTimestamp(0),
|
||||||
|
mErrorCause(-1) {mId = Id;}
|
||||||
|
virtual ~SrnDeviceScanDetailsDataItem() {}
|
||||||
|
// Data members common to all SRN tech types
|
||||||
|
/* Represents info on whether SRN data is valid (no error)*/
|
||||||
|
bool mValidSrnData;
|
||||||
|
/* SRN device RSSI reported */
|
||||||
|
int32_t mApSrnRssi;
|
||||||
|
/* MAC adress of SRN device */
|
||||||
|
uint8_t mApSrnMacAddress[SRN_MAC_ADDRESS_LENGTH];
|
||||||
|
/* UTC timestamp at which the scan was requested.for this SRN device*/
|
||||||
|
int64_t mApSrnTimestamp;
|
||||||
|
/* UTC timestamp at which the scan was started. */
|
||||||
|
int64_t mRequestTimestamp;
|
||||||
|
/* UTC timestamp at which the scan was received.*/
|
||||||
|
int64_t mReceiveTimestamp;
|
||||||
|
/* Reason for the error/failure if SRN details are not valid */
|
||||||
|
int32_t mErrorCause;
|
||||||
|
};
|
||||||
|
|
||||||
|
class BtDeviceScanDetailsDataItem: public SrnDeviceScanDetailsDataItem {
|
||||||
|
public:
|
||||||
|
BtDeviceScanDetailsDataItem() :
|
||||||
|
SrnDeviceScanDetailsDataItem(BT_SCAN_DATA_ITEM_ID) {}
|
||||||
|
virtual ~BtDeviceScanDetailsDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class BtLeDeviceScanDetailsDataItem: public SrnDeviceScanDetailsDataItem {
|
||||||
|
public:
|
||||||
|
BtLeDeviceScanDetailsDataItem() :
|
||||||
|
SrnDeviceScanDetailsDataItem(BTLE_SCAN_DATA_ITEM_ID) {}
|
||||||
|
virtual ~BtLeDeviceScanDetailsDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class BatteryLevelDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
inline BatteryLevelDataItem(uint8_t batteryPct = BATTERY_PCT_DEFAULT) :
|
||||||
|
mBatteryPct(batteryPct) {mId = BATTERY_LEVEL_DATA_ITEM_ID;}
|
||||||
|
inline ~BatteryLevelDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
uint8_t mBatteryPct;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LocFeatureStatusDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
LocFeatureStatusDataItem(std::unordered_set<int> fids) :
|
||||||
|
mFids(fids) {mId = LOC_FEATURE_STATUS_DATA_ITEM_ID;}
|
||||||
|
virtual ~LocFeatureStatusDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
std::unordered_set<int> mFids;
|
||||||
|
};
|
||||||
|
|
||||||
|
class InEmergencyCallDataItem: public IDataItemCore {
|
||||||
|
public:
|
||||||
|
InEmergencyCallDataItem(bool isEmergency = false) :
|
||||||
|
mIsEmergency(isEmergency) {mId = IN_EMERGENCY_CALL_DATA_ITEM_ID;}
|
||||||
|
virtual ~InEmergencyCallDataItem() {}
|
||||||
|
virtual void stringify(string& /*valueStr*/) override;
|
||||||
|
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||||
|
// Data members
|
||||||
|
bool mIsEmergency;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace loc_core
|
||||||
|
|
||||||
|
#endif //DATAITEM_CONCRETETYPES_H
|
@ -1,555 +0,0 @@
|
|||||||
/* Copyright (c) 2015-2017, 2020, The Linux Foundation. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above
|
|
||||||
* copyright notice, this list of conditions and the following
|
|
||||||
* disclaimer in the documentation and/or other materials provided
|
|
||||||
* with the distribution.
|
|
||||||
* * Neither the name of The Linux Foundation, nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __DATAITEMCONCRETEBASETYPES__
|
|
||||||
#define __DATAITEMCONCRETEBASETYPES__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <cstring>
|
|
||||||
#include <sstream>
|
|
||||||
#include <DataItemId.h>
|
|
||||||
#include <IDataItemCore.h>
|
|
||||||
#include <gps_extended_c.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
|
|
||||||
#define MAC_ADDRESS_LENGTH 6
|
|
||||||
// MAC address length in bytes
|
|
||||||
// QMI_LOC_SRN_MAC_ADDR_LENGTH_V02
|
|
||||||
#define SRN_MAC_ADDRESS_LENGTH 6
|
|
||||||
#define WIFI_SUPPLICANT_DEFAULT_STATE 0
|
|
||||||
|
|
||||||
static constexpr char sDelimit = ':';
|
|
||||||
|
|
||||||
namespace loc_core
|
|
||||||
{
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
enum NetworkType {
|
|
||||||
TYPE_MOBILE = 0,
|
|
||||||
TYPE_WIFI,
|
|
||||||
TYPE_ETHERNET,
|
|
||||||
TYPE_BLUETOOTH,
|
|
||||||
TYPE_MMS,
|
|
||||||
TYPE_SUPL,
|
|
||||||
TYPE_DUN,
|
|
||||||
TYPE_HIPRI,
|
|
||||||
TYPE_WIMAX,
|
|
||||||
TYPE_PROXY,
|
|
||||||
TYPE_UNKNOWN,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct NetworkInfoType
|
|
||||||
{
|
|
||||||
// Unique network handle ID
|
|
||||||
uint64_t networkHandle;
|
|
||||||
// Type of network for corresponding network handle
|
|
||||||
NetworkType networkType;
|
|
||||||
NetworkInfoType() : networkHandle(NETWORK_HANDLE_UNKNOWN), networkType(TYPE_UNKNOWN) {}
|
|
||||||
NetworkInfoType(string strObj) {
|
|
||||||
size_t posDelimit = strObj.find(sDelimit);
|
|
||||||
|
|
||||||
if ( posDelimit != string::npos) {
|
|
||||||
int32_t type = TYPE_UNKNOWN;
|
|
||||||
string handleStr = strObj.substr(0, posDelimit);
|
|
||||||
string typeStr = strObj.substr(posDelimit + 1, strObj.length() - posDelimit - 1);
|
|
||||||
stringstream(handleStr) >> networkHandle;
|
|
||||||
stringstream(typeStr) >> type;
|
|
||||||
networkType = (NetworkType) type;
|
|
||||||
} else {
|
|
||||||
networkHandle = NETWORK_HANDLE_UNKNOWN;
|
|
||||||
networkType = TYPE_UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bool operator== (const NetworkInfoType& other) {
|
|
||||||
return ((networkHandle == other.networkHandle) && (networkType == other.networkType));
|
|
||||||
}
|
|
||||||
string toString() {
|
|
||||||
string valueStr;
|
|
||||||
valueStr.clear ();
|
|
||||||
char nethandle [32];
|
|
||||||
memset (nethandle, 0, 32);
|
|
||||||
snprintf(nethandle, sizeof(nethandle), "%" PRIu64, networkHandle);
|
|
||||||
valueStr += string(nethandle);
|
|
||||||
valueStr += sDelimit;
|
|
||||||
char type [12];
|
|
||||||
memset (type, 0, 12);
|
|
||||||
snprintf (type, 12, "%u", networkType);
|
|
||||||
valueStr += string (type);
|
|
||||||
return valueStr;
|
|
||||||
}
|
|
||||||
} NetworkInfoType;
|
|
||||||
|
|
||||||
|
|
||||||
class AirplaneModeDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
AirplaneModeDataItemBase(bool mode):
|
|
||||||
mMode(mode),
|
|
||||||
mId(AIRPLANEMODE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~AirplaneModeDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mMode;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ENHDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
ENHDataItemBase(bool enabled) :
|
|
||||||
mEnabled(enabled),
|
|
||||||
mId(ENH_DATA_ITEM_ID) {}
|
|
||||||
virtual ~ENHDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mEnabled;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class GPSStateDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
GPSStateDataItemBase(bool enabled) :
|
|
||||||
mEnabled(enabled),
|
|
||||||
mId(GPSSTATE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~GPSStateDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mEnabled;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class NLPStatusDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
NLPStatusDataItemBase(bool enabled) :
|
|
||||||
mEnabled(enabled),
|
|
||||||
mId(NLPSTATUS_DATA_ITEM_ID) {}
|
|
||||||
virtual ~NLPStatusDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mEnabled;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class WifiHardwareStateDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
WifiHardwareStateDataItemBase(bool enabled) :
|
|
||||||
mEnabled(enabled),
|
|
||||||
mId(WIFIHARDWARESTATE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~WifiHardwareStateDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mEnabled;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ScreenStateDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
ScreenStateDataItemBase(bool state) :
|
|
||||||
mState(state),
|
|
||||||
mId(SCREEN_STATE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~ScreenStateDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mState;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class PowerConnectStateDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
PowerConnectStateDataItemBase(bool state) :
|
|
||||||
mState(state),
|
|
||||||
mId(POWER_CONNECTED_STATE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~PowerConnectStateDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mState;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class TimeZoneChangeDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
TimeZoneChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) :
|
|
||||||
mCurrTimeMillis (currTimeMillis),
|
|
||||||
mRawOffsetTZ (rawOffset),
|
|
||||||
mDstOffsetTZ (dstOffset),
|
|
||||||
mId(TIMEZONE_CHANGE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~TimeZoneChangeDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
int64_t mCurrTimeMillis;
|
|
||||||
int32_t mRawOffsetTZ;
|
|
||||||
int32_t mDstOffsetTZ;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class TimeChangeDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
TimeChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) :
|
|
||||||
mCurrTimeMillis (currTimeMillis),
|
|
||||||
mRawOffsetTZ (rawOffset),
|
|
||||||
mDstOffsetTZ (dstOffset),
|
|
||||||
mId(TIME_CHANGE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~TimeChangeDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
int64_t mCurrTimeMillis;
|
|
||||||
int32_t mRawOffsetTZ;
|
|
||||||
int32_t mDstOffsetTZ;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ShutdownStateDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
ShutdownStateDataItemBase(bool state) :
|
|
||||||
mState (state),
|
|
||||||
mId(SHUTDOWN_STATE_DATA_ITEM_ID) {}
|
|
||||||
virtual ~ShutdownStateDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mState;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class AssistedGpsDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
AssistedGpsDataItemBase(bool enabled) :
|
|
||||||
mEnabled(enabled),
|
|
||||||
mId(ASSISTED_GPS_DATA_ITEM_ID) {}
|
|
||||||
virtual ~AssistedGpsDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
bool mEnabled;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class NetworkInfoDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
NetworkInfoDataItemBase(
|
|
||||||
NetworkType initialType, int32_t type, string typeName, string subTypeName,
|
|
||||||
bool available, bool connected, bool roaming, uint64_t networkHandle, string apn):
|
|
||||||
mAllTypes(typeToAllTypes(initialType)),
|
|
||||||
mType(type),
|
|
||||||
mTypeName(typeName),
|
|
||||||
mSubTypeName(subTypeName),
|
|
||||||
mAvailable(available),
|
|
||||||
mConnected(connected),
|
|
||||||
mRoaming(roaming),
|
|
||||||
mNetworkHandle(networkHandle),
|
|
||||||
mId(NETWORKINFO_DATA_ITEM_ID), mApn(apn) {
|
|
||||||
mAllNetworkHandles[0].networkHandle = networkHandle;
|
|
||||||
mAllNetworkHandles[0].networkType = initialType;
|
|
||||||
}
|
|
||||||
virtual ~NetworkInfoDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
inline virtual NetworkType getType(void) const {
|
|
||||||
return (NetworkType)mType;
|
|
||||||
}
|
|
||||||
inline uint64_t getAllTypes() { return mAllTypes; }
|
|
||||||
inline NetworkInfoType* getNetworkHandle() {
|
|
||||||
return &mAllNetworkHandles[0];
|
|
||||||
}
|
|
||||||
// Data members
|
|
||||||
uint64_t mAllTypes;
|
|
||||||
int32_t mType;
|
|
||||||
string mTypeName;
|
|
||||||
string mSubTypeName;
|
|
||||||
bool mAvailable;
|
|
||||||
bool mConnected;
|
|
||||||
bool mRoaming;
|
|
||||||
NetworkInfoType mAllNetworkHandles[MAX_NETWORK_HANDLES];
|
|
||||||
uint64_t mNetworkHandle;
|
|
||||||
string mApn;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
inline uint64_t typeToAllTypes(NetworkType type) {
|
|
||||||
return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1<<type);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class ServiceStatusDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
ServiceStatusDataItemBase(int32_t serviceState) :
|
|
||||||
mServiceState (serviceState),
|
|
||||||
mId(SERVICESTATUS_DATA_ITEM_ID) {}
|
|
||||||
virtual ~ServiceStatusDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
int32_t mServiceState;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ModelDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
ModelDataItemBase(const string & name) :
|
|
||||||
mModel (name),
|
|
||||||
mId(MODEL_DATA_ITEM_ID) {}
|
|
||||||
virtual ~ModelDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
string mModel;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ManufacturerDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
ManufacturerDataItemBase(const string & name) :
|
|
||||||
mManufacturer (name),
|
|
||||||
mId(MANUFACTURER_DATA_ITEM_ID) {}
|
|
||||||
virtual ~ManufacturerDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
string mManufacturer;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class RilServiceInfoDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
inline RilServiceInfoDataItemBase() :
|
|
||||||
mData(nullptr), mId(RILSERVICEINFO_DATA_ITEM_ID) {}
|
|
||||||
inline virtual ~RilServiceInfoDataItemBase() { if (nullptr != mData) free(mData); }
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
inline RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase& peer) :
|
|
||||||
RilServiceInfoDataItemBase() {
|
|
||||||
peer.setPeerData(*this);
|
|
||||||
}
|
|
||||||
inline virtual bool operator==(const RilServiceInfoDataItemBase& other) const {
|
|
||||||
return other.mData == mData;
|
|
||||||
}
|
|
||||||
inline virtual void setPeerData(RilServiceInfoDataItemBase& /*peer*/) const {}
|
|
||||||
void* mData;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class RilCellInfoDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
inline RilCellInfoDataItemBase() :
|
|
||||||
mData(nullptr), mId(RILCELLINFO_DATA_ITEM_ID) {}
|
|
||||||
inline virtual ~RilCellInfoDataItemBase() { if (nullptr != mData) free(mData); }
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
inline RilCellInfoDataItemBase(const RilCellInfoDataItemBase& peer) :
|
|
||||||
RilCellInfoDataItemBase() {
|
|
||||||
peer.setPeerData(*this);
|
|
||||||
}
|
|
||||||
inline virtual bool operator==(const RilCellInfoDataItemBase& other) const {
|
|
||||||
return other.mData == mData;
|
|
||||||
}
|
|
||||||
inline virtual void setPeerData(RilCellInfoDataItemBase& /*peer*/) const {}
|
|
||||||
void* mData;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class WifiSupplicantStatusDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
WifiSupplicantStatusDataItemBase() :
|
|
||||||
mState((WifiSupplicantState)WIFI_SUPPLICANT_DEFAULT_STATE),
|
|
||||||
mApMacAddressValid(false),
|
|
||||||
mWifiApSsidValid(false),
|
|
||||||
mId(WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID) {
|
|
||||||
memset (&mApMacAddress, 0, sizeof (mApMacAddress));
|
|
||||||
mWifiApSsid.clear();
|
|
||||||
}
|
|
||||||
virtual ~WifiSupplicantStatusDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
typedef enum WifiSupplicantState {
|
|
||||||
DISCONNECTED,
|
|
||||||
INTERFACE_DISABLED,
|
|
||||||
INACTIVE,
|
|
||||||
SCANNING,
|
|
||||||
AUTHENTICATING,
|
|
||||||
ASSOCIATING,
|
|
||||||
ASSOCIATED,
|
|
||||||
FOUR_WAY_HANDSHAKE,
|
|
||||||
GROUP_HANDSHAKE,
|
|
||||||
COMPLETED,
|
|
||||||
DORMANT,
|
|
||||||
UNINITIALIZED,
|
|
||||||
INVALID
|
|
||||||
} WifiSupplicantState;
|
|
||||||
/* Represents whether access point attach state*/
|
|
||||||
WifiSupplicantState mState;
|
|
||||||
/* Represents info on whether ap mac address is valid */
|
|
||||||
bool mApMacAddressValid;
|
|
||||||
/* Represents mac address of the wifi access point*/
|
|
||||||
uint8_t mApMacAddress[MAC_ADDRESS_LENGTH];
|
|
||||||
/* Represents info on whether ap SSID is valid */
|
|
||||||
bool mWifiApSsidValid;
|
|
||||||
/* Represents Wifi SSID string*/
|
|
||||||
string mWifiApSsid;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class TacDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
TacDataItemBase(const string & name) :
|
|
||||||
mValue (name),
|
|
||||||
mId(TAC_DATA_ITEM_ID) {}
|
|
||||||
virtual ~TacDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
string mValue;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MccmncDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
MccmncDataItemBase(const string & name) :
|
|
||||||
mValue(name),
|
|
||||||
mId(MCCMNC_DATA_ITEM_ID) {}
|
|
||||||
virtual ~MccmncDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
// Data members
|
|
||||||
string mValue;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SrnDeviceScanDetailsDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
SrnDeviceScanDetailsDataItemBase(DataItemId Id) :
|
|
||||||
mValidSrnData(false),
|
|
||||||
mApSrnRssi(-1),
|
|
||||||
mApSrnTimestamp(0),
|
|
||||||
mRequestTimestamp(0),
|
|
||||||
mReceiveTimestamp(0),
|
|
||||||
mErrorCause(-1),
|
|
||||||
mId(Id) {}
|
|
||||||
virtual ~SrnDeviceScanDetailsDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
// Data members common to all SRN tech types
|
|
||||||
/* Represents info on whether SRN data is valid (no error)*/
|
|
||||||
bool mValidSrnData;
|
|
||||||
/* SRN device RSSI reported */
|
|
||||||
int32_t mApSrnRssi;
|
|
||||||
/* MAC adress of SRN device */
|
|
||||||
uint8_t mApSrnMacAddress[SRN_MAC_ADDRESS_LENGTH];
|
|
||||||
/* UTC timestamp at which the scan was requested.for this SRN device*/
|
|
||||||
int64_t mApSrnTimestamp;
|
|
||||||
/* UTC timestamp at which the scan was started. */
|
|
||||||
int64_t mRequestTimestamp;
|
|
||||||
/* UTC timestamp at which the scan was received.*/
|
|
||||||
int64_t mReceiveTimestamp;
|
|
||||||
/* Reason for the error/failure if SRN details are not valid */
|
|
||||||
int32_t mErrorCause;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class BtDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase {
|
|
||||||
|
|
||||||
public:
|
|
||||||
BtDeviceScanDetailsDataItemBase() :
|
|
||||||
SrnDeviceScanDetailsDataItemBase(BT_SCAN_DATA_ITEM_ID) {}
|
|
||||||
virtual ~BtDeviceScanDetailsDataItemBase() {}
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
};
|
|
||||||
|
|
||||||
class BtLeDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase {
|
|
||||||
|
|
||||||
public:
|
|
||||||
BtLeDeviceScanDetailsDataItemBase() :
|
|
||||||
SrnDeviceScanDetailsDataItemBase(BTLE_SCAN_DATA_ITEM_ID) {}
|
|
||||||
virtual ~BtLeDeviceScanDetailsDataItemBase() {}
|
|
||||||
virtual void stringify(string& /*valueStr*/) {}
|
|
||||||
virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
|
|
||||||
};
|
|
||||||
|
|
||||||
class BatteryLevelDataItemBase : public IDataItemCore {
|
|
||||||
public:
|
|
||||||
inline BatteryLevelDataItemBase(uint8_t batteryPct) :
|
|
||||||
mBatteryPct(batteryPct), mId(BATTERY_LEVEL_DATA_ITEM_ID) {}
|
|
||||||
inline ~BatteryLevelDataItemBase() {}
|
|
||||||
inline virtual DataItemId getId() { return mId; }
|
|
||||||
// Data members
|
|
||||||
uint8_t mBatteryPct;
|
|
||||||
protected:
|
|
||||||
DataItemId mId;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace loc_core
|
|
||||||
|
|
||||||
#endif //__DATAITEMCONCRETEBASETYPES__
|
|
@ -72,6 +72,8 @@ typedef enum e_DataItemId {
|
|||||||
|
|
||||||
// 26 -
|
// 26 -
|
||||||
BATTERY_LEVEL_DATA_ITEM_ID,
|
BATTERY_LEVEL_DATA_ITEM_ID,
|
||||||
|
IN_EMERGENCY_CALL_DATA_ITEM_ID,
|
||||||
|
LOC_FEATURE_STATUS_DATA_ITEM_ID,
|
||||||
|
|
||||||
MAX_DATA_ITEM_ID_1_1,
|
MAX_DATA_ITEM_ID_1_1,
|
||||||
} DataItemId;
|
} DataItemId;
|
||||||
|
@ -32,50 +32,101 @@
|
|||||||
#include <DataItemId.h>
|
#include <DataItemId.h>
|
||||||
#include <IDataItemCore.h>
|
#include <IDataItemCore.h>
|
||||||
#include <DataItemsFactoryProxy.h>
|
#include <DataItemsFactoryProxy.h>
|
||||||
|
#include <DataItemConcreteTypes.h>
|
||||||
#include <loc_pla.h>
|
#include <loc_pla.h>
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include "loc_misc_utils.h"
|
#include "loc_misc_utils.h"
|
||||||
|
|
||||||
namespace loc_core
|
namespace loc_core
|
||||||
{
|
{
|
||||||
void* DataItemsFactoryProxy::dataItemLibHandle = NULL;
|
|
||||||
get_concrete_data_item_fn* DataItemsFactoryProxy::getConcreteDIFunc = NULL;
|
|
||||||
|
|
||||||
IDataItemCore* DataItemsFactoryProxy::createNewDataItem(DataItemId id)
|
IDataItemCore* DataItemsFactoryProxy::createNewDataItem(IDataItemCore* dataItem) {
|
||||||
{
|
|
||||||
IDataItemCore *mydi = nullptr;
|
IDataItemCore *mydi = nullptr;
|
||||||
|
|
||||||
if (NULL != getConcreteDIFunc) {
|
switch (dataItem->getId()) {
|
||||||
mydi = (*getConcreteDIFunc)(id);
|
case AIRPLANEMODE_DATA_ITEM_ID:
|
||||||
}
|
mydi = new AirplaneModeDataItem(*((AirplaneModeDataItem*)dataItem));
|
||||||
else {
|
break;
|
||||||
getConcreteDIFunc = (get_concrete_data_item_fn * )
|
case ENH_DATA_ITEM_ID:
|
||||||
dlGetSymFromLib(dataItemLibHandle, DATA_ITEMS_LIB_NAME, DATA_ITEMS_GET_CONCRETE_DI);
|
mydi = new ENHDataItem(*((ENHDataItem*)dataItem));
|
||||||
|
break;
|
||||||
if (NULL != getConcreteDIFunc) {
|
case GPSSTATE_DATA_ITEM_ID:
|
||||||
LOC_LOGd("Loaded function %s : %p", DATA_ITEMS_GET_CONCRETE_DI, getConcreteDIFunc);
|
mydi = new GPSStateDataItem(*((GPSStateDataItem*)dataItem));
|
||||||
mydi = (*getConcreteDIFunc)(id);
|
break;
|
||||||
}
|
case NLPSTATUS_DATA_ITEM_ID:
|
||||||
else {
|
mydi = new NLPStatusDataItem(*((NLPStatusDataItem*)dataItem));
|
||||||
// dlysm failed.
|
break;
|
||||||
const char * err = dlerror();
|
case WIFIHARDWARESTATE_DATA_ITEM_ID:
|
||||||
if (NULL == err)
|
mydi = new WifiHardwareStateDataItem(*((WifiHardwareStateDataItem*)dataItem));
|
||||||
{
|
break;
|
||||||
err = "Unknown";
|
case NETWORKINFO_DATA_ITEM_ID:
|
||||||
}
|
mydi = new NetworkInfoDataItem(*((NetworkInfoDataItem*)dataItem));
|
||||||
LOC_LOGe("failed to find symbol %s; error=%s", DATA_ITEMS_GET_CONCRETE_DI, err);
|
break;
|
||||||
}
|
case SERVICESTATUS_DATA_ITEM_ID:
|
||||||
}
|
mydi = new ServiceStatusDataItem(*((ServiceStatusDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case RILCELLINFO_DATA_ITEM_ID:
|
||||||
|
mydi = new RilCellInfoDataItem(*((RilCellInfoDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case RILSERVICEINFO_DATA_ITEM_ID:
|
||||||
|
mydi = new RilServiceInfoDataItem(*((RilServiceInfoDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case MODEL_DATA_ITEM_ID:
|
||||||
|
mydi = new ModelDataItem(*((ModelDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case MANUFACTURER_DATA_ITEM_ID:
|
||||||
|
mydi = new ManufacturerDataItem(*((ManufacturerDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case IN_EMERGENCY_CALL_DATA_ITEM_ID:
|
||||||
|
mydi = new InEmergencyCallDataItem(*((InEmergencyCallDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case ASSISTED_GPS_DATA_ITEM_ID:
|
||||||
|
mydi = new AssistedGpsDataItem(*((AssistedGpsDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case SCREEN_STATE_DATA_ITEM_ID:
|
||||||
|
mydi = new ScreenStateDataItem(*((ScreenStateDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case POWER_CONNECTED_STATE_DATA_ITEM_ID:
|
||||||
|
mydi = new PowerConnectStateDataItem(*((PowerConnectStateDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case TIMEZONE_CHANGE_DATA_ITEM_ID:
|
||||||
|
mydi = new TimeZoneChangeDataItem(*((TimeZoneChangeDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case TIME_CHANGE_DATA_ITEM_ID:
|
||||||
|
mydi = new TimeChangeDataItem(*((TimeChangeDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID:
|
||||||
|
mydi = new WifiSupplicantStatusDataItem(*((WifiSupplicantStatusDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case SHUTDOWN_STATE_DATA_ITEM_ID:
|
||||||
|
mydi = new ShutdownStateDataItem(*((ShutdownStateDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case TAC_DATA_ITEM_ID:
|
||||||
|
mydi = new TacDataItem(*((TacDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case MCCMNC_DATA_ITEM_ID:
|
||||||
|
mydi = new MccmncDataItem(*((MccmncDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case BTLE_SCAN_DATA_ITEM_ID:
|
||||||
|
mydi = new BtLeDeviceScanDetailsDataItem(*((BtLeDeviceScanDetailsDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case BT_SCAN_DATA_ITEM_ID:
|
||||||
|
mydi = new BtDeviceScanDetailsDataItem(*((BtDeviceScanDetailsDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case BATTERY_LEVEL_DATA_ITEM_ID:
|
||||||
|
mydi = new BatteryLevelDataItem(*((BatteryLevelDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case LOC_FEATURE_STATUS_DATA_ITEM_ID:
|
||||||
|
mydi = new LocFeatureStatusDataItem(*((LocFeatureStatusDataItem*)dataItem));
|
||||||
|
break;
|
||||||
|
case INVALID_DATA_ITEM_ID:
|
||||||
|
case MAX_DATA_ITEM_ID:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
return mydi;
|
return mydi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataItemsFactoryProxy::closeDataItemLibraryHandle()
|
|
||||||
{
|
|
||||||
if (NULL != dataItemLibHandle) {
|
|
||||||
dlclose(dataItemLibHandle);
|
|
||||||
dataItemLibHandle = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2017, 2020, 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
|
||||||
@ -35,18 +35,9 @@
|
|||||||
|
|
||||||
namespace loc_core
|
namespace loc_core
|
||||||
{
|
{
|
||||||
|
|
||||||
#define DATA_ITEMS_LIB_NAME "libdataitems.so"
|
|
||||||
#define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem"
|
|
||||||
|
|
||||||
typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId);
|
|
||||||
|
|
||||||
class DataItemsFactoryProxy {
|
class DataItemsFactoryProxy {
|
||||||
public:
|
public:
|
||||||
static IDataItemCore* createNewDataItem(DataItemId id);
|
static IDataItemCore* createNewDataItem(IDataItemCore* di);
|
||||||
static void closeDataItemLibraryHandle();
|
|
||||||
static void *dataItemLibHandle;
|
|
||||||
static get_concrete_data_item_fn *getConcreteDIFunc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2015, 2017, 2020 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
|
||||||
@ -49,7 +49,7 @@ public:
|
|||||||
* @details Gets Data item id.
|
* @details Gets Data item id.
|
||||||
* @return Data item id.
|
* @return Data item id.
|
||||||
*/
|
*/
|
||||||
virtual DataItemId getId () = 0;
|
inline DataItemId getId() { return mId; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Stringify.
|
* @brief Stringify.
|
||||||
@ -68,13 +68,15 @@ public:
|
|||||||
*
|
*
|
||||||
* @return Zero for success or non zero for failure.
|
* @return Zero for success or non zero for failure.
|
||||||
*/
|
*/
|
||||||
virtual int32_t copy (IDataItemCore * src, bool *dataItemCopied = nullptr) = 0;
|
virtual int32_t copyFrom(IDataItemCore * src) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destructor.
|
* @brief Destructor.
|
||||||
* @details Destructor.
|
* @details Destructor.
|
||||||
*/
|
*/
|
||||||
virtual ~IDataItemCore () {}
|
virtual ~IDataItemCore () {}
|
||||||
|
protected:
|
||||||
|
DataItemId mId = INVALID_DATA_ITEM_ID;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
@ -80,7 +80,8 @@
|
|||||||
# NUMBER_OF_ROWS_SGC_ and NUMBER_OF_COLUMNS_SGC_ represent the number of
|
# NUMBER_OF_ROWS_SGC_ and NUMBER_OF_COLUMNS_SGC_ represent the number of
|
||||||
# rows/columns for signal gain corrections
|
# rows/columns for signal gain corrections
|
||||||
|
|
||||||
ANTENNA_INFO_VECTOR_SIZE = 2
|
# ANTENNA_INFO_VECTOR_SIZE must be non zero if antenna corrections are sent
|
||||||
|
# ANTENNA_INFO_VECTOR_SIZE = 2
|
||||||
|
|
||||||
CARRIER_FREQUENCY_0 = 1575.42
|
CARRIER_FREQUENCY_0 = 1575.42
|
||||||
|
|
||||||
|
@ -74,21 +74,12 @@ CAPABILITIES=0x17
|
|||||||
####################################
|
####################################
|
||||||
# LTE Positioning Profile Settings
|
# LTE Positioning Profile Settings
|
||||||
####################################
|
####################################
|
||||||
# LPP_PROFILE is a bit mask(unit8 in HAL interface)
|
# LPP_PROFILE is a bit mask
|
||||||
# 0: Enable RRLP on LTE(Default)
|
# 0: Enable RRLP on LTE(Default)
|
||||||
# 0x01: LPP User Plane
|
# 0x1: LPP User Plane
|
||||||
# 0x02: LPP Control Plane
|
# 0x2: LPP Control Plane
|
||||||
# 0x04: LPP User Plane for NR5G
|
# 0x4: LPP User Plane for NR5G
|
||||||
# 0x08: LPP Control Plane for NR5G
|
# 0x8: LPP Control Plane for NR5G
|
||||||
# Mot modification
|
|
||||||
# 0x10: LPPe CP DBH
|
|
||||||
# 0x20: LPPe CP WLAN
|
|
||||||
# 0x40: LPPe UP DBH
|
|
||||||
# 0x80: LPPe UP WLAN
|
|
||||||
# TMO = 0x32 (50) LPP CP, RRLP UP, LPPe CP DBH & WLAN, LPPe CP UBP if product support pressure sensor
|
|
||||||
# ATT = 0x33 (51) LPP CP, LPP UP, LPPe CP DBH & WLAN, LPPe CP UBP if product support pressure sensor
|
|
||||||
# VzW = 0xF3 (243) LPP CP, LPP UP, LPPe CP DBH & WLAN, LPPe UP DBH & WLAN, LPPe CP & UP UBP if product support pressure sensor
|
|
||||||
|
|
||||||
LPP_PROFILE = 2
|
LPP_PROFILE = 2
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
@ -104,6 +95,15 @@ DATUM_TYPE = 0
|
|||||||
# NMEA provider (1=Modem Processor, 0=Application Processor)
|
# NMEA provider (1=Modem Processor, 0=Application Processor)
|
||||||
NMEA_PROVIDER=0
|
NMEA_PROVIDER=0
|
||||||
|
|
||||||
|
################################
|
||||||
|
# NMEA TAG BLOCK GROUPING
|
||||||
|
################################
|
||||||
|
# NMEA tag block grouping is only applicable to GSA
|
||||||
|
# Default is disabled
|
||||||
|
# 0 - disabled
|
||||||
|
# 1 - enabled
|
||||||
|
NMEA_TAG_BLOCK_GROUPING_ENABLED = 0
|
||||||
|
|
||||||
# Customized NMEA GGA fix quality that can be used to tell
|
# Customized NMEA GGA fix quality that can be used to tell
|
||||||
# whether SENSOR contributed to the fix.
|
# whether SENSOR contributed to the fix.
|
||||||
#
|
#
|
||||||
|
@ -117,6 +117,7 @@ GnssAdapter::GnssAdapter() :
|
|||||||
mOdcpiRequestActive(false),
|
mOdcpiRequestActive(false),
|
||||||
mOdcpiTimer(this),
|
mOdcpiTimer(this),
|
||||||
mOdcpiRequest(),
|
mOdcpiRequest(),
|
||||||
|
mOdcpiStateMask(0),
|
||||||
mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW),
|
mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW),
|
||||||
mSystemStatus(SystemStatus::getInstance(mMsgTask)),
|
mSystemStatus(SystemStatus::getInstance(mMsgTask)),
|
||||||
mServerUrl(":"),
|
mServerUrl(":"),
|
||||||
@ -176,8 +177,7 @@ GnssAdapter::GnssAdapter() :
|
|||||||
doneInit();
|
doneInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks)
|
||||||
GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks)
|
|
||||||
{
|
{
|
||||||
struct MsgSetControlCallbacks : public LocMsg {
|
struct MsgSetControlCallbacks : public LocMsg {
|
||||||
GnssAdapter& mAdapter;
|
GnssAdapter& mAdapter;
|
||||||
@ -2690,48 +2690,6 @@ void GnssAdapter::checkAndRestartTimeBasedSession()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationCapabilitiesMask
|
|
||||||
GnssAdapter::getCapabilities()
|
|
||||||
{
|
|
||||||
LocationCapabilitiesMask mask = 0;
|
|
||||||
uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities();
|
|
||||||
// time based tracking always supported
|
|
||||||
mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT;
|
|
||||||
// geofence always supported
|
|
||||||
mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT;
|
|
||||||
if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT;
|
|
||||||
}
|
|
||||||
if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT |
|
|
||||||
LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::gnssConstellationConfig()) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT;
|
|
||||||
}
|
|
||||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) {
|
|
||||||
mask |= LOCATION_CAPABILITIES_AGPM_BIT;
|
|
||||||
}
|
|
||||||
//Get QWES feature status mask
|
|
||||||
mask |= ContextBase::getQwesFeatureStatus();
|
|
||||||
return mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GnssAdapter::notifyClientOfCachedLocationSystemInfo(
|
GnssAdapter::notifyClientOfCachedLocationSystemInfo(
|
||||||
LocationAPI* client, const LocationCallbacks& callbacks) {
|
LocationAPI* client, const LocationCallbacks& callbacks) {
|
||||||
@ -4822,6 +4780,7 @@ GnssAdapter::requestOdcpiEvent(OdcpiRequestInfo& request)
|
|||||||
void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
|
void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
|
||||||
{
|
{
|
||||||
if (nullptr != mOdcpiRequestCb) {
|
if (nullptr != mOdcpiRequestCb) {
|
||||||
|
bool sendEmergencyCallStatusEvent = false;
|
||||||
LOC_LOGd("request: type %d, tbf %d, isEmergency %d"
|
LOC_LOGd("request: type %d, tbf %d, isEmergency %d"
|
||||||
" requestActive: %d timerActive: %d",
|
" requestActive: %d timerActive: %d",
|
||||||
request.type, request.tbfMillis, request.isEmergencyMode,
|
request.type, request.tbfMillis, request.isEmergencyMode,
|
||||||
@ -4829,23 +4788,26 @@ void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
|
|||||||
// ODCPI START and ODCPI STOP from modem can come in quick succession
|
// ODCPI START and ODCPI STOP from modem can come in quick succession
|
||||||
// so the mOdcpiTimer helps avoid spamming the framework as well as
|
// so the mOdcpiTimer helps avoid spamming the framework as well as
|
||||||
// extending the odcpi session past 30 seconds if needed
|
// extending the odcpi session past 30 seconds if needed
|
||||||
|
|
||||||
if (ODCPI_REQUEST_TYPE_START == request.type) {
|
if (ODCPI_REQUEST_TYPE_START == request.type) {
|
||||||
if (false == mOdcpiRequestActive && false == mOdcpiTimer.isActive()) {
|
if (!(mOdcpiStateMask & ODCPI_REQ_ACTIVE) && false == mOdcpiTimer.isActive()) {
|
||||||
mOdcpiRequestCb(request);
|
fireOdcpiRequest(request);
|
||||||
mOdcpiRequestActive = true;
|
mOdcpiStateMask |= ODCPI_REQ_ACTIVE;
|
||||||
mOdcpiTimer.start();
|
mOdcpiTimer.start();
|
||||||
|
sendEmergencyCallStatusEvent = true;
|
||||||
// if the current active odcpi session is non-emergency, and the new
|
// if the current active odcpi session is non-emergency, and the new
|
||||||
// odcpi request is emergency, replace the odcpi request with new request
|
// odcpi request is emergency, replace the odcpi request with new request
|
||||||
// and restart the timer
|
// and restart the timer
|
||||||
} else if (false == mOdcpiRequest.isEmergencyMode &&
|
} else if (false == mOdcpiRequest.isEmergencyMode &&
|
||||||
true == request.isEmergencyMode) {
|
true == request.isEmergencyMode) {
|
||||||
mOdcpiRequestCb(request);
|
fireOdcpiRequest(request);
|
||||||
mOdcpiRequestActive = true;
|
mOdcpiStateMask |= ODCPI_REQ_ACTIVE;
|
||||||
if (true == mOdcpiTimer.isActive()) {
|
if (true == mOdcpiTimer.isActive()) {
|
||||||
mOdcpiTimer.restart();
|
mOdcpiTimer.restart();
|
||||||
} else {
|
} else {
|
||||||
mOdcpiTimer.start();
|
mOdcpiTimer.start();
|
||||||
}
|
}
|
||||||
|
sendEmergencyCallStatusEvent = true;
|
||||||
// if ODCPI request is not active but the timer is active, then
|
// if ODCPI request is not active but the timer is active, then
|
||||||
// just update the active state and wait for timer to expire
|
// just update the active state and wait for timer to expire
|
||||||
// before requesting new ODCPI to avoid spamming ODCPI requests
|
// before requesting new ODCPI to avoid spamming ODCPI requests
|
||||||
@ -4858,11 +4820,22 @@ void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
|
|||||||
// to avoid spamming more odcpi requests to the framework
|
// to avoid spamming more odcpi requests to the framework
|
||||||
} else if (ODCPI_REQUEST_TYPE_STOP == request.type) {
|
} else if (ODCPI_REQUEST_TYPE_STOP == request.type) {
|
||||||
LOC_LOGd("request: type %d, isEmergency %d", request.type, request.isEmergencyMode);
|
LOC_LOGd("request: type %d, isEmergency %d", request.type, request.isEmergencyMode);
|
||||||
mOdcpiRequestCb(request);
|
fireOdcpiRequest(request);
|
||||||
mOdcpiRequestActive = false;
|
mOdcpiStateMask = 0;
|
||||||
|
sendEmergencyCallStatusEvent = true;
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGE("Invalid ODCPI request type..");
|
LOC_LOGE("Invalid ODCPI request type..");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Raise InEmergencyCall event
|
||||||
|
if (sendEmergencyCallStatusEvent && request.isEmergencyMode) {
|
||||||
|
SystemStatus* systemstatus = getSystemStatus();
|
||||||
|
if (nullptr != systemstatus) {
|
||||||
|
systemstatus->eventInEmergencyCall(0 != mOdcpiStateMask);
|
||||||
|
} else {
|
||||||
|
LOC_LOGe("Failed to get system status instance.");
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGw("ODCPI request not supported");
|
LOC_LOGw("ODCPI request not supported");
|
||||||
}
|
}
|
||||||
@ -4902,9 +4875,6 @@ bool GnssAdapter::reportQwesCapabilities(
|
|||||||
mAdapter(adapter),
|
mAdapter(adapter),
|
||||||
mFeatureMap(std::move(featureMap)) {}
|
mFeatureMap(std::move(featureMap)) {}
|
||||||
inline virtual void proc() const {
|
inline virtual void proc() const {
|
||||||
LOC_LOGi("ReportQwesFeatureStatus before caps %" PRIx64 " ",
|
|
||||||
mAdapter.getCapabilities());
|
|
||||||
ContextBase::setQwesFeatureStatus(mFeatureMap);
|
|
||||||
LOC_LOGi("ReportQwesFeatureStatus After caps %" PRIx64 " ",
|
LOC_LOGi("ReportQwesFeatureStatus After caps %" PRIx64 " ",
|
||||||
mAdapter.getCapabilities());
|
mAdapter.getCapabilities());
|
||||||
mAdapter.broadcastCapabilities(mAdapter.getCapabilities());
|
mAdapter.broadcastCapabilities(mAdapter.getCapabilities());
|
||||||
@ -4916,29 +4886,70 @@ bool GnssAdapter::reportQwesCapabilities(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback,
|
void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback,
|
||||||
OdcpiPrioritytype priority)
|
OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask)
|
||||||
{
|
{
|
||||||
struct MsgInitOdcpi : public LocMsg {
|
struct MsgInitOdcpi : public LocMsg {
|
||||||
GnssAdapter& mAdapter;
|
GnssAdapter& mAdapter;
|
||||||
OdcpiRequestCallback mOdcpiCb;
|
OdcpiRequestCallback mOdcpiCb;
|
||||||
OdcpiPrioritytype mPriority;
|
OdcpiPrioritytype mPriority;
|
||||||
|
OdcpiCallbackTypeMask mTypeMask;
|
||||||
inline MsgInitOdcpi(GnssAdapter& adapter,
|
inline MsgInitOdcpi(GnssAdapter& adapter,
|
||||||
const OdcpiRequestCallback& callback,
|
const OdcpiRequestCallback& callback,
|
||||||
OdcpiPrioritytype priority) :
|
OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask) :
|
||||||
LocMsg(),
|
LocMsg(),
|
||||||
mAdapter(adapter),
|
mAdapter(adapter),
|
||||||
mOdcpiCb(callback), mPriority(priority){}
|
mOdcpiCb(callback), mPriority(priority),
|
||||||
|
mTypeMask(typeMask) {}
|
||||||
inline virtual void proc() const {
|
inline virtual void proc() const {
|
||||||
mAdapter.initOdcpi(mOdcpiCb, mPriority);
|
mAdapter.initOdcpi(mOdcpiCb, mPriority, mTypeMask);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
sendMsg(new MsgInitOdcpi(*this, callback, priority));
|
sendMsg(new MsgInitOdcpi(*this, callback, priority, typeMask));
|
||||||
|
}
|
||||||
|
|
||||||
|
void GnssAdapter::deRegisterOdcpiCommand(OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask) {
|
||||||
|
struct MsgDeRegisterNonEsOdcpi : public LocMsg {
|
||||||
|
GnssAdapter& mAdapter;
|
||||||
|
OdcpiPrioritytype mPriority;
|
||||||
|
OdcpiCallbackTypeMask mTypeMask;
|
||||||
|
inline MsgDeRegisterNonEsOdcpi(GnssAdapter& adapter,
|
||||||
|
OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask) :
|
||||||
|
LocMsg(),
|
||||||
|
mAdapter(adapter),
|
||||||
|
mPriority(priority),
|
||||||
|
mTypeMask(typeMask) {}
|
||||||
|
inline virtual void proc() const {
|
||||||
|
mAdapter.deRegisterOdcpi(mPriority, mTypeMask);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sendMsg(new MsgDeRegisterNonEsOdcpi(*this, priority, typeMask));
|
||||||
|
}
|
||||||
|
|
||||||
|
void GnssAdapter::fireOdcpiRequest(const OdcpiRequestInfo& request) {
|
||||||
|
if (request.isEmergencyMode) {
|
||||||
|
mOdcpiRequestCb(request);
|
||||||
|
} else {
|
||||||
|
std::unordered_map<OdcpiPrioritytype, OdcpiRequestCallback>::iterator iter;
|
||||||
|
for (int priority = ODCPI_HANDLER_PRIORITY_HIGH;
|
||||||
|
priority >= ODCPI_HANDLER_PRIORITY_LOW && iter == mNonEsOdcpiReqCbMap.end();
|
||||||
|
priority--) {
|
||||||
|
iter = mNonEsOdcpiReqCbMap.find((OdcpiPrioritytype)priority);
|
||||||
|
}
|
||||||
|
if (iter != mNonEsOdcpiReqCbMap.end()) {
|
||||||
|
iter->second(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback,
|
void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback,
|
||||||
OdcpiPrioritytype priority)
|
OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
|
||||||
{
|
if (typeMask & EMERGENCY_ODCPI) {
|
||||||
LOC_LOGd("In priority: %d, Curr priority: %d", priority, mCallbackPriority);
|
LOC_LOGd("In priority: %d, Curr priority: %d", priority, mCallbackPriority);
|
||||||
if (priority >= mCallbackPriority) {
|
if (priority >= mCallbackPriority) {
|
||||||
mOdcpiRequestCb = callback;
|
mOdcpiRequestCb = callback;
|
||||||
@ -4948,6 +4959,13 @@ void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback,
|
|||||||
LOC_REGISTRATION_MASK_ENABLED);
|
LOC_REGISTRATION_MASK_ENABLED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (typeMask & NON_EMERGENCY_ODCPI) {
|
||||||
|
//If this is for non emergency odcpi,
|
||||||
|
//Only set callback to mNonEsOdcpiReqCbMap according to its priority
|
||||||
|
//Will overwrite callback with same priority in this map
|
||||||
|
mNonEsOdcpiReqCbMap[priority] = callback;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GnssAdapter::injectOdcpiCommand(const Location& location)
|
void GnssAdapter::injectOdcpiCommand(const Location& location)
|
||||||
{
|
{
|
||||||
@ -5005,8 +5023,8 @@ void GnssAdapter::odcpiTimerExpire()
|
|||||||
|
|
||||||
// if ODCPI request is still active after timer
|
// if ODCPI request is still active after timer
|
||||||
// expires, request again and restart timer
|
// expires, request again and restart timer
|
||||||
if (mOdcpiRequestActive) {
|
if (mOdcpiStateMask & ODCPI_REQ_ACTIVE) {
|
||||||
mOdcpiRequestCb(mOdcpiRequest);
|
fireOdcpiRequest(mOdcpiRequest);
|
||||||
mOdcpiTimer.restart();
|
mOdcpiTimer.restart();
|
||||||
} else {
|
} else {
|
||||||
mOdcpiTimer.stop();
|
mOdcpiTimer.stop();
|
||||||
@ -5844,6 +5862,8 @@ GnssAdapter::nfwControlCommand(bool enable) {
|
|||||||
mApi(api),
|
mApi(api),
|
||||||
mEnable(enable) {}
|
mEnable(enable) {}
|
||||||
inline virtual void proc() const {
|
inline virtual void proc() const {
|
||||||
|
|
||||||
|
if (mAdapter.mSupportNfwControl) {
|
||||||
GnssConfigGpsLock gpsLock;
|
GnssConfigGpsLock gpsLock;
|
||||||
|
|
||||||
gpsLock = ContextBase::mGps_conf.GPS_LOCK;
|
gpsLock = ContextBase::mGps_conf.GPS_LOCK;
|
||||||
@ -5856,15 +5876,14 @@ GnssAdapter::nfwControlCommand(bool enable) {
|
|||||||
mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
|
mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
|
||||||
mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock);
|
mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock);
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (mSupportNfwControl) {
|
|
||||||
sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable));
|
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGw("NFW control is not supported, do not use this for NFW");
|
LOC_LOGw("NFW control is not supported, do not use this for NFW");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable));
|
||||||
|
}
|
||||||
|
|
||||||
// Set tunc constrained mode, use 0 session id to indicate
|
// Set tunc constrained mode, use 0 session id to indicate
|
||||||
// that no callback is needed. Session id 0 is used for calls that
|
// that no callback is needed. Session id 0 is used for calls that
|
||||||
@ -6518,8 +6537,7 @@ GnssAdapter::initEngHubProxyCommand() {
|
|||||||
sendMsg(new MsgInitEngHubProxy(this));
|
sendMsg(new MsgInitEngHubProxy(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool GnssAdapter::initEngHubProxy() {
|
||||||
GnssAdapter::initEngHubProxy() {
|
|
||||||
static bool firstTime = true;
|
static bool firstTime = true;
|
||||||
static bool engHubLoadSuccessful = false;
|
static bool engHubLoadSuccessful = false;
|
||||||
|
|
||||||
@ -6616,16 +6634,19 @@ GnssAdapter::initEngHubProxy() {
|
|||||||
|
|
||||||
GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb =
|
GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb =
|
||||||
[this] (const std::unordered_map<LocationQwesFeatureType, bool> &featureMap) {
|
[this] (const std::unordered_map<LocationQwesFeatureType, bool> &featureMap) {
|
||||||
|
ContextBase::setQwesFeatureStatus(featureMap);
|
||||||
reportQwesCapabilities(featureMap);
|
reportQwesCapabilities(featureMap);
|
||||||
};
|
};
|
||||||
|
|
||||||
getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy");
|
getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy");
|
||||||
if(getter != nullptr) {
|
if(getter != nullptr) {
|
||||||
EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(),
|
// Wait for the script(rootdir/etc/init.qcom.rc) to create socket folder
|
||||||
reportPositionEventCb,
|
|
||||||
reportSvEventCb, reqAidingDataCb,
|
EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mContext,
|
||||||
updateNHzRequirementCb,
|
mSystemStatus->getOsObserver(),
|
||||||
updateQwesFeatureStatusCb);
|
reportPositionEventCb, reportSvEventCb, reqAidingDataCb,
|
||||||
|
updateNHzRequirementCb, updateQwesFeatureStatusCb);
|
||||||
|
|
||||||
if (hubProxy != nullptr) {
|
if (hubProxy != nullptr) {
|
||||||
mEngHubProxy = hubProxy;
|
mEngHubProxy = hubProxy;
|
||||||
engHubLoadSuccessful = true;
|
engHubLoadSuccessful = true;
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <loc_misc_utils.h>
|
#include <loc_misc_utils.h>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <NativeAgpsHandler.h>
|
#include <NativeAgpsHandler.h>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#define MAX_URL_LEN 256
|
#define MAX_URL_LEN 256
|
||||||
#define NMEA_SENTENCE_MAX_LENGTH 200
|
#define NMEA_SENTENCE_MAX_LENGTH 200
|
||||||
@ -258,10 +259,17 @@ class GnssAdapter : public LocAdapterBase {
|
|||||||
OdcpiRequestCallback mOdcpiRequestCb;
|
OdcpiRequestCallback mOdcpiRequestCb;
|
||||||
bool mOdcpiRequestActive;
|
bool mOdcpiRequestActive;
|
||||||
OdcpiPrioritytype mCallbackPriority;
|
OdcpiPrioritytype mCallbackPriority;
|
||||||
|
typedef uint8_t OdcpiStateMask;
|
||||||
|
OdcpiStateMask mOdcpiStateMask;
|
||||||
|
typedef enum {
|
||||||
|
ODCPI_REQ_ACTIVE = (1<<0),
|
||||||
|
CIVIC_ADDRESS_REQ_ACTIVE = (1<<1)
|
||||||
|
} OdcpiStateBits;
|
||||||
OdcpiTimer mOdcpiTimer;
|
OdcpiTimer mOdcpiTimer;
|
||||||
OdcpiRequestInfo mOdcpiRequest;
|
OdcpiRequestInfo mOdcpiRequest;
|
||||||
|
std::unordered_map<OdcpiPrioritytype, OdcpiRequestCallback> mNonEsOdcpiReqCbMap;
|
||||||
void odcpiTimerExpire();
|
void odcpiTimerExpire();
|
||||||
|
std::function<void(const Location&)> mAddressRequestCb;
|
||||||
/* ==== DELETEAIDINGDATA =============================================================== */
|
/* ==== DELETEAIDINGDATA =============================================================== */
|
||||||
int64_t mLastDeleteAidingDataTime;
|
int64_t mLastDeleteAidingDataTime;
|
||||||
|
|
||||||
@ -300,8 +308,20 @@ class GnssAdapter : public LocAdapterBase {
|
|||||||
int totalSvCntInThisConstellation);
|
int totalSvCntInThisConstellation);
|
||||||
|
|
||||||
/* ======== UTILITIES ================================================================== */
|
/* ======== UTILITIES ================================================================== */
|
||||||
inline void initOdcpi(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
|
inline void initOdcpi(const OdcpiRequestCallback& callback,
|
||||||
|
OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask);
|
||||||
|
inline void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
|
||||||
|
if (typeMask & NON_EMERGENCY_ODCPI) {
|
||||||
|
mNonEsOdcpiReqCbMap.erase(priority);
|
||||||
|
}
|
||||||
|
}
|
||||||
inline void injectOdcpi(const Location& location);
|
inline void injectOdcpi(const Location& location);
|
||||||
|
void fireOdcpiRequest(const OdcpiRequestInfo& request);
|
||||||
|
//inline void setAddressRequestCb(const std::function<void(const Location&)>& addressRequestCb)
|
||||||
|
//{ mAddressRequestCb = addressRequestCb;}
|
||||||
|
//inline void injectLocationAndAddr(const Location& location, const GnssCivicAddress& addr)
|
||||||
|
//{ mLocApi->injectPositionAndCivicAddress(location, addr);}
|
||||||
static bool isFlpClient(LocationCallbacks& locationCallbacks);
|
static bool isFlpClient(LocationCallbacks& locationCallbacks);
|
||||||
|
|
||||||
/*==== DGnss Ntrip Source ==========================================================*/
|
/*==== DGnss Ntrip Source ==========================================================*/
|
||||||
@ -468,8 +488,12 @@ public:
|
|||||||
LocEngineRunState engState);
|
LocEngineRunState engState);
|
||||||
|
|
||||||
/* ========= ODCPI ===================================================================== */
|
/* ========= ODCPI ===================================================================== */
|
||||||
|
|
||||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||||
void initOdcpiCommand(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
|
void initOdcpiCommand(const OdcpiRequestCallback& callback,
|
||||||
|
OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask);
|
||||||
|
void deRegisterOdcpiCommand(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
|
||||||
void injectOdcpiCommand(const Location& location);
|
void injectOdcpiCommand(const Location& location);
|
||||||
/* ======== RESPONSES ================================================================== */
|
/* ======== RESPONSES ================================================================== */
|
||||||
void reportResponse(LocationError err, uint32_t sessionId);
|
void reportResponse(LocationError err, uint32_t sessionId);
|
||||||
@ -628,7 +652,6 @@ public:
|
|||||||
void setSuplHostServer(const char* server, int port, LocServerType type);
|
void setSuplHostServer(const char* server, int port, LocServerType type);
|
||||||
void notifyClientOfCachedLocationSystemInfo(LocationAPI* client,
|
void notifyClientOfCachedLocationSystemInfo(LocationAPI* client,
|
||||||
const LocationCallbacks& callbacks);
|
const LocationCallbacks& callbacks);
|
||||||
LocationCapabilitiesMask getCapabilities();
|
|
||||||
void updateSystemPowerStateCommand(PowerStateType systemPowerState);
|
void updateSystemPowerStateCommand(PowerStateType systemPowerState);
|
||||||
|
|
||||||
/*==== DGnss Usable Report Flag ====================================================*/
|
/*==== DGnss Usable Report Flag ====================================================*/
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include <SystemStatus.h>
|
#include <SystemStatus.h>
|
||||||
#include <DataItemId.h>
|
#include <DataItemId.h>
|
||||||
#include <DataItemsFactoryProxy.h>
|
#include <DataItemsFactoryProxy.h>
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
#include <loc_log.h>
|
#include <loc_log.h>
|
||||||
#include <NativeAgpsHandler.h>
|
#include <NativeAgpsHandler.h>
|
||||||
#include <GnssAdapter.h>
|
#include <GnssAdapter.h>
|
||||||
@ -48,8 +48,8 @@ void NativeAgpsHandler::notify(const list<IDataItemCore*>& dlist) {
|
|||||||
for (auto each : dlist) {
|
for (auto each : dlist) {
|
||||||
switch (each->getId()) {
|
switch (each->getId()) {
|
||||||
case NETWORKINFO_DATA_ITEM_ID: {
|
case NETWORKINFO_DATA_ITEM_ID: {
|
||||||
NetworkInfoDataItemBase* networkInfo =
|
NetworkInfoDataItem* networkInfo =
|
||||||
static_cast<NetworkInfoDataItemBase*>(each);
|
static_cast<NetworkInfoDataItem*>(each);
|
||||||
uint64_t mobileBit = (uint64_t )1 << loc_core::TYPE_MOBILE;
|
uint64_t mobileBit = (uint64_t )1 << loc_core::TYPE_MOBILE;
|
||||||
uint64_t allTypes = networkInfo->mAllTypes;
|
uint64_t allTypes = networkInfo->mAllTypes;
|
||||||
mConnected = ((networkInfo->mAllTypes & mobileBit) == mobileBit);
|
mConnected = ((networkInfo->mAllTypes & mobileBit) == mobileBit);
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include <LocAdapterBase.h>
|
#include <LocAdapterBase.h>
|
||||||
#include <DataItemId.h>
|
#include <DataItemId.h>
|
||||||
#include <DataItemsFactoryProxy.h>
|
#include <DataItemsFactoryProxy.h>
|
||||||
#include <DataItemConcreteTypesBase.h>
|
#include <DataItemConcreteTypes.h>
|
||||||
|
|
||||||
using namespace loc_util;
|
using namespace loc_util;
|
||||||
using namespace loc_core;
|
using namespace loc_core;
|
||||||
@ -322,13 +322,10 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
|
|||||||
const list<IDataItemCore*>& dataItemList) :
|
const list<IDataItemCore*>& dataItemList) :
|
||||||
mXtraSysStatObj(xtraSysStatObs) {
|
mXtraSysStatObj(xtraSysStatObs) {
|
||||||
for (auto eachItem : dataItemList) {
|
for (auto eachItem : dataItemList) {
|
||||||
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(
|
IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(eachItem);
|
||||||
eachItem->getId());
|
|
||||||
if (NULL == dataitem) {
|
if (NULL == dataitem) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Copy the contents of the data item
|
|
||||||
dataitem->copy(eachItem);
|
|
||||||
|
|
||||||
mDataItemList.push_back(dataitem);
|
mDataItemList.push_back(dataitem);
|
||||||
}
|
}
|
||||||
@ -349,8 +346,7 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
|
|||||||
{
|
{
|
||||||
case NETWORKINFO_DATA_ITEM_ID:
|
case NETWORKINFO_DATA_ITEM_ID:
|
||||||
{
|
{
|
||||||
NetworkInfoDataItemBase* networkInfo =
|
NetworkInfoDataItem* networkInfo = static_cast<NetworkInfoDataItem*>(each);
|
||||||
static_cast<NetworkInfoDataItemBase*>(each);
|
|
||||||
NetworkInfoType* networkHandleInfo =
|
NetworkInfoType* networkHandleInfo =
|
||||||
static_cast<NetworkInfoType*>(networkInfo->getNetworkHandle());
|
static_cast<NetworkInfoType*>(networkInfo->getNetworkHandle());
|
||||||
mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(),
|
mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(),
|
||||||
@ -360,16 +356,14 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
|
|||||||
|
|
||||||
case TAC_DATA_ITEM_ID:
|
case TAC_DATA_ITEM_ID:
|
||||||
{
|
{
|
||||||
TacDataItemBase* tac =
|
TacDataItem* tac = static_cast<TacDataItem*>(each);
|
||||||
static_cast<TacDataItemBase*>(each);
|
|
||||||
mXtraSysStatObj->updateTac(tac->mValue);
|
mXtraSysStatObj->updateTac(tac->mValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MCCMNC_DATA_ITEM_ID:
|
case MCCMNC_DATA_ITEM_ID:
|
||||||
{
|
{
|
||||||
MccmncDataItemBase* mccmnc =
|
MccmncDataItem* mccmnc = static_cast<MccmncDataItem*>(each);
|
||||||
static_cast<MccmncDataItemBase*>(each);
|
|
||||||
mXtraSysStatObj->updateMccMnc(mccmnc->mValue);
|
mXtraSysStatObj->updateMccMnc(mccmnc->mValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -27,6 +27,42 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "GnssAdapter.h"
|
#include "GnssAdapter.h"
|
||||||
#include "location_interface.h"
|
#include "location_interface.h"
|
||||||
|
|
||||||
@ -73,7 +109,9 @@ static void enableNfwLocationAccess(bool enable);
|
|||||||
static void nfwInit(const NfwCbInfo& cbInfo);
|
static void nfwInit(const NfwCbInfo& cbInfo);
|
||||||
static void getPowerStateChanges(std::function<void(bool)> powerStateCb);
|
static void getPowerStateChanges(std::function<void(bool)> powerStateCb);
|
||||||
|
|
||||||
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
|
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask);
|
||||||
|
static void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
|
||||||
static void odcpiInject(const Location& location);
|
static void odcpiInject(const Location& location);
|
||||||
|
|
||||||
static void blockCPI(double latitude, double longitude, float accuracy,
|
static void blockCPI(double latitude, double longitude, float accuracy,
|
||||||
@ -135,6 +173,7 @@ static const GnssInterface gGnssInterface = {
|
|||||||
getDebugReport,
|
getDebugReport,
|
||||||
updateConnectionStatus,
|
updateConnectionStatus,
|
||||||
odcpiInit,
|
odcpiInit,
|
||||||
|
deRegisterOdcpi,
|
||||||
odcpiInject,
|
odcpiInject,
|
||||||
blockCPI,
|
blockCPI,
|
||||||
getGnssEnergyConsumed,
|
getGnssEnergyConsumed,
|
||||||
@ -379,10 +418,17 @@ static void updateConnectionStatus(bool connected, int8_t type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority)
|
static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask)
|
||||||
{
|
{
|
||||||
if (NULL != gGnssAdapter) {
|
if (NULL != gGnssAdapter) {
|
||||||
gGnssAdapter->initOdcpiCommand(callback, priority);
|
gGnssAdapter->initOdcpiCommand(callback, priority, typeMask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
|
||||||
|
if (NULL != gGnssAdapter) {
|
||||||
|
gGnssAdapter->deRegisterOdcpiCommand(priority, typeMask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ PRODUCT_PACKAGES += gnss_antenna_info.conf
|
|||||||
PRODUCT_PACKAGES += gnss@2.0-base.policy
|
PRODUCT_PACKAGES += gnss@2.0-base.policy
|
||||||
PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy
|
PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy
|
||||||
PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy
|
PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy
|
||||||
PRODUCT_PACKAGES += gnss@2.0-xtwifi-inet-agent.policy
|
|
||||||
PRODUCT_PACKAGES += libloc_pla_headers
|
PRODUCT_PACKAGES += libloc_pla_headers
|
||||||
PRODUCT_PACKAGES += liblocation_api_headers
|
PRODUCT_PACKAGES += liblocation_api_headers
|
||||||
PRODUCT_PACKAGES += libgps.utils_headers
|
PRODUCT_PACKAGES += libgps.utils_headers
|
||||||
|
@ -25,6 +25,42 @@
|
|||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
#define LOG_NDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_LocationAPI"
|
#define LOG_TAG "LocSvc_LocationAPI"
|
||||||
|
|
||||||
|
@ -26,6 +26,11 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
|
*/
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
#define LOG_NDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_APIClientBase"
|
#define LOG_TAG "LocSvc_APIClientBase"
|
||||||
|
|
||||||
@ -357,7 +362,8 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(TrackingOptions& options)
|
|||||||
pthread_mutex_lock(&mMutex);
|
pthread_mutex_lock(&mMutex);
|
||||||
if (mLocationAPI) {
|
if (mLocationAPI) {
|
||||||
if (mTracking) {
|
if (mTracking) {
|
||||||
LOC_LOGW("%s:%d] Existing tracking session present", __FUNCTION__, __LINE__);
|
pthread_mutex_unlock(&mMutex);
|
||||||
|
locAPIUpdateTrackingOptions(options);
|
||||||
} else {
|
} else {
|
||||||
uint32_t session = mLocationAPI->startTracking(options);
|
uint32_t session = mLocationAPI->startTracking(options);
|
||||||
LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session);
|
LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session);
|
||||||
@ -367,11 +373,13 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(TrackingOptions& options)
|
|||||||
mRequestQueues[REQUEST_TRACKING].reset(session);
|
mRequestQueues[REQUEST_TRACKING].reset(session);
|
||||||
mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this));
|
mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this));
|
||||||
mTracking = true;
|
mTracking = true;
|
||||||
|
pthread_mutex_unlock(&mMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal = LOCATION_ERROR_SUCCESS;
|
retVal = LOCATION_ERROR_SUCCESS;
|
||||||
}
|
} else {
|
||||||
pthread_mutex_unlock(&mMutex);
|
pthread_mutex_unlock(&mMutex);
|
||||||
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,40 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
#ifndef LOCATIONDATATYPES_H
|
#ifndef LOCATIONDATATYPES_H
|
||||||
#define LOCATIONDATATYPES_H
|
#define LOCATIONDATATYPES_H
|
||||||
|
|
||||||
@ -238,77 +272,91 @@ typedef enum {
|
|||||||
|
|
||||||
// Set of masks for Modem and QWES capabilities.
|
// Set of masks for Modem and QWES capabilities.
|
||||||
typedef uint64_t LocationCapabilitiesMask;
|
typedef uint64_t LocationCapabilitiesMask;
|
||||||
typedef enum {
|
|
||||||
// supports startTracking API with minInterval param
|
// supports startTracking API with minInterval param
|
||||||
LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT = (1<<0),
|
#define LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT (1<<0)
|
||||||
// supports startBatching API with minInterval param
|
// supports startBatching API with minInterval param
|
||||||
LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT = (1<<1),
|
#define LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT (1<<1)
|
||||||
// supports startTracking API with minDistance param
|
// supports startTracking API with minDistance param
|
||||||
LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT = (1<<2),
|
#define LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT (1<<2)
|
||||||
// supports startBatching API with minDistance param
|
// supports startBatching API with minDistance param
|
||||||
LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT = (1<<3),
|
#define LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT (1<<3)
|
||||||
// supports addGeofences API
|
// supports addGeofences API
|
||||||
LOCATION_CAPABILITIES_GEOFENCE_BIT = (1<<4),
|
#define LOCATION_CAPABILITIES_GEOFENCE_BIT (1<<4)
|
||||||
// supports GnssMeasurementsCallback
|
// supports GnssMeasurementsCallback
|
||||||
LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT = (1<<5),
|
#define LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT (1<<5)
|
||||||
// supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based)
|
// supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based)
|
||||||
LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6),
|
#define LOCATION_CAPABILITIES_GNSS_MSB_BIT (1<<6)
|
||||||
// supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted)
|
// supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted)
|
||||||
LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7),
|
#define LOCATION_CAPABILITIES_GNSS_MSA_BIT (1<<7)
|
||||||
// supports debug nmea sentences in the debugNmeaCallback
|
// supports debug nmea sentences in the debugNmeaCallback
|
||||||
LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8),
|
#define LOCATION_CAPABILITIES_DEBUG_NMEA_BIT (1<<8)
|
||||||
// support outdoor trip batching
|
// support outdoor trip batching
|
||||||
LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9),
|
#define LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT (1<<9)
|
||||||
// support constellation enablement
|
// support constellation enablement
|
||||||
LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT = (1<<10),
|
#define LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT (1<<10)
|
||||||
// support agpm
|
// support agpm
|
||||||
LOCATION_CAPABILITIES_AGPM_BIT = (1<<11),
|
#define LOCATION_CAPABILITIES_AGPM_BIT (1<<11)
|
||||||
// support location privacy
|
// support location privacy
|
||||||
LOCATION_CAPABILITIES_PRIVACY_BIT = (1<<12),
|
#define LOCATION_CAPABILITIES_PRIVACY_BIT (1<<12)
|
||||||
// support measurement corrections
|
// support measurement corrections
|
||||||
LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT = (1<<13),
|
#define LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT (1<<13)
|
||||||
// support Robust Location
|
// support Robust Location
|
||||||
LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT = (1<<14),
|
#define LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT (1<<14)
|
||||||
// support precise location edgnss
|
// support precise location edgnss
|
||||||
LOCATION_CAPABILITIES_EDGNSS_BIT = (1<<15),
|
#define LOCATION_CAPABILITIES_EDGNSS_BIT (1<<15)
|
||||||
// Modem supports Carrier Phase for Precise Positioning
|
// Modem supports Carrier Phase for Precise Positioning
|
||||||
// Measurement Engine (PPME).
|
// Measurement Engine (PPME).
|
||||||
LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT = (1<<16),
|
#define LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT (1<<16)
|
||||||
// Modem supports SV Polynomial for tightly coupled external
|
// Modem supports SV Polynomial for tightly coupled external
|
||||||
// DR support. This is a Standalone Feature.
|
// DR support. This is a Standalone Feature.
|
||||||
LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT = (1<<17),
|
#define LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT (1<<17)
|
||||||
// Modem supports SV Ephemeris for tightly coupled external
|
// Modem supports SV Ephemeris for tightly coupled external
|
||||||
// PPE engines. This is a Standalone Feature.
|
// PPE engines. This is a Standalone Feature.
|
||||||
LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT = (1<<18),
|
#define LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT (1<<18)
|
||||||
// Modem supports GNSS Single Frequency feature. This is a
|
// Modem supports GNSS Single Frequency feature. This is a
|
||||||
// Standalone Feature.
|
// Standalone Feature.
|
||||||
LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY = (1<<19),
|
#define LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY (1<<19)
|
||||||
// Modem supports GNSS Multi Frequency feature. Multi Frequency
|
// Modem supports GNSS Multi Frequency feature. Multi Frequency
|
||||||
// enables Single frequency also.
|
// enables Single frequency also.
|
||||||
LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY = (1<<20),
|
#define LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY (1<<20)
|
||||||
// This mask indicates VPe license bundle is enabled. VEPP
|
// This mask indicates VPe license bundle is enabled. VEPP
|
||||||
// bundle include Carrier Phase and SV Polynomial features.
|
// bundle include Carrier Phase and SV Polynomial features.
|
||||||
LOCATION_CAPABILITIES_QWES_VPE = (1<<21),
|
#define LOCATION_CAPABILITIES_QWES_VPE (1<<21)
|
||||||
// This mask indicates support for CV2X Location basic features.
|
// This mask indicates support for CV2X Location basic features.
|
||||||
// This bundle includes features for GTS Time & Freq, C-TUNC
|
// This bundle includes features for GTS Time & Freq, C-TUNC
|
||||||
// (Constrained Time uncertainity.
|
// (Constrained Time uncertainity.
|
||||||
LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC = (1<<22),
|
#define LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC (1<<22)
|
||||||
// This mask indicates support for CV2X Location premium features.
|
// This mask indicates support for CV2X Location premium features.
|
||||||
// This bundle includes features for CV2X Location Basic features,
|
// This bundle includes features for CV2X Location Basic features,
|
||||||
// QDR3 feature, and PACE. (Position Assisted Clock Estimator.
|
// QDR3 feature, and PACE. (Position Assisted Clock Estimator.
|
||||||
LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM = (1<<23),
|
#define LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM (1<<23)
|
||||||
// This mask indicates that PPE (Precise Positioning Engine)
|
// This mask indicates that PPE (Precise Positioning Engine)
|
||||||
// library is enabled or Precise Positioning Framework (PPF)
|
// library is enabled or Precise Positioning Framework (PPF)
|
||||||
// is available. This bundle includes features for Carrier
|
// is available. This bundle includes features for Carrier
|
||||||
// Phase and SV Ephermeris.
|
// Phase and SV Ephermeris.
|
||||||
LOCATION_CAPABILITIES_QWES_PPE = (1<<24),
|
#define LOCATION_CAPABILITIES_QWES_PPE (1<<24)
|
||||||
// This mask indicates QDR2_C license bundle is enabled. This
|
// This mask indicates QDR2_C license bundle is enabled. This
|
||||||
// bundle includes features for SV Polynomial.
|
// bundle includes features for SV Polynomial.
|
||||||
LOCATION_CAPABILITIES_QWES_QDR2 = (1<<25),
|
#define LOCATION_CAPABILITIES_QWES_QDR2 (1<<25)
|
||||||
// This mask indicates QDR3_C license bundle is enabled. This
|
// This mask indicates QDR3_C license bundle is enabled. This
|
||||||
// bundle includes features for SV Polynomial.
|
// bundle includes features for SV Polynomial.
|
||||||
LOCATION_CAPABILITIES_QWES_QDR3 = (1<<26),
|
#define LOCATION_CAPABILITIES_QWES_QDR3 (1<<26)
|
||||||
} LocationCapabilitiesBits;
|
// This mask indicates DGNSS license bundle is enabled.
|
||||||
|
#define LOCATION_CAPABILITIES_QWES_DGNSS (1<<27)
|
||||||
|
// This mask indicates Antenna info is enabled.
|
||||||
|
#define LOCATION_CAPABILITIES_ANTENNA_INFO (1<<28)
|
||||||
|
// This mask indicates qppe or qfe library is presented.
|
||||||
|
#define LOCATION_CAPABILITIES_PRECISE_LIB_PRESENT (1<<29)
|
||||||
|
// This mask indicates wifi RSSI positioning is
|
||||||
|
// enabled by QWES license.
|
||||||
|
#define LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING (1ULL<<30)
|
||||||
|
// This mask indicates wifi RTT positioning is
|
||||||
|
// enabled by QWES license.
|
||||||
|
#define LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING (1ULL<<31)
|
||||||
|
// This mask indicates wifi RSSI positioning is supported.
|
||||||
|
#define LOCATION_CAPABILITIES_WIFI_RSSI_POSITIONING (1ULL<<32)
|
||||||
|
// This mask indicates wifi RTT positioning is supported.
|
||||||
|
#define LOCATION_CAPABILITIES_WIFI_RTT_POSITIONING (1ULL<<33)
|
||||||
|
|
||||||
typedef uint8_t LocationQwesFeatureType;
|
typedef uint8_t LocationQwesFeatureType;
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -347,10 +395,29 @@ typedef enum {
|
|||||||
// This indicates VEPP license bundle is enabled. VEPP
|
// This indicates VEPP license bundle is enabled. VEPP
|
||||||
// bundle include Carrier Phase and SV Polynomial features.
|
// bundle include Carrier Phase and SV Polynomial features.
|
||||||
LOCATION_QWES_FEATURE_TYPE_VPE,
|
LOCATION_QWES_FEATURE_TYPE_VPE,
|
||||||
|
// This indicates DGNSS license is enabled.
|
||||||
|
LOCATION_QWES_FEATURE_TYPE_DGNSS,
|
||||||
|
// This indicates DLP feature is enabled by QESDK APP
|
||||||
|
// license
|
||||||
|
LOCATION_QWES_FEATURE_TYPE_DLP_QESDK,
|
||||||
|
// This indicates wifi RSSI positioning is
|
||||||
|
// enabled by QWES license.
|
||||||
|
LOCATION_QWES_FEATURE_TYPE_RSSI_POSITIONING,
|
||||||
|
// This indicates wifi RTT positioning is
|
||||||
|
// enabled by QWES license.
|
||||||
|
LOCATION_QWES_FEATURE_TYPE_RTT_POSITIONING,
|
||||||
// Max value
|
// Max value
|
||||||
LOCATION_QWES_FEATURE_TYPE_MAX
|
LOCATION_QWES_FEATURE_TYPE_MAX
|
||||||
} LocationQwesFeatureTypes;
|
} LocationQwesFeatureTypes;
|
||||||
|
|
||||||
|
typedef uint64_t LocationHwCapabilitiesMask;
|
||||||
|
typedef enum {
|
||||||
|
// This indicates wifi HW has RSSI capability.
|
||||||
|
LOCATION_WIFI_CAPABILITY_RSSI = (1<<0),
|
||||||
|
// This indicates wifi HW has RTT capability.
|
||||||
|
LOCATION_WIFI_CAPABILITY_RTT = (1<<1)
|
||||||
|
} LocationHwCapabilitiesBits;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LOCATION_TECHNOLOGY_TYPE_GNSS = 0,
|
LOCATION_TECHNOLOGY_TYPE_GNSS = 0,
|
||||||
} LocationTechnologyType;
|
} LocationTechnologyType;
|
||||||
@ -2067,4 +2134,11 @@ typedef struct {
|
|||||||
uint64_t hlosQtimer5;
|
uint64_t hlosQtimer5;
|
||||||
} GnssLatencyInfo;
|
} GnssLatencyInfo;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
NON_EMERGENCY_ODCPI = (1<<0),
|
||||||
|
EMERGENCY_ODCPI = (1<<1)
|
||||||
|
} OdcpiCallbackTypeMaskBits;
|
||||||
|
|
||||||
|
typedef uint16_t OdcpiCallbackTypeMask;
|
||||||
|
|
||||||
#endif /* LOCATIONDATATYPES_H */
|
#endif /* LOCATIONDATATYPES_H */
|
||||||
|
@ -26,6 +26,41 @@
|
|||||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||||
|
|
||||||
|
Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted (subject to the limitations in the
|
||||||
|
disclaimer below) provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||||
|
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||||
|
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
#ifndef LOCATION_INTERFACE_H
|
#ifndef LOCATION_INTERFACE_H
|
||||||
#define LOCATION_INTERFACE_H
|
#define LOCATION_INTERFACE_H
|
||||||
|
|
||||||
@ -79,7 +114,9 @@ struct GnssInterface {
|
|||||||
void (*getDebugReport)(GnssDebugReport& report);
|
void (*getDebugReport)(GnssDebugReport& report);
|
||||||
void (*updateConnectionStatus)(bool connected, int8_t type, bool roaming,
|
void (*updateConnectionStatus)(bool connected, int8_t type, bool roaming,
|
||||||
NetworkHandle networkHandle, std::string& apn);
|
NetworkHandle networkHandle, std::string& apn);
|
||||||
void (*odcpiInit)(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
|
void (*odcpiInit)(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
|
||||||
|
OdcpiCallbackTypeMask typeMask);
|
||||||
|
void (*deRegisterOdcpi)(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
|
||||||
void (*odcpiInject)(const Location& location);
|
void (*odcpiInject)(const Location& location);
|
||||||
void (*blockCPI)(double latitude, double longitude, float accuracy,
|
void (*blockCPI)(double latitude, double longitude, float accuracy,
|
||||||
int blockDurationMsec, double latLonDiffThreshold);
|
int blockDurationMsec, double latLonDiffThreshold);
|
||||||
|
@ -2341,10 +2341,17 @@ typedef std::function<void(const OdcpiRequestInfo& request)> OdcpiRequestCallbac
|
|||||||
|
|
||||||
/* ODCPI callback priorities*/
|
/* ODCPI callback priorities*/
|
||||||
enum OdcpiPrioritytype {
|
enum OdcpiPrioritytype {
|
||||||
|
//ODCPI callback registered by AFW via IGNSS AIDL has LOW priority
|
||||||
ODCPI_HANDLER_PRIORITY_LOW,
|
ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
ODCPI_HANDLER_PRIORITY_DEFAULT = ODCPI_HANDLER_PRIORITY_LOW,
|
||||||
|
//ODCPI callback registered by IzatProvider on LE/KaiOS has medium priority
|
||||||
|
ODCPI_HANDLER_PRIORITY_MEDIUM,
|
||||||
|
//Non emergency ODCPI callback registered by IzatManager for RTT position injection
|
||||||
|
//has high priority
|
||||||
ODCPI_HANDLER_PRIORITY_HIGH
|
ODCPI_HANDLER_PRIORITY_HIGH
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Callback with AGNSS(IpV4) status information.
|
* Callback with AGNSS(IpV4) status information.
|
||||||
*
|
*
|
||||||
@ -2422,6 +2429,13 @@ typedef uint64_t NetworkHandle;
|
|||||||
#define NETWORK_HANDLE_UNKNOWN ~0
|
#define NETWORK_HANDLE_UNKNOWN ~0
|
||||||
#define MAX_NETWORK_HANDLES 10
|
#define MAX_NETWORK_HANDLES 10
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
LOC_FEATURE_STATUS_UNKNOWN = 0,
|
||||||
|
LOC_FEATURE_STATUS_NONE = 1,
|
||||||
|
LOC_FEATURE_STATUS_OK = 2,
|
||||||
|
LOC_FEATURE_STATUS_EXPIRED = 3
|
||||||
|
} LocFeatureStatus;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user