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 DrNackCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("drNack", core, parent)
[docs]
def set(self, search: str, data_read_nack: bool) -> None:
"""
``SEARch:TRIGger:I2C:DRNack`` \n
Snippet: ``driver.search.trigger.i2C.drNack.set(search = 'abc', data_read_nack = False)`` \n
Searches for the end of the read process when the master reads data from the slave. This Nack is sent according to the
protocol definition, it is not an error.
:param data_read_nack: OFF | ON
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('data_read_nack', data_read_nack, DataType.Boolean))
self._core.io.write_with_opc(f'SEARch:TRIGger:I2C:DRNack {param}'.rstrip())
[docs]
def get(self, search: str) -> bool:
"""
``SEARch:TRIGger:I2C:DRNack`` \n
Snippet: ``value: bool = driver.search.trigger.i2C.drNack.get(search = 'abc')`` \n
Searches for the end of the read process when the master reads data from the slave. This Nack is sent according to the
protocol definition, it is not an error.
:return: data_read_nack: OFF | ON
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:I2C:DRNack? {param}')
return Conversions.str_to_bool(response)