1#!/usr/bin/env python3 2# 3# Copyright 2021 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the 'License'); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an 'AS IS' BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17from acts_contrib.test_utils.gnss.GnssBlankingBase import GnssBlankingBase 18 19 20class GnssBlankingThTest(GnssBlankingBase): 21 """ LAB GNSS Cellular Coex Tx Power Sweep TTFF/FFPE Tests""" 22 23 def gnss_wwan_blanking_sweep_base(self): 24 """ 25 GNSS WWAN blanking cellular power sweep base function 26 """ 27 # Get parameters from user params. 28 first_wait = self.user_params.get('first_wait', 300) 29 30 # Start the test item with gnss_init_power_setting. 31 if self.gnss_init_power_setting(first_wait): 32 self.log.info('Successfully set the GNSS power level to %d' % 33 self.sa_sensitivity) 34 self.log.info('Start searching for cellular power level threshold') 35 # After the GNSS power initialization is done, start the cellular power sweep. 36 self.result_cell_pwr = self.cell_power_sweep() 37 38 def test_gnss_gsm850_sweep(self): 39 """ 40 GNSS WWAN blanking cellular power sweep GSM850, Ch190. 41 """ 42 self.eecoex_func = 'CELLR,2,850,190,1,1,{}' 43 self.start_pwr = self.gsm_sweep_params[0] 44 self.stop_pwr = self.gsm_sweep_params[1] 45 self.offset = self.gsm_sweep_params[2] 46 self.gnss_wwan_blanking_sweep_base() 47 48 def test_gnss_gsm900_sweep(self): 49 """ 50 GNSS WWAN blanking cellular power sweep GSM900, Ch20. 51 """ 52 self.eecoex_func = 'CELLR,2,900,20,1,1,{}' 53 self.start_pwr = self.gsm_sweep_params[0] 54 self.stop_pwr = self.gsm_sweep_params[1] 55 self.offset = self.gsm_sweep_params[2] 56 self.gnss_wwan_blanking_sweep_base() 57 58 def test_gnss_gsm1800_sweep(self): 59 """ 60 GNSS WWAN blanking cellular power sweep GSM1800, Ch699. 61 """ 62 self.eecoex_func = 'CELLR,2,1800,699,1,1,{}' 63 self.start_pwr = self.gsm_sweep_params[0] 64 self.stop_pwr = self.gsm_sweep_params[1] 65 self.offset = self.gsm_sweep_params[2] 66 self.gnss_wwan_blanking_sweep_base() 67 68 def test_gnss_gsm1900_sweep(self): 69 """ 70 GNSS WWAN blanking cellular power sweep GSM1900, Ch661. 71 """ 72 self.eecoex_func = 'CELLR,2,1900,661,1,1,{}' 73 self.start_pwr = self.gsm_sweep_params[0] 74 self.stop_pwr = self.gsm_sweep_params[1] 75 self.offset = self.gsm_sweep_params[2] 76 self.gnss_wwan_blanking_sweep_base() 77 78 def test_gnss_lte_b38_sweep(self): 79 """ 80 GNSS WWAN blanking cellular power sweep LTE-TDD, B38, 10M, 12RB@0, Ch38000. 81 """ 82 self.eecoex_func = 'CELLR,5,38,38000,true,PRIMARY,{},10MHz,0,12' 83 self.start_pwr = self.lte_tdd_pc3_sweep_params[0] 84 self.stop_pwr = self.lte_tdd_pc3_sweep_params[1] 85 self.offset = self.lte_tdd_pc3_sweep_params[2] 86 self.gnss_wwan_blanking_sweep_base() 87 88 def test_gnss_lte_b39_sweep(self): 89 """ 90 GNSS WWAN blanking cellular power sweep LTE-TDD, B39, 10M, 12RB@0, Ch38450. 91 """ 92 self.eecoex_func = 'CELLR,5,39,38450,true,PRIMARY,{},10MHz,0,12' 93 self.start_pwr = self.lte_tdd_pc3_sweep_params[0] 94 self.stop_pwr = self.lte_tdd_pc3_sweep_params[1] 95 self.offset = self.lte_tdd_pc3_sweep_params[2] 96 self.gnss_wwan_blanking_sweep_base() 97 98 def test_gnss_lte_b40_sweep(self): 99 """ 100 GNSS WWAN blanking cellular power sweep LTE-TDD, B40, 10M, 12RB@0, Ch39150. 101 """ 102 self.eecoex_func = 'CELLR,5,40,39150,true,PRIMARY,{},10MHz,0,12' 103 self.start_pwr = self.lte_tdd_pc3_sweep_params[0] 104 self.stop_pwr = self.lte_tdd_pc3_sweep_params[1] 105 self.offset = self.lte_tdd_pc3_sweep_params[2] 106 self.gnss_wwan_blanking_sweep_base() 107 108 def test_gnss_lte_b41_sweep(self): 109 """ 110 GNSS WWAN blanking cellular power sweep LTE-TDD, B41, 10M, 12RB@0, Ch40620. 111 """ 112 self.eecoex_func = 'CELLR,5,41,40620,true,PRIMARY,{},10MHz,0,12' 113 self.start_pwr = self.lte_tdd_pc3_sweep_params[0] 114 self.stop_pwr = self.lte_tdd_pc3_sweep_params[1] 115 self.offset = self.lte_tdd_pc3_sweep_params[2] 116 self.gnss_wwan_blanking_sweep_base() 117 118 def test_gnss_lte_b42_sweep(self): 119 """ 120 GNSS WWAN blanking cellular power sweep LTE-TDD, B42, 10M, 12RB@0, Ch42590. 121 """ 122 self.eecoex_func = 'CELLR,5,42,42590,true,PRIMARY,{},10MHz,0,12' 123 self.start_pwr = self.lte_tdd_pc3_sweep_params[0] 124 self.stop_pwr = self.lte_tdd_pc3_sweep_params[1] 125 self.offset = self.lte_tdd_pc3_sweep_params[2] 126 self.gnss_wwan_blanking_sweep_base() 127 128 def test_gnss_lte_b48_sweep(self): 129 """ 130 GNSS WWAN blanking cellular power sweep LTE-TDD, B48, 10M, 12RB@0, Ch55990. 131 """ 132 self.eecoex_func = 'CELLR,5,48,55990,true,PRIMARY,{},10MHz,0,12' 133 self.start_pwr = self.lte_tdd_pc3_sweep_params[0] 134 self.stop_pwr = self.lte_tdd_pc3_sweep_params[1] 135 self.offset = self.lte_tdd_pc3_sweep_params[2] 136 self.gnss_wwan_blanking_sweep_base() 137 138 def test_gnss_stand_alone_gnss(self): 139 """ 140 GNSS stand alone test item. 141 """ 142 self.eecoex_func = '' 143 self.start_pwr = 0 144 self.stop_pwr = 0 145 self.offset = 0 146 self.gnss_wwan_blanking_sweep_base() 147