from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CrcErrorCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("crcError", core, parent)
[docs]
def set(self, crc_error: bool, trigger=repcap.Trigger.Default) -> None:
"""
``TRIGger<*>:SENT:CRCerror`` \n
Snippet: ``driver.trigger.sent.crcError.set(crc_error = False, trigger = repcap.Trigger.Default)`` \n
Triggers on CRC errors in both, the transmission sequences and serial messages. A CRC error occurs when the CRC
calculated by the receiver differs from the received value in the CRC sequence. The CRC length is 4 bits for transmission
sequences and short serial messages, and 6 bit of enhanced serial messages. To trigger on an error event, select the
correspondig trigger type with TRIGger<m>:SENT:TYPE ERRC.
:param crc_error: OFF | ON
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
"""
param = Conversions.bool_to_str(crc_error)
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
self._core.io.write(f'TRIGger{trigger_cmd_val}:SENT:CRCerror {param}')
[docs]
def get(self, trigger=repcap.Trigger.Default) -> bool:
"""
``TRIGger<*>:SENT:CRCerror`` \n
Snippet: ``value: bool = driver.trigger.sent.crcError.get(trigger = repcap.Trigger.Default)`` \n
Triggers on CRC errors in both, the transmission sequences and serial messages. A CRC error occurs when the CRC
calculated by the receiver differs from the received value in the CRC sequence. The CRC length is 4 bits for transmission
sequences and short serial messages, and 6 bit of enhanced serial messages. To trigger on an error event, select the
correspondig trigger type with TRIGger<m>:SENT:TYPE ERRC.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
:return: crc_error: OFF | ON
"""
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:SENT:CRCerror?')
return Conversions.str_to_bool(response)