[Feature][Modem]Update MTK MODEM V1.6 baseline version: MOLY.NR15.R3.MD700.IVT.MP1MR3.MP.V1.6
MTK modem version: MT2735_IVT_MOLY.NR15.R3.MD700.IVT.MP1MR3.MP.V1.6.tar.gz
RF modem version: NA
Change-Id: I45a4c2752fa9d1a618beacd5d40737fb39ab64fb
diff --git a/mcu/protocol/interface/agps/gnss2lcsp_enum.h b/mcu/protocol/interface/agps/gnss2lcsp_enum.h
new file mode 100644
index 0000000..1d4d4e3
--- /dev/null
+++ b/mcu/protocol/interface/agps/gnss2lcsp_enum.h
@@ -0,0 +1,944 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2013
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * gnss2lcsp_enum.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * A-GNSS project
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 02 13 2019 tzu-ying.chen
+ * [MOLY00376476] [GPS] GPS/GNSS assistance data timing issue in 2/3G GCF performance test cases for GPS
+ *
+ * .
+ *
+ * 07 30 2018 tzu-ying.chen
+ * [MOLY00342999] [LBS] A-Galileo development
+ *
+ * .
+ *
+ * 10 16 2017 jl.hsiao
+ * [MOLY00282702] [LBS] Early fix and MDT battery level support
+ * .
+ *
+ * 10 16 2017 jl.hsiao
+ * [MOLY00282702] [LBS] Early fix and MDT battery level support
+ * .
+ *
+ * 07 07 2017 wynne.chu
+ * [MOLY00261827] [UMOYLA] LPPe development
+ *
+ * .
+ *
+ * 04 07 2017 jie-yu.wang
+ * [MOLY00233110] [SBP] MDT feature change for CMCC requirement
+ * [LBS][Sync from 91/92][Header] MDT feature.
+ *
+ * 10 28 2016 wynne.chu
+ * [MOLY00206577] [Gen92] A-BeiDou feature development
+ *
+ * .
+ *
+ * 10 20 2016 wynne.chu
+ * [MOLY00208519] [MT6293][VzW]LTE SIB8/16 for AGPS fine time aiding (code sync from UMOLY)
+ *
+ * .
+ *
+ * 01 18 2016 roland.li
+ * [MOLY00149314] [Metrico ??]AGPS??, ??OTDOA?ECID????ECID.
+ * .
+ *
+ * 12 10 2015 roland.li
+ * [MOLY00149314] [Metrico ??]AGPS??, ??OTDOA?ECID????ECID.
+ * .
+ *
+ * 04 29 2015 roland.li
+ * [MOLY00109917] [6291][LBS]MDT check in to UMOLY TRUNK
+ * Fix buld error.
+ *
+ * 04 29 2015 roland.li
+ * [MOLY00109917] [6291][LBS]MDT check in to UMOLY TRUNK
+ * [MDT]LBS part.
+ *
+ * 04 16 2015 roland.li
+ * [MOLY00087866] [Uni-Bin]AGNSS ubin change
+ * .
+ *
+ *
+ *****************************************************************************/
+
+#ifndef _GNSS2LCSP_ENUM_H
+#define _GNSS2LCSP_ENUM_H
+
+
+/* MACROS *******************************************************************/
+
+/**
+ * among LPP/RRC/RRLP, the max number of elements for GNSS data is different in some data fields.
+ * we take the largest value as element definition for common interface
+ */
+#define GNSS_MAX_REF_TIME_SAT_ELEMENT 16 /* 64 for LPP, 16 for RRC, 12 for RRLP. Use 16 to reduce structure size */
+#define GNSS_MAX_REF_CELL_FTA_ELEMENT 16 /* 16 for LPP, 1 for RRC/RRLP */
+
+#define GNSS_MAX_GNSS_GENERIC_ASSIST_DATA_ELEMENT 16 /* 16 for LPP, 8 for RRC/RRLP in provide assistance data;
+ 16 for LPP/RRLP, 8 for RRC in capability */
+
+/* GNSS Time Model */
+#define GNSS_MAX_TIME_MODEL_ELEMENT 5 /* 15 for LPP, 7 for RRC/RRLP, Use 5 since gnss-TO-ID only 5 (GPS, Galileo, QZSS, GLONASS, BDS) */
+
+/* GNSS DGNSS */
+#define GNSS_MAX_DGNSS_SGN_TYPE_ELEMENT 3 /* 3 for LPP/RRLP, 8 for RRC */
+#define GNSS_MAX_DGNSS_CORRECTION_INFO_ELEMENT 16 /* 64 for LPP/RRC, 16 for RRLP. Use 16 to reduce structure size */
+
+/* GNSS Navigation Model */
+#define GNSS_MAX_NAV_SAT_ELEMENT 16 /* 64 for LPP/RRC, 32 for RRLP. Use 16 to reduce structure size */
+#define GNSS_MAX_NAV_SAT_ELEMENT_BIT_POS 64 /* 64 for LPP/RRC, 32 for RRLP, dedicated for assist data req */
+#define GNSS_MAX_NAV_STD_CLK_MODEL_ELEMENT 4 /* 2 for LPP/RRLP, 4 for RRC */
+#define GNSS_MAX_NAV_CLOCK_MODEL_ELEMENT 6 /* currently there is 6 clock models */
+#define GNSS_MAX_NAV_ORBIT_MODEL_ELEMENT 6 /* currently there is 6 orbit models */
+
+/* GNSS Real Time Integrity */
+#define GNSS_MAX_RTI_BAD_SAT_ELEMENT 16 /* 64 for LPP/RRC, 16 for RRLP. Use 16 to reduce structure size */
+
+/* GNSS Data Bit Assistance */
+#define GNSS_MAX_DBA_SGN_TYPE_ELEMENT 8 /* 8 for LPP/RRC/RRLP */
+#define GNSS_MAX_DBA_SAT_ELEMENT 16 /* 64 for LPP/RRC, 32 for RRLP. Use 16 to reduce structure size */
+#define GNSS_MAX_DBA_BIT_LENGTH 64 /* 1024 bit for LPP/RRC/RRLP, but RRLP use integer intead of bit. Process only max 64 bits to reduce structure size */
+
+/* GNSS Acquisition Assitance */
+#define GNSS_MAX_ACQ_ASSIST_SAT_ELEMENT 16 /* 64 for LPP/RRC, 16 for RRLP. Use 16 to reduce structure size */
+
+/* GNSS Almanac */
+#define GNSS_MAX_ALMANAC_SAT_ELEMENT 32 /* 64 for LPP/RRC, 36 for RRLP. Use 32 to reduce structure size */
+
+/* GNSS Auxiliary Information */
+#define GNSS_MAX_AUX_SAT_ELEMENT 16 /* 64 for LPP/RRC/RRLP. Use 16 to reduce structure size */
+
+/* GNSS BDS Grid Ion Model */
+#define GNSS_MAX_BDS_GRID_ION_ELEMENT 16 /* 320 for LPP/RRC/RRLP. Use 16 to reduce structure size.
+ Spec description of BDS-GridModelParameter\gridIonList:
+ This list provides ionospheric grid point information for each grid point. Up to 16 instances are used in this version of the specification.
+ The values 17 to 320 are reserved for future use */
+
+/* GNSS DBDS Correction */
+#define GNSS_MAX_DBDS_SGN_TYPE_ELEMENT 3 /* 3 for LPP/RRLP, 8 for RRC */
+#define GNSS_MAX_DBDS_CORRECTION_ELEMENT 16 /* 64 for LPP/RRC/RRLP. Use 16 to reduce structure size */
+
+
+/* MTK supports standalone GPS+QZSS+GLONASS+Galileo+Beidou, and assisted-GNSS supports A-GPS+A-GLONASS+A-BDS */
+#define GNSS_MAX_SUPPORT_NUM 0x04 /* A-GPS + A-GLONASS + A-BDS+A-Galileo */
+
+
+/* GNSS Measurement Info */
+#define GNSS_MAX_MEASURED_GNSS_ELEMENT GNSS_MAX_SUPPORT_NUM /* 16 for LPP, 8 for RRC/RRLP, Use GNSS_MAX_SUPPORT_NUM to reduce structure size */
+#define GNSS_MAX_MEASURED_SGN_PER_GNSS_ELEMENT 4 /* 8 for LPP/RRC/RRLP, Use 4 to reduce structure size */
+#define GNSS_MAX_MEASURED_SAT_PER_SGN_ELEMENT 16 /* 64 for LPP/RRC, 16 for RRLP. Use 16 to reduce structure size */
+
+/* GNSS Request Additional Generic Assist Data */
+#define GNSS_MAX_REQ_ADD_GENERIC_ASSIST_DATA_ELEMENT GNSS_MAX_SUPPORT_NUM /* 16 for LPP, 8 for RRC, unspecified for RRLP (up to 40 bytes), Use 9 since number of generic assistance data type is only 9 */
+
+
+/* GNSS ID Bitmap, use two-byte representation */
+#define GNSS_ID_BITMAP_NONE 0x00
+#define GNSS_ID_BITMAP_GPS 0x8000 /* gps (0) */
+#define GNSS_ID_BITMAP_SBAS 0x4000 /* sbas (1) */
+#define GNSS_ID_BITMAP_QZSS 0x2000 /* qzss (2) */
+#define GNSS_ID_BITMAP_GALILEO 0x1000 /* galileo (3) */
+#define GNSS_ID_BITMAP_GLONASS 0x0800 /* glonass (4) */
+#define GNSS_ID_BITMAP_BDS 0x0400 /* bds (5) */
+
+#define GNSS_ID_BITMAP_GPS_GLONASS (GNSS_ID_BITMAP_GPS | GNSS_ID_BITMAP_GLONASS)
+#define GNSS_ID_BITMAP_GPS_BDS (GNSS_ID_BITMAP_GPS | GNSS_ID_BITMAP_BDS)
+#define GNSS_ID_BITMAP_GPS_GLONASS_BDS (GNSS_ID_BITMAP_GPS | GNSS_ID_BITMAP_GLONASS | GNSS_ID_BITMAP_BDS)
+#define GNSS_ID_BITMAP_GPS_GALILEO (GNSS_ID_BITMAP_GPS | GNSS_ID_BITMAP_GALILEO)
+#define GNSS_ID_BITMAP_GPS_GLONASS_BDS_GALILEO (GNSS_ID_BITMAP_GPS | GNSS_ID_BITMAP_GLONASS | GNSS_ID_BITMAP_BDS | GNSS_ID_BITMAP_GALILEO)
+
+/* SBAS ID Bitmap, use one-byte representation */
+#define SBAS_ID_BITMAP_NONE 0x00
+#define SBAS_ID_BITMAP_WASS 0x80 /* waas (0) */
+#define SBAS_ID_BITMAP_EGNOS 0x40 /* egnos (1) */
+#define SBAS_ID_BITMAP_MSAS 0x20 /* msas (2) */
+#define SBAS_ID_BITMAP_GAGAN 0x10 /* gagan (3) */
+
+/* GNSS Signal IDs Bitmap, use one-byte representation
+ * GNSS | Bit 1 | Bit 2 | Bit 3 | Bit 4 | Bit 5 | Bit 6 | Bit 7 | Bit 8 |
+ * | (MSB) | | | | | | | (LSB) |
+ * --------+--------+-------+-------+-------+-------+-------+-------+-------+
+ * GPS | L1 C/A | L1C | L2C | L5 | -- reserved --|-------|-------|
+ * SBAS | L1 | -- reserved --|-------|-------|-------|-------|-------|
+ * QZSS | QZS-L1 |QZS-L1C|QZS-L2C| QZS-L5| -- reserved --|-------|-------|
+ * GLONASS | G1 | G2 | G3 | -- reserved --|-------|-------|-------|
+ * Galileo | E1 | E5a | E5b | E6 |E5a+E5b| -- reserved --|-------|
+ * BDS | B1I | -- reserved --|-------|-------|-------|-------|-------|
+ */
+/* GNSS signal spectrum */
+#define GNSS_SGN_ID_BITMAP_GPS_L1C_A 0x80 /* bit 1 */
+#define GNSS_SGN_ID_BITMAP_GPS_L1C 0x40 /* bit 2 */
+#define GNSS_SGN_ID_BITMAP_GPS_L2C 0x20 /* bit 3 */
+#define GNSS_SGN_ID_BITMAP_GPS_L5 0x10 /* bit 4 */
+
+#define GNSS_SGN_ID_BITMAP_SBAS_L1 0x80 /* bit 1 */
+
+#define GNSS_SGN_ID_BITMAP_QZSS_L1C_A 0x80 /* bit 1 */
+#define GNSS_SGN_ID_BITMAP_QZSS_L1C 0x40 /* bit 2 */
+#define GNSS_SGN_ID_BITMAP_QZSS_L2C 0x20 /* bit 3 */
+#define GNSS_SGN_ID_BITMAP_QZSS_L5 0x10 /* bit 4 */
+
+#define GNSS_SGN_ID_BITMAP_GLONASS_G1 0x80 /* bit 1 */
+#define GNSS_SGN_ID_BITMAP_GLONASS_G2 0x40 /* bit 2 */
+#define GNSS_SGN_ID_BITMAP_GLONASS_G3 0x20 /* bit 3 */
+
+#define GNSS_SGN_ID_BITMAP_GALILEO_E1 0x80 /* bit 1 */
+#define GNSS_SGN_ID_BITMAP_GALILEO_E5A 0x40 /* bit 2 */
+#define GNSS_SGN_ID_BITMAP_GALILEO_E5B 0x20 /* bit 3 */
+#define GNSS_SGN_ID_BITMAP_GALILEO_E6 0x10 /* bit 4 */
+#define GNSS_SGN_ID_BITMAP_GALILEO_E5_A_B 0x08 /* bit 5 */
+
+#define GNSS_SGN_ID_BITMAP_BDS_B1I 0x80 /* bit 1 */
+
+/* GNSS Signal ID value */
+#define GNSS_SGN_ID_VALUE_GPS_L1C_A 0
+#define GNSS_SGN_ID_VALUE_GPS_L1C 1
+#define GNSS_SGN_ID_VALUE_GPS_L2C 2
+#define GNSS_SGN_ID_VALUE_GPS_L5 3
+
+#define GNSS_SGN_ID_VALUE_SBAS_L1 0
+
+#define GNSS_SGN_ID_VALUE_QZSS_L1C_A 0
+#define GNSS_SGN_ID_VALUE_QZSS_L1C 1
+#define GNSS_SGN_ID_VALUE_QZSS_L2C 2
+#define GNSS_SGN_ID_VALUE_QZSS_L5 3
+
+#define GNSS_SGN_ID_VALUE_GLONASS_G1 0
+#define GNSS_SGN_ID_VALUE_GLONASS_G2 1
+#define GNSS_SGN_ID_VALUE_GLONASS_G3 2
+
+#define GNSS_SGN_ID_VALUE_GALILEO_E1 0
+#define GNSS_SGN_ID_VALUE_GALILEO_E5A 1
+#define GNSS_SGN_ID_VALUE_GALILEO_E5B 2
+#define GNSS_SGN_ID_VALUE_GALILEO_E6 3
+#define GNSS_SGN_ID_VALUE_GALILEO_E5_A_B 4
+
+#define GNSS_SGN_ID_VALUE_BDS_B1I 0
+
+#define GNSS_SGN_ID_VALUE_MAX 7
+
+/* GNSS Clock and Orbit Model Value (for Navigation Model) */
+#define GNSS_NAV_CLOCK_MODEL_1_VALUE_STANDARD 1 /* model-1 */
+#define GNSS_NAV_CLOCK_MODEL_2_VALUE_NAV 2 /* model-2 */
+#define GNSS_NAV_CLOCK_MODEL_3_VALUE_CNAV 3 /* model-3 */
+#define GNSS_NAV_CLOCK_MODEL_4_VALUE_GLONASS 4 /* model-4 */
+#define GNSS_NAV_CLOCK_MODEL_5_VALUE_SBAS 5 /* model-5 */
+#define GNSS_NAV_CLOCK_MODEL_6_VALUE_BDS 6 /* model-6 */
+
+#define GNSS_NAV_ORBIT_MODEL_1_VALUE_KEPLERIAN_SET 1 /* model-1 */
+#define GNSS_NAV_ORBIT_MODEL_2_VALUE_NAV_KEPLERIAN_SET 2 /* model-2 */
+#define GNSS_NAV_ORBIT_MODEL_3_VALUE_CNAV_KEPLERIAN_SET 3 /* model-3 */
+#define GNSS_NAV_ORBIT_MODEL_4_VALUE_GLONASS_ECEF 4 /* model-4 */
+#define GNSS_NAV_ORBIT_MODEL_5_VALUE_SBAS_ECEF 5 /* model-5 */
+#define GNSS_NAV_ORBIT_MODEL_6_VALUE_BDS_KEPLERIAN_SET 6 /* model-6 */
+
+/* Almanac Model Value */
+#define GNSS_ALMANAC_MODEL_1_VALUE_KEPLERIAN_SET 1 /* model-1 */
+#define GNSS_ALMANAC_MODEL_2_VALUE_NAV_KEPLERIAN_SET 2 /* model-2 */
+#define GNSS_ALMANAC_MODEL_3_VALUE_REDUCED_KEPLERIAN_SET 3 /* model-3 */
+#define GNSS_ALMANAC_MODEL_4_VALUE_MIDI_KEPLERIAN_SET 4 /* model-4 */
+#define GNSS_ALMANAC_MODEL_5_VALUE_GLONASS_SET 5 /* model-5 */
+#define GNSS_ALMANAC_MODEL_6_VALUE_ECEF_SBAS_SET 6 /* model-6 */
+#define GNSS_ALMANAC_MODEL_7_VALUE_BDS_ALMANAC_SET 7 /* model-7 */
+
+/* UTC Model Value */
+#define GNSS_UTC_MODEL_1_VALUE 1 /* model-1 (0) */
+#define GNSS_UTC_MODEL_2_VALUE 2 /* model-2 (1) */
+#define GNSS_UTC_MODEL_3_VALUE 3 /* model-3 (2) */
+#define GNSS_UTC_MODEL_4_VALUE 4 /* model-4 (3) */
+#define GNSS_UTC_MODEL_5_VALUE 5 /* model-5 (4) */
+
+/* Ionospheric Model */
+#define GNSS_ION_MODEL_KLOBUCHAR 0x80 /* klobuchar (0) */
+#define GNSS_ION_MODEL_NEQUICK 0x40 /* neQuick (1) */
+
+/* Klobuchar Model Parameter - dataID (2 bits) */
+/**
+ * '11': the parameters have been generated by QZSS
+ * '01': the parameters have been generated by BDS
+ * '00': the parameters are applicable worldwide
+ */
+#define GNSS_ION_KLOBUCHAR_DATA_ID_VALUE_QZSS 0x03
+#define GNSS_ION_KLOBUCHAR_DATA_ID_VALUE_BDS 0x01
+#define GNSS_ION_KLOBUCHAR_DATA_ID_VALUE_WW 0x00
+#define GNSS_ION_KLOBUCHAR_DATA_ID_MASK 0x03
+
+/* Navigation Model */
+#define GNSS_NAV_CLOCK_MODEL_1_STANDARD 0x80 /* model-1 (0) */
+#define GNSS_NAV_CLOCK_MODEL_2_NAV 0x40 /* model-2 (1) */
+#define GNSS_NAV_CLOCK_MODEL_3_CNAV 0x20 /* model-3 (2) */
+#define GNSS_NAV_CLOCK_MODEL_4_GLONASS 0x10 /* model-4 (3) */
+#define GNSS_NAV_CLOCK_MODEL_5_SBAS 0x08 /* model-5 (4) */
+#define GNSS_NAV_CLOCK_MODEL_6_BDS 0x04 /* model-6 (5) */
+
+#define GNSS_NAV_ORBIT_MODEL_1_KEPLERIAN_SET 0x80 /* model-1 (0) */
+#define GNSS_NAV_ORBIT_MODEL_2_NAV_KEPLERIAN_SET 0x40 /* model-2 (1) */
+#define GNSS_NAV_ORBIT_MODEL_3_CNAV_KEPLERIAN_SET 0x20 /* model-3 (2) */
+#define GNSS_NAV_ORBIT_MODEL_4_GLONASS_ECEF 0x10 /* model-4 (3) */
+#define GNSS_NAV_ORBIT_MODEL_5_SBAS_ECEF 0x08 /* model-5 (4) */
+#define GNSS_NAV_ORBIT_MODEL_6_BDS_KEPLERIAN_SET 0x04 /* model-6 (5) */
+
+
+/* Almanac */
+#define GNSS_ALMANAC_MODEL_1_KEPLERIAN_SET 0x80 /* model-1 (0) */
+#define GNSS_ALMANAC_MODEL_2_NAV_KEPLERIAN_SET 0x40 /* model-2 (1) */
+#define GNSS_ALMANAC_MODEL_3_REDUCED_KEPLERIAN_SET 0x20 /* model-3 (2) */
+#define GNSS_ALMANAC_MODEL_4_MIDI_KEPLERIAN_SET 0x10 /* model-4 (3) */
+#define GNSS_ALMANAC_MODEL_5_GLONASS_SET 0x08 /* model-5 (4) */
+#define GNSS_ALMANAC_MODEL_6_ECEF_SBAS_SET 0x04 /* model-6 (5) */
+#define GNSS_ALMANAC_MODEL_7_BDS_ALMANAC_SET 0x02 /* model-7 (6) */
+
+
+/* UTC Model*/
+#define GNSS_UTC_MODEL_1 0x80 /* model-1 (0) */
+#define GNSS_UTC_MODEL_2 0x40 /* model-2 (1) */
+#define GNSS_UTC_MODEL_3 0x20 /* model-3 (2) */
+#define GNSS_UTC_MODEL_4 0x10 /* model-4 (3) */
+#define GNSS_UTC_MODEL_5 0x08 /* model-5 (4) */
+
+
+/* GNSS measurement fields validity bitmask */
+#define GNSS_MEAS_INFO_CARRIER_QUALITY_VALIDITY 0x01
+#define GNSS_MEAS_INFO_INT_CODE_PHASE_VALIDITY 0x02
+#define GNSS_MEAS_INFO_DOPPLER_VALIDITY 0x04
+#define GNSS_MEAS_INFO_ADR_VALIDITY 0x08
+#define GNSS_MEAS_INFO_ALL_VALIDITY 0x0F
+
+#define CHECK_GNSS_MEAS_INFO_CARRIER_QUALITY_VALIDITY(validity) ((validity & GNSS_MEAS_INFO_ALL_VALIDITY) & GNSS_MEAS_INFO_CARRIER_QUALITY_VALIDITY) ? KAL_TRUE : KAL_FALSE
+#define SET_GNSS_MEAS_INFO_CARRIER_QUALITY_VALIDITY(validity) (validity |= GNSS_MEAS_INFO_CARRIER_QUALITY_VALIDITY)
+
+#define CHECK_GNSS_MEAS_INFO_INT_CODE_PHASE_VALIDITY(validity) ((validity & GNSS_MEAS_INFO_ALL_VALIDITY) & GNSS_MEAS_INFO_INT_CODE_PHASE_VALIDITY) ? KAL_TRUE : KAL_FALSE
+#define SET_GNSS_MEAS_INFO_INT_CODE_PHASE_VALIDITY(validity) (validity |= GNSS_MEAS_INFO_INT_CODE_PHASE_VALIDITY)
+
+#define CHECK_GNSS_MEAS_INFO_DOPPLER_VALIDITY(validity) ((validity & GNSS_MEAS_INFO_ALL_VALIDITY) & GNSS_MEAS_INFO_DOPPLER_VALIDITY) ? KAL_TRUE : KAL_FALSE
+#define SET_GNSS_MEAS_INFO_DOPPLER_VALIDITY(validity) (validity |= GNSS_MEAS_INFO_DOPPLER_VALIDITY)
+
+#define CHECK_GNSS_MEAS_INFO_ADR_VALIDITY(validity) ((validity & GNSS_MEAS_INFO_ALL_VALIDITY) & GNSS_MEAS_INFO_ADR_VALIDITY) ? KAL_TRUE : KAL_FALSE
+#define SET_GNSS_MEAS_INFO_ADR_VALIDITY(validity) (validity |= GNSS_MEAS_INFO_ADR_VALIDITY)
+
+
+/* GNSS assist data type bitmask */
+#define GNSS_ASSIST_MASK_NONE 0x0
+
+#define GNSS_COM_ASSIST_MASK_REF_TIME (1 << 0) /* 0x0001 */
+#define GNSS_COM_ASSIST_MASK_REF_LOCATION (1 << 1) /* 0x0002 */
+#define GNSS_COM_ASSIST_MASK_IONOSPHERE (1 << 2) /* 0x0004 */
+#define GNSS_COM_ASSIST_MASK_EARTH_ORIENT_PARAMS (1 << 3) /* 0x0008 */
+
+#define GNSS_GEN_ASSIST_MASK_TIME_MODEL (1 << 4) /* 0x0010 */
+#define GNSS_GEN_ASSIST_MASK_DGNSS_CORRECTION (1 << 5) /* 0x0020 */
+#define GNSS_GEN_ASSIST_MASK_NAV_MODEL (1 << 6) /* 0x0040 */
+#define GNSS_GEN_ASSIST_MASK_RTI (1 << 7) /* 0x0080 */
+#define GNSS_GEN_ASSIST_MASK_DATA_BIT_ASSIST (1 << 8) /* 0x0100 */
+#define GNSS_GEN_ASSIST_MASK_ACQUISITION (1 << 9) /* 0x0200 */
+#define GNSS_GEN_ASSIST_MASK_ALMANAC (1 <<10) /* 0x0400 */
+#define GNSS_GEN_ASSIST_MASK_UTC_MODEL (1 <<11) /* 0x0800 */
+#define GNSS_GEN_ASSIST_MASK_AUX_INFO (1 <<12) /* 0x1000 */
+#define GNSS_GEN_ASSIST_MASK_DBDS_CORRECTION (1 <<13) /* 0x2000 */
+#define GNSS_GEN_ASSIST_MASK_BDS_GRID_MODEL (1 <<14) /* 0x4000 */
+
+// LPPE HA Part
+#define MAX_ENUM_VALUE 2147483647
+
+#define GNSS_HA_COM_ASSIST_MASK_IONOSPHERE (1 << 15) /* 0x08000 */
+#define GNSS_HA_COM_ASSIST_MASK_TROPOSPHERE (1 << 16) /* 0x10000 */
+#define GNSS_HA_COM_ASSIST_MASK_ALTITUDE (1 << 17) /* 0x20000 */
+#define GNSS_HA_COM_ASSIST_MASK_SOLAR_RADIATION (1 << 18) /* 0x40000 */
+#define GNSS_HA_COM_ASSIST_MASK_CCP (1 << 19) /* 0x80000 */
+#define GNSS_HA_GEN_ASSIST_MASK_CCP (1 << 20) /* 0x100000 */
+#define GNSS_HA_GEN_ASSIST_MASK_DEGRADATION (1 << 21) /* 0x200000 */
+
+
+#define GNSS_ASSIST_MB_MANDATORY_MASK (GNSS_COM_ASSIST_MASK_REF_TIME | \
+ GNSS_COM_ASSIST_MASK_REF_LOCATION | \
+ GNSS_COM_ASSIST_MASK_IONOSPHERE | \
+ GNSS_COM_ASSIST_MASK_EARTH_ORIENT_PARAMS | \
+ GNSS_GEN_ASSIST_MASK_TIME_MODEL | \
+ GNSS_GEN_ASSIST_MASK_DGNSS_CORRECTION | \
+ GNSS_GEN_ASSIST_MASK_NAV_MODEL | \
+ GNSS_GEN_ASSIST_MASK_RTI | \
+ GNSS_GEN_ASSIST_MASK_DATA_BIT_ASSIST | \
+ GNSS_GEN_ASSIST_MASK_ALMANAC | \
+ GNSS_GEN_ASSIST_MASK_UTC_MODEL | \
+ GNSS_GEN_ASSIST_MASK_AUX_INFO | \
+ GNSS_GEN_ASSIST_MASK_DBDS_CORRECTION | \
+ GNSS_GEN_ASSIST_MASK_BDS_GRID_MODEL) /* 0x7DFF */
+
+
+#define GNSS_ASSIST_MA_MANDATORY_MASK (GNSS_COM_ASSIST_MASK_REF_TIME | \
+ GNSS_GEN_ASSIST_MASK_ACQUISITION | \
+ GNSS_GEN_ASSIST_MASK_AUX_INFO) /* 0x1201 */
+
+
+#define GNSS_ASSIST_TIME_INDEPENDENT_MASK (GNSS_COM_ASSIST_MASK_REF_LOCATION) /* 0x0002 */
+
+
+#define GNSS_LAST_SEC_TIME 1000
+#define GNSS_MDT_GPS_RESPONSE_TIME 1000
+#define GNSS_MDT_LBS_ERRC_PERIOD_TIME 1280
+#define GNSS_INIT_TIMER_INTERVAL 10000
+
+
+/* ---LPPe HA GNSS Interface--- maximum element definition */
+#define GNSS_HA_MAX_LOCAL_KLOBUCHAR_MODEL_ELEMENT 16
+#define GNSS_HA_MAX_LOCAL_KLOBUCHAR_MODEL 8
+#define GNSS_HA_MAX_STORM_ELEMENT 16
+#define GNSS_HA_MAX_LOCAL_TROPO_DELAY_AREA_ELEMENT 8
+#define GNSS_HA_MAX_LOCAL_TROPO_DELAY_TIME_ELEMENT 8
+#define GNSS_HA_MAX_LOCAL_SURFACE_PARAMS_ELEMENT 8
+#define GNSS_HA_MAX_LOCAL_SURFACE_PARAMS_TIME_ELEMENT 8
+#define GNSS_HA_MAX_ALTITUDE_ASSIST_AREA_ELEMENT 8
+#define GNSS_HA_MAX_PRESSURE_ASSIST_ELEMENT 16
+#define GNSS_HA_MAX_CCP_SIGNAL_SUPP_ELEMENT 8
+#define GNSS_HA_MAX_CCP_PREF_STATION_LIST_ELEMENT 8 /* OMA-TS-LPPe: maxReferenceStations */
+#define GNSS_HA_MAX_WA_IONO_SURF_PER_SV_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+#define GNSS_HA_MAX_MECHANICS_SV_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+#define GNSS_HA_MAX_DCB_LIST_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+#define GNSS_HA_MAX_DCB_ELEMENT 16
+#define GNSS_HA_MAX_DEGRAD_MODEL_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+#define GNSS_HA_MAX_CCP_GENERIC_ELEMENT 8
+#define GNSS_HA_MAX_CCP_PER_SIG_ELEMENT 8
+#define GNSS_HA_MAX_CCP_PER_SV_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+#define GNSS_HA_MAX_REQ_NAV_MODEL_ID_ELEMENT 8
+#define GNSS_HA_MAX_MEAS_PER_GNSS_ELEMENT 16
+#define GNSS_HA_MAX_MEAS_PER_SIGNAL_ELEMENT 8
+#define GNSS_HA_MAX_MEAS_PER_SV_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+#define GNSS_HA_MAX_TEC_PER_SV_ELEMENT 16 /* OMA-TS-LPPe: defines 64, reduce size to 16 */
+
+#define GNSS_HA_MAX_GNSS_GENERIC_ASSIST_DATA_ELEMENT 16
+#define GNSS_HA_MAX_GENERIC_AD_NAV_MODEL_ID_ELEMENT 8
+#define GNSS_HA_MAX_HA_GNSS_CAPA_ELEMENT 8
+
+
+/* ---LPPe HA GNSS Interface--- optional field validity bit definition */
+#define GNSS_HA_MAPPING_FUNC_PARAMS_BIT_BH_VALID 0x80
+#define GNSS_HA_MAPPING_FUNC_PARAMS_BIT_CH_VALID 0x40
+#define GNSS_HA_MAPPING_FUNC_PARAMS_BIT_AW_VALID 0x20
+#define GNSS_HA_MAPPING_FUNC_PARAMS_BIT_BW_VALID 0x10
+#define GNSS_HA_MAPPING_FUNC_PARAMS_BIT_CW_VALID 0x08
+
+#define GNSS_HA_LOCAL_TROPO_DELAY_TIME_ELEMENT_BIT_EH_VALID 0x80
+#define GNSS_HA_LOCAL_TROPO_DELAY_TIME_ELEMENT_BIT_ZW0_VALID 0x40
+#define GNSS_HA_LOCAL_TROPO_DELAY_TIME_ELEMENT_BIT_EW_VALID 0x20
+#define GNSS_HA_LOCAL_TROPO_DELAY_TIME_ELEMENT_BIT_GN_VALID 0x10
+#define GNSS_HA_LOCAL_TROPO_DELAY_TIME_ELEMENT_BIT_GE_VALID 0x08
+
+#define GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_GN_PRESSURE 0x80
+#define GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_GE_PRESSURE 0x40
+#define GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_TEMPERATURE 0x20
+#define GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_TEMPERATURE_RATE 0x10
+#define GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_GN_TEMPERATURE 0x08
+#define GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_GE_TEMPERATURE 0x04
+
+
+/* ---LPPe HA GNSS Interface--- bitmask field bit defintion */
+#define GNSS_HA_COMM_AD_REQ_IONO_BIT_KLOBUCHAR_MODEL 0x01
+#define GNSS_HA_COMM_AD_REQ_IONO_BIT_IONO_STORM_WARNING 0x02
+
+#define GNSS_HA_COMM_AD_REQ_TROPO_BIT_DELAY_LIST 0x01
+#define GNSS_HA_COMM_AD_REQ_TROPO_BIT_SURFACE_PARAMS 0x02
+
+#define GNSS_HA_IONO_MEAS_REQ_BIT_TEC_PER_SV 0x01
+#define GNSS_HA_IONO_MEAS_REQ_BIT_ZENITH_TEC 0x02
+
+#define GNSS_HA_COMM_IONO_AD_SUPP_BIT_LOCAL_KLOBUCHAR 0x01
+#define GNSS_HA_COMM_IONO_AD_SUPP_BIT_IONO_STORM_WARNING 0x02
+#define GNSS_HA_COMM_IONO_AD_SUPP_BIT_WIDE_AREA_IONO_SURFACE 0x04
+
+#define GNSS_HA_COMM_TROPO_AD_SUPP_BIT_LOCAL_TROPOSPHERE_DELAY 0x01
+#define GNSS_HA_COMM_TROPO_AD_SUPP_BIT_SURFACE_PARAMETERS 0x02
+#define GNSS_HA_COMM_TROPO_AD_SUPP_BIT_MULTI_GRID_POINTS 0x04
+
+#define GNSS_HA_COMM_CCP_AD_SUPP_BIT_SUPPORT_AREA_ASSIST 0x01
+#define GNSS_HA_COMM_CCP_AD_SUPP_BIT_MULTI_REF_STATION 0x02
+
+#define GNSS_HA_GENE_AD_SUPP_BIT_BIT_TEC_PER_SV 0x01
+#define GNSS_HA_GENE_AD_SUPP_BIT_BIT_ZENITH_TEC 0x02
+
+#define GNSS_HA_MODE_SUPPORT_BIT_UE_BASED 0x01
+#define GNSS_HA_MODE_SUPPORT_BIT_UE_ASSISTED 0x02
+
+#define GNSS_HA_ANT_SUPPORT_BIT_ANT_DESCRIPTION 0x01
+#define GNSS_HA_ANT_SUPPORT_BIT_ANT_ORIENTATION 0x02
+
+
+/* GNSS standard clock model element */
+#define ITEM_0_IS_INAV 0
+#define ITEM_1_IS_INAV 1
+#define ITEM_0_IS_FNAV 0
+#define ITEM_1_IS_FNAV 1
+#define STANDARD_CLOCK_MODEL_INAV 0
+#define STANDARD_CLOCK_MODEL_FNAV 1
+
+
+
+
+/* NNUM ********************************************************************/
+
+typedef enum
+{
+ GNSS_NETWORK_CELL_TYPE_NULL,
+ GNSS_NETWORK_CELL_TYPE_EUTRA,
+ GNSS_NETWORK_CELL_TYPE_UTRA,
+ GNSS_NETWORK_CELL_TYPE_GSM
+} gnss_network_cell_type_enum;
+
+
+typedef enum
+{
+ GNSS_ID_GPS,
+ GNSS_ID_SBAS,
+ GNSS_ID_QZSS,
+ GNSS_ID_GALILEO,
+ GNSS_ID_GLONASS,
+ GNSS_ID_BDS,
+ GNSS_ID_MAX = MAX_ENUM_VALUE
+} gnss_id_enum;
+
+
+typedef enum
+{
+ GNSS_TO_ID_GPS = 1,
+ GNSS_TO_ID_GALILEO,
+ GNSS_TO_ID_QZSS,
+ GNSS_TO_ID_GLONASS,
+ GNSS_TO_ID_BDS
+} gnss_to_id_enum;
+
+
+typedef enum
+{
+ SBAS_ID_WAAS,
+ SBAS_ID_EGNOS,
+ SBAS_ID_MSAS,
+ SBAS_ID_GAGAN
+} sbas_id_enum;
+
+
+typedef enum
+{
+ GNSS_COMMON_ASSIST_DATA_TYPE_REF_TIME,
+ GNSS_COMMON_ASSIST_DATA_TYPE_REF_LOCACTION,
+ GNSS_COMMON_ASSIST_DATA_TYPE_ION_MODEL,
+ GNSS_COMMON_ASSIST_DATA_TYPE_EARTH_ORIENT_PARAMS,
+ GNSS_COMMON_HA_ASSIST_DATA_TYPE_ION_MODEL,
+ GNSS_COMMON_HA_ASSIST_DATA_TYPE_TROPO_MODEL,
+ GNSS_COMMON_HA_ASSIST_DATA_TYPE_ALT,
+ GNSS_COMMON_HA_ASSIST_DATA_TYPE_SOLAR,
+ GNSS_COMMON_HA_ASSIST_DATA_TYPE_CCP
+} gnss_common_assist_data_type_enum;
+
+
+typedef enum
+{
+ GNSS_GENERIC_ASSIST_DATA_TYPE_TIME_MODEL,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_DGNSS_CORRECTION,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_NAVIGATION_MODEL,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_RTI,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_DATA_BIT_ASSIST,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_ACQUISITION,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_ALMANAC,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_UTC_MODEL,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_AUX_INFO,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_DBDS_CORRECTION,
+ GNSS_GENERIC_ASSIST_DATA_TYPE_BDS_GRID_MODEL,
+ GNSS_GENERIC_HA_ASSIST_DATA_TYPE_CCP,
+ GNSS_GENERIC_HA_ASSIST_DATA_TYPE_DEGRADATION
+} gnss_generic_assist_data_type_enum;
+
+
+typedef enum
+{
+ GNSS_CLOCK_MODEL_TYPE_STANDARD,
+ GNSS_CLOCK_MODEL_TYPE_NAV,
+ GNSS_CLOCK_MODEL_TYPE_CNAV,
+ GNSS_CLOCK_MODEL_TYPE_GLONASS,
+ GNSS_CLOCK_MODEL_TYPE_SBAS,
+ GNSS_CLOCK_MODEL_TYPE_BDS
+} gnss_clock_model_type_enum;
+
+
+typedef enum
+{
+ GNSS_ORBIT_MODEL_TYPE_KEPLERIAN_SET,
+ GNSS_ORBIT_MODEL_TYPE_NAV_KEPLERIAN_SET,
+ GNSS_ORBIT_MODEL_TYPE_CNAV_KEPLERIAN_SET,
+ GNSS_ORBIT_MODEL_TYPE_GLONASS_ECEF,
+ GNSS_ORBIT_MODEL_TYPE_SBAS_ECEF,
+ GNSS_ORBIT_MODEL_TYPE_BDS_KEPLERIAN_SET
+} gnss_orbit_model_type_enum;
+
+
+typedef enum
+{
+ GNSS_NAV_MODEL_REQ_TYPE_STORED_NAV_LIST,
+ GNSS_NAV_MODEL_REQ_TYPE_REQ_NAV_LIST
+} gnss_nav_model_req_type_enum;
+
+typedef enum
+{
+ GNSS_ACQ_ASSIST_DOPPLER_UNCERTAINTY_EXT_ENUM_D60,
+ GNSS_ACQ_ASSIST_DOPPLER_UNCERTAINTY_EXT_ENUM_D80,
+ GNSS_ACQ_ASSIST_DOPPLER_UNCERTAINTY_EXT_ENUM_D100,
+ GNSS_ACQ_ASSIST_DOPPLER_UNCERTAINTY_EXT_ENUM_D120,
+ GNSS_ACQ_ASSIST_DOPPLER_UNCERTAINTY_EXT_ENUM_NO_INFO
+} gnss_acq_assist_doppler_uncertainty_ext_enum;
+
+
+typedef enum
+{
+ GNSS_ALMANAC_TYPE_KEPLERIAN_SET,
+ GNSS_ALMANAC_TYPE_NAV_KEPLERIAN_SET,
+ GNSS_ALMANAC_TYPE_REDUCED_KEPLERIAN_SET,
+ GNSS_ALMANAC_TYPE_MIDI_KEPLERIAN_SET,
+ GNSS_ALMANAC_TYPE_GLONASS_SET,
+ GNSS_ALMANAC_TYPE_ECEF_SBAS_SET,
+ GNSS_ALMANAC_TYPE_BDS_ALMANAC_SET
+} gnss_almanac_type_enum;
+
+
+typedef enum
+{
+ GNSS_UTC_MODEL_TYPE_MODEL1, /* GPS, Galileo, QZSS */
+ GNSS_UTC_MODEL_TYPE_MODEL2,
+ GNSS_UTC_MODEL_TYPE_MODEL3, /* GLONASS */
+ GNSS_UTC_MODEL_TYPE_MODEL4, /* SBAS */
+ GNSS_UTC_MODEL_TYPE_MODEL5 /* BDS */
+} gnss_utc_model_type_enum;
+
+
+typedef enum
+{
+ GNSS_AUX_INFO_GNSS_TYPE_GPS,
+ GNSS_AUX_INFO_GNSS_TYPE_GLONASS
+} gnss_aux_info_gnss_type_enum;
+
+
+typedef enum
+{
+ GNSS_POS_RESULT_TYPE_POS_CNF,
+ GNSS_POS_RESULT_TYPE_ASSIST_DATA_REQ
+} gnss_pos_result_type_enum;
+
+
+typedef enum
+{
+ GNSS_MEAS_RESULT_TYPE_MEAS_CNF,
+ GNSS_MEAS_RESULT_TYPE_ASSIST_DATA_REQ
+} gnss_meas_result_type_enum;
+
+
+typedef enum
+{
+ GNSS_LOC_RESULT_NULL,
+ GNSS_LOC_RESULT_NO_ERROR,
+ GNSS_LOC_RESULT_UNDEFINED,
+ GNSS_LOC_RESULT_REQ_TIMEOUT,
+ GNSS_LOC_RESULT_NOT_ENOUGH_SATELLITES,
+ GNSS_LOC_RESULT_ASSIST_DATA_MISSING, /* not used in POS(MEAS)_REQ/CNF primitive */
+
+ /* dedicated for RRLP */
+ GNSS_LOC_RESULT_METHOD_NOT_SUPPORTED,
+ GNSS_LOC_RESULT_REFERENCE_BTS_NOT_SERVING_BTS,
+
+ /* dedicated for RRC */
+ GNSS_LOC_RESULT_NOT_ACCOMPLISHED_TIMING_OF_CELL_FRAMES, /* similar to FINE_TIME_ASSISTANCE_MEASUREMENTS_NOT_POSSIBLE */
+ GNSS_LOC_RESULT_REFERENCE_CELL_NOT_SERVING_CELL, /* reference cell's SFN cannot be decoded */
+
+ /* dedicated for LPP */
+ GNSS_LOC_RESULT_FINE_TIME_ASSISTANCE_MEASUREMENTS_NOT_POSSIBLE, /* fineTimeAssistanceMeasurementsNotPossible IE present */
+ GNSS_LOC_RESULT_ADR_MEASUREMENTS_NOT_POSSIBLE, /* adrMeasurementsNotPossible IE present */
+ GNSS_LOC_RESULT_MULTI_FREQUENCY_MEASUREMENTS_NOT_POSSIBLE /* multiFrequencyMeasurementsNotPossible IE present */
+//#ifdef __EARLY_FIX_SUPPORT__
+ ,GNSS_LOC_RESULT_EARLY_FIX, /* Early fix result */
+ GNSS_LOC_RESULT_EARLY_FIX_NO_RESULT /* Early fix no result */
+//#endif
+} gnss_loc_result_enum;
+
+
+typedef enum {
+ TIME_SIB_RESULT_OK =0, /* ERRC/EL1 reported useful info, check fields in lbs_errc_read_time_sib_ind_struct */
+ TIME_SIB_RESULT_NOT_TRY =1, /* No valid SIB info, and LBS doesn��t need to try again */
+ TIME_SIB_RESULT_RE_TRY =2, /* No valid SIB info, and LBS may try again */
+ TIME_SIB_RESULT_TIMEOUT =3 /* While trying to read SIB for time sync, guard timer timeouts(2s), Can retry, ask ERRC for further check*/
+} time_sib_result_enum;
+
+
+typedef enum {
+ TIME_SIB_CDMA_SYS_TIME_SYNC =0,
+ TIME_SIB_CDMA_SYS_TIME_ASYNC =1
+} time_sib_cdma_sys_time_type_enum;
+
+
+typedef enum {
+ GNSS_TIME,
+ GPS_TIME,
+ UTC_TIME
+} frame_sync_pulse_time_type_enum;
+
+typedef enum{
+ ERRC_MDT_NO_REPORT_LOCATION,
+ ERRC_MDT_REQUEST_STORE_LOCATION, /* ERRC request report stored location, LBS will determine report mode by ERRC request and User location setting. */
+ ERRC_MDT_REQUEST_OPEN_GPS /* ERRC request report GPS, LBS will determine report mode by ERRC request and User location setting. */
+} errc_lbs_gnss_pos_mdt_type_enum;
+
+
+/* ---LPPe HA GNSS Interface--- */
+typedef enum
+{
+ GNSS_HA_IONO_MODEL_TYPE_STATIC_MODEL,
+ GNSS_HA_IONO_MODEL_TYPE_PERIODIC_MODEL,
+ GNSS_HA_IONO_MODEL_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_iono_model_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_COMMON_ASSIST_DATA_TYPE_IONO_MODEL,
+ GNSS_HA_COMMON_ASSIST_DATA_TYPE_TROPO_MODEL,
+ GNSS_HA_COMMON_ASSIST_DATA_TYPE_ALTITUDE,
+ GNSS_HA_COMMON_ASSIST_DATA_TYPE_SOLAR_RAD,
+ GNSS_HA_COMMON_ASSIST_DATA_TYPE_CCP_ASSIST,
+ GNSS_HA_COMMON_ASSIST_DATA_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_common_assist_data_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_WA_ION_SURF,
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_SV_MECHANICS,
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_SV_DCB,
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_DEGRAD_MODEL,
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_CCP_ASSIST,
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_NAV_MODEL,
+ GNSS_HA_GENERIC_ASSIST_DATA_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_generic_assist_data_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_CCP_ASSIST_COMMON_TYPE_COMMOM,
+ GNSS_HA_CCP_ASSIST_COMMON_TYPE_CONTROL,
+ GNSS_HA_CCP_ASSIST_COMMON_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_ccp_assist_common_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_SV_TYPE_GPS_IIR,
+ GNSS_HA_SV_TYPE_GPS_IIRM,
+ GNSS_HA_SV_TYPE_GPS_IIF,
+ GNSS_HA_SV_TYPE_GPS_III,
+ GNSS_HA_SV_TYPE_GLONASS_M,
+ GNSS_HA_SV_TYPE_GLONASS_K1,
+ GNSS_HA_SV_TYPE_GLONASS_K2,
+ GNSS_HA_SV_TYPE_GLONASS_KM,
+ GNSS_HA_SV_TYPE_UNKNOWN,
+ GNSS_HA_SV_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_sv_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_DCB_REF_PD_PILOT,
+ GNSS_HA_DCB_REF_PD_DATA,
+ GNSS_HA_DCB_REF_PD_NOT_APPLICABLE,
+ GNSS_HA_DCB_REF_MAX = MAX_ENUM_VALUE
+} gnss_ha_dcb_ref_pd_enum;
+
+
+typedef enum
+{
+ GNSS_HA_CODE_PHASE_ERR_TYPE_RMS,
+ GNSS_HA_CODE_PHASE_ERR_TYPE_CNR,
+ GNSS_HA_CODE_PHASE_ERR_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_code_phase_err_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_AGNSS_QOR_TYPE_10_M,
+ GNSS_HA_AGNSS_QOR_TYPE_1_KM,
+ GNSS_HA_AGNSS_QOR_TYPE_10_KM,
+ GNSS_HA_AGNSS_QOR_TYPE_100_KM,
+ GNAA_HA_AGNSS_QOR_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_agnss_qor_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_HORI_UNC_TYPE_CEP,
+ GNSS_HA_HORI_UNC_TYPE_ELLIPSE,
+ GNSS_HA_HORI_UNC_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_hori_unc_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_MULTIPATH_DETECTION_TYPE_LOW,
+ GNSS_HA_MULTIPATH_DETECTION_TYPE_MODERATE,
+ GNSS_HA_MULTIPATH_DETECTION_TYPE_HIGH,
+ GNSS_HA_MULTIPATH_DETECTION_TYPE_NOT_MEASURED,
+ GNSS_HA_MULTIPATH_DETECTION_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_multipath_detect_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_TGT_ERR_CAUSE_UNDEFINED,
+ GNSS_HA_TGT_ERR_CAUSE_HA_METHOD_NOT_SUPPORTED,
+ GNSS_HA_TGT_ERR_CAUSE_MAX = MAX_ENUM_VALUE
+} gnss_ha_tgt_err_cause_enum;
+
+
+typedef enum
+{
+ GNSS_HA_TGT_IONO_MEAS_ERR_CAUSE_UNDEFINED,
+ GNSS_HA_TGT_IONO_MEAS_ERR_CAUSE_IONO_MEAS_NOT_SUPPORTED,
+ GNSS_HA_TGT_IONO_MEAS_ERR_CAUSE_IONO_MEAS_NOT_AVAILABLE,
+ GNSS_HA_TGT_IONO_MEAS_ERR_CAUSE_MAX = MAX_ENUM_VALUE
+} gnss_ha_tgt_iono_meas_err_cause_enum;
+
+typedef enum
+{
+ GNSS_HA_TGT_ENV_OBSERVE_ERR_CAUSE_UNDEFINED,
+ GNSS_HA_TGT_ENV_OBSERVE_ERR_CAUSE_SURF_MEAS_NOT_SUPPORTED,
+ GNSS_HA_TGT_ENV_OBSERVE_ERR_CAUSE_SURF_MEAS_NOT_AVAILABLE,
+ GNSS_HA_TGT_ENV_OBSERVE_ERR_CAUSE_MAX = MAX_ENUM_VALUE
+} gnss_ha_tgt_env_observe_err_cause_enum;
+
+
+typedef enum
+{
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_UNDEFINED,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_NOT_SUPPORTED_BY_TARGET,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_UNAVAILABLE_FOR_ALL_REQUESTED_SIGNALS,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_ANTENNA_INFO_NOT_SUPPORTED,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_ANTENNA_INFO_NOT_AVAILABLE,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_PRESSURE_INFO_NOT_SUPPORTED,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_PRESSURE_INFO_NOT_AVAILABLE,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_UNABLE_TO_MODIFY_CTRL_PARAMS,
+ GNSS_HA_TGT_GNSS_ERR_CAUSE_GNSS_MAX = MAX_ENUM_VALUE
+} gnss_ha_tgt_gnss_err_cause_enum;
+
+
+typedef enum
+{
+ GNSS_HA_REQ_CCP_REF_STATION_TYPE_POS_BASED,
+ GNSS_HA_REQ_CCP_REF_STATION_TYPE_ID_BASED,
+ GNSS_HA_REQ_CCP_REF_STATION_TYPE_KILL_LIST,
+ GNSS_HA_REQ_CCP_REF_STATION_TYPE_MAX = MAX_ENUM_VALUE
+} gnss_ha_req_ccp_ref_station_type_enum;
+
+
+typedef enum
+{
+ GNSS_HA_RleIonoElement_ionoIndex_noaaScales_selected = 1,
+ GNSS_HA_RleIonoElement_ionoIndex_UnKnowItem_selected,
+ GNSS_HA_RleIonoElement_ionoIndex_MAX = MAX_ENUM_VALUE
+} gnss_ha_rle_iono_element_selector_enum;
+
+
+typedef enum
+{
+ GNSS_HA_NOAASCALES_G1,
+ GNSS_HA_NOAASCALES_G2,
+ GNSS_HA_NOAASCALES_G3,
+ GNSS_HA_NOAASCALES_G4,
+ GNSS_HA_NOAASCALES_G5,
+ GNSS_HA_NOAASCALES_UNKNOWN,
+ GNSS_HA_NOAASCALES_NONE,
+ GNSS_HA_NOAASCALES_MAX = MAX_ENUM_VALUE
+} gnss_ha_noaa_scales_enum;
+
+
+typedef enum
+{
+ GNSS_HA_ELLIPSOID_POINT_LATITUDESIGN_NORTH,
+ GNSS_HA_ELLIPSOID_POINT_LATITUDESIGN_SOUTH,
+ GNSS_HA_ELLIPSOID_POINT_LATITUDESIGN_MAX = MAX_ENUM_VALUE
+} gnss_ha_ellopsoid_point_latitude_sign_enum;
+
+
+typedef enum
+{
+ GNSS_HA_ANTENNA_DESCRIPTION_IGS_ANTENNA_NAME_SELECTED = 1,
+ GNSS_HA_ANTENNA_DESCRIPTION_PROPRIETARY_NAME_SELECTED,
+ GNSS_HA_ANTENNA_DESCRIPTION_UNKNOWN_ITEM_SELECTED,
+ GNSS_HA_ANTENNA_DESCRIPTION_MAX = MAX_ENUM_VALUE
+} gnss_ha_antenna_description_selector_enum;
+
+
+typedef enum
+{
+ GNSS_HA_NAVMODEL_COORDINATE_BASED_REFERENCED_TO_CENTER_OF_MASS,
+ GNSS_HA_NavModel_COORDINATE_BASED_REFERENCED_TO_ANTENNA_PHASE_CENTER,
+ GNSS_HA_NavModel_COORDINATE_BASED_REFERENCED_TO_MAX = MAX_ENUM_VALUE
+} gnss_ha_nav_model_coordinate_based_referenced_enum;
+
+typedef enum
+{
+ LIST_GPS_ASSIST_ALMANAC,
+ LIST_GPS_ASSIST_NAVIGATION_MODEL,
+ LIST_GPS_ASSIST_REF_LOCATION,
+ LIST_GNSS_COMMON_ASSIST_DATA_REF_LOCACTION,
+ LIST_GNSS_GENERIC_ASSIST_DATA_NAVIGATION_MODEL,
+ LIST_GNSS_GENERIC_ASSIST_DATA_ALMANAC,
+
+ LIST_GPS_GNSS_ASSIST_DATA_TYPE_MAX
+} list_gps_gnss_assist_data_type_enum;
+
+#endif /* _GNSS2LCSP_ENUM_H_ */
+
diff --git a/mcu/protocol/interface/agps/gnss2lcsp_struct.h b/mcu/protocol/interface/agps/gnss2lcsp_struct.h
new file mode 100644
index 0000000..c6342bf
--- /dev/null
+++ b/mcu/protocol/interface/agps/gnss2lcsp_struct.h
@@ -0,0 +1,3254 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2013
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * gnss2lcsp_struct.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * A-GNSS project
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 11 29 2019 jie-yu.wang
+ * [MOLY00461947] [LPP] Patch back from 1001.DEV to VMOLY
+ * [MPD][VMOLY] LPP patch back.
+ *
+ * 07 01 2019 tzu-ying.chen
+ * [MOLY00416602] [LPP][GPS] Dual-frequency development
+ *
+ * .
+ *
+ * 07 30 2018 jie-yu.wang
+ * [MOLY00342988] [LPP] A-Galileo development
+ * [LPP] A-Galileo
+ *
+ * 12 14 2017 jl.hsiao
+ * [MOLY00296306] [Bianco][O1][6630][GPS] 4G FDD B1 AGNSS CP MA7.5 Sensitivity -130dB is Fail (Time out waiting for the 1st measurment)
+ *
+ * .
+ *
+ * 12 14 2017 jl.hsiao
+ * [MOLY00296306] [Bianco][O1][6630][GPS] 4G FDD B1 AGNSS CP MA7.5 Sensitivity -130dB is Fail (Time out waiting for the 1st measurment)
+ * .
+ *
+ * 10 16 2017 jl.hsiao
+ * [MOLY00282702] [LBS] Early fix and MDT battery level support
+ * .
+ *
+ * 10 16 2017 jl.hsiao
+ * [MOLY00282702] [LBS] Early fix and MDT battery level support
+ * .
+ *
+ * 07 07 2017 wynne.chu
+ * [MOLY00261827] [UMOYLA] LPPe development
+ *
+ * .
+ *
+ * 04 07 2017 jie-yu.wang
+ * [MOLY00240104] MDT feature change for Vodafone requirement
+ * [UMOLYA][LBS]MDT feature change for VDF.
+ *
+ * 04 07 2017 jie-yu.wang
+ * [MOLY00233110] [SBP] MDT feature change for CMCC requirement
+ * [LBS][Sync from 91/92][Header] MDT feature.
+ *
+ * 10 28 2016 wynne.chu
+ * [MOLY00206577] [Gen92] A-BeiDou feature development
+ *
+ * .
+ *
+ * 10 20 2016 wynne.chu
+ * [MOLY00208519] [MT6293][VzW]LTE SIB8/16 for AGPS fine time aiding (code sync from UMOLY)
+ *
+ * .
+ *
+ * 04 29 2015 roland.li
+ * [MOLY00109917] [6291][LBS]MDT check in to UMOLY TRUNK
+ * [MDT]LBS part.
+ *
+ * 04 28 2015 george.chang
+ * [MOLY00109714] [6291] MOB MDT check in to UMOLY TRUNK
+ * .
+ *
+ * 04 16 2015 roland.li
+ * [MOLY00087866] [Uni-Bin]AGNSS ubin change
+ * .
+ *
+ * 01 07 2015 roland.li
+ * [MOLY00089901] [UMOLY][LBS][LPP] new feaure check in
+ * backout gnss2lcsp change.
+ *
+ * 08 04 2014 doug.shih
+ * [MOLY00073990] [LPP CP] LPP code check-in for OTDOA feature
+ * .
+ *
+ * 04 13 2014 roland.li
+ * [MOLY00061982] [6595][6630][AGPS][Certification] 2G GSM1900 AGLO MSB70.16.5.1 & 70.16.6 ?????EE????????????????????
+ * TOD issue.
+ *
+ * 03 12 2014 roland.li
+ * [MOLY00058246] [ASOP] AGNSS LBS task, AGNSS TOD to TOW transfer.
+ *
+ *
+ *****************************************************************************/
+
+#ifndef _GNSS2LCSP_STRUCT_H
+#define _GNSS2LCSP_STRUCT_H
+
+#include "gnss2lcsp_enum.h"
+#include "gps2lcsp_enum.h"
+
+#include "mcd_l3_inc_struct.h" /* for PLMN id */
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+
+#include "dlist.h"
+
+//#if defined(__AGNSS_SUPPORT__) || defined(__AGPS_SUPPORT__) /* should add a new compile option __AGNSS_SUPPORT__*/
+
+
+/*=== GNSS Common Assistance Data ===*/
+
+/* start for gnss reference time */
+typedef struct
+{
+ kal_uint8 svID; /* satellite PRN [1..64] */
+ kal_uint16 tlmWord; /* telemetry message [0..16383] */
+ kal_uint8 antiSpoof; /* anti spoof flag [0..1] */
+ kal_uint8 alert; /* alert flag [0..1] */
+ kal_uint8 tlmRsvdBits; /* 2 bit reserved bits [0..3] */
+} gnss_gps_tow_assist_struct;
+
+
+typedef struct
+{
+ gnss_id_enum gnssTimeID;
+ /**
+ * This field specifies the sequential number of days from the origin of the GNSS System Time as follows:
+ * GPS, QZSS, SBAS �V Days from January 6th 1980 00:00:00 UTC(USNO)
+ * Galileo �V TBD;
+ * GLONASS �V Days from January 1st 1996
+ */
+ kal_uint16 gnssDayNumber; /* [0..32767] */
+ kal_uint32 gnssTimeOfDay; /* [0..86399] in seconds */
+ kal_bool gnssTimeOfDayFracMsecValid;
+ kal_uint16 gnssTimeOfDayFracMsec; /* [0..999] in milli-seconds */
+ kal_bool notificationLeapSecondValid;
+ kal_uint8 notificationLeapSecond; /* only present when gnss=GLONASS */
+ kal_uint8 numGpsTowAssist; /* only present when gnss=GPS */
+ gnss_gps_tow_assist_struct gpsTowAssist[GNSS_MAX_REF_TIME_SAT_ELEMENT];
+} gnss_system_time_struct;
+
+
+typedef struct
+{
+ kal_uint16 physCellId; /* [0..503] */
+ kal_uint32 earfcn; /* [0..262143], 65535 is invalid to indicate ARFCN-ValueEUTRA-v9a0 present */
+ /* optional field */
+ kal_bool plmnIdValid;
+ plmn_id_struct plmnId;
+ kal_bool cellIdValid;
+ kal_uint32 cellId; /* eutra 28 bits */
+} gnss_eutra_cell_id_struct;
+
+
+typedef struct
+{
+ kal_uint16 physCellId; /* [0..511] */
+ kal_uint16 uarfcn; /* [0..16383] */
+ /* optional field */
+ kal_bool plmnIdValid;
+ plmn_id_struct plmnId;
+ kal_bool cellIdValid;
+ kal_uint32 cellId; /* utra 32 bits */
+} gnss_utra_cell_id_struct;
+
+
+typedef struct
+{
+ kal_uint16 bcchCarrier; /* [0..1023] */
+ kal_uint8 bsic; /* [0..63] */
+ /* optional field */
+ kal_bool plmnIdValid;
+ plmn_id_struct plmnId;
+ kal_bool cellIdValid; /* this validity flag indicate if lac and cellId are present or not */
+ kal_uint16 lac; /* lac 16 bits */
+ kal_uint16 cellId; /* gsm 16 bits */
+} gnss_gsm_cell_id_struct;
+
+
+typedef struct
+{
+ gnss_network_cell_type_enum type;
+
+ union
+ {
+ gnss_eutra_cell_id_struct eutra;
+ gnss_utra_cell_id_struct utra;
+ gnss_gsm_cell_id_struct gsm;
+ }
+ data;
+} gnss_network_cell_id_struct;
+
+
+typedef struct
+{
+ /* The total time since the particular frame structure start is secondsFromFrameStructureStart + fractionalSecondsFromFrameStructureStart */
+ kal_uint16 secondsFromFrameStructureStart; /* [0-12533] in seconds, this field specifies the number of seconds from the beginning of the longest frame structure in the corresponding air interface */
+ kal_uint32 fractionalSecondsFromFrameStructureStart; /* [0-3999999] in 250 nano-seconds, This field specifies the fractional part of the secondsFromFrameStructureStart in 250 ns resolution */
+ kal_bool framDriftValid;
+ kal_int8 frameDrift; /* [-64~63] in 2^(-30) seconds/second */
+ gnss_network_cell_id_struct cellID;
+} gnss_network_time_struct;
+
+
+typedef struct
+{
+ gnss_network_time_struct networkTime;
+ kal_bool referenceTimeUncValid;
+ kal_uint8 referenceTimeUnc; /* K = [0..127], uncertainty r (microseconds) = C*(((1+x)^K)-1), C=0.5, x=0.14 */
+ kal_bool bsAlignValid;
+ kal_bool bsAlign; /* indicate all cell with the same carrier freq. and TA/LA/RA are frame aligned */
+} gnss_ref_time_one_cell_struct;
+
+
+typedef struct
+{
+ gnss_system_time_struct systemTime;
+ kal_bool referenceTimeUncValid;
+ kal_uint8 referenceTimeUnc; /* K = [0..127], uncertainty r (microseconds) = C*(((1+x)^K)-1), C=0.5, x=0.14 */
+ kal_uint8 numGnssReferenceTimeForCells;
+ gnss_ref_time_one_cell_struct gnssReferenceTimeForCells[GNSS_MAX_REF_CELL_FTA_ELEMENT];
+} gnss_reference_time_struct;
+/* end for gnss reference time */
+
+
+/* start for gnss reference location */
+typedef struct
+{
+ kal_bool signOfLatitude; /* TRUE: SOUTH, FALSE: NORTH */
+ kal_uint32 degreesLatitude; /* [0..8388607] */
+ kal_int32 degreesLongitude; /* [-8388608..8388607] */
+ kal_bool signOfAltitude; /* TRUE: DEPTH, FALSE: HEIGHT */
+ kal_uint16 altitude; /* [0..32767] */
+ kal_uint8 uncertaintySemiMajor; /* K: [0..127], uncertainty r (meter) = C*((1+x)^K-1), C=10, x=0.1 */
+ kal_uint8 uncertaintySemiMinor; /* K: [0..127], uncertaintyr (meter) = C*((1+x)^K-1), C=10, x=0.1 */
+ kal_uint8 orientationMajorAxis; /* bearing angle degree: [0-179] */
+ kal_uint8 uncertaintyAltitude; /* K: [0..127], uncertainty h (meter) = C*((1+x)^K-1), C=45, x=0.025 */
+ kal_uint8 confidence; /* [0..100] */
+} gnss_reference_location_struct;
+/* end for gnss reference location */
+
+
+/* start for gnss ionospheric model */
+typedef struct
+{
+ kal_uint8 dataId; /* dataID, to indicate the klobuchar model parameter is apply for which GNSS, map to GNSS_ION_KLOBUCHAR_DATA_ID_VALUE_* */
+ kal_int8 alfa0; /* alpha0 [-128..127] (* 2^-30 seconds) */
+ kal_int8 alfa1; /* alpha1 [-128..127] (* 2^-27 seconds/semicircle) */
+ kal_int8 alfa2; /* alpha2 [-128..127] (* 2^-24 seconds/semicircle^2) */
+ kal_int8 alfa3; /* alpha3 [-128..127] (* 2^-24 seconds/semicircle^3) */
+ kal_int8 beta0; /* beta0 [-128..127] (* 2^11 seconds) */
+ kal_int8 beta1; /* beta1 [-128..127] (* 2^14 seconds/semicircle) */
+ kal_int8 beta2; /* beta2 [-128..127] (* 2^16 seconds/semicircle^2) */
+ kal_int8 beta3; /* beta3 [-128..127] (* 2^16 seconds/semicircle^3) */
+} gnss_klobuchar_model_paras_struct;
+
+
+typedef struct
+{
+ kal_uint16 ai0; /* [0..4095], to be changed to [0..2047] when A-Galileo is planed to support (because LPP ASN.1 is upgraded to Rel-12, but RRC and RRLP not) */
+ kal_int16 ai1; /* [0..4095], to be changed to kal_int16 [-1024..1023] when A-Galileo is planed to support (because LPP ASN.1 is upgraded to Rel-12, but RRC and RRLP not) */
+ kal_int16 ai2; /* [0..4095], to be changed to kal_int16 [-8192..8191] when A-Galileo is planed to support (because LPP ASN.1 is upgraded to Rel-12, but RRC and RRLP not) */
+
+ /* optional field */
+ /**
+ * iono storm flag represent five region: [value 0: no disturbance, value 1: disturbance]
+ * region 1: for the northern region (60�X<MODIP<90�X)
+ * region 2: for the northern middle region (30�X<MODIP<60�X)
+ * region 3: for the equatorial region (-30�X<MODIP<30�X)
+ * region 4: for the southern middle region (-60�X<MODIP<-30�X)
+ * region 5: for the southern region (-90�X<MODIP<-60�X)
+ */
+ kal_bool ionoStormFlag1Valid;
+ kal_bool ionoStormFlag1;
+ kal_bool ionoStormFlag2Valid;
+ kal_bool ionoStormFlag2;
+ kal_bool ionoStormFlag3Valid;
+ kal_bool ionoStormFlag3;
+ kal_bool ionoStormFlag4Valid;
+ kal_bool ionoStormFlag4;
+ kal_bool ionoStormFlag5Valid;
+ kal_bool ionoStormFlag5;
+} gnss_nequick_model_paras_struct;
+
+
+typedef struct
+{
+ kal_bool klobucharModelValid; /* for GPS, GLONASS, etc... */
+ gnss_klobuchar_model_paras_struct klobucharModel;
+ kal_bool neQuickModelValid; /* for Galileo */
+ gnss_nequick_model_paras_struct neQuickModel;
+} gnss_ionospheric_model_struct;
+/* end for gnss ionospheric model */
+
+
+/* start for gnss earth orientation parameters */
+typedef struct
+{
+ kal_uint16 teop; /* [0..65535], EOP data reference time in seconds, scale factor 2^4 seconds */
+ kal_int32 pmX; /* [-1048576..1048575], X-axis polar motion value at reference time in arc-seconds, scale factor 2^(-20) arc-seconds */
+ kal_int16 pmXdot; /* [-16384..16383], X-axis polar motion drift at reference time in arc-seconds/day, scale factor 2^(-21) arc-seconds/day */
+ kal_int32 pmY; /* [-1048576..1048575], Y-axis polar motion value at reference time in arc-seconds, scale factor 2^(-20) arc-seconds */
+ kal_int16 pmYdot; /* [-16384..16383] Y-axis polar motion drift at reference time in arc-seconds/day, scale factor 2^(-21) arc-seconds/day */
+ kal_int32 deltaUT1; /* [-1073741824..1073741823], UT1-UTC diff at reference time in seconds, scale factor 2^(-24) seconds */
+ kal_int32 deltaUT1dot; /* [-262144..262143], the rate of UT1-UTC diff at reference time in seconds/day, scale factor 2^(-25) seconds/day */
+} gnss_earth_orient_params_struct;
+/* end for gnss earth orientation parameters */
+
+
+/*=== GNSS Generic Assistance Data ===*/
+
+/* start for gnss time model */
+/**
+ * in LPP, location server could provide up to 15 GNSS-GNSS system time offset
+ * in RRC/RRLP, location server could provide up to 7 GNSS-GNSS system time offset
+ * i.e. generic assist data is for GPS, time model could provide GPS-GLONASS time offset
+ */
+typedef struct
+{
+ /* note that RRC/RRLP tA0, tA1 range is larger than LPP, although scale factor is the same */
+ kal_uint16 gnssTimeModelRefTime; /* [0..65535], the reference time of week, scale factor 2^4 seconds */
+ kal_int32 tA0; /* [-67108864..67108863] for LPP, [-2147483648 .. 2147483647] for RRC/RRLP, the bias coefficient, scale factor 2^(-35) seconds */
+ kal_bool tA1Valid;
+ kal_int32 tA1; /* [-4096..4095] for LPP, [-8388608 .. 8388607] for RRC/RRLP, the drift coefficient, scale factor 2^(-51) seconds/second */
+ kal_bool tA2Valid;
+ kal_int8 tA2; /* [-64..63], the drift rate correction coefficient, scale factor 2^(-68) seconds/second^2 */
+ gnss_to_id_enum gnssToId; /* GPS, Galileo, QZSS, GLOANSS, BDS */
+ /* optional field */
+ kal_bool weekNumberValid;
+ kal_uint16 weekNumber; /* [0..8191], the reference week */
+ kal_bool deltaTValid;
+ kal_int8 deltaT; /* [-128..127], the integer number of seconds of GNSS-GNSS time offset */
+} gnss_time_model_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numTimeModels;
+ gnss_time_model_element_struct gnssTimeModels[GNSS_MAX_TIME_MODEL_ELEMENT]; /* 6-15 is reserved */
+} gnss_time_model_list_struct;
+
+/* end for gnss time model */
+
+
+/* start for gnss dgnss correction */
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint16 iod; /* [11 bits], for issue of data field */
+ kal_uint8 udre; /* [0-3] */
+ kal_int16 pseudoRangeCor; /* [-2047..2047], the correction to the pseudorange for the particular satellite at dgnssRefTime, scale factor 0.32 meters */
+ kal_int8 rangeRateCor; /* [-127..127], the rate-of-change of the pseudorange correction for the particular satellite, scale factor 0.032 meters/sec */
+ /* optional field */
+ kal_bool udreGrowthRateValid;
+ kal_uint8 udreGrowthRate; /* [0-7], an estimate of the growth rate of uncertainty (1-�m) in the corrections for the particular satellite */
+ kal_bool udreValidityTimeValid;
+ kal_uint8 udreValidityTime; /* [0-7], the time when the udreGrowthRate field applies and is included if udreGrowthRate is included */
+} gnss_dgnss_corrections_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 gnssSignalId; /* map to GNSS_SGN_ID_VALUE_* */
+ kal_uint8 gnssStatusHealth; /* [0-7], for UDRE scale factor */
+ kal_uint8 numCorrectionElements;
+ gnss_dgnss_corrections_element_struct correctionElements[GNSS_MAX_DGNSS_CORRECTION_INFO_ELEMENT];
+} gnss_dgnss_signal_type_element_struct;
+
+
+typedef struct
+{
+ kal_uint16 dgnssRefTime; /* [0..3599], the time for which the DGNSS corrections are valid, modulo 1 hour, scale factor 1 seconds */
+ kal_uint8 numSgnTypes;
+ gnss_dgnss_signal_type_element_struct sgnTypes[GNSS_MAX_DGNSS_SGN_TYPE_ELEMENT];
+} gnss_diff_correction_struct;
+/* end for gnss dgnss correction */
+
+
+/* start for gnss navigation model */
+typedef struct
+{
+ kal_uint16 stanClockToc; /* [0..16383] */
+ kal_int16 stanClockAF2; /* [-32..31] */
+ kal_int32 stanClockAF1; /* [-1048576..1048575] */
+ kal_int32 stanClockAF0; /* [-1073741824..1073741823] */
+ kal_uint8 sisa; /* [0..255] */
+ /* optional field */
+ kal_bool stanClockTgdValid;
+ kal_int16 stanClockTgd; /* [-512..511], scale factor 2^(-32) seconds */
+ kal_bool stanModelIdValid;
+ kal_uint8 stanModelID; /* [0..1], 0 for I/Nav, 1 for F/Nav Galileo clock clock */
+} gnss_std_clock_model_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numStdClkElement;
+ gnss_std_clock_model_element_struct stdClkElement[GNSS_MAX_NAV_STD_CLK_MODEL_ELEMENT];
+} gnss_standard_clock_model_struct;
+
+
+typedef struct
+{
+ kal_uint16 navToc; /* [0..37799], time of clock, scale factor 2^4 seconds */
+ kal_int8 navaf2; /* [-128..127], clock correction polynomial coefficient, scale factor 2^(-55) seconds/second^2 */
+ kal_int16 navaf1; /* [-32768..32767], clock correction polynomial coefficient, scale factor 2^(-43) seconds/second */
+ kal_int32 navaf0; /* [-2097152..2097151], clock correction polynomial coefficient, scale factor 2^(-31) seconds */
+ kal_int8 navTgd; /* [-128..127], group delay, scale factor 2^(-31) seconds */
+} gnss_nav_clock_model_struct;
+
+
+typedef struct
+{
+ kal_uint16 cnavToc; /* [0..2015], clock data reference time of week, scale factor 300 seconds */
+ kal_uint16 cnavTop; /* [0..2015], clock data predict time of week, scale factor 300 seconds */
+ kal_int8 cnavURA0; /* [-16..15], SV clock accuracy index */
+ kal_uint8 cnavURA1; /* [0..7], SV clock accuracy change index */
+ kal_uint8 cnavURA2; /* [0..7], SV clock accuracy change rate index */
+ kal_int16 cnavAf2; /* [-512..511], SV clock drift rate correction coefficient, scale factor 2^(-60) seconds/second^2 */
+ kal_int32 cnavAf1; /* [-524288..524287], SV clock drift correction coefficient, scale factor 2^(-48) seconds/second */
+ kal_int32 cnavAf0; /* [-33554432..33554431], SV clock bias correction coefficient, scale 2^(-35) seconds */
+ kal_int16 cnavTgd; /* [-4096..4095], group delay, scale factor 2^(-35) seconds */
+ kal_bool cnavISCl1cpValid;
+ kal_int16 cnavISCl1cp; /* [-4096..4095], inter signal group delay correction, scale factor 2^(-35) seconds */
+ kal_bool cnavISCl1cdValid;
+ kal_int16 cnavISCl1cd; /* [-4096..4095], inter signal group delay correction, scale factor 2^(-35) seconds */
+ kal_bool cnavISCl1caValid;
+ kal_int16 cnavISCl1ca; /* [-4096..4095], inter signal group delay correction, scale factor 2^(-35) seconds */
+ kal_bool cnavISCl2cValid;
+ kal_int16 cnavISCl2c; /* [-4096..4095], inter signal group delay correction, scale factor 2^(-35) seconds */
+ kal_bool cnavISCl5i5Valid;
+ kal_int16 cnavISCl5i5; /* [-4096..4095], inter signal group delay correction, scale factor 2^(-35) seconds */
+ kal_bool cnavISCl5q5Valid;
+ kal_int16 cnavISCl5q5; /* [-4096..4095], inter signal group delay correction, scale factor 2^(-35) seconds */
+} gnss_cnav_clock_model_struct;
+
+
+typedef struct
+{
+ kal_int32 gloTau; /* [-2097152..2097151], satellite clock offset, scale factor 2^(-30) seconds */
+ kal_int16 gloGamma; /* [-1024..1023], relative frequency offset from nominal value, scale factor 2^(-40) */
+ kal_bool gloDeltaTauValid;
+ kal_int8 gloDeltaTau; /* [-16..15], time difference between transmission in G2 and G1, scale factor 2^(-30) seconds */
+} gnss_glonass_clock_model_struct;
+
+
+typedef struct
+{
+ kal_uint16 sbasTo; /* [0..5399], scale factor 16 seconds */
+ kal_int16 sbasAgfo; /* [-2048..2047], scale factor 2^(-31) seconds */
+ kal_int8 sbasAgf1; /* [-128..127], scale factor 2^(-40) seconds/second */
+} gnss_sbas_clock_model_struct;
+
+
+typedef struct
+{
+ kal_uint8 bdsAODC; /* [0..31], age of data, clock (AODC) */
+ kal_uint32 bdsToc; /* [0..131071], time of clock, scale factor 2^3 seconds */
+ kal_int32 bdsA0; /* [-8388608..8388607], clock correction polynomial coefficient, scale factor 2^(-33) seconds */
+ kal_int32 bdsA1; /* [-2097152..2097151], clock correction polynomial coefficient, scale factor 2^(-50) sec/sec */
+ kal_int32 bdsA2; /* [-1024..1023], clock correction polynomial coefficient, scale factor 2^(-66) sec/sec2 */
+ kal_int32 bdsTgd1; /* [-512..511], equipment group delay differential, scale factor 0.1 nanosecond */
+} gnss_bds_clock_model_struct;
+
+
+typedef struct
+{
+ gnss_clock_model_type_enum type;
+
+ union
+ {
+ gnss_standard_clock_model_struct standardClockModelList; /* Model-1: usually used for Galileo */
+ gnss_nav_clock_model_struct navClockModel; /* Model-2: for GPS */
+ gnss_cnav_clock_model_struct cnavClockModel; /* Model-3: for modernized GPS */
+ gnss_glonass_clock_model_struct glonassClockModel; /* Model-4: for GLONASS */
+ gnss_sbas_clock_model_struct sbasClockModel; /* Model-5: for SBAS */
+ gnss_bds_clock_model_struct bdsClockModel; /* Model-6: for BDS */
+ } data;
+} gnss_clock_model_struct;
+
+typedef struct
+{
+ kal_uint16 keplerToe; /* [0 .. 16383], time-of-ephemeris, scale factor 60 seconds */
+ kal_int32 keplerW; /* [-2147483648..2147483647], argument of perigee, scale factor 2^(-31) semi-circles */
+ kal_int16 keplerDeltaN; /* [-32768..32767], mean motion difference from computed value, scale factor 2^(-43) semi-circles/second */
+ kal_int32 keplerM0; /* [-2147483648..2147483647], mean anomaly at reference time, scale factor 2^(-31) semi-circles */
+ kal_int32 keplerOmegaDot; /* [-8388608.. 8388607], longitude of ascending node of orbit plane at weekly epoch, scale factor 2^(-43) semi-circles/second */
+ kal_uint32 keplerE; /* [0..4294967295], eccentricity, scale factor 2^(-33) */
+ kal_int16 keplerIDot; /* [-8192..8191], rate of inclination angle, scale factor 2^(-43) semi-circles/second */
+ kal_uint32 keplerAPowerHalf; /* [0.. 4294967295], semi-major Axis, scale factor 2^(-19) meters^(0.5)*/
+ kal_int32 keplerI0; /* [-2147483648..2147483647], inclination angle at reference time, scale factor 2^(-31) semi-circles */
+ kal_int32 keplerOmega0; /* [-2147483648..2147483647], longitude of ascending node of orbit plane at weekly epoch, scale factor 2^(-31) semi-circles */
+ kal_int16 keplerCrs; /* [-32768..32767], amplitude of the sine harmonic correction term to the orbit radius, scale factor 2^(-5) meters */
+ kal_int16 keplerCis; /* [-32768..32767], amplitude of the sine harmonic correction term to the angle of inclination, scale factor 2^(-29) radians */
+ kal_int16 keplerCus; /* [-32768..32767], amplitude of the sine harmonic correction term to the argument of latitude, scale factor 2^(-29) radians */
+ kal_int16 keplerCrc; /* [-32768..32767], amplitude of the cosine harmonic correction term to the orbit radius, scale factor 2^(-5) meters */
+ kal_int16 keplerCic; /* [-32768..32767], amplitude of the cosine harmonic correction term to the angle of inclination, scale factor 2^(-29) radians */
+ kal_int16 keplerCuc; /* [-32768..32767], amplitude of the cosine harmonic correction term to the argument of latitude, scale factor 2^(-29) radians */
+} gnss_nav_model_keplerian_set_struct;
+
+typedef struct
+{
+ kal_uint32 reserved1; /* [0..8388607], 23 bit field */
+ kal_uint32 reserved2; /* [0..16777215], 24 bit field */
+ kal_uint32 reserved3; /* [0..16777215], 24 bit field */
+ kal_uint16 reserved4; /* [0..65535], 16 bit field */
+} gnss_nav_model_nav_keplerian_set_struct_add_nav_param_ephemSF1Rsvd_struct;
+
+
+typedef struct
+{
+ kal_uint8 ephemCodeOnL2; /* [0..3] */
+ kal_uint8 ephemL2Pflag; /* [0..1] */
+ gnss_nav_model_nav_keplerian_set_struct_add_nav_param_ephemSF1Rsvd_struct ephemSF1Rsvd;
+ kal_uint8 ephemAODA; /* [0..31] */
+} gnss_nav_model_nav_keplerian_set_struct_add_nav_param_struct;
+
+
+typedef struct
+{
+ kal_uint8 navURA; /* [0..15], SV accuracy */
+ kal_uint8 navFitFlag; /* [0..1], fit interval indication */
+ kal_uint16 navToe; /* [0..37799], time of ephemeris, scale factor 2^4 seconds */
+ kal_int32 navOmega; /* [-2147483648..2147483647], argument of perigee, scale factor 2^(-31) semi-circles */
+ kal_int16 navDeltaN; /* [-32768..32767], mean motion difference from computed value, scale factor 2^(-43) semi-circles/second */
+ kal_int32 navM0; /* [-2147483648..2147483647], mean anonmaly at reference time, scale factor 2^(-31) semi-circles */
+ kal_int32 navOmegaADot; /* [-8388608..8388607], rate of right ascension, scale factor 2^(-43) semi-circles/second */
+ kal_uint32 navE; /* [0..4294967295], eccentricity, scale factor 2^(-33) */
+ kal_int16 navIDot; /* [-8192..8191], rate of inclination angle, scale factor 2^(-43) semi-circles/second */
+ kal_uint32 navAPowerHalf; /* [0..4294967295], square root of semi-major axis, scale factor 2^(-19) meters^(0.5) */
+ kal_int32 navI0; /* [-2147483648..2147483647], inclination angle at reference time, scale factor 2^(-31) semi-circles */
+ kal_int32 navOmegaA0; /* [-2147483648..2147483647], longitude of ascending node of orbit plane at weekly epoch, scale factor 2^(-31) semi-circles*/
+ kal_int16 navCrs; /* [-32768..32767], amplitude of sine harmonic correction term to the orbit radius, scale factor 2^(-5) meters */
+ kal_int16 navCis; /* [-32768..32767], amplitude of the sine harmonic correction term to the angle of inclination, scale factor 2^(-29) radians */
+ kal_int16 navCus; /* [-32768..32767], amplitude of the sine harmonic correction term to the argument of latitude, scale factor 2^(-29) radians */
+ kal_int16 navCrc; /* [-32768..32767], amplitude of the cosine harmonic correction term to the orbit radius, scale factor 2^(-5) meters */
+ kal_int16 navCic; /* [-32768..32767], amplitude of the cosine harmonic correction term to the angle of inclination, scale factor 2^(-29) radians */
+ kal_int16 navCuc; /* [-32768..32767], amplitude of the cosine harmonic correction term to the argument of latitude, scale factor 2^(-29) radians */
+ /* optional field */
+ kal_bool addNavParamValid;
+ gnss_nav_model_nav_keplerian_set_struct_add_nav_param_struct addNAVparam; /* data and reserved bits in GPS NAV message */
+} gnss_nav_model_nav_keplerian_set_struct;
+
+
+typedef struct
+{
+ kal_uint16 cnavTop; /* [0..2015], data predict time of week, scale factor 300 seconds */
+ kal_int8 cnavURAindex; /* [-16..15], SV accuracy */
+ kal_int32 cnavDeltaA; /* [-33554432..33554431], semi-major axis difference at reference time, scale factor 2^(-9) meters */
+ kal_int32 cnavAdot; /* [-16777216..16777215], change rate in semi-major axis, scale factor 2^(-21) meters/sec */
+ kal_int32 cnavDeltaNo; /* [-65536..65535], mean motion difference from computed value at reference time, scale factor 2^(-44) semi-circles/second */
+ kal_int32 cnavDeltaNoDot; /* [-4194304..419430], rate of mean motion difference from computed value, scale factor 2^(-57) semi-circles/seconds */
+ kal_int64 cnavMo; /* [-4294967296..4294967295], mean anomaly at reference time, scale factor 2^(-32) semi-circles */
+ kal_uint64 cnavE; /* [0..8589934591], eccentricity, scale factor 2^(-34) */
+ kal_int64 cnavOmega; /* [-4294967296..4294967295], argument of perigee, scale factor 2^(-32) semi-circles */
+ kal_int64 cnavOMEGA0; /* [-4294967296..4294967295], reference right ascension angle, scale factor 2^(-32) semi-circles */
+ kal_int32 cnavDeltaOmegaDot; /* [-65536..65535], rate of right ascension difference, scale factor 2^(-44) semi-circles/second */
+ kal_int64 cnavIo; /* [-4294967296..4294967295], inclination angle at reference time, scale factor 2^(-32) semi-circles */
+ kal_int16 cnavIoDot; /* [-16384..16383], rate of inclination angle, scale factor 2^(-44) semi-circles/second */
+ kal_int16 cnavCis; /* [-32768..32767], amplitude of the sine harmonic correction term to the angle of inclination, scale factor 2^(-30) radians */
+ kal_int16 cnavCic; /* [-32768..32767], amplitude of the cosine harmonic correction term to the angle of inclination, scale factor 2^(-30) radians */
+ kal_int32 cnavCrs; /* [-8388608..8388607], amplitude of sine harmonic correction term to the orbit radius, scale factor 2^(-8) meters */
+ kal_int32 cnavCrc; /* [-8388608..8388607], amplitude of the cosine harmonic correction term to the orbit radius, scale factor 2^(-8) meters */
+ kal_int32 cnavCus; /* [-1048576..1048575], amplitude of the sine harmonic correction term to the argument of latitude, scale factor 2^(-30) radians */
+ kal_int32 cnavCuc; /* [-1048576..1048575], amplitude of the cosine harmonic correction term to the argument of latitude, scale factor 2^(-30) radians */
+} gnss_nav_model_cnav_keplerian_set_struct;
+
+
+typedef struct
+{
+ kal_uint8 gloEn; /* [0..31] */
+ kal_uint8 gloP1; /* 2 bit field, time interval between two adjacent values of tb */
+ kal_bool gloP2; /* change of tb flag */
+ kal_uint8 gloM; /* [0..3], type of satellite */
+ kal_int32 gloX; /* [-67108864..67108863], x-coordinate of satellite at time tb, scale factor 2^(-11) kilometers */
+ kal_int32 gloXdot; /* [-8388608..8388607], x-coordinate of satellite velocity at time tb, scale factor 2^(-20) kilometers/second */
+ kal_int8 gloXdotdot; /* [-16..15], x-coordinate of satellite acceleration at time tb, scale factor 2^(-30) kilometers/second^2 */
+ kal_int32 gloY; /* [-67108864..67108863], y-coordinate of satellite at time tb, scale factor 2^(-11) kilometers */
+ kal_int32 gloYdot; /* [-8388608..8388607], y-coordinate of satellite velocity at time tb, scale factor 2^(-20) kilometers/second */
+ kal_int8 gloYdotdot; /* [-16..15], y-coordinate of satellite acceleration at time tb, scale factor 2^(-30) kilometers/second^2 */
+ kal_int32 gloZ; /* [-67108864..67108863], z-coordinate of satellite at time tb, scale factor 2^(-11) kilometers */
+ kal_int32 gloZdot; /* [-8388608..8388607)], z-coordinate of satellite velocity at time tb, scale factor 2^(-20) kilometers/second */
+ kal_int8 gloZdotdot; /* [-16..15], z-coordinate of satellite acceleration at time tb, scale factor 2^(-30) kilometers/second^2 */
+} gnss_nav_model_glonass_ecef_struct;
+
+
+typedef struct
+{
+ kal_bool sbasToValid;
+ kal_uint16 sbasTo; /* [0..5399], time applicability, scale factor 16 seconds */
+ kal_uint8 sbasAccuracy; /* 4 bits field, accuracy */
+ kal_int32 sbasXg; /* [-536870912..536870911], scale factor 0.08 meters */
+ kal_int32 sbasYg; /* [-536870912..536870911], scale factor 0.08 meters */
+ kal_int32 sbasZg; /* [-16777216..16777215], 0.4 meters */
+ kal_int32 sbasXgDot; /* [-65536..65535], rate of change, scale factor 0.000625 meters/second */
+ kal_int32 sbasYgDot; /* [-65536..65535], rate of change, scale factor 0.000625 meters/second */
+ kal_int32 sbasZgDot; /* [-131072..131071], rate of change, scale factor 0.004 meters/second */
+ kal_int16 sbasXgDotDot; /* [-512..511], acceleration, scale factor 0.0000125 meters/second^2 */
+ kal_int16 sbagYgDotDot; /* [-512..511], acceleration, scale factor 0.0000125 meters/second^2 */
+ kal_int16 sbasZgDotDot; /* [-512..511], acceleration, scale factor 0.0000625 meters/second^2 */
+} gnss_nav_model_sbas_ecef_struct;
+
+typedef struct
+{
+ kal_uint8 bdsAODE; /* [0..31], age of data, ephemeris (AODE) */
+ kal_uint8 bdsURAI; /* [0..15], URA Index, URA is used to describe the signal-in-space accuracy in meters */
+ kal_uint32 bdsToe; /* [0..131071], ephemeris reference time, scale factor 2^3 seconds */
+ kal_uint32 bdsAPowerHalf; /* [0..4294967295], square root of semi-major axis, Scale factor 2^(-19) meters^(1/2) */
+ kal_uint32 bdsE; /* [0..4294967295], eccentricity, dimensionless, scale factor 2^(-33) */
+ kal_int32 bdsW; /* [-2147483648..2147483647], argument of perigee, scale factor 2^(-31) semi-circles */
+ kal_int16 bdsDeltaN; /* [-32768..32767], mean motion difference from computed value, scale factor 2-43 semi-circles/sec */
+ kal_int32 bdsM0; /* [-2147483648..2147483647], mean anomaly at reference time, scale factor 2^(-31) semi-circles */
+ kal_int32 bdsOmega0; /* [-2147483648..2147483647], longitude of ascending node of orbital of plane computed according to reference time, scale factor 2^(-31) semi-circles */
+ kal_int32 bdsOmegaDot; /* [-8388608..8388607], rate of right ascension, scale factor 2^(-43) semi-circles/sec */
+ kal_int32 bdsI0; /* [-2147483648..2147483647], inclination angle at reference time, scale factor 2^(-31) semi-circles */
+ kal_int16 bdsIDot; /* [-8192..8191], rate of inclination angle, scale factor 2^(-43) semi-circles/sec */
+ kal_int32 bdsCuc; /* [-131072..131071], amplitude of cosine harmonic correction term to the argument of latitude, scale factor 2^(-31) radians */
+ kal_int32 bdsCus; /* [-131072..131071], amplitude of sine harmonic correction term to the argument of latitude, scale factor 2^(-31) radians */
+ kal_int32 bdsCrc; /* [-131072..131071], amplitude of cosine harmonic correction term to the orbit radius, scale factor 2^(-6) meters */
+ kal_int32 bdsCrs; /* [-131072..131071], amplitude of sine harmonic correction term to the orbit radius, scale factor 2^(-6) meters */
+ kal_int32 bdsCic; /* [-131072..131071], amplitude of cosine harmonic correction term to the angle of inclination, scale factor 2^(-31) radians */
+ kal_int32 bdsCis; /* [-131072..131071], amplitude of sine harmonic correction term to the angle of inclination, scale factor 2^(-31) radians */
+} gnss_nav_model_bds_keplerian_set_struct;
+
+
+typedef struct
+{
+ gnss_orbit_model_type_enum type;
+
+ union
+ {
+ gnss_nav_model_keplerian_set_struct keplerianSet; /* Model-1: usually used for Galileo */
+ gnss_nav_model_nav_keplerian_set_struct navKeplerianSet; /* Model-2: for GPS series */
+ gnss_nav_model_cnav_keplerian_set_struct cnavKeplerianSet; /* Model-3: for modernized GPS series */
+ gnss_nav_model_glonass_ecef_struct glonassECEF; /* Model-4: for GLONASS */
+ gnss_nav_model_sbas_ecef_struct sbasECEF; /* Model-5: for SBAS */
+ gnss_nav_model_bds_keplerian_set_struct bdsKeplerianSet; /* Model-6: for BDS */
+ } data;
+} gnss_orbit_model_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 svHealth; /* 8 bits */
+ kal_uint16 iod; /* 11 bits */
+ gnss_clock_model_struct clockModel;
+ gnss_orbit_model_struct orbitModel;
+ /* Optional field */
+ kal_bool svHealthExt_v1240Valid;
+ kal_uint8 svHealthExt_v1240; /* 4 bits */
+} gnss_nav_model_satellite_element;
+
+
+typedef struct
+{
+ kal_bool nonBroadcastIndFlag; /* [0..1] value 0: navigation model data correspond to satellite broadcasted data;
+ value 1: navigation model data is not derived from satellite broadcasted data */
+ kal_uint8 numSatElement;
+ gnss_nav_model_satellite_element satElement[GNSS_MAX_NAV_SAT_ELEMENT];
+} gnss_navigation_model_struct;
+
+
+typedef struct
+{
+ kal_bool nonBroadcastIndFlag; /* [0..1] value 0: navigation model data correspond to satellite broadcasted data;
+ value 1: navigation model data is not derived from satellite broadcasted data */
+ kal_uint8 numSatElement;
+ DLIST_HANDLE navDynamicHandle;
+ DLIST_HEAD navDynamicList;
+} gnss_navigation_model_dynamic_struct;
+/* end for gnss navigation model */
+
+
+/* start for gnss real time integrity */
+typedef struct
+{
+ kal_uint8 badSVID; /* [0..63] */
+ kal_bool badSignalIDValid;
+ kal_uint8 badSignalID; /* identidy the bad signal or signals of a satellite, bit string representation, map to GNSS_SGN_ID_BITMAP_* */
+} gnss_bad_signal_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numBadSignalElement;
+ gnss_bad_signal_element_struct badSignalElement[GNSS_MAX_RTI_BAD_SAT_ELEMENT];
+} gnss_real_time_integrity_struct;
+/* end for gnss real time integrity */
+
+
+/* start for gnss data bit assistance */
+typedef struct
+{
+ kal_uint8 gnssSignalType; /* identify GNSS signal type, map to GNSS_SGN_ID_VALUE_* */
+ kal_uint8 numGnssDataBits;
+ kal_uint8 gnssDataBits[GNSS_MAX_DBA_BIT_LENGTH/8]; /* data bit original max is 1024 bits */
+} gnss_data_bit_signal_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 numGnssDataBitsSgnElement;
+ gnss_data_bit_signal_element_struct gnssDataBitsSgnElement[GNSS_MAX_DBA_SGN_TYPE_ELEMENT];
+} gnss_data_bit_satellite_element_struct;
+
+
+typedef struct
+{
+ kal_uint16 gnssTOD; /* [0..3599], reference time of the first bit of the data modulo 1 hour, scale factor 1 second */
+ kal_bool gnssTODfracValid;
+ kal_uint16 gnssTODfrac; /* [0..999], fractional part of gnssTD, scale factor 1 milli-second */
+ kal_uint8 numGnssDataBitsSatElement;
+ gnss_data_bit_satellite_element_struct gnssDataBitsSatElement[GNSS_MAX_DBA_SAT_ELEMENT];
+} gnss_data_bit_assistance_struct;
+/* end for gnss data bit assistance */
+
+
+/* start for gnss acquisition assistance */
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_int16 doppler0; /* [-2048..2047], Doppler (0th order term) value for velocity, scale factor 0.5 m/s in th range from -1024 m/s to +1023.5 m/s */
+ kal_uint8 doppler1; /* [0..63], Doppler (1th order term) value for acceleration, scale factor 1/210 m/s^2 in the range from -0.2 m/s^2 to +0.1 m/s^2 */
+ kal_uint8 dopplerUncertainty; /* [0..4], defined values: 2.5 m/s, 5 m/s, 10 m/s, 20 m/s, 40 m/s encoded as integer range 0-4 by 2^(-n)*40 m/s, n=0-4 */
+ kal_uint16 codePhase; /* [0..1022], scale factor 2^(-10) ms in the range from 0 to (1-2^(-10)) ms */
+ kal_uint8 intCodePhase; /* [0..127], integer codephase, scale factor 1ms */
+ kal_uint8 codePhaseSearchWindow; /* [0..31], map to value-to-searchwindow table (ms) */
+ kal_uint16 azimuth; /* [0..511], azimuth angle a, x-degrees of satellite x<=a<x+0.703125, scale factor 0.703125 degrees */
+ kal_uint8 elevation; /* [0..127], elevation angle e, y-degrees of satellite y>=e<y+0.703125, scale factr 0.703125 degrees */
+ /* optional field */
+ kal_bool codePhase1023Valid;
+ kal_bool codePhase1023; /* only use if codePhase is 1022, codePhase value is 1023*2^(-10) = (1-2^(-10)) ms */
+ /* if support dopplerUncertaintyExtR10, should ignore dopplerUncertainty field */
+ kal_bool dopplerUncertaintyExtR10Valid;
+ gnss_acq_assist_doppler_uncertainty_ext_enum dopplerUncertaintyExtR10; /* enumerated value map to 60 m/s, 80 m/s, 100 m/s, 120 ms, and No Information */
+} gnss_acquisition_assist_element_struct;
+
+
+/**
+ * please note that RRC/RRLP use alternative word to represent GNSS Acquisition Assistance:
+ * RRC: GANSS-ReferenceMeasurementInfo
+ * RRLP: ganssRefMeasurementAssist
+ */
+typedef struct
+{
+ kal_uint8 gnssSignalID; /* GNSS type, map to GNSS_SGN_ID_VALUE_* */
+ kal_uint8 numGnssAcqAssistElement;
+ gnss_acquisition_assist_element_struct gnssAcqAssistElement[GNSS_MAX_ACQ_ASSIST_SAT_ELEMENT];
+ kal_bool confidenceR10Valid;
+ kal_uint8 confidenceR10; /* only for LPP */
+} gnss_acquisition_assistance_struct;
+/* end for gnss acquisition assistance */
+
+
+/* start for gnss almanac */
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint16 kepAlmanacE; /* [0..2047], eccentricity, scale factor 2^(-16) */
+ kal_int16 kepAlmanacDeltaI; /* [-1024..1023], scale factor 2^(-14) semi-circles */
+ kal_int16 kepAlmanacOmegaDot; /* [-1024..1023], longitude of ascending node of orbit plane at weekly epoch, scale factor 2^(-33) semi-circles/seconds */
+ kal_uint8 kepSVStatusINAV; /* bit string (size(4)) */
+ kal_uint8 kepSVStatusFNAV; /* bit string (size(2)) */
+ kal_int32 kepAlmanacAPowerHalf; /* [-4096..4095], semi-major axis delta, scale factor 2^(-9) meters^0.5 */
+ kal_int16 kepAlmanacOmega0; /* [-32768..32767], longitude of ascending node of orbit plane at weekly epoch, scale factor 2^(-15) semi-circles */
+ kal_int16 kepAlmanacW; /* [-32768..32767], argument of perigee, scale factor 2^(-15) semi-circles */
+ kal_int16 kepAlmanacM0; /* [-32768..32767], mean anomaly at reference time, scale factor 2^(-15) semi-circles */
+ kal_int16 kepAlmanacAF0; /* [-32768..32767], scale factor 2^(-19) seconds */
+ kal_int16 kepAlmanacAF1; /* [-4096..4095], scale factor 2^(-38) seconds */
+} gnss_almanac_keplerian_set_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint16 navAlmE; /* [0..65535], eccentricity, scale factor 2^(-21) */
+ kal_int16 navAlmDeltaI; /* [-32768..32767], correction to inclination, scale factor 2^(-19) semi-circles */
+ kal_int16 navAlmOMEGADOT; /* [-32768..32767], rate of right ascension, scale factor 2^(-38) semi-circles/second */
+ kal_uint8 navAlmSVHealth; /* [0..255] */
+ kal_uint32 navAlmSqrtA; /* [0..16777215], square root of the semi-major axis, scale factor 2^(-11) meters^0.5 */
+ kal_int32 navAlmOMEGAo; /* [-8388608..8388607], longitude of ascending node of orbit plane at weekly epoch, scale factor 2^(-23) semi-circles */
+ kal_int32 navAlmOmega; /* [-8388608..8388607], argument of perigee, , scale factor 2^(-23) semi-circles */
+ kal_int32 navAlmMo; /* [-8388608..8388607], mean anomaly at reference time, scale factor 2^(-23) semi-circles */
+ kal_int16 navAlmaf0; /* [-1024..1023], apparent satellite clock correction, scale factor 2^(-20) seconds */
+ kal_int16 navAlmaf1; /* [-1024..1023], apparent satellite clock correction, scale factor 2^(-38) semi-circles seconds/second */
+} gnss_almanac_nav_keplerian_set_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_int8 redAlmDeltaA; /* [-128..127], scale factor 2^9 meters */
+ kal_int8 redAlmOmega0; /* [-64..63], scale factor 2^(-6) semi-circles */
+ kal_int8 redAlmPhi0; /* [-64..63], scale factor 2^(-6) semi-circles */
+ kal_bool redAlmL1Health; /* L1 health */
+ kal_bool redAlmL2Health; /* L2 health */
+ kal_bool redAlmL5Health; /* L5 health */
+} gnss_almanac_reduced_keplerian_set_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint16 midiAlmE; /* [0..2047], eccentricity, scale factor 2^(-16) */
+ kal_int16 midiAlmDeltaI; /* [-1024..1023], scale factor 2^(-14) semi-circles */
+ kal_int16 midiAlmOmegaDot; /* [-1024..1023], scale factor 2^(-33) semi-circles/second */
+ kal_uint32 midiAlmSqrtA; /* [0..131071], scale factor 2^(-4) meters^0.5 */
+ kal_int16 midiAlmOmega0; /* [-32768..32767], scale factor 2^(-15) semi-circles */
+ kal_int16 midiAlmOmega; /* [-32768..32767], scale factor 2^(-15) semi-circles */
+ kal_int16 midiAlmMo; /* [-32768..32767], scale factor 2^(-15) semi-circles */
+ kal_int16 midiAlmaf0; /* [-1024..1023], scale factor 2^(-20) seconds */
+ kal_int16 midiAlmaf1; /* [-512..511], scale factor 2^(-37) seconds/second */
+ kal_bool midiAlmL1Health; /* L1 health */
+ kal_bool midiAlmL2Health; /* L2 health */
+ kal_bool midiAlmL5Health; /* L5 health */
+} gnss_almanac_midi_keplerian_set_struct;
+
+
+typedef struct
+{
+ kal_uint16 gloAlmNA; /* [1..1461], N^A, scale factor 1 days */
+ kal_uint8 gloAlmnA; /* [1..24] */
+ kal_uint8 gloAlmHA; /* [0..31] */
+ kal_int32 gloAlmLambdaA; /* [-1048576..1048575], scale factor 2^(-20) semi-circles */
+ kal_uint32 gloAlmtlambdaA; /* [0..2097151], scale factor 2(^-5) seconds */
+ kal_int32 gloAlmDeltaIa; /* [-131072..131071], scale factor 2^(-20) semi-circles */
+ kal_int32 gloAlmDeltaTA; /* [-2097152..2097151], scale factor 2^(-9) seconds/orbit period */
+ kal_int8 gloAlmDeltaTdotA; /* [-64..63], scale factor 2^(-14) seconds/orbit period */
+ kal_uint16 gloAlmEpsilonA; /* [0..32767], scale factor 2^(-20) */
+ kal_int16 gloAlmOmegaA; /* [-32768..32767], scale factor 2^(-15) semi-circles */
+ kal_int16 gloAlmTauA; /* [-512..511], scale factor 2^(-18) seconds */
+ kal_uint8 gloAlmCA; /* [0..1] */
+ kal_bool gloAlmMAValid;
+ kal_uint8 gloAlmMA; /* 2 bit field */
+} gnss_almanac_glonass_set_struct;
+
+
+typedef struct
+{
+ kal_uint8 sbasAlmDataID; /* [0..3] */
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 sbasAlmHealth; /* 8 bit field */
+ kal_int16 sbasAlmXg; /* [-16384..16383], scale factor 2600 meters */
+ kal_int16 sbasAlmYg; /* [-16384..16383], scale factor 2600 meters */
+ kal_int16 sbasAlmZg; /* [-256..255], scale factor 26000 meters */
+ kal_int8 sbasAlmXgdot; /* [-4..3], rate of change, scale factor 10 meters/second */
+ kal_int8 sbasAlmYgDot; /* [-4..3], rate of change, scale factor 10 meters/second */
+ kal_int8 sbasAlmZgDot; /* [-8..7], rate of change, scale factor 40.96 meters/second */
+ kal_uint16 sbasAlmTo; /* [0..2047], scale factor 64 meters/seconds */
+} gnss_almanac_ecef_sbas_set_struct;
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_bool bdsAlmToaValid;
+ kal_uint8 bdsAlmToa; /* [0..255], almanac reference time, scale factor 2^12 seconds */
+ kal_uint32 bdsAlmSqrtA; /* [0..16777215], square root of semi-major axis, scale factor 2^(-11) meters^(1/2) */
+ kal_uint32 bdsAlmE; /* [0..131071], eccentricity, dimensionless, scale factor 2^(-21) */
+ kal_int32 bdsAlmW; /* [-8388608..8388607], argument of perigee, scale factor 2^(-23) semi-circles */
+ kal_int32 bdsAlmM0; /* [-8388608..8388607], mean anomaly at reference time, scale factor 2^(-23) semi-circles */
+ kal_int32 bdsAlmOmega0; /* [-8388608..8388607], longitude of ascending node of orbital plane computed according to reference time, scale factor 2^(-23) semi-circles */
+ kal_int32 bdsAlmOmegaDot; /* [-65536..65535], rate of right ascension, scale factor 2^(-38) semi-circles/sec */
+ kal_int16 bdsAlmDeltaI; /* [-32768..32767], correction of orbit reference inclination at reference time, scale factor 2^(-19) semi-circles */
+ kal_int16 bdsAlmA0; /* [-1024..1023], satellite clock bias, scale factor 2^(-20) seconds */
+ kal_int16 bdsAlmA1; /* [-1024..1023], satellite clock rate, scale factor 2^(-38) sec/sec */
+ kal_bool bdsSvHealthValid;
+ kal_uint16 bdsSvHealth; /* 9 bit field, indicate satellites health information as defined in BDS ICD v2.0 Table 5-15. The left most bit is the MSB */
+} gnss_almanac_bds_almanac_set_struct;
+
+typedef struct
+{
+ gnss_almanac_type_enum type;
+
+ union
+ {
+ gnss_almanac_keplerian_set_struct keplerianSet; /* for Galileo */
+ gnss_almanac_nav_keplerian_set_struct navKeplerianSet; /* for GPS, QZSS */
+ gnss_almanac_reduced_keplerian_set_struct reducedKeplerianSet; /* for GPS, Modernized GPS, QZSS */
+ gnss_almanac_midi_keplerian_set_struct midiKeplerianSet; /* for GPS, Modernized GPS, QZSS */
+ gnss_almanac_glonass_set_struct glonassSet; /* for GLONASS */
+ gnss_almanac_ecef_sbas_set_struct ecefSbasSet; /* for SBAS */
+ gnss_almanac_bds_almanac_set_struct bdsAlmanacSet; /* for BDS */
+ } data;
+} gnss_almanac_element_struct;
+
+
+typedef struct
+{
+ kal_bool weekNumberValid;
+ kal_uint8 weekNumber; /* [0..255], almanac reference week number for non-GLONASS system, modulo 256 weeks */
+ kal_bool toaValid;
+ kal_uint16 toa; /* [0.255], almanac reference time for non-GLONASS system, scale factor 2^12 seconds. For A-Galileo, the toa-ext-v1240 can be [256..1023]. */
+ kal_bool iodaValid;
+ kal_uint8 ioda; /* [0..3], issue of data, for Galileo system. For A-Galileo, the ioda-ext-v1240 can be [4..15] */
+ kal_bool completeAlmanacProvided; /* if almanac list contains complete GNSS constellation */
+ kal_uint8 numGnssAlmanacElement;
+ gnss_almanac_element_struct gnssAlmanacElement[GNSS_MAX_ALMANAC_SAT_ELEMENT];
+} gnss_almanac_struct;
+/* end for gnss almanac */
+
+
+/* start for gnss utc model */
+typedef struct
+{
+ kal_int32 gnssUtcA1; /* [-8388608..8388607], scale factor 2^(-50) seconds/second */
+ kal_int32 gnssUtcA0; /* [-2147483648..2147483647], scale factor 2^(-30) seconds */
+ kal_uint8 gnssUtcTot; /* [0..255], scale factor 2^12 seconds */
+ kal_uint8 gnssUtcWNt; /* [0..255], scale factor 1 week */
+ kal_int8 gnssUtcDeltaTls; /* [-128..127], scale factor 1 second */
+ kal_uint8 gnssUtcWNlsf; /* [0..255], scale factor 1 week */
+ kal_int8 gnssUtcDN; /* [-128..127], scale factor 1 day */
+ kal_int8 gnssUtcDeltaTlsf; /* [-128..127], scale factor 1 second */
+} gnss_utc_model_set1_struct;
+
+
+typedef struct
+{
+ kal_int16 utcA0; /* [-32768..32767], bias coefficient of GNSS time scale relative to UTC time scale, scale factor 2^(-35) seconds */
+ kal_int16 utcA1; /* [-4096..4095], drift coefficient of GNSS time scale relative to UTC time scale, scale factor 2^(-51) seconds/second */
+ kal_int8 utcA2; /* [-64..63], drift rate correction coefficient of GNSS time sacel relative to UTC time scale, scale factor 2^(-68) seconds/second^2 */
+ kal_int8 utcDeltaTls; /* [-128..127], current or past leap second count, scale factor 1 second */
+ kal_uint16 utcTot; /* [0..65535], time data reference time of week, scale factor 2^4 seconds */
+ kal_uint16 utcWNot; /* [0..8191], time data reference week number, scale factor 1 week */
+ kal_uint8 utcWNlsf; /* [0..255], leap second reference week number, scale factor 1 week */
+ kal_uint8 utcDN; /* 4 bits field, leap second reference day number, scale factor 1 day */
+ kal_int8 utcDeltaTlsf; /* [-128..127], current or future leap second count, scale factor 1 second */
+} gnss_utc_model_set2_struct;
+
+
+typedef struct
+{
+ kal_uint16 nA; /* [1..1461], callendar day number within four-year period beginning since the leap year, scale factor 1 day */
+ kal_int32 tauC; /* [-2147483648..2147483647], GLONASS time scale correction to UTC(SU), scale factor 2^(-31) seconds */
+ /* optional field, mandatory present if GLONASS-M satellites are presnet in the current GLONASS constellation */
+ kal_bool b1Valid;
+ kal_int16 b1; /* [-1024..1023], coefficient to determine delta UT1, scale factor 2^(-10) seconds */
+ kal_bool b2Valid;
+ kal_int16 b2; /* [-512..511], coefficient to determind delta UT1, scale factor 2^(-16) seconds/msd */
+ kal_bool kpValid;
+ kal_uint8 kp; /* 2 bits field, notification of expected leap second correction */
+} gnss_utc_model_set3_struct;
+
+
+typedef struct
+{
+ kal_int32 utcA1wnt; /* [-8388608..8388607], scale factor 2^(-50) seconds/second */
+ kal_int32 utcA0wnt; /* [-2147483648..2147483647], scale factor 2^(-30) seconds */
+ kal_uint8 utcTot; /* [0..255], scale factor 2^12 seconds */
+ kal_uint8 utcWNt; /* [0..255], scale factor 1 week */
+ kal_int8 utcDeltaTls; /* [-128..127], scale factor 1 second */
+ kal_uint8 utcWNlsf; /* [0..255], scale factor 1 week */
+ kal_int8 utcDN; /* [-128..127], scale factor 1 day */
+ kal_int8 utcDeltaTlsf; /* [-128..127], scale factor 1 second */
+ kal_uint8 utcStandardID; /* [0..7], if GNSS-ID indicates SBAS, this field indicated the UTC stadard used for the SBAS network time indicated by SBAS-ID to UTC relation */
+} gnss_utc_model_set4_struct;
+
+
+typedef struct
+{
+ kal_int32 utcA0; /* [-2147483648..2147483647], BDS clock bias relative to UTC, scale factor 2^(-30) seconds */
+ kal_int32 utcA1; /* [-8388608..8388607], BDS clock rate relative to UTC, scale factor 2^(-50) sec/sec */
+ kal_int8 utcDeltaTls; /* [-128..127], delta time due to leap seconds before the new leap second effective, scale factor 1 second */
+ kal_uint8 utcWNlsf; /* [0..255], week number of the new leap second, scale factor 1 week */
+ kal_uint8 utcDN; /* [0..255], day number of week of the new leap second, scale factor 1 day */
+ kal_int8 utcDeltaTlsf; /* [-128..127], delta time due to leap seconds after the new leap second effective, scale factor 1 second */
+} gnss_utc_model_set5_struct;
+
+
+typedef struct
+{
+ gnss_utc_model_type_enum type;
+
+ union
+ {
+ gnss_utc_model_set1_struct utcModel1; /* for GPS, Galileo, QZSS */
+ gnss_utc_model_set2_struct utcModel2; /* for GPS, Galileo, QZSS */
+ gnss_utc_model_set3_struct utcModel3; /* for GLONASS */
+ gnss_utc_model_set4_struct utcModel4; /* for SBAS */
+ gnss_utc_model_set5_struct utcModel5; /* for BDS */
+ } data;
+} gnss_utc_model_struct;
+/* end for gnss utc model */
+
+
+/* start for gnss aux info */
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 signalsAvailable; /* 8 bits field, indicate the ranging signals supported by the satellite indicated by svID, map to GNSS_SGN_ID_BITMAP_* */
+} gnss_aux_gps_sat_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numGpsElement;
+ gnss_aux_gps_sat_element_struct gpsElement[GNSS_MAX_AUX_SAT_ELEMENT];
+} gnss_aux_info_gps_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 signalsAvailable; /* 8 bits field, indicate the ranging signals supported by the satellite indicated by svID */
+ /* optional field */
+ kal_bool channelNumberValid;
+ kal_int8 channelNumber; /* [-7..13] indicate the GLONASS carrier frequency number of the satellite identified by svID */
+} gnss_aux_glonass_sat_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numGlonassElement;
+ gnss_aux_glonass_sat_element_struct glonassElement[GNSS_MAX_AUX_SAT_ELEMENT];
+} gnss_aux_info_glonass_struct;
+
+
+typedef struct
+{
+ gnss_aux_info_gnss_type_enum type;
+
+ union
+ {
+ gnss_aux_info_gps_struct gps;
+ gnss_aux_info_glonass_struct glonass;
+ } data;
+} gnss_aux_info_struct;
+/* end for gnss aux info */
+
+
+/* start for gnss dbds correction */
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 bdsUDREI; /* [0..15], indicate user differential range error information by user differential range error index (UDREI) as defined in BDS ICD v2.0, sec 5.3.3.7.2 */
+ kal_uint8 bdsRURAI; /* [0..15], indicate Regional User Range Accuracy (RURA) information by Regional User Range Accuracy Index (UDREI) as defined in BDS ICD v2.0, sec 5.3.3.6 */
+ kal_int16 bdsECCDeltaT; /* [-4096..4095], indicate the BDS differential correction information which is expressed in equivalent clock correction (deltat).
+ add the value of deltat to the observed pseudo-range to correct the effect caused by the satellite clock offset and ephemeris error.
+ value -4096 means the deltat is not available, scale factor 0.1 meter */
+} gnss_dbds_correction_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numCorrectionElements;
+ gnss_dbds_correction_element_struct correctionElements[GNSS_MAX_DBDS_CORRECTION_ELEMENT];
+} gnss_dbds_correction_list_struct;
+
+
+typedef struct
+{
+ kal_bool gnssSignalIdValid;
+ kal_uint8 gnssSignalId; /* map to GNSS_SGN_ID_VALUE_* */
+ gnss_dbds_correction_list_struct correctionList;
+} gnss_dbds_correction_sgn_type_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numSgnTypeElements;
+ gnss_dbds_correction_sgn_type_element_struct sgnTypeElements[GNSS_MAX_DBDS_SGN_TYPE_ELEMENT];
+} gnss_dbds_correction_sgn_type_list_struct;
+
+
+typedef struct
+{
+ kal_uint16 dbdsRefTime; /* [0..3599], the time for which the differential corrections are valid, modulo 1 hour. dbds-RefTime is given in BDS system time, scale factor 1 second */
+ gnss_dbds_correction_sgn_type_list_struct dbdsSgnTypeList;
+} gnss_dbds_diff_corrections_struct;
+/* end for gnss dbds correction */
+
+
+/* start for gnss bds grid model */
+typedef struct
+{
+ kal_uint16 igpID; /* indicate the ionospheric grid point (IGP) number as defined in BDS ICD v2.0, sec 5.3.3.8 */
+ kal_uint16 dt; /* indicate dT as defined in BDS ICD v2.0, sec 5.3.3.8.1, i.e. the vertical delay at the corresponding IGP indicated by igp-ID, scale factor 0.125 meter */
+ kal_uint8 givei; /* indicate the Grid Ionospheric Vertical Error Index (GIVEI) which is used to describe the delay correction accuracy at ionospheric grid point indicated by igp-ID, the mapping between GIVEI and GIVE is defined in BDS ICD v2.0, sec 5.3.3.8.2 */
+} gnss_bds_grid_ion_element_struct;
+
+
+typedef struct
+{
+ kal_uint16 numGridIonElement;
+ gnss_bds_grid_ion_element_struct gridIonElement[GNSS_MAX_BDS_GRID_ION_ELEMENT]; /* a list that provides ionospheric grid point information for each grid point. Up to 16 instances are used in this version of the specification. The values 17 to 320 are reserved for future use */
+} gnss_bds_grid_ion_list_struct;
+
+
+typedef struct
+{
+ kal_uint16 bdsRefTime; /* [0..3599], the time for which the grid model parameters are valid, modulo 1 hour. bdsRefTime is given in BDS system time, scale factor 1 second */
+ gnss_bds_grid_ion_list_struct gridIonList; /* a list that provides ionospheric grid point information for each grid point. Up to 16 instances are used in this version of the specification. The values 17 to 320 are reserved for future use */
+} gnss_bds_grid_model_params_struct;
+/* end for gnss bds grid model */
+
+
+/* LCSP -> GNSS Task */
+/* This structure for MSG_ID_LCSP_GNSS_OPEN_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ //kal_uint8 gnssIdBitmap; /* GNSS_ID_BITMAP_* */
+ //kal_uint8 preferGnssMode; /* TBD: should not used this kind of design in GNSS */
+} lcsp_gnss_open_req_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_CLOSE_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ //kal_uint8 gnssIdBitmap; /* GNSS_ID_BITMAP_* */
+} lcsp_gnss_close_req_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_COMMON_ASSIST_DATA_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ gnss_common_assist_data_type_enum type;
+ union
+ {
+ gnss_reference_time_struct refTime;
+ gnss_reference_location_struct refLoc;
+ gnss_ionospheric_model_struct ionModel;
+ gnss_earth_orient_params_struct eop;
+ } data;
+} lcsp_gnss_common_assist_data_req_struct;
+
+
+/**
+ * in LPP, location server could provide up to 16 GNSSs generic assist data
+ * in RRC/RRLP, location server could provide up to 8 GANSSs generic assist data
+ */
+/* This structure for MSG_ID_LCSP_GNSS_GENERIC_ASSIST_DATA_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ gnss_id_enum gnssId;
+ kal_bool sbasIdValid; /* only present when gnss is sbas */
+ sbas_id_enum sbasId;
+
+ gnss_generic_assist_data_type_enum type;
+ union
+ {
+ gnss_time_model_list_struct timeModel;
+ gnss_diff_correction_struct dgnss;
+ gnss_navigation_model_struct navModel;
+ gnss_real_time_integrity_struct rti;
+ gnss_data_bit_assistance_struct dataBitAssist;
+ gnss_acquisition_assistance_struct acqAssist;
+ gnss_almanac_struct almanac;
+ gnss_utc_model_struct utcModel;
+ gnss_aux_info_struct auxInfo;
+ gnss_dbds_diff_corrections_struct dbds;
+ gnss_bds_grid_model_params_struct bdsGridModel;
+ } data;
+} lcsp_gnss_generic_assist_data_req_struct;
+
+
+typedef struct
+{
+ /* note: for MA, use horizontalAccuracy to represent pseudorange error */
+ kal_bool horizontalAccuracyValid;
+ kal_uint8 horizontalAccuracy; /* range: 0-127, refer TS 23.032, K1 decoding formula */
+ kal_uint8 horizontalAccuracyConfidence; /* range: 0-100, refer TS 23.032, direct map to percentage, zero indicate "no inforamation" */
+ kal_bool verticalAccuracyValid;
+ kal_uint8 verticalAccuracy; /* range: 0-127, refer TS 23.032, K3 decoding formula */
+ kal_uint8 verticalAccuracyConfidence; /* range: 0-100, refer TS 23.032, direct map to percentage, zero indicate "no inforamation" */
+ kal_uint8 responseTime; /* range: 1-128 seconds */
+//#ifdef __EARLY_FIX_SUPPORT__
+ kal_uint8 responseTimeEarlyFix; /* range: 1-128 seconds, 0 means not enabled */
+//#endif
+ kal_bool isPeriodic;
+} gnss_loc_req_qos_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_POS_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ lcs_sim_source_enum simSource;
+ kal_uint16 gnssMethod; /* network allowed GNSS type, may be multiple GNSS, map to GNSS_ID_BITMAP_* */
+ kal_bool fineTimeAssistanceMeasReq; /* network requested fine time measurement */
+ /**
+ * note: we assume that when network requests UE to do fine time measurement,
+ * network will always give UE corresponding refercence cell information in Reference Time Assistance Data,
+ * then GNSS task should use this reference cell information within Reference Time Assistance Data to ask current RAT's L1 module to do fine time measurement,
+ * otherwise the measurement would fail.
+ */
+ kal_bool assistanceAvailability; /* network allow UE request additional GNSS assistance data */
+ gnss_loc_req_qos_struct qos;
+ kal_bool autoResetTrigger;
+} lcsp_gnss_pos_req_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_MEAS_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ lcs_sim_source_enum simSource;
+ kal_uint16 gnssMethod; /* network allowed GNSS type, may be multiple GNSS, map to GNSS_ID_BITMAP_* */
+ kal_bool fineTimeAssistanceMeasReq; /* network requested fine time measurement */
+ /**
+ * note: we assume that when network requests UE to do fine time measurement,
+ * network will always give UE corresponding refercence cell information in Reference Time Assistance Data,
+ * then GNSS task should use this reference cell information within Reference Time Assistance Data to ask current RAT's L1 module to do fine time measurement,
+ * otherwise the measurement would fail.
+ */
+ kal_bool adrMeasReq; /* network requested ADR(accumulated Doppler range) measurement */
+ kal_bool multiFreqMeasReq; /* network requested to report multiple supported GNSS type */
+ kal_bool assistanceAvailability; /* network allow UE request additional GNSS assistance data */
+ gnss_loc_req_qos_struct qos;
+ kal_bool autoResetTrigger;
+} lcsp_gnss_meas_req_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_ABORT_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+} lcsp_gnss_abort_req_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_RESET_UE_STORED_POS_INFO */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ /* empty */
+} lcsp_gnss_reset_ue_stored_pos_info_struct;
+
+
+/* GNSS Task -> LCSP */
+/* This structure for MSG_ID_LCSP_GNSS_COMMON_ASSIST_DATA_CNF */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+ gnss_common_assist_data_type_enum type;
+ kal_bool resultOk;
+} lcsp_gnss_common_assist_data_cnf_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_GENERIC_ASSIST_DATA_CNF */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ gnss_id_enum gnssId;
+ kal_bool sbasIdValid; /* only present when gnss is sbas */
+ sbas_id_enum sbasId;
+ gnss_generic_assist_data_type_enum type;
+ kal_bool resultOk;
+} lcsp_gnss_generic_assist_data_cnf_struct;
+
+
+/* No more additional assistance data req primitive, embeded assistance data request in GNSS_POS/MEAS_CNF */
+/**
+ * For common assistance data,
+ * to simplify complexity, LPP would align RRC/RRLP ASN.1 design, request all supported data fields of the assistance data type request
+ * e.g. If network request GPS+GLONASS positioning estimate, LPP will request all supported fields in the GNSS-ReferenceTimeReq if GNSS task response reference time missing
+ * (1) gnssTimeReqPrefList = GPS-ID + GLONASS-ID
+ * (2) gpsTOWAssistReq = true
+ * (3) notOfLeapSecReq = true
+ *
+ * If network request GPS only positioning estimate, LPP will request all supported fields in the GNSS-ReferenceTimeReq if GNSS task response reference time missing
+ * (1) gnssTimeReqPrefList = GPS-ID
+ * (2) gpsTOWAssistReq = true
+ * (3) notOfLeapSecReq = false
+ *
+ * the same design policy also applies on RRC/RRLP original(extend) GANSS-AdditionalAssistanceDataRequest/GANSSAssistanceData
+ */
+
+typedef struct
+{
+ kal_bool gnssReferenceTimeReq; /* fill the request as above example */
+ kal_bool gnssReferenceLocationReq;
+ kal_bool gnssIonosphericModelReq; /* klobucharModel for GPS, neQuickModel for Galileo, therefore we fill the request according to GNSS method */
+ kal_bool gnssEarthOrientationParametersReq;
+} gnss_request_common_assist_data_struct;
+
+
+/**
+ * For generic assistance data, we need to specify GNSS id, and its requested assistance data type.
+ * In some assistance data, we also need to include more data in addition to true/false
+ * (1) Time Model => GNSS-ID + deltaTreq
+ * (2) D-Correction => GNSS-Signal-ID + udreValidityTime
+ * (3) Nav Model => stored nav list or request nav list
+ * (4) RTI => only true/false!
+ * (5) Data Bit Assist => GNSS-TOD + interval + speficy which GNSS-Signal-ID, satellite data bit
+ * (6) ACQ => GNSS-Signal-ID
+ * (7) Almanac => Model ID (GNSS-ID map to currect Almanac Model ID)
+ * (8) UTC => Model ID (GNSS-ID map to currect UTC Model ID)
+ * (9) AUX => only true/false!
+ * (10) DBDS Correction => GNSS-Signal-ID
+ * (11) BDS Grid Model => only true/false!
+ */
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ kal_uint8 numGnssToIDReq;
+ gnss_to_id_enum GnssToIDReq[GNSS_MAX_TIME_MODEL_ELEMENT]; /* 5-15 is reserved */
+} gnss_request_time_model_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ kal_uint8 gnssSignalsReq; /* requested GNSS Signal(s), map to GNSS_SGN_ID_BITMAP_* */
+ kal_bool validityTimeReq; /* udreGrowthRate and udreValidityTime are requested or not */
+} gnss_request_diff_correction_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint16 iod; /* 11 bits field */
+ /* GNSS-ID to clock/orbit model ID (map to GNSS_NAV_CLOCK_MODEL_*_VALUE_* and GNSS_NAV_ORBIT_MODEL_*_VALUE_*)
+ * gps : Model-2
+ * sbas : Model-5
+ * qzss : Model-2
+ * galileo: Model-1
+ * glonass: Model-4
+ * bds : Model-6
+ */
+ kal_bool clockModelIDValid;
+ kal_uint8 clockModelID; /* [1..8], optional, specify which clock model used */
+ kal_bool orbitModelIDValid;
+ kal_uint8 orbitModelID; /* [1..8]. optional, specify which orbit model used */
+} gnss_sat_data_element_struct;
+
+
+typedef struct
+{
+ kal_uint16 gnssWeekOrDay; /* [0..4095], indicate GNSS week number for non-GLONASS, otherwise indicate calendar number of data within four-year interval starting from 1st of January in a leap year */
+ kal_uint8 gnssToe; /* [0.255], indicate GNSS time of ephemeris in hours of latest ephemeris for non-GLONASS, otherwise indicate the time of ephemeris in units of 15 minutes of the latest ephemeris */
+ kal_uint8 tToeLimit; /* [0..15], indicate ephemeris age tolerance in units of hours for non-GLONASS, otherwise indicate ephemeris age tolerance in units of 30 minutes */
+ kal_uint8 numSatDataElement;
+ gnss_sat_data_element_struct satDataElement[GNSS_MAX_NAV_SAT_ELEMENT]; /* optional */
+} gnss_stored_nav_list_struct;
+
+
+typedef struct
+{
+ kal_uint8 svReqList[GNSS_MAX_NAV_SAT_ELEMENT_BIT_POS/8]; /* bit position represent SV-ID, total 64 bits */
+ /* GNSS-ID to clock/orbit model ID (map to GNSS_NAV_CLOCK_MODEL_*_VALUE_* and GNSS_NAV_ORBIT_MODEL_*_VALUE_*)
+ * gps : Model-2
+ * sbas : Model-5
+ * qzss : Model-2
+ * galileo: Model-1
+ * glonass: Model-4
+ * bds : Model-6
+ */
+ kal_uint8 numClockModelIDPrefList;
+ kal_uint8 clockModelIDPrefList[GNSS_MAX_NAV_CLOCK_MODEL_ELEMENT]; /* optional, list requested clock model in the order of preference */
+ kal_uint8 numOrbitModelIDPrefList;
+ kal_uint8 orbitModelIDPrefList[GNSS_MAX_NAV_ORBIT_MODEL_ELEMENT]; /* optional, list requested orbit model in the order of preference */
+ kal_bool addNaparamReqValid;
+ kal_bool addNavparamReq; /* dedicated for orbit model - nav-keplerian-set (gps) if need to include addNAVpara IE */
+} gnss_requested_nav_list_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ gnss_nav_model_req_type_enum type; /* storedNavList or reqNavList */
+ /*
+ * TBD: NAV request would be too complex for GNSS task/MNL to have this kind of detailed nav data.
+ * evaluate if we could simplify it (always use requestd nav list according to GNSS method?)
+ */
+ union
+ {
+ gnss_stored_nav_list_struct storedNavList; /* this needs GNSS chip response current searched SAT info (in detailed) */
+ gnss_requested_nav_list_struct reqNavList; /* this could simply fill corresponding IE according network specified GNSS method, but needs svID list */
+ } data;
+} gnss_request_nav_model_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ kal_uint16 gnssTODReq; /* [0..3599], specify the reference time for the first data bit requestd in GNSS specific system time, modulo 1 hour, scale factor 1 second */
+ kal_bool gnssTODFracReqValid;
+ kal_uint16 gnssTODFracReq; /* [0..999], speficty the franctional part of GNSS-TOD-Req, scale factor 1 millisecond */
+ kal_uint8 dataBitInterval; /* [0..15], value K, the time length for Data Bit Assist requested, r (second) = 0.1*2^K, K=0 means it is not specified */
+ kal_uint8 gnssSignalTypes; /* requested GNSS Signal(s), map to GNSS_SGN_ID_BITMAP_* */
+ kal_uint8 numReqSatList;
+ kal_uint8 ReqSatList[GNSS_MAX_DBA_SAT_ELEMENT]; /* optional, list contains SV-IDs for Data Bit Assist requested */
+} gnss_request_data_bit_assist_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ kal_uint8 gnssSignalTypeReq; /* requested signal type, only specify one single signal, map to GNSS_SGN_ID_VALUE_* */
+} gnss_request_acq_assist_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ /* this could simply fill corresponding IE according network specified GNSS method */
+ /*
+ * GNSS-ID to almanac model ID (map to GNSS_ALMANAC_MODEL_*_VALUE_*)
+ * gps : Model-2 (keplerian NAV almanac set)
+ * sbas : Model-6 (ecef-SBAS almanac set)
+ * qzss : Model-2 (keplerian NAV almanac set)
+ * galileo: Model-1 (keplerian almanac set)
+ * glonass: Model-5 (Glonass almanac set)
+ * bds : Model-7 (BDS almanac set)
+ */
+ kal_bool modelIDValid;
+ kal_uint8 modelID; /* [1..8], currently 1..7, map to GNSS_ALMANAC_MODEL_7_VALUE_* */
+} gnss_request_almanac_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ /* this could simply fill corresponding IE according network specified GNSS method */
+ /*
+ * GNSS-ID to UTC model ID (map to GNSS_UTC_MODEL_*_VALUE)
+ * gps : Model-1
+ * sbas : Model-4
+ * qzss : Model-1
+ * galileo: Model-1
+ * glonass: Model-3
+ * bds : Model-5
+ */
+ kal_bool modelIDValid;
+ kal_uint8 modelID; /* [1..8], currently 1..5 map to GNSS_UTC_MODEL_*_VALUE */
+} gnss_request_utc_model_struct;
+
+
+typedef struct
+{
+ kal_bool isRequested; /* indicate if this type of data is requested */
+ kal_uint8 gnssSignalsReq; /* requested GNSS Signal(s), map to GNSS_SGN_ID_BITMAP_* */
+} gnss_request_dbds_correction_struct;
+
+
+typedef struct
+{
+ gnss_id_enum gnssID;
+ kal_bool sbasIDValid;
+ sbas_id_enum sbasID;
+
+ gnss_request_time_model_struct gnssTimeModelsReq;
+ gnss_request_diff_correction_struct gnssDCorrectionsReq;
+ gnss_request_nav_model_struct gnssNavModelReq;
+ kal_bool gnssRTIReq;
+ gnss_request_data_bit_assist_struct gnssDataBitAssistReq;
+ gnss_request_acq_assist_struct gnssAcqAssistReq;
+ gnss_request_almanac_struct gnssAlmanacReq;
+ gnss_request_utc_model_struct gnssUTCModelReq;
+ kal_bool gnssAuxInfoReq;
+ gnss_request_dbds_correction_struct gnssDBDSCorrectionsReq;
+ kal_bool gnssBDSGridModelReq;
+} gnss_request_generic_assist_data_struct;
+
+
+typedef struct
+{
+ gnss_request_common_assist_data_struct gnssCommonAssistData;
+ kal_uint8 numGnssGenericAssistData;
+ gnss_request_generic_assist_data_struct gnssGenericAssistData[GNSS_MAX_REQ_ADD_GENERIC_ASSIST_DATA_ELEMENT];
+} gnss_request_assist_data_struct;
+
+
+typedef struct
+{
+ gnss_eutra_cell_id_struct cellID;
+ kal_uint16 systemFrameNumber; /* 10 bits field, refer TS 36.331 */
+} gnss_measured_ref_network_time_eutra_struct;
+
+
+typedef struct
+{
+ gnss_utra_cell_id_struct cellID;
+ kal_uint16 refSystemFrameNumber; /* [0..4095], refer TS 25.331 */
+} gnss_measured_ref_network_time_utra_struct;
+
+
+typedef struct
+{
+ gnss_gsm_cell_id_struct cellID;
+ kal_uint16 referenceFN; /* [0..65535] */
+ kal_bool referenceFNMSBValid;
+ kal_uint8 referenceFNMSB; /* [0..63], FN (frame number) = referenceFNMSB*42432 + referenceFN */
+ kal_bool deltaGNSSTODValid;
+ kal_uint8 deltaGNSSTOD; /* [0..127], the difference in millisecond between gnssTODmsec and millisecond part of the SV time of first SV in the list reported from target device */
+} gnss_measured_ref_network_time_gsm_struct;
+
+
+typedef struct
+{
+ gnss_network_cell_type_enum type;
+ union
+ {
+ gnss_measured_ref_network_time_eutra_struct eutra;
+ gnss_measured_ref_network_time_utra_struct utra;
+ gnss_measured_ref_network_time_gsm_struct gsm;
+ } data;
+} gnss_measured_ref_network_time_struct;
+
+
+typedef struct
+{
+ kal_uint32 gpsTOW; /* [0..604799999], scale factor millisecond, only used for legacy GPS! (gnssTimeID == GPS) */
+ kal_uint16 gnssDayNumber; /* [0..32767] */
+ kal_uint32 gnssTODmsec; /* [0..3599999], scale factor 1 millisecond in a hour*/
+ kal_bool gnssTODfracValid;
+ kal_uint16 gnssTODfrac; /* [0..3999], scale factor 250 nanoseconds */
+ kal_bool gnssTODuncValid;
+ kal_uint8 gnssTODunc; /* [0..127], K = [0..127], uncertainty r (microseconds) = C*(((1+x)^K)-1), C=0.5, x=0.14 */
+ gnss_id_enum gnssTimeID; /* specify GNSS type of GNSS system time (TOD+frac) provided */
+
+ /* contain networkTime only if fineTimeAssistanceMeasReq is TRUE */
+ kal_bool networkTimeValid;
+ gnss_measured_ref_network_time_struct networkTime;
+} gnss_measured_ref_time;
+
+
+/* we only support horizontal velocity */
+typedef struct
+{
+ kal_uint16 bearing; /* [0..359], direction clockwise from North, scale factor 1 degrees */
+ kal_uint16 horizontalSpeed; /* [0..2047], scale factor 1 kilometers/hour */
+} gnss_h_velocity_struct;
+
+
+typedef struct
+{
+ kal_bool signOfLatitude; /* TRUE: SOUTH, FALSE: NORTH */
+ kal_uint32 degreesLatitude; /* [0..8388607], 23 bits field */
+ kal_int32 degreesLongitude; /* [-8388608..8388607], 24 bits field */
+ kal_bool signOfAltitude; /* TRUE: DEPTH, FALSE: HEIGHT */
+ kal_uint16 altitude; /* [0..32767], 15 bits field */
+ kal_uint8 uncertaintySemiMajor; /* K: [0..127], uncertainty r (meter) = C*((1+x)^K-1), C=10, x=0.1 */
+ kal_uint8 uncertaintySemiMinor; /* K: [0..127], uncertaintyr (meter) = C*((1+x)^K-1), C=10, x=0.1 */
+ kal_uint8 orientationMajorAxis; /* bearing angle degree: [0-179] */
+ kal_uint8 uncertaintyAltitude; /* K: [0..127], uncertainty h (meter) = C*((1+x)^K-1), C=45, x=0.025 */
+ kal_uint8 confidence; /* [0..100] */
+ kal_bool velocityValid;
+ gnss_h_velocity_struct velocityEstimate;
+} gnss_gad_pos_estimate_struct;
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63] */
+ kal_uint8 cNo; /* [0..63], carrier-to-noise ratio, scale factor 1dB-Hz */
+ kal_uint8 multipath; /* multipath indicator, real data is two bits field represent multipath enum
+ '0' = Not measured
+ '1' = Low, MP error < 5m
+ '2' = Medium, 5m < MP error < 43m
+ '3' = High, MP error > 43m
+ */
+
+ /* use validity flag and rearrange fields to reduce structure size */
+ /**
+ * GNSS_MEAS_INFO_CARRIER_QUALITY_VALIDITY 0x01
+ * GNSS_MEAS_INFO_INT_CODE_PHASE_VALIDITY 0x02
+ * GNSS_MEAS_INFO_DOPPLER_VALIDITY 0x04
+ * GNSS_MEAS_INFO_ADR_VALIDITY 0x08
+ */
+ kal_uint8 validity;
+
+ kal_uint8 carrierQualityInd; /* [0..3], two bits field represent carrier phase data inverted/direct, and (not) continuous */
+ kal_uint8 intCodePhase; /* [0..127], integer millisecond part of code phase modulo codePhaseAmbiguity, scale factor 1 milli-seconds in the range from 0 to 127 milliseconds */
+
+ /* to represent codephase RMS error value index, refer floating-point representation mapping table, LPP/RRC/RRLP should combine M & E to index value according to the table */
+ kal_uint8 codePhaseRMSErrorM; /* codePhase(pseudorange) RMS Error Mantissa */
+ kal_uint8 codePhaseRMSErrorE; /* codePhase(Pseudorange) RMS Error Exponent */
+
+ kal_int16 doppler; /* [-32768..32767], scale factor 0.04 meter/seconds */
+
+ kal_uint32 codePhase; /* [0..2097151], contain the whole and fractional value of the code phase, scale factor 2^(-21) milliseconds in the range from 0 to (1-2^(-21)) milliseconds */
+
+ kal_uint32 adr; /* [0 .. 33554431], accumulated delta range, scale factor 2^(-10) meters in the range for 0 to 32767.5 meters */
+
+ // For LPPE HA
+ kal_uint8 haAdrRMSerror; /* [0..127], contain the RMS error of the continuous carrier phase, scale factor 2^-10 meters, in the range [0, 0.12403) meters */
+ kal_bool haLockIndicator; /* TRUE if the carrier phase tracking has been continuous between the previous and the current measurement delivery; */
+} gnss_measure_info_one_sat;
+
+
+typedef struct
+{
+ kal_uint8 signalID; /* map to GNSS_SGN_ID_VALUE_* */
+ kal_bool codePhaseAmbiguityValid;
+ kal_uint8 codePhaseAmbiguity; /* [0..127], scale factor 1 milli-seconds */
+ kal_uint8 numSatMeasElement;
+ gnss_measure_info_one_sat satMeasElement[GNSS_MAX_MEASURED_SAT_PER_SGN_ELEMENT];
+} gnss_measure_info_one_sgn;
+
+
+typedef struct
+{
+ gnss_id_enum gnssID;
+ kal_uint8 numSgnMeasElement;
+ gnss_measure_info_one_sgn sgnMeasElement[GNSS_MAX_MEASURED_SGN_PER_GNSS_ELEMENT];
+} gnss_measure_info_one_gnss;
+
+
+typedef struct
+{
+ /**
+ * Measurement information up to 16 GNSSs can be included.
+ * Per GNSS, up to 8 GNSS signal measurements
+ * Per GNSS signal measurement (band), up to 64 GNSS satellites
+ */
+ kal_uint8 numGnssMeasElements;
+ gnss_measure_info_one_gnss gnssMeasElement[GNSS_MAX_MEASURED_GNSS_ELEMENT];
+ gnss_measured_ref_time measuredRefTime; /* should always present */
+ //gnss_ha_measured_result_struct haMeasResult;
+} gnss_measured_result_struct;
+
+/* This structure for MSG_ID_LCSP_GNSS_ADDITIONAL_ASSIST_DATA_REQ */
+/* This primitive is dedicated for LPP:
+ * For LPP, if we request additional assistance data, the network will not resent
+ * a new RequestLocationInformation followed by ProvideAssistanceData (two procedures are independent).
+ *
+ * Therefore, the response time will not reset and LPP will not send a new LCSP_GNSS_POS(MEAS)_REQ,
+ * that's why we separate request additional assistance data by another message
+ * rather than embeded in LCSP_GNSS_POS(MEAS)_CNF (as RRLP/ULCS design)
+ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID; /* transaction ID should align LCSP_GNSS_POS(MEAS)_REQ if present, for checking assistanceAvailability */
+
+ kal_uint16 gnssMethod; /* network allowed GNSS type in LCSP_GNSS_POS(MEAS)_REQ if present (or current GNSS chip operation mode), may be multiple GNSS, map to GNSS_ID_BITMAP_* */
+ gnss_request_assist_data_struct assistDataReq;
+ kal_bool lppeAssistDataValid;
+} lcsp_gnss_additional_assist_data_req_struct;
+
+
+/* start for gnss chip support */
+typedef struct
+{
+ gnss_id_enum gnssID;
+ kal_uint8 sgnIdBitmap;
+} gnss_gnss_info_one_gnss;
+
+
+typedef struct
+{
+ kal_bool adrFlag;
+ kal_bool ftaFlag;
+ kal_bool dgnssFlag;
+ kal_uint8 gnssNumber;
+ kal_uint16 gnssMethod; /* specify the estimated location is supported by GNSS chip, map to GNSS_ID_BITMAP_* */
+ gnss_gnss_info_one_gnss gnssInfo[GNSS_MAX_SUPPORT_NUM];
+ kal_bool lppeFlag;
+} gnss_capability_report_struct;
+
+
+/* This structure for MSG_ID_ERRC_LBS_GNSS_POS_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool positioning_status; /*KAL_TRUE:activate, KAL_FALSE:deactivate} for START/STOP MDT positioning */
+ errc_lbs_gnss_pos_mdt_type_enum positioning_mdt_type; /* start/stop MDT positioning with logged MDT or immediate MDT */
+}errc_lbs_gnss_pos_req_struct;
+
+/* This structure for MSG_ID_ERRC_LBS_GNSS_POS_IND */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 gnssMethod; /*GNSS Satellite system calculated for this positioning information, gnssMethod = 0x00 if the position info not available*/
+ gnss_gad_pos_estimate_struct locationEstimate; /*Position information ellipsoidPointWithAltitudeAndUncertaintyEllipsoid*/
+ gnss_measured_ref_time measuredRefTime; /* Timing information for gnss- TOD-msec-r10, The TOD is also available*/
+ kal_uint32 measuredTimeDiff; /* Time difference between LBS getting the positioning result and reporting to ERRC*/
+} errc_lbs_gnss_pos_ind_struct;
+
+
+typedef struct {
+ kal_bool is_cdma_eutra_sync; /*FDD mode TRUE : sync sys time recommended, FALSE : assync time recommended.*/
+ time_sib_cdma_sys_time_type_enum cdma_sys_time_type; /*Used for sync/async_sys_time choice*/
+ union
+ {
+ kal_uint8 sync_sys_time[5]; /*bit string : 39 bits*/
+ kal_uint8 async_sys_time[7]; /*bit string : 49 bits*/
+ }
+ choice;
+} time_sib_cdma_sys_time_info_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 CtrlFlag; /*0: Disable (stop pulse), 1: Enable (Start in periodic mode), 2: Test Mode Enable (Start in one shot mode)*/
+ kal_uint32 PulsePeriod; /* unit : msec, Range: 100 ~ 300000, The period of pulse. (100 ms ~ 5 min), effective when CtrlFlag = 1 */
+ kal_uint16 PulseNumber; /*number : 0~7200, 0: Periodic Mode, 1~7200: Non-Periodic Number of Pulse, effective when CtrlFlag = 1*/
+} lbs_errc_read_time_sib_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ time_sib_result_enum result;
+ /*SIB8*/
+ kal_bool is_sib8_valid;
+ time_sib_cdma_sys_time_info_struct sys_time_info;
+ kal_uint64 sib8_time_diff;
+ /*SIB16*/
+ kal_bool is_sib16_valid;
+ kal_uint64 timeinfo_utc;
+ kal_uint8 dayLightSavingTime[2];
+ kal_bool is_leap_seconds_valid;
+ kal_int16 leap_seconds;
+ kal_int16 localTimeOffset;
+ kal_uint64 sib16_time_diff;
+} lbs_errc_read_time_sib_ind_struct;
+
+
+/* ---LPPe HA GNSS Interface---begin--- */
+typedef struct
+{
+ kal_uint8 cep; /* [0..255] */
+ kal_uint8 confidenceHorizontal; /* [0..99] */
+ kal_uint8 confidenceVertical; /* [0..99] */
+} gnss_ha_3Dposition_struct;
+
+
+typedef struct
+{
+ kal_uint16 eastComponent; /* [0..511] */
+ kal_uint16 northComponent; /* [0..511] */
+ kal_uint16 upComponent; /* [0..511] */
+ kal_uint8 cepV; /* [0..255] */
+ kal_uint8 uncertaintySemiMajor; /* [0..255] */
+ kal_uint8 uncertaintySemiMinor; /* [0..255] */
+ kal_uint8 offsetAngle; /* [0..179] */
+ kal_uint8 confidenceHorizontal; /* [0..99] */
+ kal_uint8 uncertaintyUpComponent; /* [0..255] */
+ kal_uint8 confidenceUp; /* [0..99] */
+} gnss_ha_3Dvelocity_struct;
+
+
+typedef struct
+{
+ gnss_ha_3Dposition_struct ThreeDposition;
+ gnss_ha_3Dvelocity_struct ThreeDvelocity;
+} gnss_ha_pos_estimate_struct;
+
+
+typedef struct
+{
+ gnss_system_time_struct beginTime; /* specify the start time of the validity period */
+ kal_bool beginTimeAltValid;
+ kal_uint16 beginTimeAlt; /* [0..2881], specify the alternative start time, and the start time is relative the time the message was received, scale factor 15 min (range from 0 minutes to 43215 min = 30 days) */
+ kal_uint16 duration; /* [0..2881], specify the duration of the validity period after the beginTime, scale factor 15 min (range from 0 minutes to 43215 min = 30 days) */
+} gnss_ha_validity_period_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct
+{
+ kal_uint8 regionSizeInv; /* [1..255], specify the inverse of the size of each side of the region in degrees, for value N the size is 10/N degrees */
+ kal_bool areaWidthValid;
+ kal_uint16 areaWidth; /* [2..9180], specify the number of regions in the area in East-West direction, if the field is not present, the value is 1 */
+ kal_uint16 codedLatOfNWCorner; /* [0..4589], specify the latitude of the North-West corner of the area, encoded as explained in OMA-TS-LPPe Appendix C.1 */
+ kal_uint16 codedLonOfNWCorner; /* [0..9179], specify the longitude of the North-West corner of the area, encoded as explained in OMA-TS-LPPe Appendix C.1 */
+
+ kal_bool rleListValid;
+ //gnss_ha_rlelist_struct rleList; /* TBD: redefine internal structure? */ /* This field lists the regions in which the data is valid. If the field is not present, the data is valid in all the regions in the area */
+} gnss_ha_validity_area_struct;
+
+
+typedef struct
+{
+ kal_uint8 regionSizeInv; /* specify the inverse of the size of each side of the region in degrees, for value N the size is 10/N degrees */
+ kal_bool areaWidthValid;
+ kal_uint16 areaWidth; /* specify the number of regions in the area in East-West direction, if the field is not present, the value is 1 */
+ kal_uint16 codedLatOfNWCorner; /* specify the latitude of the North-West corner of the area, encoded as explained in OMA-TS-LPPe Appendix C.1 */
+ kal_uint16 codedLonOfNWCorner; /* specify the longitude of the North-West corner of the area, encoded as explained in OMA-TS-LPPe Appendix C.1 */
+} gnss_ha_storm_validity_area_struct; /* only used in gnss_ha_iono_storm_ind_struct */
+
+
+typedef struct
+{
+ kal_uint8 duration; /* [1..63], scale factor 15 min, range [15, 945 min], i.e. upto 16 hours */
+ kal_bool durationLSBValid;
+ kal_uint8 durationLSB; /* [1..89], finer granularity duration, scale factor is 10 seconds, range [10, 890] seconds */
+} gnss_ha_duration;
+
+
+typedef struct
+{
+ kal_uint8 validityBitmap; /* bhValid, chValid, awValid, bwValid, cwValid, use GNSS_HA_MAPPING_FUNC_PARAMS_BIT_*_VALID */
+ kal_uint16 ah; /* [0..16383], the a-coefficient of the hydrostatic mapping function, scale factor 2^-14 */
+ /* optional */
+ kal_uint16 bh; /* [0..16383], the b-coefficient of the hydrostatic mapping function, scale factor 2^-14 */
+ /* optional */
+ kal_uint16 ch; /* [0..16383], the c-coefficient of the hydrostatic mapping function, scale factor 2^-14 */
+ /* optional */
+ kal_uint16 aw; /* [0..16383], the a-coefficient of the wet mapping function, scale factor 2^-14 */
+ /* optional */
+ kal_uint16 bw; /* [0..16383], the b-coefficient of the wet mapping function, scale factor 2^-14 */
+ /* optional */
+ kal_uint16 cw; /* [0..16383], the c-coefficient of the wet mapping function, scale factor 2^-14 */
+} gnss_ha_mapping_func_params_struct;
+
+
+typedef struct
+{
+ kal_int32 latitude; /* [-2147483648..2147483647], latitude based on WGS84 [GPS-ICD-200D] datum, the relation between the latitude X in range [-90', 90'],
+ and the coded number N is N = floor((X/90')*2^31), where value N=2^31 is coded as N=2^31-1, resolution 4.7 mm */
+ kal_int32 longitude; /* [-2147483648..2147483647], longitude based on WGS84 [GPS-ICD-200D] datum, the relation between the longitude X in range [-180', 180'),
+ and the coded number N is floor((X/180')*2^31), worst-case resolution (at the Equator) 9.3 mm */
+ kal_bool cepValid;
+ kal_uint8 cep; /* [0..255], horizontal uncertainty expressed as Circular Error Probable expressed as the coded number N,
+ the relation between the CEP and the coded number is given by CEP = 0.3*((1+0.02)^N - 1) meters, range [0, 45.6) meters */
+ kal_bool uncSemiMajorValid;
+ kal_uint8 uncSemiMajor; /* [0..255], the semi-major axis of the horizontal uncertainty ellipse expressed as the coded number N,
+ the relation between the semi-major axis and the coded number is given by semi-major axis = 0.3*( (1+0.02)^N -1) meters, range [0, 45.6) meters */
+ kal_bool uncSemiMinorValid;
+ kal_uint8 uncSemiMinor; /* [0..255], the semi-minor axis of the horizontal uncertainty ellipse expressed as the coded number N,
+ the relation between the semi-minor axis and the coded number is given by semi-minor axis = 0.3*((1+0.02)^N -1) meters, range [0, 45.6) meters */
+ kal_bool offsetAngleValid;
+ kal_uint8 offsetAngle; /* [0..179], the angle of semi-major axis measured clockwise with respect to True North in steps of 1 degree */
+
+ kal_bool confHorizontalValid;
+ kal_uint8 confHorizontal; /* [0..99], specify the horizontal confidence percentage associated with the CEP or Uncertainty Ellipse depending upon which is included */
+ kal_int32 altitude; /* [-64000..1280000], altitude with respect to WGS84 [GPS-ICD-200D] ellipsoid, scale factor 2^(-7) meters, range [-500, 10000] meters */
+ kal_uint8 uncAltitude; /* [0..255], the altitude uncertainty expressed as the coded number N, the relation between the altitude uncertainty and
+ the coded number is given by uncertainty= 0.3*((1+0.02)^N -1) meters, range [0, 45.6) meters */
+ kal_bool confVerticalValid;
+ kal_uint8 confVertical; /* [0..99], specify the confidence percentage associated with the altitude uncertainty */
+} gnss_ha_high_accu_3d_position_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* begin of gnss_ha_ionospheric_model */
+typedef struct
+{
+ gnss_ha_validity_period_struct validityPeriod; /* specify the start time and duration of the model validity period */
+ kal_int8 alfa0; /* [-128..127], specify the alpha0 parameter of the Klobuchar model, scale factor 2^(-30) seconds */
+ kal_int8 alfa1; /* [-128..127], specify the alpha1 parameter of the Klobuchar model, scale factor 2^(-27) seconds/semi-circle */
+ kal_int8 alfa2; /* [-128..127], specify the alpha2 parameter of the Klobuchar model, scale factor 2^(-24) seconds/semi-circle^2 */
+ kal_int8 alfa3; /* [-128..127], specify the alpha3 parameter of the Klobuchar model, scale factor 2^(-24) seconds/semi-circle^3 */
+ kal_int8 beta0; /* [-128..127], specify the beta0 parameter of the Klobuchar model, scale factor 2^11 seconds */
+ kal_int8 beta1; /* [-128..127], specify the beta1 parameter of the Klobuchar model, scale factor 2^14 seconds/semi-circle */
+ kal_int8 beta2; /* [-128..127], specify the beta2 parameter of the Klobuchar model, scale factor 2^16 seconds/semi-circle^2 */
+ kal_int8 beta3; /* [-128..127], specify the beta3 parameter of the Klobuchar model, scale factor 2^16 seconds/semi-circle^3 */
+} gnss_ha_local_klobuchar_model_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_area_struct validityArea;
+ kal_uint8 numKlobucharModel;
+ gnss_ha_local_klobuchar_model_struct klobucharModel[GNSS_HA_MAX_LOCAL_KLOBUCHAR_MODEL]; /* local klobuchar model per validity period */
+} gnss_ha_local_klobuchar_model_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numKlobucharElement;
+ gnss_ha_local_klobuchar_model_element_struct klobucharElement[GNSS_HA_MAX_LOCAL_KLOBUCHAR_MODEL_ELEMENT]; /* local klobuchar model per validity area */
+} gnss_ha_local_klobuchar_model_list_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct
+{
+ gnss_ha_validity_period_struct validityPeriod;
+ //gnss_ha_rle_iono_list_struct rleListIono;
+} gnss_ha_storm_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numStormElement;
+ gnss_ha_storm_element_struct stormElement[GNSS_HA_MAX_STORM_ELEMENT];
+} gnss_ha_storm_list_struct;
+
+
+typedef struct
+{
+ gnss_ha_storm_validity_area_struct area; /* rlelist is not not included or ignored in IonoStormIndication */
+ gnss_ha_storm_list_struct stormList; /* provide information on the ionospheric activity in the area defined by area */
+} gnss_ha_iono_storm_ind_struct;
+
+
+typedef struct
+{
+ kal_bool localKlobucharListValid;
+ gnss_ha_local_klobuchar_model_list_struct localKlobucharList; /* localized Klobuchar model */
+
+ kal_bool ionoStormIndValid;
+ gnss_ha_iono_storm_ind_struct ionoStormInd; /* information on the ionosphere conditions in the area */
+} gnss_ha_ionospheric_static_model_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct
+{
+ kal_bool durationValid;
+ gnss_ha_duration duration; /* specify the length of the continuous periodic assistance session */
+
+ kal_bool rateValid;
+ kal_uint8 rate; /* [1..64], specify the length of the continuous periodic assistance session */
+
+ kal_bool refPositionValid;
+ //gnss_ha_ellipsoid_point_struct referencePosition; /* TBD: redefine internal structure? */
+
+ kal_bool validityAreaValid;
+ gnss_ha_validity_area_struct validityArea;
+} gnss_ha_wa_iono_control_param_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_period_struct validityPeriod; /* define the validity period of the widea area ionosphere correction */
+} gnss_ha_wa_iono_common_param_struct;
+
+
+typedef struct
+{
+ kal_bool controlParamsValid;
+ gnss_ha_wa_iono_control_param_struct controlParams; /* carry the control parameters of the periodic Wide Area ionosphere surface corrections */
+ kal_bool commonParamsValid;
+ gnss_ha_wa_iono_common_param_struct commonParams; /* carry the common parameters of the periodic Wide Area ionosphere surface corrections */
+} gnss_ha_ionospheric_periodic_model_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+
+ gnss_ha_iono_model_type_enum type;
+ union
+ {
+ gnss_ha_ionospheric_static_model_struct staticModel;
+ gnss_ha_ionospheric_periodic_model_struct periodicWAIono; /* based on the real-time GNSS observations and thus updated frequently to the target */
+ } data;
+} lcsp_gnss_ha_common_ionospheric_model_req_struct;
+/* end of gnss_ha_ionospheric_model */
+
+
+/* begin of gnss_ha_troposphere_model */
+typedef struct
+{
+ gnss_ha_validity_period_struct validityPeriod; /* specify the start time and duration of the local troposphere parameters validity period */
+ kal_uint16 zh0; /* [0..4095], the hydrostatic zenith delay (meters), measured at the reference altitude level, scale factor 2^(-10) m */
+
+ kal_uint8 validityBitmap; /* ehValid, zw0Valid, ewValid, gNValid, gEValid, use GNSS_HA_LOCAL_TROPO_DELAY_TIME_ELEMENT_BIT_*_VALID */
+ /* optional */
+ kal_uint16 eh; /* [0..4095], the exponential fit parameter (1/m) for scaling zh0 to the target altitude, scale factor 2^(-20) (1/m) */
+ /* optional */
+ kal_uint16 zw0; /* [0..4095], the wet zenith delay (meters), measured at the reference altitude level, scale factor 2^(-10) m */
+ /* optional */
+ kal_uint16 ew; /* [0..4095], the exponential fit parameter (1/m) for scaling zw0 to the target altitude, scale factor 2^(-20) (1/m) */
+ /* optional */
+ kal_int16 gN; /* [-8192..8191], the gradient parameter (m) in North direction of the azimuthally asymmetric part of the tropospheric slant delay, scale factor 2^(-7) m */
+ /* optioanl */
+ kal_int16 gE; /* [-8192..8191], the gradient parameter (m) in East direction of the azimuthally asymmetric part of the tropospheric slant delay, scale factor 2^(-7) m */
+
+ gnss_ha_mapping_func_params_struct mappingFuncParams; /* coefficients of the mapping functions */
+} gnss_ha_local_tropo_delay_time_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numDelayTimeElement;
+ gnss_ha_local_tropo_delay_time_element_struct delayTimeElement[GNSS_HA_MAX_LOCAL_TROPO_DELAY_TIME_ELEMENT];
+} gnss_ha_local_tropo_delay_time_list_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_area_struct validityArea; /* specify the geographical validity area of the local troposphere model parameters */
+
+ kal_bool refAltitudeValid;
+ kal_int16 refAltitude; /* [-1000..8192], specify the reference altitude (from nominal sea level, EGM96) at which the delay measurements are made, scale factor 1m, if absent, the reference altitude is the zero nominal sea level */
+
+ kal_bool graRefPositionValid;
+ //gnss_ha_ellipsoid_point_struct graRefPosition; /* TBD: redefine internal structure? */ /* specify the origion for the spatial gradients gN and gE, if absent, the origin is taken as the middle point of the validity area */
+
+ gnss_ha_local_tropo_delay_time_list_struct delayList; /* specify the troposphere delays */
+} gnss_ha_local_tropo_delay_area_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numDelayAreaElement;
+ gnss_ha_local_tropo_delay_area_element_struct delayAreaElement[GNSS_HA_MAX_LOCAL_TROPO_DELAY_AREA_ELEMENT];
+} gnss_ha_troposphere_delay_list_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_period_struct validityPeriod; /* specify the start time and duration of the surface parameter validity period */
+
+ kal_int16 pressure; /* [-1024..1023], local atmospheric pressure measurement (hPa) at the altitude given by refAltitude, scale factor 0.1 hPa, the value is added to the nominal pressure of 1013hPa */
+ kal_int8 pressureRate; /* [-128..127], rate of change of pressure, when calculating the pressure, the origin of time is the begin time of the validity period, scale factor 10 Pa/hour */
+
+ kal_uint8 validityBitmap; /* gNpressureValid, gEpressureValid, temperatureValid, temperatureRateValid, gNtemperatureValid, gEtemperatureValid, use GNSS_HA_LOCAL_SURF_PARAMS_TIME_ELEMENT_BIT_* */
+ /* optional */
+ kal_int8 gNpressure; /* [-128..127], specify the northward gradient of the atmospheric pressure, if this field is present, but gE is not given, the eastward gradient is zero, scale factor 10 Pa/km */
+ /* optional */
+ kal_int8 gEpressure; /* [-128..127], specify the eastward gradient of the atmospheric pressure, if this field is present, but gN is not given, the nothward gradient is zero, scale factor 10 Pa/km */
+ /* optional */
+ kal_int8 temperature; /* [-64..63], local temperature measurement at the reference altitude refAltitude, scale factor 1K, the value is added to 273K */
+ /* optional */
+ kal_int8 temperatureRate; /* [-16..16], local temperature change rate, the scale factor 1K/hour */
+ /* optional */
+ kal_int8 gNtemperature; /* [-8..7], specify the northward gradient of the temperature, if this field is present, but gE is not given, the eastward gradient is zero, scale factor 1 K/km */
+ /* optional*/
+ kal_int8 gEtemperature; /* [-8..7], specify the eastward gradient of the temperature, if this field is present, but gN is not given, the nothward gradient is zero, scale factor 1 K/km */
+
+ gnss_ha_mapping_func_params_struct mappingFuncParams; /* coefficients of the mapping functions */
+} gnss_ha_local_surface_params_time_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numParamsTimeElements;
+ gnss_ha_local_surface_params_time_element_struct paramsTimeElement[GNSS_HA_MAX_LOCAL_SURFACE_PARAMS_TIME_ELEMENT];
+} gnss_ha_local_surface_params_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_area_struct validityArea; /* specify the geographical validity area of the local troposphere model parameters */
+
+ kal_bool refAltitudeValid;
+ kal_int16 refAltitude; /* [-1000..8192], specify the reference altitude (from nominal sea level, EGM96) at which the surface measurements are made, scale factor 1m, if absent, the reference altitude is the zero nominal sea level EGM96 */
+
+ kal_bool graRefPositionValid;
+ //gnss_ha_ellipsoid_point_struct graRefPosition; /* specify the origion for the spatial gradients gN and gE, if absent, the origin is taken as the middle point of the validity area */
+ gnss_ha_local_surface_params_struct paramsList; /* specify the surface parameters */
+} gnss_ha_local_surface_params_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numParamsElements;
+ gnss_ha_local_surface_params_element_struct paramsElement[GNSS_HA_MAX_LOCAL_SURFACE_PARAMS_ELEMENT];
+} gnss_ha_local_surface_params_list_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+
+ kal_bool tropoDelayListValid;
+ gnss_ha_troposphere_delay_list_struct tropoDelayList; /* provide the zenith troposphere delay components determined in a given location and the needed parameters to adjust the delay to the target's altitude */
+ kal_bool surfaceParamListValid;
+ gnss_ha_local_surface_params_list_struct surfaceParametersList; /* provide the surface pressure and optionally temperature that allow the target to compute the tropospheric delay using one of the known atmosphere models, such as the Hopfield or Saastamoinen model */
+} lcsp_gnss_ha_common_troposphere_model_req_struct;
+/* end of gnss_ha_troposphere_model */
+
+
+/* begin of gnss_ha_altitude_assist */
+typedef struct
+{
+ gnss_ha_validity_period_struct validityPeriod; /* specify the start time and duration of the altitude assistance validity period */
+
+ kal_int16 pressure; /* [-1024..1023], local atmospheric pressure measurement (hPa) at the altitude given by refAltitude, scale factor 10 Pa, the value is added to the nominal pressure of 1013hPa */
+ kal_bool pressureRateValid;
+ kal_int8 pressureRate; /* [-128..127], rate of change of pressure, when calculating the pressure, the origin of time is the begin time of the validity period, scale factor 10 Pa/hour */
+
+ kal_bool gNValid;
+ kal_int8 gN; /* [-128..127], specify the northward gradient of the atmospheric pressure, scale factor 10 Pa/km */
+ kal_bool gEValid;
+ kal_int8 gE; /* [-128..127], specify the eastward gradient of the atmospheric pressure, scale factor 10 Pa/km */
+} gnss_ha_pressure_assist_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numPressureElements;
+ gnss_ha_pressure_assist_element_struct pressureElement[GNSS_HA_MAX_PRESSURE_ASSIST_ELEMENT];
+} gnss_ha_pressure_assist_list_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_area_struct validityArea; /* specify the geographical validity area of the altitude assistance */
+
+ kal_bool gradRefPositionValid;
+ gnss_reference_location_struct gradRefPosition; /* specify the origin for the spatial gradients gN and gE, if absent, the origin is taken as the middle point of the validity area */
+
+ kal_bool refAltitudeValid;
+ kal_int16 refAltitude; /* specify the reference altitude (from nominal sea level, [EGM96]) at which the surface measurements are made, scale factor 1m, if absent, the reference altitude is the zero nominal sea level */
+
+ gnss_ha_pressure_assist_list_struct pressureAssistanceList; /* specify the set of pressure assistance elements for different periods of time */
+} gnss_ha_altitude_assist_area_element_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+
+ kal_uint8 numAltitudeAreaElement;
+ gnss_ha_altitude_assist_area_element_struct altitudeAreaElement[GNSS_HA_MAX_ALTITUDE_ASSIST_AREA_ELEMENT];
+} lcsp_gnss_ha_common_altitude_assist_req_struct;
+/* end of gnss_ha_altitude_assist */
+
+
+/* begin of gnss_ha_altitude_assist */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+
+ kal_uint16 solarRad; /* specifies the solar radiation at one AU from the Sun, scale factor 1 Wm^(-2) */
+} lcsp_gnss_ha_common_solar_radiation_req_struct;
+/* end of gnss_ha_altitude_assist */
+
+
+/* begin of gnss_ha_ccp_assist_common */
+typedef struct
+{
+ gnss_id_enum gnssID; /* specify the GNSS type */
+ kal_uint8 gnssSignals; /* specify the GNSS signal types for which CCP assistance can be provided in the area, GNSS Signal(s), map to GNSS_SGN_ID_BITMAP_* */
+} gnss_ha_ccp_signal_supp_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numSigSuppElement;
+ gnss_ha_ccp_signal_supp_element_struct sigSuppElement[GNSS_HA_MAX_CCP_SIGNAL_SUPP_ELEMENT];
+} gnss_ha_ccp_signal_supp_struct;
+
+
+typedef struct
+{
+ gnss_ha_validity_area_struct areaDescr; /* provide the description of the area */
+ gnss_ha_ccp_signal_supp_struct sigSupp; /* provide the GNSS signal support information */
+} gnss_ha_ccp_support_area_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+
+typedef struct
+{
+ kal_uint16 refStationID; /* define the ID of the reference station */
+ gnss_ha_high_accu_3d_position_struct refStationLoc; /* define the location of the reference station, of which ID is refStationID */
+ kal_bool antennaDescrValid;
+ //gnss_ha_antenna_struct antennaDescr; /* TBD: redefine internal structure? */ /* specify the antenna type used at the reference station */
+} gnss_ha_ccp_pref_station_list_element_struct;
+
+
+typedef struct
+{
+
+ kal_uint8 numPrefStationElement;
+ gnss_ha_ccp_pref_station_list_element_struct prefStationElement[GNSS_HA_MAX_CCP_PREF_STATION_LIST_ELEMENT];
+} gnss_ha_ccp_pref_station_list_struct;
+
+
+typedef struct
+{
+ kal_bool supportAreaValid;
+ gnss_ha_ccp_support_area_struct supportArea; /* provide information on the area, in which CCP is supported */
+
+ kal_bool nbrListValid;
+ gnss_ha_ccp_pref_station_list_struct nbrList; /* provide information on the possible neighbour reference stations */
+
+ kal_bool durationValid;
+ gnss_ha_duration duration; /* specify the length of the continuous periodic assistance session */
+
+ kal_bool rateValid;
+ kal_uint8 rate; /* [1..64], specify the interval between the assistance data deliveries in seconds */
+
+ kal_bool refStationListValid;
+ gnss_ha_ccp_pref_station_list_struct refStationList; /* provide the locations of the reference stations for which CCP assistance is being provided */
+} gnss_ha_ccp_assist_common_ctrl_params_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+ gnss_ha_ccp_assist_common_type_enum type;
+ union
+ {
+ gnss_system_time_struct commParamsRefSysTime; /* define the CCP-specific common parameters (reference time) */
+ gnss_ha_ccp_assist_common_ctrl_params_struct ctrlParams; /* define the CCP-specific control parameters */
+ } data;
+} lcsp_gnss_ha_common_ccp_assist_req_struct;
+/* end of gnss_ha_ccp_assist_common */
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* begin of gnss_ha_req_ionospheric_model */
+typedef struct
+{
+ kal_uint8 ionoReq; /* specify which ionosphere models are being requested for, mapping to GNSS_HA_COMM_AD_REQ_IONO_BIT_* */
+
+ kal_bool reqBeginTimeValid;
+ gnss_system_time_struct reqBeginTime; /* specify the first time instant when an ionosphere model is needed, if absent, begin time is the current time */
+
+ gnss_ha_duration duration; /* specify for how long period the ionospheric model is requested */
+} gnss_ha_req_ionospheric_static_model_struct;
+
+
+typedef struct
+{
+ kal_bool durationValid;
+ gnss_ha_duration duration; /* specify the length of the continuous periodic assistance session */
+
+ kal_bool rateValid;
+ kal_uint8 rate; /* [0..64], specify the interval between the assistance data deliveries in seconds */
+} gnss_ha_req_ionospheric_periodic_model_struct;
+
+
+typedef struct
+{
+ gnss_ha_iono_model_type_enum type;
+ union
+ {
+ gnss_ha_req_ionospheric_static_model_struct staticModelReq; /* request for the one-shot ionosphere models */
+ gnss_ha_req_ionospheric_periodic_model_struct periodicWAIonoReq; /* request for periodic ionosphere models */
+ } data;
+} gnss_ha_req_ionospheric_model_struct;
+/* end of gnss_ha_req_ionospheric_model */
+
+
+/* begin of gnss_ha_req_troposphere_model */
+typedef struct
+{
+ kal_uint8 tropoModelReq; /* specify the desired model or models, mapping to GNSS_HA_COMM_AD_REQ_TROPO_BIT_* */
+
+ kal_bool supportMultiGridPoints; /* indicate if the target is requesting parameter sets originating from multiple locations around it (TRUE)
+ FALSE means that only the nearest grid point parameters are requested */
+
+ kal_bool reqBeginTimeValid;
+ gnss_system_time_struct reqBeginTime; /* specify the first time instant when a valid troposphere model is needed, if absent, the begin time is the current time */
+
+ gnss_ha_duration duration; /* specify how long time the tropospheric model is requested for */
+} gnss_ha_req_troposphere_model_struct;
+/* end of gnss_ha_req_troposphere_model */
+
+
+/* begin of gnss_ha_req_altitude_assist */
+typedef struct
+{
+ kal_bool reqBeginTimeValid;
+ gnss_system_time_struct reqBeginTime; /* specify the first time instant when altitude assistance is needed, if absent, the begin time is the current time */
+
+ kal_bool durationValid;
+ gnss_ha_duration duration; /* specify how long time the altitude assistance is requested for, if absent, altitude assistance is requested for the current moment */
+} gnss_ha_req_altitude_assist_struct;
+/* end of gnss_ha_req_altitude_assist */
+
+
+/* begin of gnss_ha_req_ccp_ctrl_params */
+typedef struct
+{
+ gnss_ha_high_accu_3d_position_struct reqRefStationLoc; /* request for a new reference station based on the position. The position may or may not be the target position */
+ gnss_ha_agnss_qor_type_enum qor; /* QoR (Quality-of-Reference station) defines how close to the requested location the closest reference station must be
+ In case the closest reference station is within the uncertainty area of the target location, the QoR parameter is neglected */
+} gnss_ha_req_ccp_pos_based_ref_station_struct;
+
+
+typedef struct
+{
+ kal_uint8 numRefStationIDElement;
+ kal_uint16 refStationIDElement[GNSS_HA_MAX_CCP_PREF_STATION_LIST_ELEMENT]; /* [0..65535], contain the reference station ID list */
+} gnss_ha_req_ccp_ref_station_list_struct;
+
+
+typedef struct
+{
+ gnss_ha_req_ccp_ref_station_type_enum type;
+ union
+ {
+ gnss_ha_req_ccp_pos_based_ref_station_struct posBasedRefStationReq;
+ gnss_ha_req_ccp_ref_station_list_struct idBasedRefStationReq; /* request for CCP AD for a new reference station based on the reference station ID */
+ gnss_ha_req_ccp_ref_station_list_struct refStationKillList; /* terminate CCP AD deliveries for selected reference stations based on their reference station IDs */
+ } data;
+} gnss_ha_req_ccp_ref_station_struct;
+
+
+typedef struct
+{
+ kal_bool durationValid;
+ gnss_ha_duration duration; /* specify the length of the continuous periodic assistance session */
+
+ kal_bool rateValid;
+ kal_uint8 rate; /* [1..64], specify the interval between the assistance data deliveries in seconds */
+
+ kal_bool refStationValid;
+ gnss_ha_req_ccp_ref_station_struct refStation; /* specify the request/modification of the active reference station set */
+} gnss_ha_req_ccp_common_req_struct;
+
+
+typedef struct
+{
+ kal_bool ccpSuppAreaReq; /* TRUE if request for the information on the CCP assistance availability in the target area */
+ kal_bool ccpNbrListReq; /* TRUE if request for the information on the reference stations in the vicinity of the target */
+
+ gnss_ha_req_ccp_common_req_struct ccpCommonRequest; /* request for a new reference station or stopping CCP AD delivery for a reference station */
+} gnss_ha_req_ccp_ctrl_params_struct;
+/* end of gnss_ha_req_ccp_ctrl_params */
+
+/* begin of gnss_ha_req_ccp_generic_struct */
+typedef struct
+{
+ kal_uint8 ccpGnssSignalsReq; /* specify the GNSS signal types for which the CCP assistance is requested by the target device, GNSS Signal(s), map to GNSS_SGN_ID_BITMAP_* */
+} gnss_ha_req_ccp_generic_struct;
+/* end of gnss_ha_req_ccp_generic_struct */
+
+typedef struct
+{
+ gnss_id_enum gnssId;
+ // kal_bool waIonoSurfaceReq; /* TRUE if wide area ionosphere correction surface is requested for the SVs of this GNSS */
+ // gnss_ha_req_mechanics_struct mechanicsReq; /* request the SV mechanics information */
+ // gnss_ha_req_dcb_struct dcbReq; /* request the differential code biases to gain higher accuracy */
+ kal_bool degradModelReq; /* TRUE if request the accuracy models for the SV orbit and clock models to get a better understanding of the accuracy of the computed position */
+ gnss_ha_req_ccp_generic_struct ccpAssistGenericReq; /* request for the CCP reference assistance data for high accuracy */
+ // gnss_ha_req_nav_model_struct navigationModelReq; /* TBD. request for the navigation models defined in LPPe */
+
+} gnss_ha_generic_assist_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+
+ /* Common assistance data */
+ kal_bool ionoModelReqValid;
+ gnss_ha_req_ionospheric_model_struct ionoModelReq; /* request for ionosphere models */
+
+ kal_bool tropoModelReqValid;
+ gnss_ha_req_troposphere_model_struct tropoModelReq; /* request troposphere models */
+
+ kal_bool altAssistReqValid;
+ gnss_ha_req_altitude_assist_struct altAssistReq; /* request altitude assistance for improved availability */
+
+ kal_bool solarRadReq; /* TRUE if request the solar radiation intensity */
+
+ kal_bool ccpCtrlParamsReqValid;
+ gnss_ha_req_ccp_ctrl_params_struct ccpCtrlParamsReq; /* request for the control parameters of the CCP AD session.
+ it shall be accompanied by ccpAssistGenericReq in the generic part of the AGNSS request */
+ /* Generic assistance data */
+ kal_uint8 numGnssSupport;
+ gnss_ha_generic_assist_struct genericAssistReq[16];
+} lcsp_gnss_ha_assist_data_request_ind_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* begin of gnss_ha_degradation_model */
+typedef struct
+{
+ kal_uint8 clockRMS0; /* specify the constant term of the clock model degradation model by cRMS0 =((1+0.1)^clockRMS0 -1) meters,
+ where clockRMS0 = 31 denotes 'Use At Own Risk', the range is [0, 16.45) meters, refer to OMA-TS-LPPe Appendix C.6.1 */
+ kal_bool clockRMS1Valid;
+ kal_uint8 clockRMS1; /* specify the first order term of the clock model degradation model, cRMS1, scale factor 2^(-14) m/s,
+ range [0, 4.3e-4) m/s, refer to OMA-TS-LPPe Appendix C.6.1 */
+} gnss_ha_clock_model_degrad_model_struct;
+
+
+typedef struct
+{
+ kal_uint8 orbitRMS0; /* specify the constant term of the orbit model degradation model by oRMS0 =((1+0.1)^orbitRMS0 -1) meters,
+ where orbitRMS0 = 31 denotes 'Use At Own Risk', the range is [0, 16.45) meters, refer to OMA-TS-LPPe Appendix C.6.2 */
+ kal_bool orbitRMS1Valid;
+ kal_uint8 orbitRMS1; /* specify the first order term of the orbit model degradation model, oRMS1, scale factor 2^(-14) m/s, range [0, 4.3e-4) m/s,
+ refer to OMA-TS-LPPe Appendix C.6.2 */
+} gnss_ha_orbit_model_degrad_model_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63], specify the SV for which degradation models are provided */
+ gnss_ha_clock_model_degrad_model_struct clockDegradationModel; /* provide the degradation model for the clock model */
+ gnss_ha_orbit_model_degrad_model_struct orbitDegradationModel; /* provide the degradation model for the orbit model */
+} gnss_ha_degrad_model_element_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+ gnss_id_enum gnssId;
+
+ kal_uint8 numDegradModelElement;
+ gnss_ha_degrad_model_element_struct degradModelElement[GNSS_HA_MAX_DEGRAD_MODEL_ELEMENT];
+} lcsp_gnss_ha_generic_degradation_model_req_struct;
+/* end of gnss_ha_degradation_model */
+
+
+/* begin of gnss_ha_ccp_assist_generic */
+typedef struct
+{
+ gnss_ha_code_phase_err_type_enum type;
+ union
+ {
+ kal_uint8 codePhaseRMSError; /* contain the pseudorange RMS error value, representation refer to TS 36.355 floating-point representation of GNSS-MeasurementList field descriptions */
+ kal_uint8 cnr; /* carrier-to-noise ratio, scale factor 0.25 dB-Hz, range [0, 63.75] dB-Hz */
+ } data;
+} gnss_ha_code_phase_error_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63], identify the SV for which CCP assistance is being provided */
+
+ kal_bool intCodePhaseValid;
+ kal_uint8 intCodePhase; /* [0..255], indicate the integer milli-second part of the code phase */
+
+ kal_uint32 codePhase; /* [0.. 14989622], contain the sub-millisecond part of the code phase observation
+ for the particular satellite signal at the reference time, scale factor 0.02 meters, range [0, 299792.44] meters */
+
+ kal_bool codePhaseErrorValid;
+ gnss_ha_code_phase_error_struct codePhaseError; /* code phase error */
+
+ kal_int32 phaseRangeDelta; /* [-524288.. 524287], define the (Phase Range �V Pseudorange), scale factor 0.5 mm, range [-262.144, 262.1435] meters */
+
+ kal_bool phaseRangeRMSErrorValid;
+ kal_uint8 phaseRangeRMSerror; /* [0..127], contain the RMS error of the continuous carrier phase, scale factor 2^(-10) meters, in the range [0, 0.12403) meters */
+
+ kal_bool lockIndicator; /* TRUE: if the carrier phase tracking has been continuous between the previous and the current assistance
+ data delivery. FALSE: a cycle slip has occurred */
+} gnss_ha_ccp_sv_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numCCPPerSVElement;
+ gnss_ha_ccp_sv_element_struct ccpPerSVElement[GNSS_HA_MAX_CCP_PER_SV_ELEMENT];
+} gnss_ha_ccp_per_sv_list_struct;
+
+
+typedef struct
+{
+ kal_uint8 signalID; /* indicate the signal id, map to GNSS_SGN_ID_VALUE_* */
+ gnss_ha_ccp_per_sv_list_struct ccpPerSVlist;
+} gnss_ha_ccp_per_signal_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numCCPPerSigElement;
+ gnss_ha_ccp_per_signal_element_struct ccpPerSigElement[GNSS_HA_MAX_CCP_PER_SIG_ELEMENT];
+} gnss_ha_ccp_per_signal_list_struct;
+
+
+typedef struct
+{
+ kal_uint16 refStationID; /* define the ID of the reference station to which the CCP assistance is provided */
+ gnss_ha_ccp_per_signal_list_struct ccpPerSignalList;
+} gnss_ha_ccp_generic_element_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_uint16 transactionID;
+ gnss_id_enum gnssId;
+
+ kal_uint8 numCCPGenericElement;
+ gnss_ha_ccp_generic_element_struct ccpGenericElement[GNSS_HA_MAX_CCP_GENERIC_ELEMENT];
+} lcsp_gnss_ha_generic_ccp_assist_req_struct;
+/* end of gnss_ha_ccp_assist_generic */
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct
+{
+ gnss_id_enum gnssID; /* GNSS ID for which HA GNSS measurements are requested */
+ kal_uint8 gnssSignals; /* specify the GNSS signal types for which HA GNSS measurements are requested by the server, map to GNSS_SGN_ID_BITMAP_* */
+} gnss_ha_meas_signal_req_element_struct;
+
+
+typedef struct
+{
+ kal_bool durationValid;
+ gnss_ha_duration duration; /* specify the length of the HA GNSS measurement session */
+
+ kal_bool rateValid;
+ kal_uint8 rate; /* [1..63], specify the rate of delivery of the HA GNSS measurements, scale factor 1 second */
+
+ /* should we support antenna info for HA GNSS? */
+ //kal_bool antennaInfoReqValid;
+ ///LPP_EXT_OMA_LPPe_AGNSS_HAgnssRequestControlParameters_antennaInformationReq antennaInformationReq; /* request for the target antenna information */
+
+ kal_bool pressureReq; /* request for the pressure information at the target site */
+
+ kal_uint8 numSigReqElement;
+ gnss_ha_meas_signal_req_element_struct sigReqelement[GNSS_HA_MAX_MEAS_PER_GNSS_ELEMENT]; /* request HA GNSS measurements for specific GNSS signals */
+} gnss_ha_meas_req_struct;
+
+
+typedef struct
+{
+ kal_int16 pressure; /* [-1024..1023], local atmospheric pressure measurement (hPa) at the target��s altitude, scale factor 0.1 hPa, the value is added to the average pressure 1013hPa */
+ kal_uint8 pressureUnc; /* [0..127], the 1-sigma standard deviation of the pressure measurement, the scale factor 0.1 hPa */
+} gnss_ha_local_pressure_struct;
+
+
+typedef struct
+{
+ kal_uint8 svID; /* [0..63], identify the SV for which HA GNSS measurements are provided */
+
+ kal_bool intCodePhaseValid;
+ kal_uint8 intCodePhase; /* [0..255], indicate the integer milli-second part of the code phase */
+
+ kal_uint32 codePhase; /* [0..14989622], contain the sub-millisecond part of the code phase observation for the particular satellite signal at the reference time
+ target shall reconstruct the full pseudorange by Pseudorange = (Integer Code Phase) + (Code Phase), scale factor 0.02 meters. Range [0, 299792.44] meters */
+
+ kal_uint8 codePhaseRMSError; /* [0..63], contain the pseudorange RMS error value. representation refer to TS 36.355 floating-point representation of GNSS-MeasurementList field descriptions */
+ gnss_ha_multipath_detect_type_enum multipathDetection; /* contain an estimate of the multipath environment */
+ kal_uint8 cnr; /* [0..255], contain an estimate of the carrier-to-noise ratio, scale factor 0.25 dB-Hz, range [0, 63.75] dB-Hz */
+ kal_uint32 adr; /* [0..536870911], contain the continuous carrier phase with direct data polarity, scale factor 2^-10 meters, in the range [0, 524287.999023438) meters */
+ kal_uint8 adrRMSerror; /* [0..127], contain the RMS error of the continuous carrier phase, scale factor 2^-10 meters, in the range [0, 0.12403) meters */
+ kal_bool lockIndicator; /* TRUE if the carrier phase tracking has been continuous between the previous and the current measurement delivery;
+ FALSE if a cycle slip has occurred */
+} gnss_ha_meas_per_sv_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numPerSVElement;
+ gnss_ha_meas_per_sv_element_struct perSVElement[GNSS_HA_MAX_MEAS_PER_SV_ELEMENT];
+} gnss_ha_meas_per_sv_list_struct;
+
+
+typedef struct
+{
+ kal_uint8 signalID; /* define GNSS signal ID for which measurements are being provided, map to GNSS_SGN_ID_VALUE_* */
+ gnss_ha_meas_per_sv_list_struct perSVlist; /* carry the HA GNSS measurements for specific satellites */
+} gnss_ha_meas_per_sig_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numPerSigElement;
+ gnss_ha_meas_per_sig_element_struct perSigElement[GNSS_HA_MAX_MEAS_PER_SIGNAL_ELEMENT];
+} gnss_ha_meas_per_sig_list_struct;
+
+
+typedef struct
+{
+ gnss_id_enum gnssID; /* GNSS ID for which measurements are being provided */
+ gnss_ha_meas_per_sig_list_struct perSignalList; /* carry the HA GNSS measurements for the given signals */
+} gnss_ha_meas_per_gnss_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numGnssElement;
+ gnss_ha_meas_per_gnss_element_struct gnssElement[GNSS_HA_MAX_MEAS_PER_GNSS_ELEMENT];
+} gnss_ha_measured_result_struct;
+
+
+typedef struct
+{
+ kal_bool positionValid;
+ gnss_reference_location_struct position; /* specify the position of the target device */
+
+ gnss_system_time_struct refTime; /* specify the time, when the measurements included are applicable */
+
+ kal_bool localPressureValid;
+ gnss_ha_local_pressure_struct localPressure; /* specify the local atmospheric pressure measurement at the target's altitude for improved altitude or delta-altitude performance */
+
+ /* should we support antenna info for HA GNSS? */
+ //LPP_EXT_OMA_LPPe_Orientation antennaOrientation; /* OPTIONAL */
+
+ gnss_ha_measured_result_struct signalMeasurements; /* carry the HA GNSS signal measurements */
+} gnss_ha_meas_cnf_struct;
+
+
+typedef struct
+{
+ kal_uint16 azimuth; /* [0..359], indicate the azimuth angle of the ionosphere measurement, i.e. the direction from the user where the TEC values are observed.
+ azimuth angle is defined as the clockwise angle from the true North, scale factor 1 degree */
+ kal_uint8 elevation; /* [0..90], indicate the elevation angle of the ionosphere measurement, i.e. how high or low in the sky the TEC value is observed, scale factor is 1 degree */
+ kal_uint16 tecValue; /* [0..511], indicate the measured TEC value towards the SV concerned, scale factor is 1 TEC unit, 10^16 e-/m^2 */
+ kal_uint8 tecUncertainty; /* [0..63], indicate the 1-sigma standard deviation of the TEC measurement, scale factor is 1 TEC unit, 10^16 e-/m^2 */
+} gnaa_ha_tec_per_sv_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numPerSVElement;
+ gnaa_ha_tec_per_sv_element_struct perSVElement[GNSS_HA_MAX_TEC_PER_SV_ELEMENT];
+} gnss_ha_tec_per_sv_struct;
+
+
+typedef struct
+{
+ kal_uint16 tecValueAtZenith; /* [0..511], indicate the measured vertical TEC value, scale factor is 1 TEC unit, 10^16 e-/m^2 */
+ kal_uint8 tecUncertaintyAtZenith; /* [0..63], indicate the 1-sigma standard deviation of the TEC measurement, scale factor is 1 TEC unit 10^16 e-/m^2 */
+} gnss_ha_tec_at_zenith_struct;
+
+
+typedef struct
+{
+ kal_uint16 azimuth;
+ kal_uint8 elevation;
+ kal_uint16 tecValue;
+ kal_uint8 tecUncertainty;
+} gnss_ha_tec_persv_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numElements;
+ gnss_ha_tec_persv_element_struct *element;
+} gnss_ha_tec_persv_struct;
+
+
+typedef struct
+{
+ gnss_system_time_struct gnssTime; /* indicate the measurement time */
+ gnss_reference_location_struct position; /* indicates the measurement location */
+
+ kal_bool tecPerSVValid;
+ gnss_ha_tec_persv_struct tecPerSV; /* contain the list of TEC values from the target towards each of the SVs seen by the target */
+
+ kal_bool tecAtZenithValid;
+ gnss_ha_tec_at_zenith_struct tecAtZenith; /* contain the target's estimate of the zenith TEC value at the target's position */
+} gnss_ha_iono_meas_struct;
+
+
+typedef struct
+{
+ kal_bool temperatureValid;
+ kal_int8 temperature; /* [-64..63], local temperature measured by the target, the value is added to 273K, scale factor 1K */
+
+ kal_bool temperatureUncValid;
+ kal_uint8 temperatureUnc; /* [0..7], the 1-sigma standard deviation of the temperature measurement, scale factor 1K */
+} gnss_ha_temperature_meas_struct;
+
+
+typedef struct
+{
+ gnss_system_time_struct gnssTime; /* indicate the measurement time */
+ gnss_reference_location_struct position; /* indicates the measurement location */
+
+ kal_int16 pressure; /* local atmospheric pressure measurement (hPa) at the target's altitude, scale factor is 0.1 hPa, the value is added to the nominal pressure of 1013hPa */
+ kal_uint8 pressureUncertainty; /* the 1-sigma standard deviation of the pressure measurement, the scale factor is 0.1 hPa */
+
+ kal_bool temperatureMeasValid;
+ gnss_ha_temperature_meas_struct temperatureMeas; /* provide temperature measurement */
+} gnss_ha_local_surf_meas_struct;
+
+
+typedef struct
+{
+ kal_bool haErrCauseValid;
+ gnss_ha_tgt_err_cause_enum haErrCause;
+
+ kal_bool ionoMeasErrCauseValid;
+ gnss_ha_tgt_iono_meas_err_cause_enum ionoMeasErrCause;
+
+ kal_bool envObserveErrCauseValid;
+ gnss_ha_tgt_env_observe_err_cause_enum envObserveErrCause;
+
+ kal_bool haGNSSErrCauseValid;
+ gnss_ha_tgt_gnss_err_cause_enum haGNSSErrCause;
+} gnss_ha_tgt_error_struct;
+
+
+typedef struct
+{
+ kal_uint8 ionoModelSupport; /* specify which ionospheric model or models the target supports, mapping to GNSS_HA_COMM_IONO_AD_SUPP_BIT_* */
+ kal_uint8 tropoModelSupport; /* specify which troposphere model or models the target supports and combining troposphere information from several grid points surrounding the target, mapping to GNSS_HA_COMM_TROPO_AD_SUPP_BIT_* */
+ kal_bool altitudeAssistSupport; /* TRUE if the targets supports altitude assistance */
+ kal_bool solarRadiationSupport; /* TRUE if the targets supports solar radiation assistance data */
+ kal_uint8 ccpSupport; /* specify which CCP assistance data type the target supports, mapping to GNSS_HA_COMM_CCP_AD_SUPP_BIT_* */
+} gnss_ha_common_assist_data_support_struct;
+
+
+typedef struct
+{
+ gnss_id_enum gnss_ID;
+
+ kal_bool mechanicsSupport; /* TRUE if the target supports mechanics assistance data */
+ kal_bool dcbSupport; /* TRUE if the target supports Differential Code Bias assistance data */
+ kal_bool degradationModelSupport; /* TRUE if the target supports navigation model degradation model assistance data */
+ kal_uint8 ccpAssistSignalIDsSupport; /* indicate if target supports CCP assistance data for at least one signal of the GNSS, mapping to GNSS_SGN_ID_BITMAP_* */
+ kal_uint8 navModelSupport[GNSS_HA_MAX_GENERIC_AD_NAV_MODEL_ID_ELEMENT]; /* TBD */
+} gnss_ha_generic_assist_data_support_element_struct;
+
+
+typedef struct
+{
+ kal_uint8 numGenericElement;
+ gnss_ha_generic_assist_data_support_element_struct genericElement[GNSS_HA_MAX_GNSS_GENERIC_ASSIST_DATA_ELEMENT];
+} gnss_ha_generic_assist_data_support_struct;
+
+
+typedef struct
+{
+ gnss_ha_common_assist_data_support_struct commonAssistDataSupp; /* provide target's GNSS-independent AGNSS capabilities */
+ gnss_ha_generic_assist_data_support_struct genericAssistDataSupp; /* provide target's GNSS-dependent AGNSS assistance data capabilities */
+} gnss_ha_assist_data_support_list_struct;
+
+
+typedef struct
+{
+ kal_uint8 ionoMeasSupport; /* specify the ionospheric measurement supported by the target device, mapping to GNSS_HA_GENE_AD_SUPP_BIT_BIT_* */
+ kal_bool pressureMeasSupport;
+ kal_bool temperatureMeasSupport;
+} gnss_ha_env_observe_support_list_struct;
+
+
+typedef struct
+{
+ gnss_id_enum gnssID; /* specify the ID of the GNSS for which HA GNSS capabilities are provided */
+ kal_uint8 signalIDsSupport; /* specify the GNSS signal types for which HA GNSS signal measurements are supported by the target device */
+} gnss_ha_capa_per_gnss_support_struct;
+
+
+typedef struct
+{
+ kal_uint8 modeSupport; /* indicate which mode supports HA GNSS, mapping to GNSS_HA_MODE_SUPPORT_BIT* */
+ kal_bool pressureInfoSupport; /* TRUE if the target is capable of providing absolute pressure information for improved delta-altitude performance */
+ kal_uint8 antInfoSupport; /* specify the antenna information support type, mapping to GNSS_HA_ANT_SUPPORT_BIT_* */
+
+ kal_uint8 numPerGNSSElement;
+ gnss_ha_capa_per_gnss_support_struct perGNSSElement[GNSS_HA_MAX_HA_GNSS_CAPA_ELEMENT];
+} gnss_ha_gnss_capa_support_struct;
+
+
+typedef struct
+{
+ kal_bool assistDataSuppListValid;
+ gnss_ha_assist_data_support_list_struct assistDataSuppList; /* provide target's HA GNSS assist data capabilities */
+
+ kal_bool envObserveSupportListValid;
+ gnss_ha_env_observe_support_list_struct envObserveSupportList; /* provide target's environment observation capabilities */
+
+ kal_bool haGNSSSupportValid;
+ gnss_ha_gnss_capa_support_struct haGNSSSupport; /* provide target's HA GNSS capabilities */
+} gnss_ha_capability_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 padding[4];
+ kal_int32 type; /* refer to agps_md_huge_data_msg_id */
+} lbs_gnss_ha_assist_cnf_struct;
+
+/* ---LPPe HA GNSS Interface---end--- */
+
+typedef struct
+{
+ kal_uint16 gnssMethod; /* specify the estimated location is calculated by which GNSS systems, map to GNSS_ID_BITMAP_* */
+ gnss_gad_pos_estimate_struct locationEstimate;
+ gnss_measured_ref_time measuredRefTime; /* should always present */
+ kal_bool haLocValid;
+ gnss_ha_pos_estimate_struct haLocationEstimate;
+} gnss_pos_result_struct;
+
+/* This structure for MSG_ID_LCSP_GNSS_STANDALONE_POS_IND*/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ gnss_loc_result_enum resultStatus;
+
+ gnss_pos_result_type_enum type;
+ union
+ {
+ gnss_pos_result_struct posResult; /* only valid when resultStatus = GNSS_LOC_RESULT_NO_ERROR */
+ gnss_request_assist_data_struct assistDataReq; /* used for ULCS/RRLP, selected when resultStatus = GNSS_LOC_RESULT_ASSIST_DATA_MISSING */
+ } data;
+} lcsp_gnss_standalone_pos_ind_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_POS_CNF */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ gnss_loc_result_enum resultStatus;
+
+ gnss_pos_result_type_enum type;
+ union
+ {
+ gnss_pos_result_struct posResult; /* only valid when resultStatus = GNSS_LOC_RESULT_NO_ERROR */
+ gnss_request_assist_data_struct assistDataReq; /* used for ULCS/RRLP, selected when resultStatus = GNSS_LOC_RESULT_ASSIST_DATA_MISSING */
+ } data;
+} lcsp_gnss_pos_cnf_struct;
+
+
+/* This structure for MSG_ID_LCSP_GNSS_MEAS_CNF */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 transactionID;
+
+ gnss_loc_result_enum resultStatus;
+
+ gnss_meas_result_type_enum type;
+ union
+ {
+ gnss_measured_result_struct measuredResult; /* only valid when resultStatus = GNSS_LOC_RESULT_NO_ERROR */
+ gnss_request_assist_data_struct assistDataReq; /* used for ULCS/RRLP, selected when resultStatus = GNSS_LOC_RESULT_ASSIST_DATA_MISSING */
+ } data;
+} lcsp_gnss_meas_cnf_struct;
+
+
+//#endif /* #if defined(__AGNSS_SUPPORT__) || defined(__AGPS_SUPPORT__) */
+
+#endif /* _GNSS2LCSP_STRUCT_H */
+
diff --git a/mcu/protocol/interface/agps/gps2lcsp_enum.h b/mcu/protocol/interface/agps/gps2lcsp_enum.h
new file mode 100644
index 0000000..78c865e
--- /dev/null
+++ b/mcu/protocol/interface/agps/gps2lcsp_enum.h
@@ -0,0 +1,245 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gps2lcsp_enum.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is the enum of GPS
+ *
+ * Author:Wang Hai
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ *******************************************************************************/
+#ifndef __GPS_ENUM_H__
+#define __GPS_ENUM_H__
+
+typedef enum
+{
+ GPS_ERR_NO_ERROR = 0,
+ GPS_ERR_UNKOWN_ERR,
+ GPS_ERR_NOT_ENOUGH_SAT,
+ GPS_ERR_LOC_CALC_DATA_MISS,
+ GPS_ERR_ASSIST_DATA_MISS,
+ GPS_ERR_TOO_MANY_REQ,
+ GPS_ERR_LOC_REQ_NOT_PROCESSED,
+ GPS_ERR_REQ_TIMEOUT,
+ GPS_ERR_REQ_METHOD_NOT_SUPPORT, /* for RRLP usage */
+ GPS_ERR_REQ_REF_BTS_NOT_SERV /* for RRLP usage */
+
+ ,GPS_ERR_REQ_REF_TIME_NOT_MEASUREED /* for UTRAN GPS ref time */
+ ,GPS_ERR_REQ_REF_SFN_NOT_DECODED /* for ULCS usage */
+
+} gps_error_code_enum;
+
+
+typedef enum
+{
+ GPS_RESULT_OK,
+ GPS_RESULT_ERROR,
+ GPS_RESULT_END
+} gps_result_enum;
+
+
+typedef enum
+{
+ GPS_ASSIST_RTI = 0, /*PMTK717*/
+ GPS_ASSIST_ACQUISITION, /*PMTK718*/
+ GPS_ASSIST_ALMANAC, /*PMTK711*/
+ GPS_ASSIST_UTC, /*PMTK716*/
+ GPS_ASSIST_IONOSPHERE, /*PMTK715*/
+ GPS_ASSIST_NAVIGATION_MODEL, /*PMTK710*/
+ GPS_ASSIST_DGPS_CORRECTION, /*PMTK720*/
+ GPS_ASSIST_REF_LOCATION, /*PMTK713*/
+ GPS_ASSIST_REF_TIME /*PMTK712*/
+} gps_assist_data_type_enum;
+
+
+typedef enum
+{
+ GPS_VELOCITY_HOR,
+ GPS_VELOCITY_HOR_AND_VER,
+ GPS_VELOCITY_HOR_UNCERT,
+ GPS_VELOCITY_HOR_AND_VER_UNCERT,
+ GPS_VELOCITY_END
+} gps_velocity_type_enum;
+
+#define GPS_ASSIST_WRONG_ASSIST_DATA_TYPE 0
+
+#define GPS_ASSIST_MASK_ALMANAC (1<<0)
+#define GPS_ASSIST_MASK_UTC (1<<1)
+#define GPS_ASSIST_MASK_IONOSPHERE (1<<2)
+#define GPS_ASSIST_MASK_NAVIGATION_MODEL (1<<3)
+#define GPS_ASSIST_MASK_DGPS_CORRECTION (1<<4)
+#define GPS_ASSIST_MASK_REF_LOCATION (1<<5)
+#define GPS_ASSIST_MASK_REF_TIME (1<<6)
+#define GPS_ASSIST_MASK_ACQUISITION (1<<7)
+#define GPS_ASSIST_MASK_RTI (1<<8)
+
+/* Adeline */
+#define GPS_ASSIST_MB_MANDATORY_MASK (GPS_ASSIST_MASK_UTC | \
+ GPS_ASSIST_MASK_IONOSPHERE | \
+ GPS_ASSIST_MASK_NAVIGATION_MODEL | \
+ GPS_ASSIST_MASK_REF_LOCATION | \
+ GPS_ASSIST_MASK_REF_TIME | \
+ GPS_ASSIST_MASK_RTI)
+
+#define GPS_ASSIST_MA_MANDATORY_MASK (GPS_ASSIST_MASK_ACQUISITION | \
+ GPS_ASSIST_MASK_REF_TIME)
+
+
+#define GPS_ASSIST_TIME_INDEPENDENT_MASK (GPS_ASSIST_MASK_REF_LOCATION)
+
+
+#define GPS_DEFAULT_PORT (0xAA)
+
+typedef enum
+{
+ GPS_CHIP_WORK_MODE_MA = 0,
+ GPS_CHIP_WORK_MODE_MB,
+ GPS_CHIP_WORK_MODE_NO_LOCK
+} gps_chip_work_mode_enum;
+
+// NEW
+/* ENUMERATED SFN-TOW-Uncertainty */
+typedef enum
+{
+ UAGPS_CP_SFN_TOW_UNCERTAINTY_NONE,
+ UAGPS_CP_SFN_TOW_UNCERTAINTY_10MS_THRESHOLD,
+ UAGPS_CP_SFN_TOW_UNCERTAINTY_MICROSECOND
+
+} uagps_cp_sfn_tow_uncertainty_type;
+
+/* ENUMERATED UTRAN-GPS-DriftRate */
+typedef enum
+{
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_0,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_1,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_2,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_5,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_10,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_15,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_25,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_50,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_1,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_2,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_5,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_10,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_15,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_25,
+ UAGPS_CP_UTRAN_GPS_DRIFTRATE_MINUS_50
+
+} uagps_cp_utran_gps_driftrate;
+
+typedef enum
+{
+ LCS_UP_SIM_SOURCE_NOT_CARE, /* for user plane */
+ LCS_CP_FROM_SIM1, /* for control plane Gemini SIM1 or single SIM */
+ LCS_CP_FROM_SIM2, /* for control plane Gemini SIM2 */
+ LCS_CP_FROM_SIM3, /* for control plane Gemini SIM3 */
+ LCS_CP_FROM_SIM4, /* for control plane Gemini SIM4 */
+ LCS_UP_FROM_SIM1, /* for user plane Gemini SIM1 or single SIM */
+ LCS_UP_FROM_SIM2, /* for user plane Gemini SIM2 */
+ LCS_UP_FROM_SIM3, /* for user plane Gemini SIM3 */
+ LCS_UP_FROM_SIM4 /* for user plane Gemini SIM4 */
+} lcs_sim_source_enum;
+
+#endif /*__GPS_ENUM_H__*/
+
diff --git a/mcu/protocol/interface/agps/gps2lcsp_struct.h b/mcu/protocol/interface/agps/gps2lcsp_struct.h
new file mode 100644
index 0000000..b1efae7
--- /dev/null
+++ b/mcu/protocol/interface/agps/gps2lcsp_struct.h
@@ -0,0 +1,707 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gps2lcsp_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for local parameter declaration about GIS sap
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __GPS2LCSP_STRUCT_H__
+#define __GPS2LCSP_STRUCT_H__
+
+#include "gps2lcsp_enum.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+
+#define GPS_ASSIST_DATA_SUB_ITEMS_FEILDS 16
+#define GPS_ASSIST_DATA_N_SATE 8
+
+#define GPS_ASSIST_DATA_N_SATE_DGPS 16
+#define GPS_ASSIST_DATA_N_SATE_NAVIGATION_MODEL 16
+#define GPS_ASSIST_DATA_N_SATE_ALMANAC 32 /* According to Stanley Huang: max almanac sat number = 32, not 64 */
+#define GPS_ASSIST_DATA_N_SATE_ACQUISITION 16
+#define GPS_ASSIST_DATA_N_SATE_RTI 16
+#define GPS_ASSIST_DATA_N_SATE_MEAS 16 /* max allowed = 16, but typical = 4 to 12 */
+#define GPS_ASSIST_DATA_N_SATE_TOW_ASSIST 16
+
+#define GPS_ASSIST_CMD_TIMER_EXP_INTERVAL 1500
+#define GPS_QUERY_TIMER_INTERVAL 500
+
+#ifdef __AGPS_SUPPORT__
+
+typedef struct
+{
+ kal_uint8 semi_maj_uncertain; /* K1 = 0-127, mandotary, horizontal accuracy, need converted by 23.032 sec 6.2 */
+ kal_uint8 semi_min_uncertain; /* K2 = 0-127, mandotary, horizontal accuracy, need converted by 23.032 sec 6.2 */
+ kal_bool altitude_uncertain_valid; /* indicate if altitude_uncertain is valid */
+ kal_uint8 altitude_uncertain; /* K3 = 0-127, optional, vertical accuracy, need converted by 23.032 sec 6.4 */
+ kal_bool delay_valid; /* indiate if dealy is valid */
+ kal_uint32 delay; /* optional, response time ms*/
+ kal_bool age_valid; /* indicate if age field is valid, */
+ kal_uint16 age; /* 0 to 65535, optional, max location age, in sec */
+ kal_bool is_check_assist_data; /*set to TRUE will response error if assist data not enough */
+
+ kal_bool is_gsm_gps_ref_time_wanted; /* set to TRUE if GSM GPS ref time was required to be reported */
+
+ kal_bool is_utran_gps_ref_time_wanted; /*Set to TRUE if UTRAN GPS ref time was required to be reported */
+
+ /* uarfcn and phyCellId are valid when is_utran_gps_ref_time_wanted == KAL_TRUE */
+ kal_uint16 uarfcn;
+ kal_uint16 phyCellId;
+
+} gps_pos_qop_struct;
+
+typedef struct
+{
+ kal_bool accuracy_valid;
+ kal_uint8 accuracy;
+ kal_uint32 delay; /* optional, response time ms*/
+ kal_bool is_check_assist_data; /*Set to TRUE will response error if assist data not enough */
+
+ kal_bool is_gsm_gps_ref_time_wanted; /* set to TRUE if GSM GPS ref time was required to be reported */
+
+ kal_bool is_utran_gps_ref_time_wanted; /*Set to TRUE if UTRAN GPS ref time was required to be reported */
+
+ /* uarfcn and phyCellId are valid when is_utran_gps_ref_time_wanted == KAL_TRUE */
+ kal_uint16 uarfcn;
+ kal_uint16 phyCellId;
+
+} gps_meas_qop_struct;
+
+typedef struct
+{
+ kal_uint16 hor_speed; /*0-65536 .4remove and .5 add 1 unit is 1 km*/
+} gps_h_velocity_struct;
+
+typedef struct
+{
+ kal_uint32 hor_speed; /*unit is 0.1 km*/
+ kal_uint32 ver_speed; /*unit is 0.1 km*/
+} gps_hv_velocity_struct;
+
+typedef struct
+{
+ kal_uint32 hor_speed; /*unit is 0.1 km*/
+ kal_uint32 hor_speed_uncertainty;
+} gps_h_velocity_uncert_struct;
+
+typedef struct
+{
+ kal_uint32 ver_direction; /*degree*/
+ kal_uint32 hor_speed; /*unit is 0.1 km*/
+ kal_uint32 ver_speed; /*unit is 0.1 km*/
+ kal_uint32 hor_speed_uncertainty;
+ kal_uint32 ver_speed_uncertainty;
+} gps_hv_velocity_uncert_struct;
+
+typedef struct
+{
+ gps_velocity_type_enum type;
+ union
+ {
+ gps_h_velocity_struct hor_velocity;
+ gps_hv_velocity_struct hv_velocity;
+ gps_h_velocity_uncert_struct hor_uncertainty;
+ gps_hv_velocity_uncert_struct hv_uncertainty;
+ } v;
+} gps_velocity_struct;
+
+
+typedef struct
+{
+ kal_uint8 type; /* only "ellipsoid point with altitude and uncertainty ellipsoid"
+ type (1001b) is supported*/
+ kal_bool sign_latitude; /* true: SOUTH, false: NORTH */
+ kal_uint32 latitude; /* N1, encoded latitude */
+ kal_uint32 longtitude; /* N2, encoded longtitude with 2's complement */
+ kal_bool sign_altitude; /* true: DEPTH, false: HEIGHT */
+ kal_uint16 altitude; /* no encoding, unit in meter */
+ kal_uint8 unc_major; /* K1, encoded r1 */
+ kal_uint8 unc_minor; /* K2, encoded r2 */
+ kal_uint8 unc_bear; /* N3, encoded a = 2N3, Bearing of semi-major axis (degrees)*/
+ kal_uint8 unc_altitude; /* K3, encode r3, vertical uncertain */
+ kal_uint8 confidence; /* %, The confidence by which the position of a target
+ entity is known to be within the shape description,
+ expressed as a percentage. [0 ~ 100] (%)*/
+ gps_velocity_struct velocity; /*only support horizontal speed*/
+ kal_uint16 bearing; /*0-360 Direction of the horizontal speed*/
+} gps_gad_pos_estimate_struct;
+
+/* in position or measurement result */
+typedef struct
+{
+ kal_uint16 ref_time_ms_part;
+ kal_uint32 ref_time_ls_part;
+
+ kal_uint16 uarfcn;
+ kal_uint16 phyCellId; // Must valid value
+ kal_uint16 sfn;
+
+ kal_bool ref_time_uncertain_valid;
+ kal_uint8 ref_time_uncertain;
+} utran_gps_ref_time_result_struct;
+
+
+typedef struct
+{
+ kal_uint16 ref_frame; /* If refFrame is within (42432..65535), it shall be ignored by the receiver */
+ kal_uint16 week; /*gps week*/
+ kal_uint32 tow; /*msec*/
+ /* GPS TOW [0 ~ 14399999] (msec) for which the location
+ estimate is valid, rounded down to the nearest
+ millisecond unit. RRLP Location Information element
+ only contains the 24 LSBs of GPS TOW. */
+ kal_uint8 fix_type; /* position fix type performed by the GPS receiver:
+ '0' = 2D fix '1' = 3D fix*/
+ gps_gad_pos_estimate_struct pos_estimate;
+} gps_pos_result_struct;
+
+
+typedef struct
+{
+ kal_uint8 sat_id; /*The particular satellite for which the measurement data is valid. [1 ~ 32]*/
+ kal_uint8 carrier_noise; /*The estimate of the carrier-to-noise ratio of the received signal from the particular satellite used in the measurement. [0 ~ 63] (dB-Hz)*/
+ kal_uint16 doppler; /*0.2 Hz The Doppler measured by the MS for the particular satellite signal. [-32768 ~ 32767]*/
+ kal_uint16 whole_chips; /*chips The whole value of the code-phase measurement made by the GPS receiver for the particular satellite signal at the time of measurement. [0 ~ 1022] (chips)*/
+ kal_uint16 fractional_chips; /*2^-10 chips The fractional value of the code-phase measurement made by the GPS receiver for the particular satellite signal at the time of measurement. (2^-10 C/A chips) [0 ~ 1023]*/
+ kal_uint8 multipath; /*The multipath Indicator value. Possible values are listed below:
+ '0' = Not measured
+ '1' = Low, MP error < 5m
+ '2' = Medium, 5m < MP error < 43m
+ '3' = High, MP error > 43m*/
+ kal_uint8 pseudorang_m; /*Pseudorange RMS Error Mantissa*/
+ kal_uint8 pseudorang_e; /*Pseudorange RMS Error Exponent*/
+} gps_meas_para_struct;
+
+
+
+typedef struct
+{
+ kal_uint16 ref_frame; /* If refFrame is within (42432..65535), it shall be ignored by the receiver */
+ kal_uint32 tow;
+ /*GPS TOW [0 ~ 14399999] (msec) for which the location estimate is valid, rounded down to the nearest millisecond unit.
+ RRLP GPS Measurement Information element only contains the 24 LSBs of GPS TOW.*/
+ kal_uint8 sate_num;/*The number of GPS measurements for which measurement satellites are provided at the time of measurement*/
+ gps_meas_para_struct meas_param[GPS_ASSIST_DATA_N_SATE_MEAS];
+} gps_meas_result_struct;
+
+
+typedef struct
+{
+ kal_uint8 sv; /* sat id, 6 bits */
+ kal_uint32 wn; /* 10 bits, set to 0 */
+ kal_uint8 c_a; /*2 bits*/
+ kal_uint8 ura; /*4 bits*/
+ kal_uint8 sv_health; /*6 bits*/
+ kal_uint16 iodc; /*10 bits*/
+ kal_uint8 l2p; /* 1 bits */
+ kal_uint32 sf1_23msb; /* 23/87 bits, MSB */
+ kal_uint32 sf1_24mb1; /* 24/87 bits */
+ kal_uint32 sf1_24mb2; /* 24/87 bits */
+ kal_uint16 sf1_16lsb; /* 16/87 bits, LSB */
+ kal_int8 tgd; /* 8 bits */
+ kal_uint16 toc; /*16 bits*/
+ kal_int8 af2; /* 8 bits */
+ kal_int16 af1; /* 16 bits */
+ kal_int32 af0; /* 22 bits */
+ kal_uint8 iode; /* 8 bits, set to iodc 8bit lsb */
+ kal_int16 crs; /* 16 bits */
+ kal_int16 delta_n; /* 16 bits */
+ kal_int32 m0; /* 32 bits */
+ kal_int16 cuc; /* 16 bits */
+ kal_uint32 e; /*32 bits*/
+ kal_int16 cus; /* 16 bits */
+ kal_uint32 sqrt_a; /*32 bits*/
+ kal_uint16 toe; /*16 bits*/
+ kal_uint8 fit; /* 1 bits */
+ kal_uint8 aodo; /*5 bits*/
+ kal_int16 cic; /* 16 bits */
+ kal_int32 omega0; /* 32 bits */
+ kal_int16 cis; /* 16 bits */
+ kal_int32 i0; /* 32 bits */
+ kal_int16 crc; /* 16 bits */
+ kal_int32 w; /* 32 bits */
+ kal_int32 omega_dot; /* 24 bits */
+ kal_int16 idot; /* 14 bits */
+} gps_assist_navigation_model_single_struct;
+/*ephemeris in GPS chip AGPS_P710*/
+
+
+typedef struct
+{
+ kal_uint8 n_sat;
+ gps_assist_navigation_model_single_struct
+ navigation_data[GPS_ASSIST_DATA_N_SATE_NAVIGATION_MODEL];
+} gps_assist_navigation_model_struct;
+/*ephemeris in GPS chip AGPS_P710*/
+
+
+typedef struct
+{
+ kal_uint8 data_id; /*2 bits set to 01*/
+ kal_uint8 sat_id; /*6 bits*/
+ kal_uint16 e; /*16 bits*/
+ kal_uint8 toa; /*8 bits*/
+ kal_int16 delta_i; /*16 bits*/
+ kal_int16 omega_dot; /*16 bits*/
+ kal_uint8 sv_health; /*8 bits*/
+ kal_uint32 sqrt_a; /*24 bits*/
+ kal_int32 omega0; /*24 bits*/
+ kal_int32 w; /*24 bits*/
+ kal_int32 m0; /*24 bits*/
+ kal_int16 af0; /*11 bits*/
+ kal_int16 af1; /*11 bits*/
+} gps_assist_almanac_single_struct;
+
+
+typedef struct
+{
+ kal_uint8 n_sat;
+ kal_uint8 week; /*Almanac reference GPS week number*/
+ gps_assist_almanac_single_struct almanac_data[GPS_ASSIST_DATA_N_SATE_ALMANAC];
+} gps_assist_almanac_struct;
+
+typedef struct
+{
+ kal_uint16 tlm_word; /*telemetry message[0-16383]*/
+ kal_uint8 sat_id; /*Sate PRN [1-32]*/
+ kal_uint8 anti_spoof; /*anti spoof flag[0,1]*/
+ kal_uint8 alert; /*alert flag*/
+ kal_uint8 tlm_rsvd_bits; /*2 bit reserved bits[0-3]*/
+
+} gps_assist_tow_assist_struct;
+
+//In "ref time" or "aquisition assitance"
+typedef struct
+{
+ kal_uint16 ref_time_ms_part;
+ kal_uint32 ref_time_ls_part;
+
+ kal_uint16 uarfcn;
+ kal_uint16 phyCellId; // Must valid value
+ kal_uint16 sfn;
+
+ uagps_cp_sfn_tow_uncertainty_type sfn_tow_uncentainty_type;
+ /* if type is UAGPS_CP_SFN_TOW_UNCERTAINTY_10MS_THRESHOLD, 0 for UAGPS_CP_SFN_TOW_UNCERTAINTY_LESS_THAN_10, 1 for UAGPS_CP_SFN_TOW_UNCERTAINTY_MORE_THAN_10,
+ if type is UAGPS_CP_SFN_TOW_UNCERTAINTY_MICROSECOND, unit is microsecond,
+ else don't care this field */
+ kal_uint32 sfn_tow_Uncertainty;
+
+ kal_bool utran_gps_driftrate_valid;
+ uagps_cp_utran_gps_driftrate utran_gps_driftrate;
+
+} utran_gps_ref_time_struct;
+
+
+typedef struct
+{
+ kal_uint16 bcch_carrier; /* BCCH Carrier of 2G serving cell: 0~1023 */
+ kal_uint8 bsic; /* BSIC of 2G serving cell: 0~63 */
+ kal_uint32 FNm; /* FNm (frame number with MSB is truncated): 0~(2^21-1) */
+ kal_uint8 tn; /* TN (timeslot number): 0~7 */
+ kal_uint8 bn; /* BN (bit number): 0~156 */
+} gsm_gps_ref_time_struct;
+
+
+typedef struct
+{
+ kal_uint16 week; /*GPS week number spec not said range*/
+ kal_uint32 tow; /*unit0.08 GPS time of week of the transmission of the $ character at the start of the message [0 ~ 604800]*/
+ kal_uint16 tow_rms; /*set to 3000*/
+ kal_uint16 fs_tow; /*set to 0*/
+ kal_uint16 fs_rms; /*set to 0*/
+ kal_uint8 n_sat; /*number of tow assist sates*/
+ gps_assist_tow_assist_struct tow_assist[GPS_ASSIST_DATA_N_SATE_TOW_ASSIST];
+
+ /* 2G Timing Sync. Info */
+ kal_bool gsm_gps_ref_time_valid;
+ gsm_gps_ref_time_struct gsm_gps_ref_time;
+
+ /* 3G Timing Sync. Info */
+ kal_bool utran_gps_ref_time_valid;
+ utran_gps_ref_time_struct utran_gps_ref_time;
+
+} gps_assist_ref_time_struct;
+
+
+typedef struct
+{
+ kal_bool sign_latitude; /* true: SOUTH, false: NORTH */
+ kal_uint32 latitude; /* N1, encoded latitude */
+ kal_uint32 longitude; /* N2, encoded longtitude with 2's complement */
+ kal_bool sign_altitude; /* true: DEPTH, false: HEIGHT */
+ kal_uint16 altitude; /* no encoding, unit in meter */
+ kal_uint16 unc_smaj; /* in m */
+ kal_uint16 unc_smin; /* in m */
+ kal_uint16 bearing; /* in degree */
+ kal_uint16 unc_vert; /* in m, uncertain altitue */
+ kal_uint8 confidence; /* 0 to 100, in % */
+} gps_assist_ref_location_struct;
+
+
+typedef struct
+{
+ kal_int8 a0; /*Alpha0 (x 2^-30 seconds)*/
+ kal_int8 a1; /*Alpha1 (x 2^-27 seconds per semicircle)*/
+ kal_int8 a2; /*Alpha2 (x 2^-24 seconds per semicircle ^2)*/
+ kal_int8 a3; /*Alpha3 (x 2^-24 seconds per semicircle ^3)*/
+ kal_int8 b0; /*Beta0 (x 2 ^ 11 seconds)*/
+ kal_int8 b1; /*Beta1 (x 2 ^ 14 seconds per semicircle)*/
+ kal_int8 b2; /*Beta2 (x 2 ^ 16 seconds per semicircle ^2)*/
+ kal_int8 b3; /*Beta3 (x 2 ^ 16 seconds per semicircle ^3)*/
+} gps_assist_ionosphere_struct;
+
+
+typedef struct
+{
+ kal_int32 a1;
+ kal_int32 a0;
+ kal_uint8 tot;
+ kal_uint8 wnt;
+ kal_int8 delta_ls;
+ kal_uint8 wnlsf;
+ kal_int8 dn;
+ kal_int8 delta_lsf;
+} gps_assist_utc_struct;
+
+
+typedef struct
+{
+ kal_uint8 number_bad;
+ kal_uint8 bad_svid[GPS_ASSIST_DATA_N_SATE_RTI]; /* 6 bits for each sat */
+} gps_assist_real_time_integrity_struct;
+
+
+typedef struct
+{
+ kal_uint8 sv_id; /*Satellite PRN number [1~32]*/
+ kal_int16 dopp0; /*unit 2.5Hz, 0th order term of satellite Doppler [-2048 ~ 2047]*/
+ kal_int8 dopp1; /*unit 1/42Hz, 1th order term of satellite Doppler [-42.0 ~ 21]*/
+ kal_uint8 dopp_sr; /*Doppler search range [2^-n * (200) Hz, n = 0 - 4]*/
+ kal_uint16 code_p; /*GPS satellite code chips [0 ~ 1022] (chip)*/
+ kal_uint8 int_code; /*Integer code phase [0 ~ 19]*/
+ kal_uint8 bit; /*GPS bit number [0 ~ 3]*/
+ kal_uint8 code_sr; /*Code phase search window [GPS task will lookup table covert to 1 ~ 512]*/
+ kal_uint8 azimuth; /*unit 11.25 deg,Satellite azimuth angle [0 ~ 31]*/
+ kal_uint8 elevation; /*unit 11.25 deg, Satellite elevation angle [0 ~ 7]*/
+} gps_assist_acquisition_single_struct;
+
+typedef struct
+{
+ kal_uint8 n_sat; /* 4 bits */
+ kal_uint32 tow; /*unit 0.08sec, GPS time of week [0 ~ 7559999] 23bits*/
+ gps_assist_acquisition_single_struct sate_data[GPS_ASSIST_DATA_N_SATE_ACQUISITION];
+
+ /* 2G Timing Sync. Info */
+ kal_bool gsm_gps_ref_time_valid;
+ gsm_gps_ref_time_struct gsm_gps_ref_time;
+
+ /* 3G Timing Sync. Info */
+ kal_bool utran_gps_ref_time_valid;
+ utran_gps_ref_time_struct utran_gps_ref_time;
+} gps_assist_acquisition_struct;
+
+
+typedef struct
+{
+ kal_uint8 sat_id; /*Satellite PRN for which the corrections are applicable [1 ~ 32]*/
+ kal_uint8 iode; /*The sequence number [0 ~ 255] for the sphemeris for the particular satellite.*/
+ kal_uint8 udre; /*Provides an estimate [0 ~ 3] of the uncertainty (1-sigma) in the corrections for the particular satellite.*/
+ kal_int16 prc; /*Unit 0.32m, The correction [+/-2047] to the pseudorange for the particular satellite at the GPS Reference Time.*/
+ kal_int8 rrc; /*Unit 0.032m, The rate of change of the pseudorange correction [+/- 127] for the particular satellite.*/
+} gps_assist_dgps_sate_data_struct;
+
+typedef struct
+{
+ kal_uint32 tow; /*Unit sec, GPS TOW [0 ~ 604799] indicates the baseline time for which the corrections are valid*/
+ kal_uint8 status; /*This field indicates the status [0 ~ 7] of the differential corrections contained in the broadcast message. The "UDRE Factor" value is applied to the UDRE values contained in the message.*/
+ kal_uint8 n_sat; /*The number of satellites for which differential corrections are available. Corrections for up to 11 satellites.*/
+ gps_assist_dgps_sate_data_struct sat_data[GPS_ASSIST_DATA_N_SATE_DGPS];
+} gps_assist_dgps_correction_struct;
+
+typedef struct
+{
+ kal_uint16 ref_bcch_carrier; /* ARFCN of current serving cell */
+ kal_uint8 ref_bsic; /* BSIC of current serving cell */
+} gps_gsm_loc_info_struct;
+
+typedef struct
+{
+ kal_bool ref_frame_msb_valid;
+ kal_uint8 ref_frame_msb;
+ kal_bool tow_subms_valid;
+ kal_uint16 tow_subms;
+ kal_bool delta_tow_valid;
+ kal_uint8 delta_tow;
+ kal_bool ref_time_unc_valid;
+ kal_uint8 ref_time_unc;
+} gsm_gps_ref_time_result_struct;
+
+
+typedef struct
+{
+ kal_uint16 w_n;
+ kal_uint16 toe;
+ kal_uint8 n_sat;
+ kal_uint8 limit;
+ kal_uint8 sat_id[GPS_ASSIST_DATA_SUB_ITEMS_FEILDS];
+ kal_uint16 iode[GPS_ASSIST_DATA_SUB_ITEMS_FEILDS];
+} gps_sat_related_data_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+ kal_bool req_time_assist_meas;
+ kal_bool environment_valid;
+ kal_uint8 environment;
+ gps_pos_qop_struct qop;
+ lcs_sim_source_enum sim_source; /* for Gemini SIM1/SIM2 */
+ /**
+ * Doug 20130326
+ * CP Auto Reset refine for OTA TIS 3G:
+ * if network does not sent RESET msg, periodicalReporting with reportingAmount is ra1
+ * autoResetTrigger is set to TRUE, and inform GPS task within POS(MEAS)_GAD_REQ.
+ */
+ kal_bool autoResetTrigger;
+} gps_pos_gad_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+ gps_error_code_enum error_code;
+ kal_bool bitmap_valid;
+ kal_uint16 bitmap;
+ gps_sat_related_data_struct sat_data;
+ gps_pos_result_struct pos_result;
+
+ kal_bool gsm_loc_info_valid;
+ gps_gsm_loc_info_struct gsm_loc_info; /* for 2G ref. time timing sync. to indicate the serving cell */
+
+ kal_bool gsm_gps_ref_time_result_valid;
+ gsm_gps_ref_time_result_struct gsm_gps_ref_time_result;
+
+ kal_bool utran_gps_ref_time_result_valid;
+ utran_gps_ref_time_result_struct utran_gps_ref_time_result;
+} gps_pos_gad_cnf_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+ kal_bool req_time_assist_meas;
+ kal_bool environment_valid;
+ kal_uint8 environment;
+ gps_meas_qop_struct qop;
+ lcs_sim_source_enum sim_source; /* for Gemini SIM1/SIM2 */
+ /**
+ * Doug 20130326
+ * CP Auto Reset refine for OTA TIS 3G:
+ * if network does not sent RESET msg, periodicalReporting with reportingAmount is ra1
+ * autoResetTrigger is set to TRUE, and inform GPS task within POS(MEAS)_GAD_REQ.
+ */
+ kal_bool autoResetTrigger;
+} gps_lcsp_meas_gad_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+ gps_error_code_enum error_code;
+ kal_bool bitmap_valid;
+ kal_uint16 bitmap;
+ gps_sat_related_data_struct sat_data;
+ gps_meas_result_struct meas_result;
+
+ kal_bool gsm_loc_info_valid;
+ gps_gsm_loc_info_struct gsm_loc_info; /* for 2G ref. time timing sync. to indicate the serving cell */
+
+ kal_bool gsm_gps_ref_time_result_valid;
+ gsm_gps_ref_time_result_struct gsm_gps_ref_time_result;
+
+ kal_bool utran_gps_ref_time_result_valid;
+ utran_gps_ref_time_result_struct utran_gps_ref_time_result;
+} gps_lcsp_meas_gad_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+} gps_lcsp_abort_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+} gps_lcsp_agps_restart_ind_struct;
+
+
+typedef union {
+ gps_assist_navigation_model_struct navigation_model;
+ gps_assist_almanac_struct almanac;
+ gps_assist_ref_time_struct ref_time;
+ gps_assist_ref_location_struct ref_location;
+ gps_assist_ionosphere_struct ionosphere;
+ gps_assist_utc_struct utc;
+ gps_assist_dgps_correction_struct dgps;
+ gps_assist_acquisition_struct acquisition;
+ gps_assist_real_time_integrity_struct rti;
+} assist_data_union;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+ kal_bool req_time_assist_meas;
+ gps_assist_data_type_enum type;
+ assist_data_union assist_data;
+ kal_bool ref_time_uncertain_valid;
+ kal_uint32 ref_time_uncertain;
+ lcs_sim_source_enum sim_source; /* for Gemini SIM1/SIM2 */
+} gps_lcsp_assist_data_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 transaction_id;
+ gps_assist_data_type_enum type;
+ gps_result_enum result;
+} gps_lcsp_assist_data_cnf_struct;
+#endif /*__AGPS_SUPPORT__*/
+#endif /*__GPS2LCSP_STRUCT_H__*/
+
diff --git a/mcu/protocol/interface/agps/gps_common.h b/mcu/protocol/interface/agps/gps_common.h
new file mode 100644
index 0000000..d5a55c4
--- /dev/null
+++ b/mcu/protocol/interface/agps/gps_common.h
@@ -0,0 +1,775 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gps_common.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * GPS related interface hand file, such as GPS uart and NMEA parser
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ *******************************************************************************/
+#ifndef _GPS_COMMON_H_
+#define _GPS_COMMON_H_
+
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+#include "ps_public_utility.h"
+#include "lbs_common_enum.h"
+#include "gnss2lcsp_enum.h"
+
+
+#define GPS_PARSER_P_VERSION_MAX 32
+#define GPS_NMEA_MAX_SVVIEW 20
+#define GPS_NMEA_MESSAGE_MAX_LENGTH (100)
+
+/* mdi_datatype.h UART port 7000 */
+#define RES_GPS_UART_SUCCEED 0
+#define RES_GPS_UART_ERR_PORT_NUMBER_WRONG -7002
+#define RES_GPS_UART_ERR_PORT_ERR_UNKNOW -7005
+#define RES_GPS_UART_ERR_NO_SLOT -7007
+
+#define AGPS_NR_AS_MAX_SERVING_CELL_NUM 8 /* We truncate the maximum number due to CCCI channl limitation.*/
+#define AGPS_NR_AS_MAX_MEASURED_CELL_NUM 32
+
+
+/*Data type for callback function of NMEA data or parserred data*/
+typedef enum
+{
+ GPS_PARSER_RAW_DATA = 0, /*Raw data of NMEA*/
+ GPS_PARSER_NMEA_GGA, /*Data structure of GGA info*/
+ GPS_PARSER_NMEA_GLL, /*Data structure of GLL info*/
+ GPS_PARSER_NMEA_GSA, /*Data structure of GSA info*/
+ GPS_PARSER_NMEA_GSV, /*Data structure of GSV info*/
+ GPS_PARSER_NMEA_RMC, /*Data structure of RMC info*/
+ GPS_PARSER_NMEA_VTG, /*Data structure of VTG info*/
+ GPS_PARSER_NMEA_SENTENCE,
+ GPS_UART_EVENT_VPORT_LOST, /*Virtual port is lost, maybe bluetooth connection is break(not support current)*/
+ GPS_SHOW_AGPS_ICON,
+ GPS_HIDE_AGPS_ICON,
+ GPS_PARSER_NMEA_END,
+ GPS_PARSER_MA_STATUS = 255
+} gps_common_parser_info_enum;
+
+
+/*Enum of GPS command*/
+typedef enum
+{
+ GPS_UART_GPS_WARM_START = 0, /*Let GPS do warm start*/
+ GPS_UART_GPS_HOT_START, /*Let GPS do hot start*/
+ GPS_UART_GPS_COLD_START, /*Let GPS do cold start*/
+ GPS_UART_GPS_VERSION,
+ GPS_UART_GPS_ENABLE_DEBUG_INFO,
+ GPS_UART_GPS_SWITCH_MODE_MA,
+ GPS_UART_GPS_SWITCH_MODE_MB,
+ GPS_UART_GPS_SWITCH_MODE_NORMAL,
+ GPS_UART_GPS_QUERY_POS,
+ GPS_UART_GPS_QUERY_MEAS,
+ GPS_UART_GPS_CLEAR_NVRAM, /*Clear GPS NVRAM*/
+ GPS_UART_GPS_AGPS_START, /*Clear GPS data*/
+ GPS_UART_GPS_SLEEP, /*Let GPS chip goto sleep mode*/
+ GPS_UART_GPS_STOP, /*Let GPS chip stop*/
+ GPS_UART_GPS_WAKE_UP, /*Let GPS chip wake up from sleep mode*/
+ GPS_UART_GPS_DUMMY = -1
+} gps_common_uart_cmd_type_enum;
+
+/*Enum of GPS work mode*/
+typedef enum
+{
+ GPS_UART_MODE_RAW_DATA = 0, /*Just need raw data*/
+ GPS_UART_MODE_LOCATION, /*Just need location*/
+ GPS_UART_MODE_LOCATION_WITH_QOP /*Need AGPS data with Qop*/
+} gps_common_uart_work_mode_enum;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 length;
+ kal_uint8 data[GPS_NMEA_MESSAGE_MAX_LENGTH];
+}gps_common_uart_write_req_struct;
+
+typedef struct
+{
+ kal_int8 hour;
+ kal_int8 minute;
+ kal_int8 second;
+ kal_int8 millisecond;
+} gps_common_nmea_utc_time_struct;
+
+typedef struct
+{
+ kal_int8 year;
+ kal_int8 month;
+ kal_int8 day;
+} gps_common_nmea_utc_date_struct;
+
+/*GPGGA -- Global Positioning System Fix Data*/
+typedef struct
+{
+ double latitude; /*Latitude South<0 North>0*/
+ double longitude; /*Longitude West<0 east>0*/
+ float h_precision; /*Horizontal Dilution of precision*/
+ double altitude; /*Antenna Altitude above/below mean-sea-level (geoid)*/
+ float unit_of_altitude; /*Units of antenna altitude, meters*/
+ float geoidal ; /*Geoidal separation, the difference between the WGS-84 earth*/
+ float unit_of_geoidal; /*Units of geoidal separation, meters*/
+ float gps_age; /*Age of differential GPS data, time in seconds since last SC104*/
+ kal_uint16 station_id; /*Differential reference station ID, 0000-1023*/
+ kal_uint8 sat_in_view; /*Number of satellites in use*/
+ gps_common_nmea_utc_time_struct utc_time; /*Time (UTC)*/
+ kal_int8 north_south; /*north or south*/
+ kal_int8 east_west; /*east or west*/
+ kal_int8 quality; /*GPS Quality Indicator*/
+} gps_common_nmea_gga_struct;
+
+
+ /*GPGSA -- GNSS DOP and Active Satellites*/
+typedef struct
+{
+ float pdop; /*PDOP in meters*/
+ float hdop; /*HDOP in meters*/
+ float vdop; /*VDOP in meters*/
+ kal_uint16 sate_id[12]; /*ID of satellites*/
+ kal_int8 op_mode; /*Selection mode: A=auto M=manual*/
+ kal_int8 fix_mode; /*Mode*/
+} gps_common_nmea_gsa_struct;
+
+
+/*GPGSV -- GNSS Satellites in View*/
+typedef struct
+{
+ kal_int16 msg_sum; /*total number of messages*/
+ kal_int16 msg_index; /*message number*/
+ kal_int16 sates_in_view; /*satellites in view*/
+ kal_int16 max_snr; /*Max snr*/
+ kal_int16 min_snr; /*Min snr*/
+ kal_int16 num_sv_trk; /*satellite number*/
+ struct
+ {
+ kal_uint8 sate_id; /*satellite id*/
+ kal_uint8 elevation; /*elevation in degrees*/
+ kal_int16 azimuth; /*azimuth in degrees to true*/
+ kal_uint8 snr; /*SNR in dB*/
+ } rsv[GPS_NMEA_MAX_SVVIEW];
+} gps_common_nmea_gsv_struct;
+
+
+/*GPRMC -- Recommended Minimum Specific GNSS Data*/
+typedef struct
+{
+ double latitude; /*latitude*/
+ double longitude; /*longitude*/
+ float ground_speed; /*Speed over ground, knots*/
+ float trace_degree; /*Track mode degrees,north is 0*/
+ float magnetic;
+ gps_common_nmea_utc_time_struct utc_time; /*UTC time*/
+ gps_common_nmea_utc_date_struct utc_date; /*UTC date*/
+ kal_int8 status; /*Status, V = Navigation receiver warning*/
+ kal_int8 north_south; /*N or S*/
+ kal_int8 east_west; /*E or W*/
+ kal_int8 magnetic_e_w; /*Magnetic E or W*/
+ kal_int8 cmode; /*Mode*/
+} gps_common_nmea_rmc_struct;
+
+
+/*GPGLL -- Geographic Position - Latitude/Longitude*/
+typedef struct
+{
+ double latitude; /*latitude*/
+ double longitude; /*longitude*/
+ gps_common_nmea_utc_time_struct utc_time; /*UTC time*/
+ kal_int8 north_south; /*N or S*/
+ kal_int8 east_west; /*E or W*/
+ kal_int8 status; /*Status A - Data Valid, V - Data Invalid*/
+ kal_int8 mode; /*mode*/
+} gps_common_nmea_gll_struct;
+
+
+/*GPVTG -- VTG Data*/
+typedef struct
+{
+ float true_heading; /*Track Degrees*/
+ float mag_heading; /*Magnetic Track Degrees*/
+ float hspeed_knot; /*Speed Knots*/
+ float hspeed_km; /*Speed Kilometers Per Hour*/
+ kal_int8 mode; /*Mode*/
+} gps_common_nmea_vtg_struct;
+
+
+typedef struct
+{
+ kal_char version[GPS_PARSER_P_VERSION_MAX];
+ kal_uint32 number;
+} gps_common_p_release_struct;
+
+typedef struct
+{
+ gps_common_p_release_struct release;
+} gps_common_p_info_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 port;
+ kal_char* buffer;
+ kal_uint32 length;
+}gps_uart_log_write_struct;
+
+#if defined(__GPS_SUPPORT__)||defined(__BT_GPS_SUPPORT__)
+kal_uint16 gnss_agnss_capability_query(void);
+void gnss_agnss_capability_set(kal_uint16 gnssMethod);
+kal_bool gnss_is_agps_supported(void);
+kal_uint8 gnss_agnss_sid_query(gnss_id_enum gnssID);
+#endif /* #if defined(__GPS_SUPPORT__)||defined(__BT_GPS_SUPPORT__) */
+
+/*Enum of GNSS rat mode*/
+typedef enum
+{
+ GNSS_RAT_GSM = 0,
+ GNSS_RAT_UMTS,
+ GNSS_RAT_LTE,
+ GNSS_RAT_NR
+} gnss_rat_enum;
+
+/* ------------------------------------------------------- */
+/* For Neighbor cell struct, copy from nbr_struct_public.h */
+/* ------------------------------------------------------- */
+
+typedef struct
+{
+ kal_uint16 mcc;
+ kal_uint16 mnc;
+ kal_uint16 lac;
+ kal_uint16 ci;
+} agps_global_cell_id_struct;
+
+typedef struct
+{
+ agps_global_cell_id_struct gci;
+ kal_uint8 nbr_meas_rslt_index;
+} agps_gas_cell_info_struct;
+
+typedef struct
+{
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_uint8 rxlev;
+} agps_gas_nbr_cell_meas_struct;
+
+typedef struct
+{
+ kal_int8 nbr_meas_num;
+ agps_gas_nbr_cell_meas_struct nbr_cells[15];
+} agps_gas_nbr_meas_struct;
+
+typedef struct
+{
+ agps_gas_cell_info_struct serv_info;
+ kal_uint8 ta;
+ kal_uint8 ordered_tx_pwr_lev;
+ kal_uint8 nbr_cell_num;
+ agps_gas_cell_info_struct nbr_cell_info[6];
+ agps_gas_nbr_meas_struct nbr_meas_rslt;
+} agps_gas_nbr_cell_info_struct;
+
+/* WCDMA cell info */
+typedef struct
+{
+ kal_uint8 uarfcn_ul_used;
+ kal_uint16 uarfcn_ul;
+ kal_uint16 uarfcn_dl;
+} agps_uas_freq_info_fdd_struct;
+
+typedef struct
+{
+ kal_uint16 uarfcn;
+} agps_uas_freq_info_tdd_struct;
+
+typedef struct agps_uas_freq_info_mode_specific_info_struct
+{
+ kal_uint8 mode; // uas_freq_info_mode_enum
+ union
+ {
+ agps_uas_freq_info_fdd_struct fdd;
+ agps_uas_freq_info_tdd_struct tdd;
+ } choice;
+} agps_uas_freq_info_mode_specific_info_struct;
+
+typedef struct
+{
+ agps_uas_freq_info_mode_specific_info_struct mode_specific_info;
+} agps_uas_freq_info_struct;
+
+typedef struct
+{
+ kal_uint16 psc;
+ kal_uint8 cpich_Ec_N0_used;
+ kal_uint8 cpich_Ec_N0;
+ kal_uint8 cpich_rscp_used;
+ kal_uint8 cpich_rscp;
+ kal_uint8 pathloss_used;
+ kal_uint8 pathloss;
+} agps_uas_cell_measured_results_fdd_struct;
+
+typedef struct
+{
+ kal_uint8 num;
+ kal_uint8 element[2*7];
+} agps_uas_cell_measured_result_tdd_timeslot_iscp_struct;
+
+typedef struct
+{
+ kal_uint8 cellParameterId;
+ kal_uint8 tgsn_used;
+ kal_uint8 tgsn;
+ kal_uint8 pccpch_rscp_used;
+ kal_uint8 pccpch_rscp;
+ kal_uint8 pathloss_used;
+ kal_uint8 pathloss;
+ kal_uint8 timeSlot_iscp_used;
+ agps_uas_cell_measured_result_tdd_timeslot_iscp_struct timeslot_iscp_list;
+
+} agps_uas_cell_measured_results_tdd_struct;
+
+typedef struct agps_uas_cell_measured_results_mode_specific_info_struct
+{
+ kal_uint8 mode; // uas_cell_measured_results_mode_enum
+
+ union
+ {
+ agps_uas_cell_measured_results_fdd_struct fdd;
+ agps_uas_cell_measured_results_tdd_struct tdd;
+ } choice;
+} agps_uas_cell_measured_results_mode_specific_info_struct;
+
+typedef struct
+{
+ kal_uint8 cell_id_used;
+ kal_uint32 cell_id;
+ agps_uas_cell_measured_results_mode_specific_info_struct mode_specific_info;
+} agps_uas_cell_measured_results_struct;
+
+typedef struct
+{
+ kal_uint8 num;
+ agps_uas_cell_measured_results_struct element[6];
+} agps_uas_cell_measured_results_list_struct;
+
+typedef struct
+{
+ kal_uint8 freq_info_used;
+ agps_uas_freq_info_struct freq_info;
+ kal_uint8 utra_carrier_rssi_used;
+ kal_uint8 utra_carrier_rssi;
+ kal_uint8 cell_measured_results_list_used;
+ agps_uas_cell_measured_results_list_struct cell_measured_results_list;
+} agps_uas_measured_results_struct;
+
+typedef struct
+{
+ kal_uint8 num;
+ agps_uas_measured_results_struct element[3];
+} agps_uas_measured_results_list_struct;
+
+typedef struct agps_uas_cell_plmn_id_struct
+{
+ kal_uint16 mcc;
+ kal_uint16 mnc;
+} agps_uas_cell_plmn_id_struct;
+
+typedef struct
+{
+ kal_uint8 is_LAC_valid;
+ kal_uint16 lac;
+ kal_uint8 is_RAC_valid;
+ kal_uint8 rac;
+ kal_uint8 num_plmn_id;
+ agps_uas_cell_plmn_id_struct plmn_id_list[6];
+} agps_uas_cell_info_struct;
+
+typedef struct
+{
+ kal_uint8 num;
+ agps_uas_cell_info_struct cell_info[6];
+} agps_uas_cell_info_list_struct;
+
+typedef struct
+{
+ agps_uas_cell_info_list_struct cell_info_list;
+} agps_uas_cell_info_per_freq_struct;
+
+/* Measurement results of most 3 different UARFCN's */
+typedef struct
+{
+ kal_uint8 num_freq;
+ agps_uas_cell_info_per_freq_struct cell_info_per_freq[3];
+} agps_uas_cell_info_ext_struct;
+
+typedef struct
+{
+ kal_uint16 mcc;
+ kal_uint16 mnc;
+ kal_uint32 uc;
+ kal_uint8 freq_info_used;
+ agps_uas_freq_info_struct freq_info;
+ kal_uint8 psc_used;
+ kal_uint16 psc;
+ kal_uint8 measured_results_list_used;
+ agps_uas_measured_results_list_struct measured_results_list;
+
+ agps_uas_cell_measured_results_mode_specific_info_struct serving_meas_result;
+ agps_uas_cell_info_struct serving_cell_ext_info;
+ agps_uas_cell_info_ext_struct cell_info_ext_list;
+} agps_uas_nbr_cell_info_struct;
+
+typedef struct
+{
+ kal_uint32 dl_freq;
+ kal_uint16 pci; //0~503
+ kal_uint8 rsrp; //0~97
+ kal_uint8 rsrq; //0~34
+
+ kal_uint8 is_cell_id_used;
+ kal_uint32 cell_id; //0~0x0FFFFFFF
+ kal_uint16 mcc; //0~999
+ kal_uint16 mnc; //0~999
+ kal_uint8 is_2_digit_mnc; //ncell cell plmn is 2 digits or 3 digits
+ kal_uint16 tac; //0~65535
+} agps_eas_cell_measured_results_struct;
+
+/* LTE cell info */
+typedef struct
+{
+ /* Serving cell info */
+ kal_uint16 mcc; //0~999
+ kal_uint16 mnc; //0~999
+ kal_uint8 is_2_digit_mnc; //serving cell plmn is 2 digits or 3 digits
+ kal_uint32 cell_id; //0~0x0FFFFFFF
+ kal_uint32 dl_freq;
+ kal_uint8 ul_freq_used;
+ kal_uint32 ul_freq;
+ kal_uint16 pci; //0~503
+ kal_uint8 is_ta_used;
+ kal_uint16 time_advance; //0~1282
+ kal_uint8 is_rsrp_valid;
+ kal_uint8 rsrp; //0~97
+ kal_uint8 is_rsrq_valid;
+ kal_uint8 rsrq; //0~34
+ kal_uint16 tac; //0~65535
+
+ /* Neighbor cell info */
+ kal_uint8 num_nbr_cell;
+ agps_eas_cell_measured_results_struct nbr_cell_list[32];
+} agps_eas_nbr_cell_info_struct;
+
+typedef struct
+{
+ kal_bool is_rsrp_valid;
+ kal_uint8 rsrp; // 0~127
+
+ kal_bool is_rsrq_valid;
+ kal_uint8 rsrq; // 0~127
+
+ kal_bool is_sinr_valid;
+ kal_uint8 sinr; // 0~127
+} agps_ssb_measurement_struct, agps_csi_measurement_struct;
+
+#pragma pack(push) // Backup the current alignment configuration
+#pragma pack(4) // Let the max alignment be 4-byte even if we have an element of alignment 8 like kal_uint64
+/* NR serving cell info */
+typedef struct
+{
+ kal_uint32 phys_cell_id; // 0~1007
+ kal_uint32 arfcn; // 0~3279165
+
+ // In case cell broadcasts several sets of NAS sysinfo, NR AS informs
+ // first set of NAS sysinfo in SIB1 of the cell.
+
+ // NAS sys info (mcc/mnc/cell_id/tac) validity
+ kal_bool is_nas_sysinfo_valid;
+
+ kal_uint16 primary_plmn_mcc; // 0~999
+
+ kal_bool is_2_digit_mnc;
+ kal_uint16 primary_plmn_mnc; // 0~999
+
+ kal_uint64 primary_plmn_cell_id; // 36-bit
+ kal_uint32 primary_plmn_tac; // 24-bit
+
+ kal_bool is_ssb_valid;
+ agps_ssb_measurement_struct ssb;
+
+ kal_bool is_csi_valid;
+ agps_csi_measurement_struct csi;
+
+ kal_bool is_ta_valid;
+ kal_uint16 ta;
+} agps_nr_as_serving_cell_info_struct;
+
+/* NR neighbor cell info */
+typedef struct
+{
+ kal_uint32 phys_cell_id; // 0~1007
+ kal_uint32 arfcn; // 0~3279165
+
+ // In case cell broadcasts several sets of NAS sysinfo, NR AS informs
+ // first set of NAS sysinfo in SIB1 of the cell.
+
+ // NAS sys info (mcc/mnc/cell_id/tac) validity
+ kal_bool is_nas_sysinfo_valid;
+
+ kal_uint16 primary_plmn_mcc; // 0~999
+
+ kal_bool is_2_digit_mnc;
+ kal_uint16 primary_plmn_mnc; // 0~999
+
+ kal_uint64 primary_plmn_cell_id; // 36-bit
+ kal_uint32 primary_plmn_tac; // 24-bit
+
+ kal_bool is_ssb_valid;
+ agps_ssb_measurement_struct ssb;
+
+ kal_bool is_csi_valid;
+ agps_csi_measurement_struct csi;
+} agps_nr_as_cell_measured_result_struct;
+#pragma pack(pop) // Restore the alignment configuration
+
+/* NR cell info */
+typedef struct
+{
+ kal_uint8 num_serving_cell;
+ agps_nr_as_serving_cell_info_struct nr_serving_cell_list[AGPS_NR_AS_MAX_SERVING_CELL_NUM];
+
+ kal_uint8 num_nbr_cell;
+ agps_nr_as_cell_measured_result_struct nbr_cell_list[AGPS_NR_AS_MAX_MEASURED_CELL_NUM];
+} agps_nr_as_nbr_cell_info_struct;
+
+typedef union
+{
+ agps_gas_nbr_cell_info_struct gas_nbr_cell_info;
+ agps_uas_nbr_cell_info_struct uas_nbr_cell_info;
+ agps_eas_nbr_cell_info_struct eas_nbr_cell_info;
+ agps_nr_as_nbr_cell_info_struct nr_as_nbr_cell_info;
+} agps_ps_nbr_cell_info_union_type;
+
+
+extern kal_bool is_agps_cp_allowed_by_rat(gnss_rat_enum rat_mode);
+extern void lbs_update_cfun_state(kal_uint8 sim_index, kal_uint8 cfun_state);
+extern void agps_cp_allowed_set_by_rat(gnss_rat_enum rat_mode, kal_bool is_allowed);
+extern pos_mode_enum check_positioning_mode_capability(void);
+extern pos_mode_enum check_agnss_positioning_mode_capability(gnss_rat_enum rat_mode,protocol_id_enum ps_id);
+extern kal_int8 lbs_cp_guard_time();
+extern kal_bool is_lbs_cp_guard_time_enable();
+extern kal_bool lbs_cp_pos_method_capability_query(pos_method_enum pos_method);
+extern kal_bool lbs_op_id_check(protocol_id_enum pid, kal_uint8 gnss_rat_mode, kal_uint32 gnss_query_op);
+extern kal_bool lbs_gvc_block_non_ems_nilr(protocol_id_enum ps_id);
+/* Query API for AGPSD LPPe support capability */
+kal_bool is_agps_lppe_enabled(void);
+kal_bool is_agps_lppe_network_location_enabled(void);
+
+#define __LBS_SETTING_SUPPORT__
+#define __EARLY_FIX_SUPPORT__
+#define __LBS_EM_SUPPORT__
+#define __LBS_LIO_SUPPORT__
+
+/* Type for LBS AP setting query API */
+typedef enum
+{
+ LBS_GENERIC_AP_SETTING,
+ LBS_SETTING_MAX_NUM
+} lbs_setting_enum;
+
+/* Structure for LBS AP setting query API */
+//typedef agps_md_sim_info_req lbs_setting_generic_ap;
+
+/* Error cause for LBS AP setting query API */
+#define LBS_SETTING_NOT_AVAILABLE (0)
+
+/* Prototype for LBS AP setting query API */
+#if defined(__UE_SIMULATOR__) || !defined(__AGPS_SUPPORT__)
+#define lbs_query_setting(a,b,c) (0)
+#else
+kal_int32 lbs_query_setting(lbs_setting_enum setting, void *buf, kal_uint32 buf_size);
+#endif
+kal_uint8 custom_lcsp_adj_rsp_time(kal_uint8 rsp, protocol_id_enum pid);
+
+typedef kal_bool (*lbs_gnss_time_update_callback)(kal_uint64);
+void register_ssu_gnss_time_update_callback(lbs_gnss_time_update_callback api);
+void deregister_ssu_gnss_time_update_callback();
+
+#endif /* _GPS_COMMON_H_ */
+
+
+
+
diff --git a/mcu/protocol/interface/agps/gps_struct.h b/mcu/protocol/interface/agps/gps_struct.h
new file mode 100644
index 0000000..73267c0
--- /dev/null
+++ b/mcu/protocol/interface/agps/gps_struct.h
@@ -0,0 +1,471 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gps_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for local parameter declaration about GIS sap
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __GPS_STRUCT_H__
+#define __GPS_STRUCT_H__
+
+#ifdef __GPS_SUPPORT__
+#include "dcl.h"
+#endif
+
+#include "gps2lcsp_enum.h"
+#include "kal_public_api.h"
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+#include "agps_md_interface.h"
+
+typedef enum
+{
+ MMI_GPS_ATE_EVENT_POWER_ON,
+ MMI_GPS_ATE_EVENT_POWER_OFF,
+ MMI_GPS_ATE_EVENT_COMMAND
+
+} gps_ate_event_type_enum;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ gps_ate_event_type_enum event;
+ kal_uint16 cmd_length;
+ kal_uint8 cmd_buf[256];
+} gps_ate_test_req_struct;
+
+typedef enum
+{
+ GPS_PARSER_P_VERSION = 0,
+ GPS_PARSER_P_GPS_MODE_SWITCH_OK,
+ GPS_PARSER_P_SYSTEM_START_OK,
+ GPS_PARSER_P_INTERNAL_VERSION,
+ GPS_PARSER_P_GPS_FIXED,
+ GPS_PARSER_P_GPS_BT_VPORT_LOST,
+ GPS_PARSER_P_GPS_BT_VPORT_CONN,
+ GPS_PARSER_P_GPS_FIXED_AND_TIME_OK,
+ GPS_PARSER_P_END
+} gps_parser_p_info_enum;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_eventgrpid event_id;
+ module_type module_id;
+ kal_uint16 port;
+ kal_int16 mode;
+ kal_int32 *return_val;
+}gps_uart_open_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_eventgrpid event_id;
+ module_type module_id;
+ kal_uint16 port;
+}gps_uart_read_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_eventgrpid event_id;
+ module_type module_id;
+ kal_uint16 port;
+ kal_bool is_rawdata;
+ kal_char* buffer;
+ kal_uint32 length;
+ kal_int16 cmd;
+ kal_int32 *return_val;
+ kal_uint32 *return_written;
+}gps_uart_write_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_eventgrpid event_id;
+ module_type module_id;
+ kal_uint16 port;
+ kal_int16 mode; /*mdi_gps_uart_work_mode_enum*/
+}gps_uart_close_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 port;
+ kal_int16 type; /*mdi_gps_parser_info_enum*/
+ kal_char* buffer;
+}gps_uart_nmea_location_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 length;
+ kal_uint16 port;
+ kal_char* buffer;
+}gps_uart_nmea_sentence_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 port;
+ module_type module_id;
+}gps_uart_raw_data_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 port;
+}gps_uart_debug_raw_data_struct;
+
+typedef struct
+{
+ kal_int8 hour;
+ kal_int8 minute;
+ kal_int8 second;
+ kal_int8 millisecond;
+} gps_nmea_utc_time_struct;
+
+typedef struct
+{
+ kal_int8 year;
+ kal_int8 month;
+ kal_int8 day;
+} gps_nmea_utc_date_struct;
+
+
+typedef struct
+{
+ gps_nmea_utc_time_struct utc_time;
+ gps_nmea_utc_date_struct utc_date;
+} gps_p_info_gps_fix_struct;
+
+
+typedef struct
+{
+ kal_uint16 port;
+} gps_p_info_gps_vport_struct;
+
+
+
+typedef union {
+ gps_p_info_gps_fix_struct gps_fix;
+ gps_p_info_gps_vport_struct vport;
+} gps_p_info_union;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ gps_parser_p_info_enum type;
+ gps_p_info_union p_info;
+}gps_uart_p_info_ind_struct;
+
+
+#ifdef __GPS_SUPPORT__
+typedef struct
+{
+ LOCAL_PARA_HDR
+ DCL_RTC_DATA_T previous_rtc;
+ DCL_RTC_DATA_T new_rtc;
+}rtc_gps_time_change_ind_struct;
+#endif
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ gps_error_code_enum error_code;
+} gps_lct_op_error_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 bitmap;
+} gps_assist_bit_mask_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 port; /*set to GPS_DEFAULT_PORT*/
+ kal_int16 prefer_gps_mode; /*mb ma*/
+}gps_uart_open_switch_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 port; /*set to GPS_DEFAULT_PORT*/
+}gps_uart_close_switch_req_struct;
+
+#ifdef __GPS_SUPPORT__
+typedef enum
+{
+ GPS_AREA_SHAPE_CIRCLE,
+ GPS_AREA_SHAPE_RECTANGLE,
+ GPS_AREA_SHAPE_END
+} gps_area_shape_enum;
+
+typedef enum
+{
+ GPS_AREA_DIRECTION_ENTER,
+ GPS_AREA_DIRECTION_LEAVE,
+ GPS_AREA_DIRECTION_END
+} gps_area_direction_enum;
+
+typedef struct
+{
+ kal_uint32 latitude;
+ kal_uint32 longtitude;
+ kal_int8 north_south; /*N for North and S for South*/
+ kal_int8 west_east; /*W for West and E for East*/
+ kal_uint32 rad; /*unit is m*/
+} gps_area_shape_circle_struct;
+
+typedef struct
+{
+ kal_uint32 latitude1;
+ kal_uint32 longtitude1;
+ kal_int8 north_south1; /*N for North and S for South*/
+ kal_int8 west_east1; /*W for West and E for East*/
+ kal_uint32 latitude2;
+ kal_uint32 longtitude2;
+ kal_int8 north_south2; /*N for North and S for South*/
+ kal_int8 west_east2; /*W for West and E for East*/
+} gps_area_shape_rectangle_struct;
+
+
+
+// MSG_ID_GPS_AREA_EVENT_ADD_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* after add the request GPS will return result with the same id to caller */
+ gps_area_shape_enum shape; /*the shape of request*/
+ kal_bool is_continue_report; /*if GPS should send MSG once or continue*/
+ gps_area_direction_enum direction; /*start send MSG after enter or leave*/
+ union {
+ gps_area_shape_circle_struct circle;
+ gps_area_shape_rectangle_struct rectangle;
+ } choice;
+} gps_area_event_add_req_struct;
+
+// MSG_ID_GPS_AREA_EVENT_ADD_RSP
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* after process the request GPS will send result with associated id to caller */
+// kal_bool is_match; /* is request match, MUST fill this field to inform UAGPS_CP position difference calculation result */
+ kal_bool is_add_ok; /*MMI_FALSE when too many request*/
+#ifdef __AGPS_SUPPORT__
+// gps_pos_result_struct pos_result; /* when is_match == KAL_TRUE, also necessary to carry this result */
+
+// kal_bool utran_gps_ref_time_result_valid;
+// utran_gps_ref_time_result_struct utran_gps_ref_time_result;
+#endif
+} gps_area_event_add_rsp_struct;
+
+// MSG_ID_GPS_AREA_EVENT_ADD_RSP
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* after process the request GPS will send result with associated id to caller */
+ kal_uint32 latitude;
+ kal_uint32 longtitude;
+ kal_int8 north_south; /*N for North and S for South*/
+ kal_int8 east_west; /*W for West and E for East*/
+
+} gps_area_event_happen_ind_struct;
+
+// MSG_ID_GPS_AREA_EVENT_DEL_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* send the id to GPS let it delete the request */
+
+} gps_area_event_del_req_struct;
+#endif /*__GPS_SUPPORT__*/
+
+#ifdef UNIT_TEST
+
+// MSG_ID_GPS_UT_SET_EVENT_IND
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_eventgrpid event_id;
+ kal_uint32 events;
+ kal_uint8 operation;
+ kal_int32 ret_address;
+ kal_int32 ret_value;
+
+} gps_ut_set_event_ind_struct;
+
+// MSG_ID_GPS_UT_WRITE_DATA_IND
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 data_buffer[100];
+
+} gps_ut_write_data_ind_struct;
+
+
+// MSG_ID_GPS_UT_LBS_HEADER_IND
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 version; //use AGPS_MD_INTERFACE_VERSION
+ agps_md_type type; //refer to agps_md_type
+ kal_uint8 len;
+} gps_ut_lbs_header_ind_struct;
+
+
+#endif
+
+#endif /*__GPS_STRUCT_H__*/
+
diff --git a/mcu/protocol/interface/agps/lbs_common_enum.h b/mcu/protocol/interface/agps/lbs_common_enum.h
new file mode 100644
index 0000000..8577059
--- /dev/null
+++ b/mcu/protocol/interface/agps/lbs_common_enum.h
@@ -0,0 +1,138 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * lbs_common_enum.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is the enum of LBS
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ *******************************************************************************/
+#ifndef __LBS_COMMON_ENUM_H__
+#define __LBS_COMMON_ENUM_H__
+
+typedef enum
+{
+ SUPL_UNKNOWN = 0,
+ SUPL_INIT,
+ SUPL_START,
+ SUPL_RESPONSE,
+ SUPL_POS_INIT,
+ SUPL_POS,
+ SUPL_END,
+ SUPL_TRIGGERED_START,
+ SUPL_TRIGGERED_RESPONSE,
+ SUPL_TRIGGERED_STOP,
+ SUPL_NOTIFY,
+ SUPL_NOTIFY_RESPONSE,
+ SUPL_SET_INIT,
+ SUPL_REPORT,
+} lbs_supl_peer_msg_type_enum;
+
+typedef enum
+{
+ GPS_TRANS_STATE_NULL,
+ GPS_TRANS_STATE_WAIT_OPEN_CNF, /*Sent OPEN request to MNL and wait the response from GPS chip */
+ GPS_TRANS_STATE_OPENED, /*OPEN_CNF reveived from MNL and start the AGPS session operation */
+ GPS_TRANS_STATE_WAIT_CLOSE_CNF, /*Sent CLOSE request to MNL and wait the response from GPS chip */
+ GPS_TRANS_STATE_CLOSED /*CLOSE_CNF reveived from MNL and close all AGPS session operation */
+} gps_chip_state_enum;
+
+typedef enum
+{
+ LCS_FROM_SIM1, /* for control plane Gemini SIM1 or single SIM */
+ LCS_FROM_SIM2, /* for control plane Gemini SIM2 */
+ LCS_FROM_SIM3, /* for control plane Gemini SIM3 */
+ LCS_FROM_SIM4 /* for control plane Gemini SIM4 */
+} lbs_sim_source_enum;
+
+typedef enum
+{
+ POS_MODE_NONE, /* If there is no _AGPS_SUPPORT_ */
+ POS_MODE_UE_BASED,
+ POS_MODE_UE_ASSISTED,
+ POS_MODE_ALL /* Default value */
+} pos_mode_enum;
+
+typedef enum
+{
+ POS_METHOD_AGNSS,
+ POS_METHOD_OTDOA,
+ POS_METHOD_ECID,
+ POS_METHOD_CONVENTIONAL_GPS,
+ POS_METHOD_LPP_EXTENSION,
+ POS_METHOD_INTER_FREQ_OTDOA
+} pos_method_enum;
+
+#endif /*__LBS_COMMON_ENUM_H__*/
+
diff --git a/mcu/protocol/interface/agps/lbs_dhl_struct.h b/mcu/protocol/interface/agps/lbs_dhl_struct.h
new file mode 100644
index 0000000..0f0f83e
--- /dev/null
+++ b/mcu/protocol/interface/agps/lbs_dhl_struct.h
@@ -0,0 +1,33 @@
+#if 0
+#ifndef _DHL_LBS_STRUCT_H_
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* _DHL_LBS_STRUCT_H_ */
+#endif
diff --git a/mcu/protocol/interface/agps/lbs_imc_struct.h b/mcu/protocol/interface/agps/lbs_imc_struct.h
new file mode 100644
index 0000000..1acc1a4
--- /dev/null
+++ b/mcu/protocol/interface/agps/lbs_imc_struct.h
@@ -0,0 +1,37 @@
+#ifndef _IMC_LBS_STRUCT_H_
+#define _IMC_LBS_STRUCT_H_
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+
+/******************************************************************************
+ * WFC location info
+ *****************************************************************************/
+#define IMS_MAX_TIME_STAMP_LENGTH 32
+typedef struct
+{
+ kal_int64 lat; //double lat
+ kal_int64 lng; //double lng
+ kal_int32 acc;
+} lbs_location_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool location_state;
+} imc_lbs_pos_ntf_struct;
+/**
+ * Description
+ * - recivied AGPS location info by LBS
+ *
+ * Direction
+ * - LBS -> IMC
+ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ lbs_location_struct loc_info;
+} imc_lbs_pos_ind_struct;
+
+#endif /* _IMC_LBS_STRUCT_H_ */
diff --git a/mcu/protocol/interface/agps/uagps_cp_gps_struct.h b/mcu/protocol/interface/agps/uagps_cp_gps_struct.h
new file mode 100644
index 0000000..6828955
--- /dev/null
+++ b/mcu/protocol/interface/agps/uagps_cp_gps_struct.h
@@ -0,0 +1,200 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uagps_cp_gps_struct.h
+ *
+ * Project:
+ * --------
+ * AGPS
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 10 02 2012 doug.shih
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * .
+ *
+ * 04 24 2012 wcpuser_integrator
+ * removed!
+ * .
+ *
+ * 12 23 2010 ham.wang
+ * removed!
+ * .
+ *
+ * 12 14 2010 james.liu
+ * removed!
+ * .
+ *
+ * 10 18 2010 james.liu
+ * removed!
+ * .
+ *
+ * 08 16 2010 james.liu
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _UAGPS_CP_GPS_STRUCT_H
+#define _UAGPS_CP_GPS_STRUCT_H
+
+#include "kal_public_api.h"
+#include "gps2lcsp_struct.h"
+#include "kal_general_types.h"
+
+/**************************************************************
+ * UAGPS_CP_GPS_SFN_GPS_TOW_DRIFT_TIME_REQ
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* after the request GPS will return result with the same id to caller */
+
+ kal_uint32 drift_time_threshold; // unit: microsecond
+
+ kal_bool is_utran_gps_ref_time_wanted; /*Set to TRUE if UTRAN GPS ref time was required to be reported */
+
+} uagps_cp_gps_sfn_gps_tow_drift_time_req_struct;
+
+/**************************************************************
+ * UAGPS_CP_GPS_SFN_GPS_TOW_DRIFT_TIME_CNF
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* after process the request GPS will send result with associated id to caller */
+
+ kal_bool drift_time_above_threshold; /* MUST fill this field to inform UAGPS_CP drift time calculation result */
+ kal_uint32 drift_time_result; // unit: microsecond
+
+ /* if for some condition measurement can not be completed, just set it to KAL_FALSE, but it should not occur ? */
+ kal_bool meas_result_valid;
+ gps_meas_result_struct meas_result;
+
+ kal_bool utran_gps_ref_time_result_valid;
+ utran_gps_ref_time_result_struct utran_gps_ref_time_result;
+
+} uagps_cp_gps_sfn_gps_tow_drift_time_cnf_struct;
+
+/**************************************************************
+ * MSG_ID_UAGPS_CP_GPS_SFN_GPS_TOW_DRIFT_TIME_CANCEL_REQ
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* send the id to GPS let it cancel the request */
+
+} uagps_cp_gps_sfn_gps_tow_drift_time_cancel_req_struct;
+
+/**************************************************************
+ * UAGPS_CP_GPS_ASSIST_DATA_ENQUIRY_IND
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint16 bitmap; // bitmap for requested assistance data type
+
+} uagps_cp_gps_assist_data_enquiry_ind_struct;
+
+//GPS AREA EVENT
+#ifdef __AGPS_CONTROL_PLANE__
+typedef struct
+{
+ kal_bool sign_latitude; /* true: SOUTH, false: NORTH */
+ kal_uint32 latitude; /* N1, encoded latitude */
+ kal_uint32 longtitude; /* N2, encoded longtitude with 2's complement */
+ kal_bool sign_altitude; /* true: DEPTH, false: HEIGHT */
+ kal_uint16 altitude; /* no encoding, unit in meter */
+} gps_pos_struct;
+
+// MSG_ID_UAGPS_CP_GPS_POS_CHANGE_EVALUATION_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_int32 transaction_id; /* GPS will return result with the same id to caller for this request */
+ gps_pos_struct prev_pos; /* previous position for comparison */
+ kal_uint32 rad; /*unit is m*/
+ kal_bool is_utran_gps_ref_time_wanted; /*Set to TRUE if UTRAN GPS ref time was required to be reported */
+} uagps_cp_gps_pos_change_evaluation_req_struct;
+
+// MSG_ID_UAGPS_CP_GPS_POS_CHANGE_EVALUATION_RSP
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_int32 transaction_id; /* GPS will send result with associated id to caller */
+ kal_bool is_match; /* is request match => MUST fill this field to inform UAGPS_CP position difference calculation result */
+ gps_pos_result_struct pos_result; /* when is_match == KAL_TRUE, also necessary to carry this result */
+ kal_bool utran_gps_ref_time_result_valid;
+ utran_gps_ref_time_result_struct utran_gps_ref_time_result;
+} uagps_cp_gps_pos_change_evaluation_rsp_struct;
+
+// MSG_ID_UAGPS_CP_GPS_POS_CHANGE_EVALUATION_DEL_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_int32 transaction_id; /* send the id to GPS to let it delete the request */
+} uagps_cp_gps_pos_change_evaluation_del_struct;
+#endif /*__AGPS_CONTROL_PLANE__*/
+
+#endif /* _UAGPS_CP_GPS_STRUCT_H */