【GPS】gps.conf文件解讀

手機adb shell修改gps.conf文件後,導入記得更改權限。android

adb shell裏面要有shell

  /system/framework裏面的com.google.android.maps.jar 
  /system/etc/permissions裏面的com.google.android.maps.xml
服務器


gps.conf文件網絡

  android源碼路徑::app

    hardware/qcom/gps/etc/gps.confless

  手機adb shell:ide

    vendor/etc/gps.confthis


 

下面就開始解讀gps.conf文件。google

#Uncommenting these urls would only enable
#the power up auto injection and force injection(test case).url

服務器速度相對最快的,能夠在修改的時候把它放到XTRA_SERVER_1裏面。

XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra3grc.bin    XTRA_SERVER這個服務器是用來下載衛星通信文件(如星曆等)的,加快定位全靠它
XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra3grc.bin    
XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra3grc.bin

XTRA_DOWNLOAD_INTERVAL_CONFIG = 172800000      移動網絡環境下XTRA下載間隔配置
XTRA_DOWNLOAD_INTERVAL_CONFIG_WIFI = 86400000    WIFI環境下XTRA下載間隔配置
#Version check for XTRA
#DISABLE = 0
#AUTO = 1
#XTRA2 = 2
#XTRA3 = 3
XTRA_VERSION_CHECK=0

# Error Estimate
# _SET = 1
# _CLEAR = 0
ERR_ESTIMATE=0

 

#NTP server    NTP_SERVER是時間服務器

NTP_SERVER提供GPS基準時間服務器,這些服務器中有些服務器從地理位置上說離咱們最近,它們所提供給咱們的時間與標準時間之間的差異也最小,定位也就更精確。

#Asia      
NTP_SERVER=cn.pool.ntp.org       原子鐘服務器在世界各地還有不少,能夠參考www.pool.ntp.org
NTP_SERVER=0.cn.pool.ntp.org
NTP_SERVER=1.cn.pool.ntp.org
NTP_SERVER=3.cn.pool.ntp.org
NTP_SERVER=2.cn.pool.ntp.org
NTP_SERVER=asia.pool.ntp.org
NTP_SERVER=1.asia.pool.ntp.org
NTP_SERVER=3.asia.pool.ntp.org
NTP_SERVER=2.asia.pool.ntp.org
NTP_SERVER=0.asia.pool.ntp.org
# NTP_SERVER=asia.pool.ntp.org      
#Europe
# NTP_SERVER=europe.pool.ntp.org        歐洲
#North America
# NTP_SERVER=north-america.pool.ntp.org     北美,服務器在美國,因爲比較遠,玩過網絡遊戲的都知道這個數值比較慢
#qualcomm
NTP_SERVER=time.izatcloud.net

 

#XTRA CA path
XTRA_CA_PATH=/system/etc/security/cacerts

# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info, 4 - Debug, 5 - Verbose
# If DEBUG_LEVEL is commented, Android's logging levels will be used
DEBUG_LEVEL = 3      gps HAL層logcat的開關,設置爲5就能夠打印全部hal層的log信息了

 

# Intermediate position report, 1=enable, 0=disable      中間定位狀態是否上報粗略位置信息

修改INTERMEDIATE_POSACCURACY_THRES後,至關於下降了android系統的定位精度門檻,這樣的好處是能夠必定程度上提升定位速度,但前提是用戶能夠接受定位完成初始時間裏定位精度降低的狀況。
只要達到定位精度的門檻,android系統就會向app報告定位數據(如,經緯度,海拔,定位偏差等),此時系統就是默認完成了定位(正常狀況下,狀態欄裏的GPS圖標會從閃爍狀態變爲已經定位的狀態);可是顯示定位精度是由app完成的
#INTERMEDIATE_POS=0      
INTERMEDIATE_POS=1      代表接受中間定位狀態時上報的粗略位置信息

# Below bit mask configures how GPS functionalities should be locked when user turns off GPS on Settings
# Set bit 0x1 if MO GPS functionalities are to be locked
# Set bit 0x2 if NI GPS functionalities are to be locked
# default - non is locked for backward compatibility
#GPS_LOCK = 0

# supl version 1.0
#SUPL_VER=0x10000
# supl version 2.0
SUPL_VER=0x20000

# Emergency SUPL, 1=enable, 0=disable
#SUPL_ES=0
SUPL_ES=1

#Choose PDN for Emergency SUPL
#1 - Use emergency PDN
#0 - Use regular SUPL PDN for Emergency SUPL

這個參數是增長的,使用緊急定位服務器,用來替換下面的SUPL_HOST(假如SUPL_HOST被屏蔽掉時),這應該是本次關鍵,當手機失去衛星信號後,不會使用基站位置信息,保持無衛星狀態,因此不會飄。
USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1

#SUPL_MODE is a bit mask set in config.xml per carrier by default.If it is uncommented here, this value will overwrite the value from config.xml.
#MSA=0X2
#MSB=0X1
#SUPL_MODE=

