yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | /***************************************************************************** |
| 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 | ****************************************************************/ |
| 71 | void valapi_gps_open_device_hw_init_req(void); |
| 72 | void valapi_gps_open_device_hw_init_conf(ValGpsOpenDeviceHwInitRspMsgT * MsgPtr); |
| 73 | |
| 74 | void valapi_gps_start_mode_set_req(ValGpsStartModeSetReqT * MsgPtr); |
| 75 | void valapi_gps_start_mode_set_conf(ValGpsStartModeSetRspMsgT * MsgPtr); |
| 76 | |
| 77 | void valapi_gps_security_set_req(ValGpsSetSecReqT * MsgPtr); |
| 78 | void valapi_gps_security_set_conf(ValGpsSetSecRspMsgT * MsgPtr); |
| 79 | |
| 80 | void valapi_gps_base_ssd_set_req(ValGpsBaseSSDSetReqT * MsgPtr); |
| 81 | void valapi_gps_base_ssd_set_conf(ValGpsBaseSSDSetRspMsgT * MsgPtr); |
| 82 | |
| 83 | void valapi_gps_write_server_config_req(ValGpsWriteServerConfigReqT* MsgPtr); |
| 84 | void valapi_gps_write_server_config_conf(ValGpsWriteServerConfigRspMsgT * MsgPtr); |
| 85 | |
| 86 | void valapi_gps_get_fix_mode_req( void ); |
| 87 | void valapi_gps_get_fix_mode_conf(ValGpsFixModeGetRspMsgT * MsgPtr); |
| 88 | |
| 89 | void Valapi_gps_Nmea_OutputSwitch_OnOff(ValGpsNmeaOuputCfgMsgT *MsgPtr); |
| 90 | |
| 91 | /*************************************************************** |
| 92 | 2 GPS Session-specific Parameter Functions |
| 93 | ****************************************************************/ |
| 94 | |
| 95 | /* 2.1 Session initialization functions*/ |
| 96 | void valapi_gps_session_open_req(ValGpsSessionOpenReqT * MsgPtr); |
| 97 | void valapi_gps_session_open_conf(ValGpsSessionOpenRspMsgT * MsgPtr); |
| 98 | |
| 99 | void valapi_gps_session_enable_security_req(ValGpsEnableSecurityReqT * MsgPtr); |
| 100 | void valapi_gps_session_enable_security_conf(ValGpsEnableSecurityRspMsgT * MsgPtr); |
| 101 | |
| 102 | void valapi_gps_session_random_period_set_req(ValGpsRandPeriodSetReqT * MsgPtr); |
| 103 | void valapi_gps_session_random_period_set_conf(ValGpsRandPeriodSetRspMsgT * MsgPtr); |
| 104 | |
| 105 | void valapi_gps_session_configure_fix_mode_req(ValGpsFixModeConfigReqT * MsgPtr); |
| 106 | void valapi_gps_session_configure_fix_mode_conf(ValGpsFixModeConfigRspMsgT * MsgPtr); |
| 107 | |
| 108 | void valapi_gps_session_configure_fix_rate_req(ValGpsFixRateConfigReqT * MsgPtr); |
| 109 | void valapi_gps_session_configure_fix_rate_conf(ValGpsFixRateConfigRspMsgT * MsgPtr); |
| 110 | |
| 111 | void valapi_gps_session_configure_qos_req(ValGpsQosConfigReqT * MsgPtr); |
| 112 | void valapi_gps_session_configure_qos_conf(ValGpsQosConfigRspMsgT * MsgPtr); |
| 113 | |
| 114 | void valapi_gps_session_start_fix_req(ValGpsStartFixReqT * MsgPtr); |
| 115 | void valapi_gps_session_start_fix_conf(ValGpsStartFixRspMsgT * MsgPtr); |
| 116 | |
| 117 | /* 2.2 Mid-GPS-session functions*/ |
| 118 | /* 2.2.1 GPS Position functions */ |
| 119 | void valapi_gps_session_get_position_req(ValGpsPositionGetReqT * MsgPtr); |
| 120 | void valapi_gps_session_get_position_conf(ValGpsPositionGetRspMsgT * MsgPtr); |
| 121 | |
| 122 | void valapi_gps_session_stop_fix_req(ValGpsStopFixReqT * MsgPtr); |
| 123 | void valapi_gps_session_stop_fix_conf(ValGpsStopFixRspMsgT * MsgPtr); |
| 124 | |
| 125 | /* 2.2.2 GPS Security functions */ |
| 126 | void valapi_gps_session_read_security_config_req(ValGpsReadSecurityConfigReqT * MsgPtr); |
| 127 | void valapi_gps_session_read_security_config_conf(ValGpsReadSecurityConfigRspWithStatusMsgT * MsgPtr); |
| 128 | |
| 129 | void valapi_gps_session_write_security_config_req(ValGpsWriteSecurityConfigReqT * MsgPtr); |
| 130 | void valapi_gps_session_write_security_config_conf(ValGpsWriteSecurityConfigRspMsgT * MsgPtr); |
| 131 | |
| 132 | void valapi_gps_session_read_encrypt_config_req(ValGpsReadEncryptConfigReqT * MsgPtr); |
| 133 | void valapi_gps_session_read_encrypt_config_conf(ValGpsReadEncryptConfigRspWithStatusMsgT * MsgPtr); |
| 134 | void valapi_gps_reset_assistdata_conf(ValGpsResetAssistRspMsgT * MsgPtr); |
| 135 | /* 2.2.3 VAL->Master Asynchronous update functions*/ |
| 136 | void valapi_gps_session_location_update_ind(kal_uint32 InstanceID); |
| 137 | void valapi_gps_session_state_update_ind(ValGpsStateChangeParamsSpyMsgT * MsgPtr); |
| 138 | void valapi_gps_session_security_update_ind(kal_uint32 InstanceID); |
| 139 | void 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 |
| 158 | void valapi_gps_factory_rf_cno_msg(LecFacReportCNoMsgT* msg_buffer); |
| 159 | void valgps_ap_gps_set_ion(ValGpsIonMsgT *MsgPtr); |
| 160 | void valgps_ap_gps_set_eph(ValGpsEphPrnMsgT *MsgPtr); |
| 161 | void valgps_ap_gps_set_alm(ValGpsAlmPrnMsgT *MsgPtr); |
| 162 | void valgps_ap_gps_set_refloc(ValGpsLocMsgT *MsgPtr); |
| 163 | void valgps_ap_gps_locresp(PswLocRspDataT *MsgPtr); |
| 164 | |
| 165 | /* 3.2 GPS on AP functions */ |
| 166 | #ifdef MTK_CBP |
| 167 | void valapi_ap_gps_reset_assist_data(void); |
| 168 | void valapi_ap_gps_fake_power_on(ValGpsFakePowerOnMsgT* FakePowerOnMsg); |
| 169 | void valapi_ap_gps_emergency_call_ind(ValGpsEmergencyCallIndMsgT* EmergencyCallInd); |
| 170 | #endif |
| 171 | void valapi_ap_gps_power_on(ValGpsPowerOnMsgT* PowerOnMsg); |
| 172 | void valapi_ap_gps_freq_aiding_req(void); |
| 173 | void valapi_ap_gps_time_aiding_req(void); |
| 174 | |
| 175 | void valapi_ap_gps_refclock_frqcal(ValGpsFreqAidingMsgT *MsgPtr); |
| 176 | void valapi_ap_gps_frame_sync(ValGpsFrameSyncMsgT *MsgPtr); |
| 177 | void valapi_ap_gps_acqassist_data(ValGpsAADataMsgT *MsgPtr); |
| 178 | void valapi_ap_gps_pseudorange_meast(ValGpsPRMeasMsgT *MsgPtr); |
| 179 | void valapi_ap_gps_cancellation_req(void); |
| 180 | void valapi_ap_gps_cp_location_response_data(ValGpsCpLocRespMsgT *MsgPtr); |
| 181 | void valapi_ap_gps_reference_location_data(ValGpsRefLocRespMsgT *MsgPtr); |
| 182 | void valapi_gps_ap_assist_req(ValGpsAssistReqT *MsgPtr); |
| 183 | /* To BP: AP request for PPM. */ |
| 184 | void valapi_ap_gps_ppm_req( VAL_LCS_PPM_REQ_T *req ); |
| 185 | /* To AP: BP reports PPM */ |
| 186 | void valapi_ap_gps_ppm_response(void * res ); |
| 187 | |
| 188 | void valapi_gps_supl_cell_info_req(void); |
| 189 | void valapi_gps_supl_cell_info_rsp(ValGpsSuplCellInformationRspMsgT *MsgPtr); |
| 190 | #ifdef MTK_CBP |
| 191 | void val_mpc_notify_and_verify_ind(void *MsgBufferP); |
| 192 | #endif |
| 193 | #ifdef MTK_GPS_SYNC_DEV |
| 194 | extern void valapi_ap_gps_time_ind(ValGpsTimeIndMsgT *MsgPtr); |
| 195 | #endif |
| 196 | void valapi_ap_gps_sv_valid_config(kal_uint8 sv_valid); |
| 197 | #endif |
| 198 | |