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
from ...... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CplsCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("cpls", core, parent)
[docs]
def set(self, search: str, tlp_cpl_status: enums.BusPcieTlpCplStatus) -> None:
"""
``SEARch:TRIGger:PCIE:TLP:CPLS`` \n
Snippet: ``driver.search.trigger.pcie.tlp.cpls.set(search = 'abc', tlp_cpl_status = enums.BusPcieTlpCplStatus.ABORT)`` \n
Sets the completion status to be searched for in the transaction layer type.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('tlp_cpl_status', tlp_cpl_status, DataType.Enum, enums.BusPcieTlpCplStatus))
self._core.io.write(f'SEARch:TRIGger:PCIE:TLP:CPLS {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.BusPcieTlpCplStatus:
"""
``SEARch:TRIGger:PCIE:TLP:CPLS`` \n
Snippet: ``value: enums.BusPcieTlpCplStatus = driver.search.trigger.pcie.tlp.cpls.get(search = 'abc')`` \n
Sets the completion status to be searched for in the transaction layer type.
:param search: ANY | SUCCESS | UNSUPPORTED | RETRY | ABORT
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:PCIE:TLP:CPLS? {param}')
return Conversions.str_to_scalar_enum(response, enums.BusPcieTlpCplStatus)