• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        ret, pwr_lvl = self.gnss_init_power_setting(first_wait)
32        if ret:
33            self.log.info(f'Successfully set the GNSS power level to {pwr_lvl}')
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        else:
38            raise AttributeError('Init power sweep is missing')
39
40    def test_gnss_gsm850_sweep(self):
41        """
42        GNSS WWAN blanking cellular power sweep GSM850, Ch190.
43        """
44        self.eecoex_func = 'CELLR,2,850,190,1,1,{}'
45        self.start_pwr = self.gsm_sweep_params[0]
46        self.stop_pwr = self.gsm_sweep_params[1]
47        self.offset = self.gsm_sweep_params[2]
48        self.gnss_wwan_blanking_sweep_base()
49
50    def test_gnss_gsm900_sweep(self):
51        """
52        GNSS WWAN blanking cellular power sweep GSM900, Ch20.
53        """
54        self.eecoex_func = 'CELLR,2,900,20,1,1,{}'
55        self.start_pwr = self.gsm_sweep_params[0]
56        self.stop_pwr = self.gsm_sweep_params[1]
57        self.offset = self.gsm_sweep_params[2]
58        self.gnss_wwan_blanking_sweep_base()
59
60    def test_gnss_gsm1800_sweep(self):
61        """
62        GNSS WWAN blanking cellular power sweep GSM1800, Ch699.
63        """
64        self.eecoex_func = 'CELLR,2,1800,699,1,1,{}'
65        self.start_pwr = self.gsm_sweep_params[0]
66        self.stop_pwr = self.gsm_sweep_params[1]
67        self.offset = self.gsm_sweep_params[2]
68        self.gnss_wwan_blanking_sweep_base()
69
70    def test_gnss_gsm1900_sweep(self):
71        """
72        GNSS WWAN blanking cellular power sweep GSM1900, Ch661.
73        """
74        self.eecoex_func = 'CELLR,2,1900,661,1,1,{}'
75        self.start_pwr = self.gsm_sweep_params[0]
76        self.stop_pwr = self.gsm_sweep_params[1]
77        self.offset = self.gsm_sweep_params[2]
78        self.gnss_wwan_blanking_sweep_base()
79
80    def test_gnss_lte_b38_sweep(self):
81        """
82        GNSS WWAN blanking cellular power sweep LTE-TDD, B38, 10M, 12RB@0, Ch38000.
83        """
84        self.eecoex_func = 'CELLR,5,38,38000,true,PRIMARY,{},10MHz,0,12'
85        self.start_pwr = self.lte_tdd_pc3_sweep_params[0]
86        self.stop_pwr = self.lte_tdd_pc3_sweep_params[1]
87        self.offset = self.lte_tdd_pc3_sweep_params[2]
88        self.gnss_wwan_blanking_sweep_base()
89
90    def test_gnss_lte_b39_sweep(self):
91        """
92        GNSS WWAN blanking cellular power sweep LTE-TDD, B39, 10M, 12RB@0, Ch38450.
93        """
94        self.eecoex_func = 'CELLR,5,39,38450,true,PRIMARY,{},10MHz,0,12'
95        self.start_pwr = self.lte_tdd_pc3_sweep_params[0]
96        self.stop_pwr = self.lte_tdd_pc3_sweep_params[1]
97        self.offset = self.lte_tdd_pc3_sweep_params[2]
98        self.gnss_wwan_blanking_sweep_base()
99
100    def test_gnss_lte_b40_sweep(self):
101        """
102        GNSS WWAN blanking cellular power sweep LTE-TDD, B40, 10M, 12RB@0, Ch39150.
103        """
104        self.eecoex_func = 'CELLR,5,40,39150,true,PRIMARY,{},10MHz,0,12'
105        self.start_pwr = self.lte_tdd_pc3_sweep_params[0]
106        self.stop_pwr = self.lte_tdd_pc3_sweep_params[1]
107        self.offset = self.lte_tdd_pc3_sweep_params[2]
108        self.gnss_wwan_blanking_sweep_base()
109
110    def test_gnss_lte_b41_sweep(self):
111        """
112        GNSS WWAN blanking cellular power sweep LTE-TDD, B41, 10M, 12RB@0, Ch40620.
113        """
114        self.eecoex_func = 'CELLR,5,41,40620,true,PRIMARY,{},10MHz,0,12'
115        self.start_pwr = self.lte_tdd_pc3_sweep_params[0]
116        self.stop_pwr = self.lte_tdd_pc3_sweep_params[1]
117        self.offset = self.lte_tdd_pc3_sweep_params[2]
118        self.gnss_wwan_blanking_sweep_base()
119
120    def test_gnss_lte_b42_sweep(self):
121        """
122        GNSS WWAN blanking cellular power sweep LTE-TDD, B42, 10M, 12RB@0, Ch42590.
123        """
124        self.eecoex_func = 'CELLR,5,42,42590,true,PRIMARY,{},10MHz,0,12'
125        self.start_pwr = self.lte_tdd_pc3_sweep_params[0]
126        self.stop_pwr = self.lte_tdd_pc3_sweep_params[1]
127        self.offset = self.lte_tdd_pc3_sweep_params[2]
128        self.gnss_wwan_blanking_sweep_base()
129
130    def test_gnss_lte_b48_sweep(self):
131        """
132        GNSS WWAN blanking cellular power sweep LTE-TDD, B48, 10M, 12RB@0, Ch55990.
133        """
134        self.eecoex_func = 'CELLR,5,48,55990,true,PRIMARY,{},10MHz,0,12'
135        self.start_pwr = self.lte_tdd_pc3_sweep_params[0]
136        self.stop_pwr = self.lte_tdd_pc3_sweep_params[1]
137        self.offset = self.lte_tdd_pc3_sweep_params[2]
138        self.gnss_wwan_blanking_sweep_base()
139
140    def test_gnss_stand_alone_gnss(self):
141        """
142        GNSS stand alone test item.
143        """
144        self.eecoex_func = ''
145        self.start_pwr = 0
146        self.stop_pwr = 0
147        self.offset = 0
148        self.gnss_wwan_blanking_sweep_base()
149