blob: a928f9f40e9f614c19bc2cdb4f10d6fdd79b8e3e [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2016
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35/*************************************************************
36*
37* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.
38*
39* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
40*
41* Copyright (c) 2010 VIA Telecom, Inc. All rights reserved.
42*
43*************************************************************/
44#ifndef VAL_GPS_API_H
45#define VAL_GPS_API_H 1
46
47/******************************************************************************
48*
49* FILE NAME : valgpsapi.c
50*
51* DESCRIPTION :
52*
53* This is the simplified command-response interface to the GPS and LBS stack.
54*
55* HISTORY :
56*
57* See Log at end of file
58*
59******************************************************************************/
60
61/*===========================================================================
62 INCLUDE FILES FOR MODULE
63===========================================================================*/
64#include "valapi.h"
65#include "valgps.h"
66#include "lecapi.h"
67
68/***************************************************************
69 1 GPS Global Parameter Functions
70****************************************************************/
71void valapi_gps_open_device_hw_init_req(void);
72void valapi_gps_open_device_hw_init_conf(ValGpsOpenDeviceHwInitRspMsgT * MsgPtr);
73
74void valapi_gps_start_mode_set_req(ValGpsStartModeSetReqT * MsgPtr);
75void valapi_gps_start_mode_set_conf(ValGpsStartModeSetRspMsgT * MsgPtr);
76
77void valapi_gps_security_set_req(ValGpsSetSecReqT * MsgPtr);
78void valapi_gps_security_set_conf(ValGpsSetSecRspMsgT * MsgPtr);
79
80void valapi_gps_base_ssd_set_req(ValGpsBaseSSDSetReqT * MsgPtr);
81void valapi_gps_base_ssd_set_conf(ValGpsBaseSSDSetRspMsgT * MsgPtr);
82
83void valapi_gps_write_server_config_req(ValGpsWriteServerConfigReqT* MsgPtr);
84void valapi_gps_write_server_config_conf(ValGpsWriteServerConfigRspMsgT * MsgPtr);
85
86void valapi_gps_get_fix_mode_req( void );
87void valapi_gps_get_fix_mode_conf(ValGpsFixModeGetRspMsgT * MsgPtr);
88
89void Valapi_gps_Nmea_OutputSwitch_OnOff(ValGpsNmeaOuputCfgMsgT *MsgPtr);
90
91/***************************************************************
92 2 GPS Session-specific Parameter Functions
93****************************************************************/
94
95/* 2.1 Session initialization functions*/
96void valapi_gps_session_open_req(ValGpsSessionOpenReqT * MsgPtr);
97void valapi_gps_session_open_conf(ValGpsSessionOpenRspMsgT * MsgPtr);
98
99void valapi_gps_session_enable_security_req(ValGpsEnableSecurityReqT * MsgPtr);
100void valapi_gps_session_enable_security_conf(ValGpsEnableSecurityRspMsgT * MsgPtr);
101
102void valapi_gps_session_random_period_set_req(ValGpsRandPeriodSetReqT * MsgPtr);
103void valapi_gps_session_random_period_set_conf(ValGpsRandPeriodSetRspMsgT * MsgPtr);
104
105void valapi_gps_session_configure_fix_mode_req(ValGpsFixModeConfigReqT * MsgPtr);
106void valapi_gps_session_configure_fix_mode_conf(ValGpsFixModeConfigRspMsgT * MsgPtr);
107
108void valapi_gps_session_configure_fix_rate_req(ValGpsFixRateConfigReqT * MsgPtr);
109void valapi_gps_session_configure_fix_rate_conf(ValGpsFixRateConfigRspMsgT * MsgPtr);
110
111void valapi_gps_session_configure_qos_req(ValGpsQosConfigReqT * MsgPtr);
112void valapi_gps_session_configure_qos_conf(ValGpsQosConfigRspMsgT * MsgPtr);
113
114void valapi_gps_session_start_fix_req(ValGpsStartFixReqT * MsgPtr);
115void valapi_gps_session_start_fix_conf(ValGpsStartFixRspMsgT * MsgPtr);
116
117/* 2.2 Mid-GPS-session functions*/
118/* 2.2.1 GPS Position functions */
119void valapi_gps_session_get_position_req(ValGpsPositionGetReqT * MsgPtr);
120void valapi_gps_session_get_position_conf(ValGpsPositionGetRspMsgT * MsgPtr);
121
122void valapi_gps_session_stop_fix_req(ValGpsStopFixReqT * MsgPtr);
123void valapi_gps_session_stop_fix_conf(ValGpsStopFixRspMsgT * MsgPtr);
124
125/* 2.2.2 GPS Security functions */
126void valapi_gps_session_read_security_config_req(ValGpsReadSecurityConfigReqT * MsgPtr);
127void valapi_gps_session_read_security_config_conf(ValGpsReadSecurityConfigRspWithStatusMsgT * MsgPtr);
128
129void valapi_gps_session_write_security_config_req(ValGpsWriteSecurityConfigReqT * MsgPtr);
130void valapi_gps_session_write_security_config_conf(ValGpsWriteSecurityConfigRspMsgT * MsgPtr);
131
132void valapi_gps_session_read_encrypt_config_req(ValGpsReadEncryptConfigReqT * MsgPtr);
133void valapi_gps_session_read_encrypt_config_conf(ValGpsReadEncryptConfigRspWithStatusMsgT * MsgPtr);
134void valapi_gps_reset_assistdata_conf(ValGpsResetAssistRspMsgT * MsgPtr);
135/* 2.2.3 VAL->Master Asynchronous update functions*/
136void valapi_gps_session_location_update_ind(kal_uint32 InstanceID);
137void valapi_gps_session_state_update_ind(ValGpsStateChangeParamsSpyMsgT * MsgPtr);
138void valapi_gps_session_security_update_ind(kal_uint32 InstanceID);
139void valapi_gps_session_stop_ind(kal_uint32 InstanceID);
140
141/***************************************************************
142 3 GPS Session with AP Parameter Functions
143****************************************************************/
144/* 3.1 PGPS on AP functions */
145#if 0
146/* under construction !*/
147/* under construction !*/
148/* under construction !*/
149/* under construction !*/
150/* under construction !*/
151/* under construction !*/
152/* under construction !*/
153/* under construction !*/
154/* under construction !*/
155/* under construction !*/
156/* under construction !*/
157#endif
158void valapi_gps_factory_rf_cno_msg(LecFacReportCNoMsgT* msg_buffer);
159void valgps_ap_gps_set_ion(ValGpsIonMsgT *MsgPtr);
160void valgps_ap_gps_set_eph(ValGpsEphPrnMsgT *MsgPtr);
161void valgps_ap_gps_set_alm(ValGpsAlmPrnMsgT *MsgPtr);
162void valgps_ap_gps_set_refloc(ValGpsLocMsgT *MsgPtr);
163void valgps_ap_gps_locresp(PswLocRspDataT *MsgPtr);
164
165/* 3.2 GPS on AP functions */
166#ifdef MTK_CBP
167void valapi_ap_gps_reset_assist_data(void);
168void valapi_ap_gps_fake_power_on(ValGpsFakePowerOnMsgT* FakePowerOnMsg);
169void valapi_ap_gps_emergency_call_ind(ValGpsEmergencyCallIndMsgT* EmergencyCallInd);
170#endif
171void valapi_ap_gps_power_on(ValGpsPowerOnMsgT* PowerOnMsg);
172void valapi_ap_gps_freq_aiding_req(void);
173void valapi_ap_gps_time_aiding_req(void);
174
175void valapi_ap_gps_refclock_frqcal(ValGpsFreqAidingMsgT *MsgPtr);
176void valapi_ap_gps_frame_sync(ValGpsFrameSyncMsgT *MsgPtr);
177void valapi_ap_gps_acqassist_data(ValGpsAADataMsgT *MsgPtr);
178void valapi_ap_gps_pseudorange_meast(ValGpsPRMeasMsgT *MsgPtr);
179void valapi_ap_gps_cancellation_req(void);
180void valapi_ap_gps_cp_location_response_data(ValGpsCpLocRespMsgT *MsgPtr);
181void valapi_ap_gps_reference_location_data(ValGpsRefLocRespMsgT *MsgPtr);
182void valapi_gps_ap_assist_req(ValGpsAssistReqT *MsgPtr);
183/* To BP: AP request for PPM. */
184void valapi_ap_gps_ppm_req( VAL_LCS_PPM_REQ_T *req );
185/* To AP: BP reports PPM */
186void valapi_ap_gps_ppm_response(void * res );
187
188void valapi_gps_supl_cell_info_req(void);
189void valapi_gps_supl_cell_info_rsp(ValGpsSuplCellInformationRspMsgT *MsgPtr);
190#ifdef MTK_CBP
191void val_mpc_notify_and_verify_ind(void *MsgBufferP);
192#endif
193#ifdef MTK_GPS_SYNC_DEV
194extern void valapi_ap_gps_time_ind(ValGpsTimeIndMsgT *MsgPtr);
195#endif
196void valapi_ap_gps_sv_valid_config(kal_uint8 sv_valid);
197#endif
198