Source code for RsSmw.Implementations.System.Communicate.Bb.Network

from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ......Internal.Utilities import trim_str_response
from ...... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class NetworkCls:
	"""
	| Commands in total: 12
	| Subgroups: 3
	| Direct child commands: 5
	"""

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

	@property
	def ipAddress(self):
		"""
		| Commands in total: 4
		| Subgroups: 1
		| Direct child commands: 3
		"""
		if not hasattr(self, '_ipAddress'):
			from .IpAddress import IpAddressCls
			self._ipAddress = IpAddressCls(self._core, self._cmd_group)
		return self._ipAddress

	@property
	def restart(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_restart'):
			from .Restart import RestartCls
			self._restart = RestartCls(self._core, self._cmd_group)
		return self._restart

	@property
	def common(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_common'):
			from .Common import CommonCls
			self._common = CommonCls(self._core, self._cmd_group)
		return self._common

[docs] def get_busy(self) -> bool: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:BUSY`` \n Snippet: ``value: bool = driver.system.communicate.bb.network.get_busy()`` \n No help available """ response = self._core.io.query_str('SYSTem:COMMunicate:BB<HwInstance>:NETWork:BUSY?') return Conversions.str_to_bool(response)
[docs] def get_mac_address(self) -> str: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:MACaddress`` \n Snippet: ``value: str = driver.system.communicate.bb.network.get_mac_address()`` \n Queries the MAC address of the network adapter. This is a password-protected function. Unlock the protection level 1 to access it, see method ``RsSmw.system.protect.state.set()`` in the R&S SMW200A user manual. :return: mac_address: string """ response = self._core.io.query_str('SYSTem:COMMunicate:BB<HwInstance>:NETWork:MACaddress?') return trim_str_response(response)
[docs] def set_mac_address(self, mac_address: str) -> None: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:MACaddress`` \n Snippet: ``driver.system.communicate.bb.network.set_mac_address(mac_address = 'abc')`` \n Queries the MAC address of the network adapter. This is a password-protected function. Unlock the protection level 1 to access it, see method ``RsSmw.system.protect.state.set()`` in the R&S SMW200A user manual. :param mac_address: string """ param = Conversions.value_to_quoted_str(mac_address) self._core.io.write(f'SYSTem:COMMunicate:BB<HwInstance>:NETWork:MACaddress {param}')
[docs] def get_port(self) -> int: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:PORT`` \n Snippet: ``value: int = driver.system.communicate.bb.network.get_port()`` \n Sets the port address use for network traffic. :return: port: integer Range: 0 to 65536 """ response = self._core.io.query_str('SYSTem:COMMunicate:BB<HwInstance>:NETWork:PORT?') return Conversions.str_to_int(response)
[docs] def set_port(self, port: int) -> None: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:PORT`` \n Snippet: ``driver.system.communicate.bb.network.set_port(port = 1)`` \n Sets the port address use for network traffic. :param port: integer Range: 0 to 65536 """ param = Conversions.decimal_value_to_str(port) self._core.io.write(f'SYSTem:COMMunicate:BB<HwInstance>:NETWork:PORT {param}')
# noinspection PyTypeChecker
[docs] def get_protocol(self) -> enums.NetProtocol: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:PROTocol`` \n Snippet: ``value: enums.NetProtocol = driver.system.communicate.bb.network.get_protocol()`` \n Selects the communication protocol for the network traffic. :return: protocol: UDP | TCP """ response = self._core.io.query_str('SYSTem:COMMunicate:BB<HwInstance>:NETWork:PROTocol?') return Conversions.str_to_scalar_enum(response, enums.NetProtocol)
[docs] def set_protocol(self, protocol: enums.NetProtocol) -> None: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:PROTocol`` \n Snippet: ``driver.system.communicate.bb.network.set_protocol(protocol = enums.NetProtocol.TCP)`` \n Selects the communication protocol for the network traffic. :param protocol: UDP | TCP """ param = Conversions.enum_scalar_to_str(protocol, enums.NetProtocol) self._core.io.write(f'SYSTem:COMMunicate:BB<HwInstance>:NETWork:PROTocol {param}')
[docs] def get_status(self) -> bool: """ ``SYSTem:COMMunicate:BB<HW>:NETWork:STATus`` \n Snippet: ``value: bool = driver.system.communicate.bb.network.get_status()`` \n Queries the network configuration state. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SYSTem:COMMunicate:BB<HwInstance>:NETWork:STATus?') return Conversions.str_to_bool(response)
def clone(self) -> 'NetworkCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = NetworkCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group