Merge 3eb3079f05
on remote branch
Change-Id: I62caf97f42c404c7b6b720355082ac75dd8f4619
This commit is contained in:
commit
a1ea019caa
25 changed files with 460 additions and 535 deletions
|
@ -1,7 +1,5 @@
|
|||
ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(LOCAL_PATH)/build/target_specific_features.mk
|
||||
ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
else
|
||||
include $(LOCAL_PATH)/android/Android.mk
|
||||
endif
|
||||
|
|
|
@ -48,7 +48,8 @@ int main() {
|
|||
|
||||
ALOGI("%s", __FUNCTION__);
|
||||
|
||||
bool vendorEnhanced = isRunningWithVendorEnhancedFramework();
|
||||
int vendorInfo = getVendorEnhancedInfo();
|
||||
bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo );
|
||||
setVendorEnhanced(vendorEnhanced);
|
||||
|
||||
#ifdef ARCH_ARM_32
|
||||
|
|
|
@ -48,7 +48,8 @@ int main() {
|
|||
|
||||
ALOGI("%s", __FUNCTION__);
|
||||
|
||||
bool vendorEnhanced = isRunningWithVendorEnhancedFramework();
|
||||
int vendorInfo = getVendorEnhancedInfo();
|
||||
bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo );
|
||||
setVendorEnhanced(vendorEnhanced);
|
||||
|
||||
#ifdef ARCH_ARM_32
|
||||
|
|
|
@ -57,29 +57,29 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||
|
||||
// for XTRA
|
||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||
switch(type)
|
||||
{
|
||||
case IAGnssRil::NetworkType::MOBILE:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
|
||||
typeout = loc_core::TYPE_MOBILE;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIFI:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
|
||||
typeout = loc_core::TYPE_WIFI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::MMS:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS;
|
||||
typeout = loc_core::TYPE_MMS;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::SUPL:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL;
|
||||
typeout = loc_core::TYPE_SUPL;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::DUN:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN;
|
||||
typeout = loc_core::TYPE_DUN;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::HIPRI:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI;
|
||||
typeout = loc_core::TYPE_HIPRI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIMAX:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
||||
typeout = loc_core::TYPE_WIMAX;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
|
@ -88,16 +88,16 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
|
|||
switch(networkType)
|
||||
{
|
||||
case NetworkType_BLUETOOTH:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH;
|
||||
typeout = loc_core::TYPE_BLUETOOTH;
|
||||
break;
|
||||
case NetworkType_ETHERNET:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET;
|
||||
typeout = loc_core::TYPE_ETHERNET;
|
||||
break;
|
||||
case NetworkType_PROXY:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY;
|
||||
typeout = loc_core::TYPE_PROXY;
|
||||
break;
|
||||
default:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||
typeout = loc_core::TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -110,12 +110,12 @@ Return<bool> AGnssRil::updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttr
|
|||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
if (nullptr != mGnss && (nullptr != mGnss->getGnssInterface())) {
|
||||
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||
int8_t typeout = loc_core::TYPE_UNKNOWN;
|
||||
bool roaming = false;
|
||||
if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_METERED) {
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
|
||||
typeout = loc_core::TYPE_WIFI;
|
||||
} else {
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
|
||||
typeout = loc_core::TYPE_MOBILE;
|
||||
}
|
||||
if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_ROAMING) {
|
||||
roaming = false;
|
||||
|
|
|
@ -48,7 +48,8 @@ int main() {
|
|||
|
||||
ALOGI("%s", __FUNCTION__);
|
||||
|
||||
bool vendorEnhanced = isRunningWithVendorEnhancedFramework();
|
||||
int vendorInfo = getVendorEnhancedInfo();
|
||||
bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo );
|
||||
setVendorEnhanced(vendorEnhanced);
|
||||
|
||||
#ifdef ARCH_ARM_32
|
||||
|
|
|
@ -12,6 +12,4 @@ else
|
|||
include $(DIR_LIST)/1.0/Android.mk
|
||||
endif #GNSS HIDL 1.1
|
||||
endif #GNSS HIDL 2.0
|
||||
else #QMAA flag set, build dummy android.hardware.gnss@1.0-impl-qti
|
||||
include $(LOCAL_PATH)/dummy/Android.mk
|
||||
endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
#build dummy android.hardware.gnss@2.0-impl-qti
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_SRC_FILES := GnssDummy.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
libhwbinder \
|
||||
libcutils \
|
||||
libutils \
|
||||
android.hardware.gnss@1.0 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@2.0-service-qti
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc
|
||||
LOCAL_SRC_FILES := \
|
||||
serviceDummy.cpp \
|
||||
|
||||
#LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
#LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libcutils \
|
||||
libdl \
|
||||
libbase \
|
||||
libutils \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libhwbinder \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
android.hardware.gnss@1.0 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_EXECUTABLE)
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "GnssDummy.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
Gnss::Gnss() {
|
||||
}
|
||||
|
||||
Gnss::~Gnss() {
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setCallback(const sp<V1_0::IGnssCallback>& /*callback*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::start() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::stop() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Return<void> Gnss::cleanup() {
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectLocation(double /*latitudeDegrees*/,
|
||||
double /*longitudeDegrees*/,
|
||||
float /*accuracyMeters*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectTime(int64_t /*timeMs*/, int64_t /*timeReferenceMs*/,
|
||||
int32_t /*uncertaintyMs*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Return<void> Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData /*aidingDataFlags*/) {
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode /*mode*/,
|
||||
V1_0::IGnss::GnssPositionRecurrence /*recurrence*/,
|
||||
uint32_t /*minIntervalMs*/,
|
||||
uint32_t /*preferredAccuracyMeters*/,
|
||||
uint32_t /*preferredTimeMs*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnss>> Gnss::getExtensionAGnss() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssNi>> Gnss::getExtensionGnssNi() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssBatching>> Gnss::getExtensionGnssBatching() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> Gnss::getExtensionGnssDebug() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IGnss* HIDL_FETCH_IGnss(const char* /*hal*/) {
|
||||
IGnss* iface = nullptr;
|
||||
iface = new Gnss();
|
||||
return iface;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssInterface"
|
||||
|
||||
#include <fstream>
|
||||
#include <dlfcn.h>
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/MQDescriptor.h>
|
||||
#include <hidl/Status.h>
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_memory;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
using ::android::hardware::gnss::V1_0::GnssLocation;
|
||||
|
||||
struct Gnss : public IGnss {
|
||||
Gnss();
|
||||
~Gnss();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
|
||||
* These declarations were generated from Gnss.hal.
|
||||
*/
|
||||
Return<bool> setCallback(const sp<V1_0::IGnssCallback>& callback) override;
|
||||
Return<bool> start() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
Return<bool> injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) override;
|
||||
Return<bool> injectTime(int64_t timeMs,
|
||||
int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) override;
|
||||
Return<void> deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
|
||||
Return<bool> setPositionMode(V1_0::IGnss::GnssPositionMode mode,
|
||||
V1_0::IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) override;
|
||||
Return<sp<V1_0::IAGnss>> getExtensionAGnss() override;
|
||||
Return<sp<V1_0::IGnssNi>> getExtensionGnssNi() override;
|
||||
Return<sp<V1_0::IGnssMeasurement>> getExtensionGnssMeasurement() override;
|
||||
Return<sp<V1_0::IGnssConfiguration>> getExtensionGnssConfiguration() override;
|
||||
Return<sp<V1_0::IGnssGeofencing>> getExtensionGnssGeofencing() override;
|
||||
Return<sp<V1_0::IGnssBatching>> getExtensionGnssBatching() override;
|
||||
|
||||
Return<sp<V1_0::IAGnssRil>> getExtensionAGnssRil() override;
|
||||
|
||||
inline Return<sp<V1_0::IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline Return<sp<V1_0::IGnssXtra>> getExtensionXtra() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
|
||||
};
|
||||
|
||||
extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti
|
||||
class hal
|
||||
user gps
|
||||
group system gps radio
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.gnss@1.0-service-qti"
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
|
||||
using android::hardware::gnss::V1_0::IGnss;
|
||||
using android::hardware::defaultPassthroughServiceImplementation;
|
||||
|
||||
int main() {
|
||||
ALOGI("%s", __FUNCTION__);
|
||||
return defaultPassthroughServiceImplementation<IGnss>();
|
||||
}
|
|
@ -154,7 +154,9 @@ bool LocAdapterBase::
|
|||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestNiNotifyEvent(const GnssNiNotification &/*notify*/, const void* /*data*/)
|
||||
requestNiNotifyEvent(const GnssNiNotification &/*notify*/,
|
||||
const void* /*data*/,
|
||||
const LocInEmergency emergencyState)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
|
|
|
@ -171,7 +171,8 @@ public:
|
|||
virtual bool requestATL(int connHandle, LocAGpsType agps_type,
|
||||
LocApnTypeMask apn_type_mask);
|
||||
virtual bool releaseATL(int connHandle);
|
||||
virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data);
|
||||
virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data,
|
||||
const LocInEmergency emergencyState);
|
||||
inline virtual bool isInSession() { return false; }
|
||||
ContextBase* getContext() const { return mContext; }
|
||||
virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements,
|
||||
|
|
|
@ -514,10 +514,14 @@ void LocApiBase::releaseATL(int connHandle)
|
|||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle));
|
||||
}
|
||||
|
||||
void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data)
|
||||
void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data,
|
||||
const LocInEmergency emergencyState)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data));
|
||||
TO_1ST_HANDLING_LOCADAPTERS(
|
||||
mLocAdapters[i]->requestNiNotifyEvent(notify,
|
||||
data,
|
||||
emergencyState));
|
||||
}
|
||||
|
||||
void* LocApiBase :: getSibling()
|
||||
|
|
|
@ -177,7 +177,8 @@ public:
|
|||
void requestLocation();
|
||||
void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask);
|
||||
void releaseATL(int connHandle);
|
||||
void requestNiNotify(GnssNiNotification ¬ify, const void* data);
|
||||
void requestNiNotify(GnssNiNotification ¬ify, const void* data,
|
||||
const LocInEmergency emergencyState);
|
||||
void reportGnssMeasurements(GnssMeasurements& gnssMeasurements, int msInWeek);
|
||||
void reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||
void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended,
|
||||
|
|
|
@ -501,19 +501,67 @@ public:
|
|||
mType = itemBase.getType();
|
||||
}
|
||||
inline bool equals(const SystemStatusNetworkInfo& peer) {
|
||||
return (mAllTypes == peer.mAllTypes);
|
||||
for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
|
||||
if (!(mAllNetworkHandles[i] == peer.mAllNetworkHandles[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
|
||||
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;
|
||||
uint64_t networkHandle =
|
||||
(static_cast<SystemStatusNetworkInfo&>(curInfo)).mNetworkHandle;
|
||||
int32_t type = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mType;
|
||||
// Replace current with cached table for now and then update
|
||||
memcpy(mAllNetworkHandles,
|
||||
(static_cast<SystemStatusNetworkInfo&>(curInfo)).getNetworkHandle(),
|
||||
sizeof(mAllNetworkHandles));
|
||||
if (mConnected) {
|
||||
mAllTypes |= allTypes;
|
||||
mAllNetworkHandles[type] = networkHandle;
|
||||
for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
|
||||
if (mNetworkHandle == mAllNetworkHandles[i].networkHandle) {
|
||||
LOC_LOGD("collate duplicate detected, not updating");
|
||||
break;
|
||||
}
|
||||
if (NETWORK_HANDLE_UNKNOWN == mAllNetworkHandles[i].networkHandle) {
|
||||
mAllNetworkHandles[i].networkHandle = mNetworkHandle;
|
||||
mAllNetworkHandles[i].networkType = (loc_core::NetworkType) mType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (0 != mAllTypes) {
|
||||
mAllTypes = (allTypes & (~mAllTypes));
|
||||
mAllNetworkHandles[type] = NETWORK_HANDLE_UNKNOWN;
|
||||
uint8_t deletedIndex = MAX_NETWORK_HANDLES;
|
||||
uint8_t lastValidIndex = 0;
|
||||
uint8_t typeCount = 0;
|
||||
for (; lastValidIndex < MAX_NETWORK_HANDLES &&
|
||||
NETWORK_HANDLE_UNKNOWN != mAllNetworkHandles[lastValidIndex].networkHandle;
|
||||
++lastValidIndex) {
|
||||
// Maintain count for number of network handles still
|
||||
// connected for given type
|
||||
if (mType == mAllNetworkHandles[lastValidIndex].networkType) {
|
||||
typeCount++;
|
||||
}
|
||||
|
||||
if (mNetworkHandle == mAllNetworkHandles[lastValidIndex].networkHandle) {
|
||||
deletedIndex = lastValidIndex;
|
||||
typeCount--;
|
||||
}
|
||||
}
|
||||
|
||||
if (MAX_NETWORK_HANDLES != deletedIndex) {
|
||||
LOC_LOGD("deletedIndex:%u, lastValidIndex:%u, typeCount:%u",
|
||||
deletedIndex, lastValidIndex, typeCount);
|
||||
mAllNetworkHandles[deletedIndex] = mAllNetworkHandles[lastValidIndex];
|
||||
mAllNetworkHandles[lastValidIndex].networkHandle = NETWORK_HANDLE_UNKNOWN;
|
||||
mAllNetworkHandles[lastValidIndex].networkType = TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
// If no more handles of given type, set bitmask
|
||||
if (0 == typeCount) {
|
||||
mAllTypes = (allTypes & (~mAllTypes));
|
||||
LOC_LOGD("mAllTypes:%" PRIx64, mAllTypes);
|
||||
}
|
||||
} // else (mConnected == false && mAllTypes == 0)
|
||||
// we keep mAllTypes as 0, which means no more connections.
|
||||
|
||||
|
|
|
@ -32,9 +32,11 @@
|
|||
|
||||
#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
|
||||
|
@ -42,10 +44,68 @@
|
|||
#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):
|
||||
|
@ -222,19 +282,6 @@ protected:
|
|||
|
||||
class NetworkInfoDataItemBase : public IDataItemCore {
|
||||
public:
|
||||
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,
|
||||
};
|
||||
NetworkInfoDataItemBase(
|
||||
NetworkType initialType, int32_t type, string typeName, string subTypeName,
|
||||
bool available, bool connected, bool roaming, uint64_t networkHandle ):
|
||||
|
@ -247,9 +294,8 @@ public:
|
|||
mRoaming(roaming),
|
||||
mNetworkHandle(networkHandle),
|
||||
mId(NETWORKINFO_DATA_ITEM_ID) {
|
||||
memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN,
|
||||
sizeof (mAllNetworkHandles));
|
||||
mAllNetworkHandles[initialType] = networkHandle;
|
||||
mAllNetworkHandles[0].networkHandle = networkHandle;
|
||||
mAllNetworkHandles[0].networkType = initialType;
|
||||
}
|
||||
virtual ~NetworkInfoDataItemBase() {}
|
||||
inline virtual DataItemId getId() { return mId; }
|
||||
|
@ -259,8 +305,8 @@ public:
|
|||
return (NetworkType)mType;
|
||||
}
|
||||
inline uint64_t getAllTypes() { return mAllTypes; }
|
||||
inline uint64_t getNetworkHandle(NetworkType type) {
|
||||
return mAllNetworkHandles[type];
|
||||
inline NetworkInfoType* getNetworkHandle() {
|
||||
return &mAllNetworkHandles[0];
|
||||
}
|
||||
// Data members
|
||||
uint64_t mAllTypes;
|
||||
|
@ -270,7 +316,7 @@ public:
|
|||
bool mAvailable;
|
||||
bool mConnected;
|
||||
bool mRoaming;
|
||||
uint64_t mAllNetworkHandles[TYPE_UNKNOWN + 1];
|
||||
NetworkInfoType mAllNetworkHandles[MAX_NETWORK_HANDLES];
|
||||
uint64_t mNetworkHandle;
|
||||
protected:
|
||||
DataItemId mId;
|
||||
|
|
|
@ -666,154 +666,144 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type)
|
|||
}
|
||||
if (LOC_AGPS_SUPL_SERVER != type && LOC_AGPS_MO_SUPL_SERVER != type) {
|
||||
LOC_LOGe("Invalid type=%d", type);
|
||||
} else {
|
||||
string& url = (LOC_AGPS_SUPL_SERVER == type) ? getServerUrl() : getMoServerUrl();
|
||||
if (length >= 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) {
|
||||
url.assign(serverUrl);
|
||||
|
||||
if (LOC_AGPS_SUPL_SERVER == type) {
|
||||
strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING);
|
||||
ContextBase::mGps_conf.SUPL_PORT = port;
|
||||
} else if (length >= 0) {
|
||||
if (LOC_AGPS_SUPL_SERVER == type) {
|
||||
getServerUrl().assign(serverUrl);
|
||||
strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING);
|
||||
ContextBase::mGps_conf.SUPL_PORT = port;
|
||||
} else {
|
||||
if (strncasecmp(getMoServerUrl().c_str(), serverUrl, sizeof(serverUrl)) != 0) {
|
||||
getMoServerUrl().assign(serverUrl);
|
||||
}
|
||||
|
||||
LOC_LOGv("serverUrl=%s length=%d type=%d", serverUrl, length, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GnssAdapter::setConfigCommand()
|
||||
GnssAdapter::setConfig()
|
||||
{
|
||||
LOC_LOGD("%s]: ", __func__);
|
||||
|
||||
struct MsgSetConfig : public LocMsg {
|
||||
GnssAdapter& mAdapter;
|
||||
LocApiBase& mApi;
|
||||
inline MsgSetConfig(GnssAdapter& adapter, LocApiBase& api) :
|
||||
LocMsg(),
|
||||
mAdapter(adapter),
|
||||
mApi(api) {}
|
||||
inline virtual void proc() const {
|
||||
if (!mAdapter.isEngineCapabilitiesKnown()) {
|
||||
mAdapter.mPendingMsgs.push_back(new MsgSetConfig(*this));
|
||||
return;
|
||||
// set nmea mask type
|
||||
uint32_t mask = 0;
|
||||
if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) {
|
||||
mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
|
||||
mask |= LOC_NMEA_MASK_DEBUG_V02;
|
||||
}
|
||||
if (mNmeaMask != mask) {
|
||||
mNmeaMask = mask;
|
||||
if (mNmeaMask) {
|
||||
for (auto it=mClientData.begin(); it != mClientData.end(); ++it) {
|
||||
if ((it->second.gnssNmeaCb != nullptr)) {
|
||||
updateEvtMask(LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT,
|
||||
LOC_REGISTRATION_MASK_ENABLED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// set nmea mask type
|
||||
uint32_t mask = 0;
|
||||
if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) {
|
||||
mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
|
||||
mask |= LOC_NMEA_MASK_DEBUG_V02;
|
||||
}
|
||||
mAdapter.mNmeaMask= mask;
|
||||
|
||||
std::string oldServerUrl = mAdapter.getServerUrl();
|
||||
std::string oldMoServerUrl = mAdapter.getMoServerUrl();
|
||||
mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST,
|
||||
ContextBase::mGps_conf.SUPL_PORT,
|
||||
LOC_AGPS_SUPL_SERVER);
|
||||
mAdapter.setSuplHostServer(ContextBase::mGps_conf.MO_SUPL_HOST,
|
||||
ContextBase::mGps_conf.MO_SUPL_PORT,
|
||||
LOC_AGPS_MO_SUPL_SERVER);
|
||||
|
||||
// inject the configurations into modem
|
||||
GnssAdapter& adapter = mAdapter;
|
||||
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
|
||||
loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf;
|
||||
|
||||
//cache the injected configuration with GnssConfigRequested struct
|
||||
GnssConfig gnssConfigRequested = {};
|
||||
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
|
||||
gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK;
|
||||
|
||||
if (gpsConf.AGPS_CONFIG_INJECT) {
|
||||
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
gnssConfigRequested.suplVersion =
|
||||
adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER);
|
||||
gnssConfigRequested.lppProfile =
|
||||
adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE);
|
||||
gnssConfigRequested.aGlonassPositionProtocolMask =
|
||||
gpsConf.A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
}
|
||||
gnssConfigRequested.lppeControlPlaneMask =
|
||||
adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY);
|
||||
gnssConfigRequested.lppeUserPlaneMask =
|
||||
adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY);
|
||||
gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(),
|
||||
adapter.mBlacklistedSvIds.end());
|
||||
mApi.sendMsg(new LocApiMsg(
|
||||
[&adapter, gpsConf, sapConf, oldServerUrl,
|
||||
oldMoServerUrl, gnssConfigRequested] () {
|
||||
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
|
||||
gnssConfigRequested);
|
||||
|
||||
// set nmea mask type
|
||||
uint32_t mask = 0;
|
||||
if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) {
|
||||
mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
|
||||
mask |= LOC_NMEA_MASK_DEBUG_V02;
|
||||
}
|
||||
|
||||
if (mask != 0) {
|
||||
adapter.mLocApi->setNMEATypesSync(mask);
|
||||
}
|
||||
|
||||
adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK);
|
||||
|
||||
adapter.mLocApi->setConstrainedTuncMode(
|
||||
gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1,
|
||||
(float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD,
|
||||
gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET);
|
||||
adapter.mLocApi->setPositionAssistedClockEstimatorMode(
|
||||
gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1);
|
||||
|
||||
if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID ||
|
||||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) {
|
||||
adapter.mLocApi->setSensorPropertiesSync(
|
||||
sapConf.GYRO_BIAS_RANDOM_WALK_VALID,
|
||||
sapConf.GYRO_BIAS_RANDOM_WALK,
|
||||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY);
|
||||
}
|
||||
adapter.mLocApi->setSensorPerfControlConfigSync(
|
||||
sapConf.SENSOR_CONTROL_MODE,
|
||||
sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH,
|
||||
sapConf.SENSOR_ACCEL_BATCHES_PER_SEC,
|
||||
sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH,
|
||||
sapConf.SENSOR_GYRO_BATCHES_PER_SEC,
|
||||
sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH,
|
||||
sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH,
|
||||
sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH,
|
||||
sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH,
|
||||
sapConf.SENSOR_ALGORITHM_CONFIG_MASK);
|
||||
} ));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
std::string oldMoServerUrl = getMoServerUrl();
|
||||
setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST,
|
||||
ContextBase::mGps_conf.SUPL_PORT,
|
||||
LOC_AGPS_SUPL_SERVER);
|
||||
setSuplHostServer(ContextBase::mGps_conf.MO_SUPL_HOST,
|
||||
ContextBase::mGps_conf.MO_SUPL_PORT,
|
||||
LOC_AGPS_MO_SUPL_SERVER);
|
||||
|
||||
// inject the configurations into modem
|
||||
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
|
||||
loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf;
|
||||
|
||||
//cache the injected configuration with GnssConfigRequested struct
|
||||
GnssConfig gnssConfigRequested = {};
|
||||
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
|
||||
gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK;
|
||||
|
||||
if (gpsConf.AGPS_CONFIG_INJECT) {
|
||||
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT |
|
||||
GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
gnssConfigRequested.suplVersion =
|
||||
mLocApi->convertSuplVersion(gpsConf.SUPL_VER);
|
||||
gnssConfigRequested.lppProfile =
|
||||
mLocApi->convertLppProfile(gpsConf.LPP_PROFILE);
|
||||
gnssConfigRequested.aGlonassPositionProtocolMask =
|
||||
gpsConf.A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
}
|
||||
gnssConfigRequested.lppeControlPlaneMask =
|
||||
mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY);
|
||||
gnssConfigRequested.lppeUserPlaneMask =
|
||||
mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY);
|
||||
gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(),
|
||||
mBlacklistedSvIds.end());
|
||||
mLocApi->sendMsg(new LocApiMsg(
|
||||
[this, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () {
|
||||
gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested);
|
||||
|
||||
// set nmea mask type
|
||||
uint32_t mask = 0;
|
||||
if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) {
|
||||
mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK;
|
||||
}
|
||||
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
|
||||
mask |= LOC_NMEA_MASK_DEBUG_V02;
|
||||
}
|
||||
|
||||
if (mask != 0) {
|
||||
mLocApi->setNMEATypesSync(mask);
|
||||
}
|
||||
|
||||
mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK);
|
||||
|
||||
mLocApi->setConstrainedTuncMode(
|
||||
gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1,
|
||||
(float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD,
|
||||
gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET);
|
||||
mLocApi->setPositionAssistedClockEstimatorMode(
|
||||
gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1);
|
||||
|
||||
if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID ||
|
||||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) {
|
||||
mLocApi->setSensorPropertiesSync(
|
||||
sapConf.GYRO_BIAS_RANDOM_WALK_VALID,
|
||||
sapConf.GYRO_BIAS_RANDOM_WALK,
|
||||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY);
|
||||
}
|
||||
mLocApi->setSensorPerfControlConfigSync(
|
||||
sapConf.SENSOR_CONTROL_MODE,
|
||||
sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH,
|
||||
sapConf.SENSOR_ACCEL_BATCHES_PER_SEC,
|
||||
sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH,
|
||||
sapConf.SENSOR_GYRO_BATCHES_PER_SEC,
|
||||
sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH,
|
||||
sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH,
|
||||
sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH,
|
||||
sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH,
|
||||
sapConf.SENSOR_ALGORITHM_CONFIG_MASK);
|
||||
} ));
|
||||
|
||||
sendMsg(new MsgSetConfig(*this, *mLocApi));
|
||||
}
|
||||
|
||||
std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldServerUrl,
|
||||
const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested,
|
||||
std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl,
|
||||
const GnssConfig& gnssConfigRequested,
|
||||
const GnssConfig& gnssConfigNeedEngineUpdate, size_t count) {
|
||||
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
|
||||
size_t index = 0;
|
||||
|
@ -846,13 +836,10 @@ std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldS
|
|||
GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||
if (gnssConfigNeedEngineUpdate.assistanceServer.type ==
|
||||
GNSS_ASSISTANCE_TYPE_SUPL) {
|
||||
if (0 != oldServerUrl.compare(serverUrl)) {
|
||||
|
||||
err = mLocApi->setServerSync(
|
||||
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
|
||||
if (index < count) {
|
||||
errsList[index] = err;
|
||||
}
|
||||
err = mLocApi->setServerSync(
|
||||
serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER);
|
||||
if (index < count) {
|
||||
errsList[index] = err;
|
||||
}
|
||||
if (0 != oldMoServerUrl.compare(moServerUrl)) {
|
||||
LocationError locErr =
|
||||
|
@ -1069,7 +1056,6 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
|||
size_t countOfConfigs = mCount;
|
||||
GnssConfig gnssConfigRequested = mConfig;
|
||||
GnssConfig gnssConfigNeedEngineUpdate = mConfig;
|
||||
std::string oldServerUrl = mAdapter.getServerUrl();
|
||||
|
||||
std::vector<uint32_t> sessionIds;
|
||||
sessionIds.assign(mIds, mIds + mCount);
|
||||
|
@ -1162,11 +1148,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
|||
|
||||
mApi.sendMsg(new LocApiMsg(
|
||||
[&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate,
|
||||
countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () {
|
||||
std::string serverUrl = adapter.getServerUrl();
|
||||
int serverUrlLen = serverUrl.length();
|
||||
std::vector<LocationError> errsList = adapter.gnssUpdateConfig(oldServerUrl,
|
||||
"", gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
|
||||
countOfConfigs, configCollectiveResponse, errs] () {
|
||||
std::vector<LocationError> errsList = adapter.gnssUpdateConfig("",
|
||||
gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
|
||||
|
||||
configCollectiveResponse->returnToSender(errsList);
|
||||
}));
|
||||
|
@ -2086,6 +2070,8 @@ GnssAdapter::handleEngineUpEvent()
|
|||
virtual void proc() const {
|
||||
mAdapter.setEngineCapabilitiesKnown(true);
|
||||
mAdapter.broadcastCapabilities(mAdapter.getCapabilities());
|
||||
// must be called only after capabilities are known
|
||||
mAdapter.setConfig();
|
||||
mAdapter.restartSessions();
|
||||
mAdapter.gnssSvIdConfigUpdate();
|
||||
mAdapter.gnssSvTypeConfigUpdate();
|
||||
|
@ -2097,7 +2083,6 @@ GnssAdapter::handleEngineUpEvent()
|
|||
};
|
||||
|
||||
readConfigCommand();
|
||||
setConfigCommand();
|
||||
sendMsg(new MsgHandleEngineUpEvent(*this));
|
||||
}
|
||||
|
||||
|
@ -3508,7 +3493,8 @@ GnssAdapter::reportData(GnssDataNotification& dataNotify)
|
|||
}
|
||||
|
||||
bool
|
||||
GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data)
|
||||
GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data,
|
||||
const LocInEmergency emergencyState)
|
||||
{
|
||||
LOC_LOGI("%s]: notif_type: %d, timeout: %d, default_resp: %d"
|
||||
"requestor_id: %s (encoding: %d) text: %s text (encoding: %d) extras: %s",
|
||||
|
@ -3521,37 +3507,49 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void*
|
|||
LocApiBase& mApi;
|
||||
const GnssNiNotification mNotify;
|
||||
const void* mData;
|
||||
const LocInEmergency mEmergencyState;
|
||||
inline MsgReportNiNotify(GnssAdapter& adapter,
|
||||
LocApiBase& api,
|
||||
const GnssNiNotification& notify,
|
||||
const void* data) :
|
||||
const void* data,
|
||||
const LocInEmergency emergencyState) :
|
||||
LocMsg(),
|
||||
mAdapter(adapter),
|
||||
mApi(api),
|
||||
mNotify(notify),
|
||||
mData(data) {}
|
||||
mData(data),
|
||||
mEmergencyState(emergencyState) {}
|
||||
inline virtual void proc() const {
|
||||
bool bIsInEmergency = false;
|
||||
bool bInformNiAccept = false;
|
||||
|
||||
bIsInEmergency = ((LOC_IN_EMERGENCY_UNKNOWN == mEmergencyState) &&
|
||||
mAdapter.getE911State()) || // older modems
|
||||
(LOC_IN_EMERGENCY_SET == mEmergencyState); // newer modems
|
||||
|
||||
if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) {
|
||||
if (mAdapter.getE911State() ||
|
||||
(GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES)) {
|
||||
mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
|
||||
bInformNiAccept = bIsInEmergency ||
|
||||
(GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES);
|
||||
|
||||
if (bInformNiAccept) {
|
||||
mAdapter.requestNiNotify(mNotify, mData, bInformNiAccept);
|
||||
} else {
|
||||
mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData);
|
||||
}
|
||||
} else if (GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) {
|
||||
if (mAdapter.getE911State() &&
|
||||
(1 == ContextBase::mGps_conf.CP_MTLR_ES)) {
|
||||
if (bIsInEmergency && (1 == ContextBase::mGps_conf.CP_MTLR_ES)) {
|
||||
mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
|
||||
} else {
|
||||
mAdapter.requestNiNotify(mNotify, mData);
|
||||
}
|
||||
else {
|
||||
mAdapter.requestNiNotify(mNotify, mData, false);
|
||||
}
|
||||
} else {
|
||||
mAdapter.requestNiNotify(mNotify, mData);
|
||||
mAdapter.requestNiNotify(mNotify, mData, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sendMsg(new MsgReportNiNotify(*this, *mLocApi, notify, data));
|
||||
sendMsg(new MsgReportNiNotify(*this, *mLocApi, notify, data, emergencyState));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -3674,7 +3672,8 @@ static void* niThreadProc(void *args)
|
|||
}
|
||||
|
||||
bool
|
||||
GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data)
|
||||
GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data,
|
||||
const bool bInformNiAccept)
|
||||
{
|
||||
NiSession* pSession = NULL;
|
||||
gnssNiCallback gnssNiCb = nullptr;
|
||||
|
@ -3686,6 +3685,20 @@ GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data)
|
|||
}
|
||||
}
|
||||
if (nullptr == gnssNiCb) {
|
||||
if (GNSS_NI_TYPE_EMERGENCY_SUPL == notify.type) {
|
||||
if (bInformNiAccept) {
|
||||
mLocApi->informNiResponse(GNSS_NI_RESPONSE_ACCEPT, data);
|
||||
NiData& niData = getNiData();
|
||||
// ignore any SUPL NI non-Es session if a SUPL NI ES is accepted
|
||||
if (NULL != niData.session.rawRequest) {
|
||||
pthread_mutex_lock(&niData.session.tLock);
|
||||
niData.session.resp = GNSS_NI_RESPONSE_IGNORE;
|
||||
niData.session.respRecvd = true;
|
||||
pthread_cond_signal(&niData.session.tCond);
|
||||
pthread_mutex_unlock(&niData.session.tLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
EXIT_LOG(%s, "no clients with gnssNiCb.");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -281,7 +281,6 @@ public:
|
|||
void disableCommand(uint32_t id);
|
||||
void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks);
|
||||
void readConfigCommand();
|
||||
void setConfigCommand();
|
||||
void requestUlpCommand();
|
||||
void initEngHubProxyCommand();
|
||||
uint32_t* gnssUpdateConfigCommand(GnssConfig config);
|
||||
|
@ -289,8 +288,8 @@ public:
|
|||
uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data);
|
||||
void deleteAidingData(const GnssAidingData &data, uint32_t sessionId);
|
||||
void gnssUpdateXtraThrottleCommand(const bool enabled);
|
||||
std::vector<LocationError> gnssUpdateConfig(const std::string& oldServerUrl,
|
||||
const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested,
|
||||
std::vector<LocationError> gnssUpdateConfig(const std::string& oldMoServerUrl,
|
||||
const GnssConfig& gnssConfigRequested,
|
||||
const GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0);
|
||||
|
||||
/* ==== GNSS SV TYPE CONFIG ============================================================ */
|
||||
|
@ -313,6 +312,7 @@ public:
|
|||
{ mGnssSvTypeConfigCb = callback; }
|
||||
inline GnssSvTypeConfigCallback gnssGetSvTypeConfigCallback()
|
||||
{ return mGnssSvTypeConfigCb; }
|
||||
void setConfig();
|
||||
|
||||
/* ========= AGPS ====================================================================== */
|
||||
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
|
||||
|
@ -359,7 +359,8 @@ public:
|
|||
bool fromEngineHub=false);
|
||||
virtual void reportNmeaEvent(const char* nmea, size_t length);
|
||||
virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek);
|
||||
virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data);
|
||||
virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data,
|
||||
const LocInEmergency emergencyState);
|
||||
virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements,
|
||||
int msInWeek);
|
||||
virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial);
|
||||
|
@ -389,7 +390,8 @@ public:
|
|||
void reportSv(GnssSvNotification& svNotify);
|
||||
void reportNmea(const char* nmea, size_t length);
|
||||
void reportData(GnssDataNotification& dataNotify);
|
||||
bool requestNiNotify(const GnssNiNotification& notify, const void* data);
|
||||
bool requestNiNotify(const GnssNiNotification& notify, const void* data,
|
||||
const bool bInformNiAccept);
|
||||
void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements);
|
||||
void reportGnssSvIdConfig(const GnssSvIdConfig& config);
|
||||
void reportGnssSvTypeConfig(const GnssSvTypeConfig& config);
|
||||
|
|
|
@ -129,19 +129,33 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) {
|
|||
}
|
||||
|
||||
bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections,
|
||||
uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle) {
|
||||
NetworkInfoType* networkHandleInfo) {
|
||||
mIsConnectivityStatusKnown = true;
|
||||
mConnections = allConnections;
|
||||
mWifiNetworkHandle = wifiNetworkHandle;
|
||||
mMobileNetworkHandle = mobileNetworkHandle;
|
||||
|
||||
LOC_LOGd("updateConnections mConnections:%" PRIx64, mConnections);
|
||||
for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) {
|
||||
mNetworkHandle[i] = networkHandleInfo[i];
|
||||
LOC_LOGd("updateConnections [%d] networkHandle:%" PRIx64 " networkType:%u",
|
||||
i, mNetworkHandle[i].networkHandle, mNetworkHandle[i].networkType);
|
||||
}
|
||||
|
||||
if (!mReqStatusReceived) {
|
||||
return true;
|
||||
}
|
||||
|
||||
stringstream ss;
|
||||
ss << "connection" << endl << mConnections << endl << wifiNetworkHandle
|
||||
<< endl << mobileNetworkHandle;
|
||||
ss << "connection" << endl << mConnections << endl
|
||||
<< mNetworkHandle[0].toString() << endl
|
||||
<< mNetworkHandle[1].toString() << endl
|
||||
<< mNetworkHandle[2].toString() << endl
|
||||
<< mNetworkHandle[3].toString() << endl
|
||||
<< mNetworkHandle[4].toString() << endl
|
||||
<< mNetworkHandle[5].toString() << endl
|
||||
<< mNetworkHandle[6].toString() << endl
|
||||
<< mNetworkHandle[7].toString() << endl
|
||||
<< mNetworkHandle[8].toString() << endl
|
||||
<< mNetworkHandle[MAX_NETWORK_HANDLES-1].toString();
|
||||
string s = ss.str();
|
||||
return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) );
|
||||
}
|
||||
|
@ -200,7 +214,16 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate
|
|||
ss << "respondStatus" << endl;
|
||||
(mGpsLock == -1 ? ss : ss << mGpsLock) << endl;
|
||||
(mConnections == (uint64_t)~0 ? ss : ss << mConnections) << endl
|
||||
<< mWifiNetworkHandle << endl << mMobileNetworkHandle << endl
|
||||
<< mNetworkHandle[0].toString() << endl
|
||||
<< mNetworkHandle[1].toString() << endl
|
||||
<< mNetworkHandle[2].toString() << endl
|
||||
<< mNetworkHandle[3].toString() << endl
|
||||
<< mNetworkHandle[4].toString() << endl
|
||||
<< mNetworkHandle[5].toString() << endl
|
||||
<< mNetworkHandle[6].toString() << endl
|
||||
<< mNetworkHandle[7].toString() << endl
|
||||
<< mNetworkHandle[8].toString() << endl
|
||||
<< mNetworkHandle[MAX_NETWORK_HANDLES-1].toString() << endl
|
||||
<< mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown;
|
||||
|
||||
string s = ss.str();
|
||||
|
@ -272,11 +295,10 @@ void XtraSystemStatusObserver::notify(const list<IDataItemCore*>& dlist)
|
|||
{
|
||||
NetworkInfoDataItemBase* networkInfo =
|
||||
static_cast<NetworkInfoDataItemBase*>(each);
|
||||
NetworkInfoType* networkHandleInfo =
|
||||
static_cast<NetworkInfoType*>(networkInfo->getNetworkHandle());
|
||||
mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(),
|
||||
(NetworkHandle) networkInfo->getNetworkHandle(
|
||||
loc_core::NetworkInfoDataItemBase::TYPE_WIFI),
|
||||
(NetworkHandle) networkInfo->getNetworkHandle(
|
||||
loc_core::NetworkInfoDataItemBase::TYPE_MOBILE));
|
||||
networkHandleInfo);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public :
|
|||
|
||||
bool updateLockStatus(GnssConfigGpsLock lock);
|
||||
bool updateConnections(uint64_t allConnections,
|
||||
uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle);
|
||||
loc_core::NetworkInfoType* networkHandleInfo);
|
||||
bool updateTac(const string& tac);
|
||||
bool updateMccMnc(const string& mccmnc);
|
||||
bool updateXtraThrottle(const bool enabled);
|
||||
|
@ -69,8 +69,7 @@ private:
|
|||
GnssConfigGpsLock mGpsLock;
|
||||
LocIpc mIpc;
|
||||
uint64_t mConnections;
|
||||
uint64_t mWifiNetworkHandle;
|
||||
uint64_t mMobileNetworkHandle;
|
||||
loc_core::NetworkInfoType mNetworkHandle[MAX_NETWORK_HANDLES];
|
||||
string mTac;
|
||||
string mMccmnc;
|
||||
bool mXtraThrottle;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# Flags from BoardConfigVendor.mk
|
||||
ifneq ($(TARGET_USES_QMAA),true)
|
||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
|
||||
else ifneq ($(TARGET_USES_QMAA_OVERRIDE_GPS),false)
|
||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
|
||||
endif
|
||||
|
||||
|
|
|
@ -457,6 +457,12 @@ typedef enum {
|
|||
LOC_RELIABILITY_HIGH = 4
|
||||
}LocReliability;
|
||||
|
||||
typedef enum {
|
||||
LOC_IN_EMERGENCY_UNKNOWN = 0,
|
||||
LOC_IN_EMERGENCY_SET = 1,
|
||||
LOC_IN_EMERGENCY_NOT_SET = 2
|
||||
}LocInEmergency;
|
||||
|
||||
typedef struct {
|
||||
struct timespec32_t apTimeStamp;
|
||||
/*boottime received from pps-ktimer*/
|
||||
|
@ -637,10 +643,12 @@ typedef uint16_t GnssSvPolyStatusMask;
|
|||
#define GNSS_SV_POLY_SRC_ALM_CORR_V02 ((GnssSvPolyStatusMask)0x01)
|
||||
#define GNSS_SV_POLY_GLO_STR4_V02 ((GnssSvPolyStatusMask)0x02)
|
||||
#define GNSS_SV_POLY_DELETE_V02 ((GnssSvPolyStatusMask)0x04)
|
||||
#define GNSS_SV_POLY_SRC_GAL_FNAV_OR_INAV_V02 ((GnssSvPolyStatusMask)0x08)
|
||||
typedef uint16_t GnssSvPolyStatusMaskValidity;
|
||||
#define GNSS_SV_POLY_SRC_ALM_CORR_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x01)
|
||||
#define GNSS_SV_POLY_GLO_STR4_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x02)
|
||||
#define GNSS_SV_POLY_DELETE_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x04)
|
||||
#define GNSS_SV_POLY_SRC_GAL_FNAV_OR_INAV_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x08)
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
@ -1026,9 +1034,19 @@ enum ulp_gnss_sv_poly_valid_flags{
|
|||
ULP_GNSS_SV_POLY_ELEVATIONUNC,
|
||||
ULP_GNSS_SV_POLY_VELO_COEFF,
|
||||
ULP_GNSS_SV_POLY_ENHANCED_IOD,
|
||||
|
||||
ULP_GNSS_SV_POLY_VALID_FLAGS
|
||||
|
||||
ULP_GNSS_SV_POLY_GPS_ISC_L1CA,
|
||||
ULP_GNSS_SV_POLY_GPS_ISC_L2C,
|
||||
ULP_GNSS_SV_POLY_GPS_ISC_L5I5,
|
||||
ULP_GNSS_SV_POLY_GPS_ISC_L5Q5,
|
||||
ULP_GNSS_SV_POLY_GPS_TGD,
|
||||
ULP_GNSS_SV_POLY_GLO_TGD_G1G2,
|
||||
ULP_GNSS_SV_POLY_BDS_TGD_B1,
|
||||
ULP_GNSS_SV_POLY_BDS_TGD_B2,
|
||||
ULP_GNSS_SV_POLY_BDS_TGD_B2A,
|
||||
ULP_GNSS_SV_POLY_BDS_ISC_B2A,
|
||||
ULP_GNSS_SV_POLY_GAL_BGD_E1E5A,
|
||||
ULP_GNSS_SV_POLY_GAL_BGD_E1E5B,
|
||||
ULP_GNSS_SV_POLY_NAVIC_TGD_L5
|
||||
};
|
||||
|
||||
#define ULP_GNSS_SV_POLY_BIT_GLO_FREQ (1<<ULP_GNSS_SV_POLY_GLO_FREQ)
|
||||
|
@ -1049,6 +1067,19 @@ enum ulp_gnss_sv_poly_valid_flags{
|
|||
#define ULP_GNSS_SV_POLY_BIT_ELEVATIONUNC (1<<ULP_GNSS_SV_POLY_ELEVATIONUNC)
|
||||
#define ULP_GNSS_SV_POLY_BIT_VELO_COEFF (1<<ULP_GNSS_SV_POLY_VELO_COEFF)
|
||||
#define ULP_GNSS_SV_POLY_BIT_ENHANCED_IOD (1<<ULP_GNSS_SV_POLY_ENHANCED_IOD)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GPS_ISC_L1CA (1<<ULP_GNSS_SV_POLY_GPS_ISC_L1CA)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GPS_ISC_L2C (1<<ULP_GNSS_SV_POLY_GPS_ISC_L2C)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GPS_ISC_L5I5 (1<<ULP_GNSS_SV_POLY_GPS_ISC_L5I5)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GPS_ISC_L5Q5 (1<<ULP_GNSS_SV_POLY_GPS_ISC_L5Q5)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GPS_TGD (1<<ULP_GNSS_SV_POLY_GPS_TGD)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GLO_TGD_G1G2 (1<<ULP_GNSS_SV_POLY_GLO_TGD_G1G2)
|
||||
#define ULP_GNSS_SV_POLY_BIT_BDS_TGD_B1 (1<<ULP_GNSS_SV_POLY_BDS_TGD_B1)
|
||||
#define ULP_GNSS_SV_POLY_BIT_BDS_TGD_B2 (1<<ULP_GNSS_SV_POLY_BDS_TGD_B2)
|
||||
#define ULP_GNSS_SV_POLY_BIT_BDS_TGD_B2A (1<<ULP_GNSS_SV_POLY_BDS_TGD_B2A)
|
||||
#define ULP_GNSS_SV_POLY_BIT_BDS_ISC_B2A (1<<ULP_GNSS_SV_POLY_BDS_ISC_B2A)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GAL_BGD_E1E5A (1<<ULP_GNSS_SV_POLY_GAL_BGD_E1E5A)
|
||||
#define ULP_GNSS_SV_POLY_BIT_GAL_BGD_E1E5B (1<<ULP_GNSS_SV_POLY_GAL_BGD_E1E5B)
|
||||
#define ULP_GNSS_SV_POLY_BIT_NAVIC_TGD_L5 (1<<ULP_GNSS_SV_POLY_NAVIC_TGD_L5)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -1521,6 +1552,19 @@ typedef struct
|
|||
double velCoef[GNSS_SV_POLY_VELOCITY_COEF_MAX_SIZE];
|
||||
/* Coefficients of velocity poly */
|
||||
uint32_t enhancedIOD; /* Enhanced Reference Time */
|
||||
float gpsIscL1ca;
|
||||
float gpsIscL2c;
|
||||
float gpsIscL5I5;
|
||||
float gpsIscL5Q5;
|
||||
float gpsTgd;
|
||||
float gloTgdG1G2;
|
||||
float bdsTgdB1;
|
||||
float bdsTgdB2;
|
||||
float bdsTgdB2a;
|
||||
float bdsIscB2a;
|
||||
float galBgdE1E5a;
|
||||
float galBgdE1E5b;
|
||||
float navicTgdL5;
|
||||
} GnssSvPolynomial;
|
||||
|
||||
typedef enum {
|
||||
|
@ -2196,6 +2240,7 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void*
|
|||
|
||||
typedef uint64_t NetworkHandle;
|
||||
#define NETWORK_HANDLE_UNKNOWN ~0
|
||||
#define MAX_NETWORK_HANDLES 10
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -467,6 +467,7 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta
|
|||
#define LOC_FEATURE_MASK_GTP_CELL_PREMIUM 0X08
|
||||
#define LOC_FEATURE_MASK_SAP_BASIC 0x40
|
||||
#define LOC_FEATURE_MASK_SAP_PREMIUM 0X80
|
||||
#define LOC_FEATURE_MASK_GTP_WAA_BASIC 0X100
|
||||
#define LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC 0X400
|
||||
#define LOC_FEATURE_MASK_ODCPI 0x1000
|
||||
#define LOC_FEATURE_MASK_FREE_WIFI_SCAN_INJECT 0x2000
|
||||
|
@ -484,6 +485,7 @@ typedef struct {
|
|||
char baseband[LOC_MAX_PARAM_STRING];
|
||||
unsigned int sglte_target;
|
||||
char feature_gtp_mode[LOC_MAX_PARAM_STRING];
|
||||
char feature_gtp_waa[LOC_MAX_PARAM_STRING];
|
||||
char feature_sap[LOC_MAX_PARAM_STRING];
|
||||
char feature_odcpi[LOC_MAX_PARAM_STRING];
|
||||
char feature_free_wifi_scan_inject[LOC_MAX_PARAM_STRING];
|
||||
|
@ -504,6 +506,7 @@ static const loc_param_s_type gps_conf_parameter_table[] = {
|
|||
/* location feature conf, e.g.: izat.conf feature mode table*/
|
||||
static const loc_param_s_type loc_feature_conf_table[] = {
|
||||
{"GTP_MODE", &conf.feature_gtp_mode, NULL, 's'},
|
||||
{"GTP_WAA", &conf.feature_gtp_waa, NULL, 's'},
|
||||
{"SAP", &conf.feature_sap, NULL, 's'},
|
||||
{"ODCPI", &conf.feature_odcpi, NULL, 's'},
|
||||
{"FREE_WIFI_SCAN_INJECT", &conf.feature_free_wifi_scan_inject, NULL, 's'},
|
||||
|
@ -567,6 +570,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
|
|||
char config_mask = 0;
|
||||
unsigned char proc_list_length=0;
|
||||
int gtp_cell_ap_enabled = 0;
|
||||
char arg_gtp_waa[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--";
|
||||
char arg_gtp_modem_cell[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--";
|
||||
char arg_gtp_wifi[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--";
|
||||
char arg_sap[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--";
|
||||
|
@ -582,6 +586,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
|
|||
UTIL_READ_CONF(LOC_PATH_GPS_CONF, gps_conf_parameter_table);
|
||||
|
||||
//Form argument strings
|
||||
strlcat(arg_gtp_waa, LOC_FEATURE_GTP_WAA, LOC_PROCESS_MAX_ARG_STR_LENGTH-3);
|
||||
strlcat(arg_gtp_modem_cell, LOC_FEATURE_GTP_MODEM_CELL, LOC_PROCESS_MAX_ARG_STR_LENGTH-3);
|
||||
strlcat(arg_gtp_wifi, LOC_FEATURE_GTP_WIFI, LOC_PROCESS_MAX_ARG_STR_LENGTH-3);
|
||||
strlcat(arg_sap, LOC_FEATURE_SAP, LOC_PROCESS_MAX_ARG_STR_LENGTH-3);
|
||||
|
@ -612,6 +617,19 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
|
|||
LOC_LOGE("%s:%d]: Unrecognized value for GTP MODE Mode."\
|
||||
" Setting GTP WIFI to default mode: DISABLED", __func__, __LINE__);
|
||||
}
|
||||
//Set service mask for GTP_WAA
|
||||
if(strcmp(conf.feature_gtp_waa, "BASIC") == 0) {
|
||||
LOC_LOGD("%s:%d]: Setting GTP WAA to mode: BASIC", __func__, __LINE__);
|
||||
loc_service_mask |= LOC_FEATURE_MASK_GTP_WAA_BASIC;
|
||||
}
|
||||
else if(strcmp(conf.feature_gtp_waa, "DISABLED") == 0) {
|
||||
LOC_LOGD("%s:%d]: GTP WAA DISABLED", __func__, __LINE__);
|
||||
}
|
||||
//conf file has a garbage value
|
||||
else {
|
||||
LOC_LOGE("%s:%d]: Unrecognized value for GTP WAA Mode."\
|
||||
" Setting GTP WAA to default mode: DISABLED", __func__, __LINE__);
|
||||
}
|
||||
|
||||
//Set service mask for SAP
|
||||
if(strcmp(conf.feature_sap, "PREMIUM") == 0) {
|
||||
|
@ -957,6 +975,22 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
|
|||
LOC_PROCESS_MAX_ARG_STR_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
if(conf.loc_feature_mask & LOC_FEATURE_MASK_GTP_WAA_BASIC) {
|
||||
if(loc_service_mask & LOC_FEATURE_MASK_GTP_WAA_BASIC) {
|
||||
strlcpy(child_proc[j].args[i++], arg_gtp_waa,
|
||||
LOC_PROCESS_MAX_ARG_STR_LENGTH);
|
||||
strlcpy(child_proc[j].args[i++], arg_basic,
|
||||
LOC_PROCESS_MAX_ARG_STR_LENGTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(child_proc[j].args[i++], arg_gtp_waa,
|
||||
LOC_PROCESS_MAX_ARG_STR_LENGTH);
|
||||
strlcpy(child_proc[j].args[i++], arg_disabled,
|
||||
LOC_PROCESS_MAX_ARG_STR_LENGTH);
|
||||
}
|
||||
}
|
||||
IF_LOC_LOGD {
|
||||
LOC_LOGD("%s:%d]: %s args\n", __func__, __LINE__, child_proc[j].name[0]);
|
||||
for(unsigned int k=0; k<LOC_PROCESS_MAX_NUM_ARGS; k++) {
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <loc_cfg.h>
|
||||
|
||||
#define GLONASS_SV_ID_OFFSET 64
|
||||
#define QZSS_SV_ID_OFFSET (-192)
|
||||
#define MAX_SV_COUNT_SUPPORTED_IN_ONE_CONSTELLATION 64
|
||||
#define MAX_SATELLITES_IN_USE 12
|
||||
#define MSEC_IN_ONE_WEEK 604800000ULL
|
||||
|
@ -439,7 +440,8 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta,
|
|||
sv_meta.talker[0] = 'G';
|
||||
sv_meta.talker[1] = 'Q';
|
||||
sv_meta.mask = sv_cache_info.qzss_used_mask;
|
||||
// QZSS SV ids are from 193-197. So keep svIdOffset 0
|
||||
// QZSS SV ids are from 193-199. So keep svIdOffset -192
|
||||
sv_meta.svIdOffset = QZSS_SV_ID_OFFSET;
|
||||
sv_meta.systemId = SYSTEM_ID_QZSS;
|
||||
if (GNSS_SIGNAL_QZSS_L1CA == signalType) {
|
||||
sv_meta.svCount = sv_cache_info.qzss_l1_count;
|
||||
|
@ -589,6 +591,10 @@ static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtende
|
|||
uint32_t svIdOffset = sv_meta_p->svIdOffset;
|
||||
uint64_t mask = sv_meta_p->mask;
|
||||
|
||||
if(sv_meta_p->svType != GNSS_SV_TYPE_GLONASS) {
|
||||
svIdOffset = 0;
|
||||
}
|
||||
|
||||
for (uint8_t i = 1; mask > 0 && svUsedCount < 64; i++)
|
||||
{
|
||||
if (mask & 1)
|
||||
|
|
Loading…
Reference in a new issue