Source code for rsrtx.Implementations.Trigger.Usb.Hand

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
from .... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class HandCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("hand", core, parent)

[docs] def set(self, usb_hdshk_typ: enums.BusUsbHandshakeTypy, trigger=repcap.Trigger.Default) -> None: """ ``TRIGger<*>:USB:HAND`` \n Snippet: ``driver.trigger.usb.hand.set(usb_hdshk_typ = enums.BusUsbHandshakeTypy.ACK, trigger = repcap.Trigger.Default)`` \n Sets the trigger to one out of four different handshake types: ACK, NAK, STALl, or NYET. :param usb_hdshk_typ: ACK | NAK | STALl | NYET \n - ACK: Sets the trigger to the ACK field (acknowledgment of error-free data packet) . - NAK: Sets the trigger to the NAK field (non-acknowledgment, no successful data transmission) . - STALl: Sets the trigger to the STALL field (endpoint is halted or a control pipe request is not supported) . - NYET: Sets the trigger to the NYET field (no response yet from receiver) . :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') """ param = Conversions.enum_scalar_to_str(usb_hdshk_typ, enums.BusUsbHandshakeTypy) trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) self._core.io.write(f'TRIGger{trigger_cmd_val}:USB:HAND {param}')
# noinspection PyTypeChecker
[docs] def get(self, trigger=repcap.Trigger.Default) -> enums.BusUsbHandshakeTypy: """ ``TRIGger<*>:USB:HAND`` \n Snippet: ``value: enums.BusUsbHandshakeTypy = driver.trigger.usb.hand.get(trigger = repcap.Trigger.Default)`` \n Sets the trigger to one out of four different handshake types: ACK, NAK, STALl, or NYET. :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') """ trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:USB:HAND?') return Conversions.str_to_scalar_enum(response, enums.BusUsbHandshakeTypy)