from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Types import DataType
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class PhysCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("phys", core, parent)
[docs]
def set(self, search: str, phy_addr: int) -> None:
"""
``SEARch:TRIGger:MDIO:PHYS`` \n
Snippet: ``driver.search.trigger.mdio.phys.set(search = 'abc', phy_addr = 1)`` \n
Allows to set the physical address (in Clause 22) or port address (in Clause 45) of the frame pattern (5 bits) ;
available only in search criteria type Data.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('phy_addr', phy_addr, DataType.Integer))
self._core.io.write(f'SEARch:TRIGger:MDIO:PHYS {param}'.rstrip())
[docs]
def get(self, search: str) -> int:
"""
``SEARch:TRIGger:MDIO:PHYS`` \n
Snippet: ``value: int = driver.search.trigger.mdio.phys.get(search = 'abc')`` \n
Allows to set the physical address (in Clause 22) or port address (in Clause 45) of the frame pattern (5 bits) ;
available only in search criteria type Data.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:MDIO:PHYS? {param}')
return Conversions.str_to_int(response)