rfemu: add max attenuation getter

this allows to query the maximum channel attenuation from within a test case

Change-Id: I35f7cb188790c59bbf2450f78c663fbc9440e406
This commit is contained in:
Andre Puschmann 2020-06-12 15:10:24 +02:00 committed by srs_andre
parent ccb632037d
commit 8b1547b562
3 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,11 @@ class RFemulation(log.Origin, metaclass=ABCMeta):
"""Set attenuation in dB on the configured channel"""
pass
@abstractmethod
def get_max_attenuation(self):
"""Get maximum channel attenuation"""
pass
def get_instance_by_type(rfemu_type, rfemu_opt):
"""Allocate a RFemulation child class based on type. Opts are passed to the newly created object."""
if rfemu_type == 'amarisoftctl':

View File

@ -59,5 +59,7 @@ class RFemulationAmarisoftCtrl(RFemulation):
result = self.ws.recv()
self.dbg('Received CTRL msg: "%s"' % result)
def get_max_attenuation(self):
return 200 # maximum cell_gain value in Amarisoft
# vim: expandtab tabstop=4 shiftwidth=4

View File

@ -64,4 +64,8 @@ class RFemulationMinicircuitsHTTP(RFemulation):
self.dbg('Received response: "%s"' % data_str)
if data_str != '1':
raise log.Error('Mini-circuits attenuation device returned failure! %s' & data_str)
def get_max_attenuation(self):
return 95 # Maximum value of the Mini-Circuits RC4DAT-6G-95
# vim: expandtab tabstop=4 shiftwidth=4