# GPS Capabilities bit mask
# SCHEDULING = 0x01
# MSB = 0x02
# MSA = 0x04
# ON_DEMAND_TIME = 0x10
# GEOFENCE = 0x20
# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
CAPABILITIES=0x31    設置支持的一些定位模式

# Accuracy threshold for intermediate positions less accurate positions are ignored, 0 for passing all positions
# ACCURACY_THRES=5000
ACCURACY_THRES=800      中間定位狀態上報的精度閾值;  設置您可以接受的粗略定位精度的門限值,通常的200對應5~10m,3000對應200m

################################
##### AGPS server settings #####
################################

# FOR SUPL SUPPORT, set the following
# SUPL_HOST=supl.host.com or IP
# SUPL_PORT=1234
# SUPL_HOST=supl.nokia.com        諾基亞在歐美的服務器
# SUPL_PORT=7275
# SUPL_HOST=suplcn.sirf.com        傳說中的A-GPS輔助定位服務器
# SUPL_PORT=7276
# SUPL_HOST=221.176.0.55
# SUPL_PORT=7276

# SUPL_HOST=supl.asia.com
# SUPL_HOST=suplcn.sirf.com
# SUPL_HOST=supl.google.com
# SUPL_HOST=supl.cn.com

這是基站定位服務器,可與前面的USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL配合使用。
SUPL_HOST=supl.qxwz.com    SUPL_HOST 是A-GPS服務器地址,聽說谷歌的是最快的。
SUPL_PORT=7276         SUPL_PORT 是A-GPS服務器端口。

# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234

# Bitmask of slots that are available for write/install to, where 1s indicate writable, and the default value is 0 where no slots are writable. For example, AGPS_CERT_WRITABLE_MASK of b1000001010 makes 3 slots available and the remaining 7 slots unwritable.
#AGPS_CERT_WRITABLE_MASK=0

####################################
# LTE Positioning Profile Settings    LTE定位配置文件設置
####################################
# 0: Enable RRLP on LTE(Default)
# 1: Enable LPP_User_Plane on LTE
# 2: Enable LPP_Control_Plane
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
#LPP_PROFILE = 2
LPP_PROFILE = 0

################################
# EXTRA SETTINGS
################################
# NMEA provider (1=Modem Processor, 0=Application Processor)
NMEA_PROVIDER=0
# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)
SGLTE_TARGET=0

##################################################
# Select Positioning Protocol on A-GLONASS system    
##################################################
# 0x1: RRC CPlane
# 0x2: RRLP UPlane
# 0x4: LLP Uplane
A_GLONASS_POS_PROTOCOL_SELECT = 0    可能會影響定位時間

##################################################
# Select technology for LPPe Control Plane          LPPE控制平面的選擇技術
##################################################
# 0x1: DBH for LPPe CP
# 0x2: WLAN AP Measurements for LPPe CP
# 0x4: SRN AP measurement for CP
# 0x8: Sensor Barometer Measurement LPPe CP
LPPE_CP_TECHNOLOGY = 0

##################################################
# Select technology for LPPe User PlaneLPPE        用戶面選擇技術
##################################################
# 0x1: DBH for LPPe UP
# 0x2: WLAN AP Measurements for LPPe UP
# 0x4: SRN AP measurement for UP
# 0x8: Sensor Barometer Measurement LPPe UP
LPPE_UP_TECHNOLOGY = 0

##################################################
# AGPS_CONFIG_INJECT
##################################################
# enable/disable injection of AGPS configurations:
# SUPL_VER
# SUPL_HOST
# SUPL_PORT
# C2K_HOST
# C2K_PORT
# LPP_PROFILE
# A_GLONASS_POS_PROTOCOL_SELECT
# 0: disable
# 1: enable
AGPS_CONFIG_INJECT = 1


 如下不作說明

##################################################
# GNSS settings for automotive use cases
# Configurations in following section are
# specific to automotive use cases, others
# please do not change, keep the default values
##################################################


 

 實際應用

  電信2G或3G使用版配置:
    NTP_SERVER=cn.pool.ntp.org
    XTRA_SERVER_1=http://xtra2.gpsonextra.net/xtra.bin
    XTRA_SERVER_2=http://xtra1.gpsonextra.net/xtra.bin
    XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
    SUPL_HOST=suplcn.sirf.com
    SUPL_PORT=7275
    PPP1_ID=ctwap@mycdma.cn
    PPP1_PW=vnet.mobi

  移動和聯通使用版配置:
    NTP_SERVER=cn.pool.ntp.org    XTRA_SERVER_1=http://xtra2.gpsonextra.net/xtra.bin    XTRA_SERVER_2=http://xtra1.gpsonextra.net/xtra.bin    XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin    SUPL_HOST=suplcn.sirf.com    SUPL_PORT=7275

相關文章
相關標籤/搜索