"""Defines a root class which is used to identify and control bt signal generation configuration."""
import functools
import nirfmxbluetoothgen.attributes as attributes
import nirfmxbluetoothgen.enums as enums
import nirfmxbluetoothgen.errors as errors
import nirfmxbluetoothgen.internal._helper as _helper
def _raise_if_disposed(f):
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
@functools.wraps(f)
def aux(*xs, **kws):
session = xs[0] # parameter 0 is 'self' which is the session object
if session.is_disposed:
raise Exception("Cannot access a disposed Session object.")
return f(*xs, **kws)
return aux
[docs]
class Session(object):
"""Defines a root class which is used to identify and control bt signal generation configuration."""
_session_function_lock = _helper.SessionFunctionLock()
def __init__(self, toolkit_compatibility_version, session_name=None, *, grpc_options=None):
"""Defines a root class which is used to identify and control bt signal generation configuration."""
if grpc_options:
import nirfmxbluetoothgen.internal._grpc_stub_interpreter as _grpc_stub_interpreter
self._interpreter = _grpc_stub_interpreter.GrpcStubInterpreter(grpc_options) # type: ignore
self._grpc_options = grpc_options
self._is_remote_session = True
else:
from nirfmxbluetoothgen.internal._library_interpreter import (
LibraryInterpreter,
)
self._interpreter = LibraryInterpreter(encoding="windows-1251") # type: ignore
self._is_remote_session = False
handle, is_new_session, _ = self._interpreter.open_session( # type: ignore
session_name,
(
toolkit_compatibility_version.value
if type(toolkit_compatibility_version) is enums.CompatibilityVersion
else toolkit_compatibility_version
),
)
self._interpreter.set_session_handle(handle) # type: ignore
self.is_new_session = is_new_session
self.is_disposed = False
self._is_named_session = bool(session_name)
def __enter__(self):
"""Enables the use of the session object in a context manager."""
return self
def __exit__(self, exc_type, exc_value, traceback):
"""Enables the use of the session object in a context manager."""
self.close() # type: ignore
[docs]
def close(self):
"""Closes the bt generation session and releases resources associated with that session. Call this function once for each uniquely named session that you have created.."""
self._session_function_lock.enter_write_lock()
try:
if not self.is_disposed:
# if self._is_named_session:
self._interpreter.close_session() # type: ignore
self._interpreter.set_session_handle() # type: ignore
self.is_disposed = True
except errors.Error:
self._interpreter.set_session_handle() # type: ignore
raise
self._session_function_lock.exit_write_lock()
[docs]
@_raise_if_disposed
def get_error_string(self, error_code):
r"""Gets the description of a driver error code.
Args:
error_code (int):
Specifies an error or warning code.
Returns:
string:
Contains the error description.
"""
try:
self._session_function_lock.enter_read_lock()
error_message = self._interpreter.get_error_string(error_code) # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return error_message
[docs]
@_raise_if_disposed
def get_actual_headroom(self, channel_string):
r"""Gets the actual headroom used by the BT Generation. This value is expressed in dB. You can use this value to
configure the peak power of the generation hardware.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the actual headroom used by the BT Generation. This value is expressed in dB. You can use this value to
configure the peak power of the generation hardware.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.ACTUAL_HEADROOM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_actual_payload_length(self, channel_string):
r"""Gets the actual payload length, in bytes, that is calculated by the BT Generation.
If you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH_MODE` attribute to
NIBTSG_VAL_PAYLOAD_LENGTH_MODE_MAXIMUM_LENGTH, the BT Generation returns the maximum permissible payload data
length as specified in the Bluetooth specifications. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH_MODE` attribute to
NIBTSG_VAL_PAYLOAD_LENGTH_MODE_USER_DEFINED, the BT Generation returns the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH` attribute. If the value that you specify in
the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH` attribute exceeds the maximum
permissible payload length for the packet, the BT Generation returns this maximum permissible payload length.
For LE-HDT Packets when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED, the Actual Payload Length is computed as
Payload length = (Nb * :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.BLOCK_SIZE`) +
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.LAST_BLOCK_SIZE` for each payload. Here Nb is number of
transmitted blocks depends on the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.TXBLOCK_MAP` attribute.
You must use "payload x" as the active channel string to configure this property for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the actual payload length, in bytes, that is calculated by the BT Generation.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.ACTUAL_PAYLOAD_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_all_iq_impairments_enabled(self, channel_string):
r"""Gets whether to enable I/Q impairments.
The default value is NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AllIQImpairmentsEnabled):
Specifies whether to enable I/Q impairments.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.ALL_IQ_IMPAIRMENTS_ENABLED.value
)
attr_val = enums.AllIQImpairmentsEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_all_iq_impairments_enabled(self, channel_string, value):
r"""Sets whether to enable I/Q impairments.
The default value is NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
value (enums.AllIQImpairmentsEnabled, int):
Specifies whether to enable I/Q impairments.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.AllIQImpairmentsEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.ALL_IQ_IMPAIRMENTS_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_auto_headroom_enabled(self, channel_string):
r"""Gets whether the BT Generation calculates the headroom or uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HEADROOM` attribute.
The default value is NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AutoHeadroomEnabled):
Specifies whether the BT Generation calculates the headroom or uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HEADROOM` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.AUTO_HEADROOM_ENABLED.value
)
attr_val = enums.AutoHeadroomEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_auto_headroom_enabled(self, channel_string, value):
r"""Sets whether the BT Generation calculates the headroom or uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HEADROOM` attribute.
The default value is NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
value (enums.AutoHeadroomEnabled, int):
Specifies whether the BT Generation calculates the headroom or uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HEADROOM` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.AutoHeadroomEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.AUTO_HEADROOM_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_awgn_enabled(self, channel_string):
r"""Gets whether to add additive white Gaussian noise (AWGN) to the baseband waveform.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AwgnEnabled):
Specifies whether to add additive white Gaussian noise (AWGN) to the baseband waveform.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.AWGN_ENABLED.value
)
attr_val = enums.AwgnEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_awgn_enabled(self, channel_string, value):
r"""Sets whether to add additive white Gaussian noise (AWGN) to the baseband waveform.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
value (enums.AwgnEnabled, int):
Specifies whether to add additive white Gaussian noise (AWGN) to the baseband waveform.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.AwgnEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.AWGN_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_bandwidth_bit_period_product(self, channel_string):
r"""Gets the bandwidth bit period product of GFSK modulation for LE-CS packet type.
The default value is 0.5. The valid values are 0.5 and 2.0 .
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the bandwidth bit period product of GFSK modulation for LE-CS packet type.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.BANDWIDTH_BIT_PERIOD_PRODUCT.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_bandwidth_bit_period_product(self, channel_string, value):
r"""Sets the bandwidth bit period product of GFSK modulation for LE-CS packet type.
The default value is 0.5. The valid values are 0.5 and 2.0 .
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the bandwidth bit period product of GFSK modulation for LE-CS packet type.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.BANDWIDTH_BIT_PERIOD_PRODUCT.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_bd_address_lap(self, channel_string):
r"""Gets the 24-bit lower address part (LAP) of the Bluetooth device address.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 24-bit lower address part (LAP) of the Bluetooth device address.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BD_ADDRESS_LAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_bd_address_lap(self, channel_string, value):
r"""Sets the 24-bit lower address part (LAP) of the Bluetooth device address.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 24-bit lower address part (LAP) of the Bluetooth device address.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BD_ADDRESS_LAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_bd_address_nap(self, channel_string):
r"""Gets the 16-bit nonsignificant address part (NAP) of the Bluetooth device address.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 16-bit nonsignificant address part (NAP) of the Bluetooth device address.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BD_ADDRESS_NAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_bd_address_nap(self, channel_string, value):
r"""Sets the 16-bit nonsignificant address part (NAP) of the Bluetooth device address.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 16-bit nonsignificant address part (NAP) of the Bluetooth device address.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BD_ADDRESS_NAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_bd_address_uap(self, channel_string):
r"""Gets the 8-bit upper address part (UAP) of the Bluetooth device address.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 8-bit upper address part (UAP) of the Bluetooth device address.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BD_ADDRESS_UAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_bd_address_uap(self, channel_string, value):
r"""Sets the 8-bit upper address part (UAP) of the Bluetooth device address.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 8-bit upper address part (UAP) of the Bluetooth device address.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BD_ADDRESS_UAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_burst_start_locations(self, channel_string):
r"""Gets an array of sample positions for the start of all bursts, within the waveform.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns an array of sample positions for the start of all bursts, within the waveform.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BURST_START_LOCATIONS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_burst_stop_locations(self, channel_string):
r"""Gets an array of sample positions for the end of all bursts, within the waveform.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns an array of sample positions for the end of all bursts, within the waveform.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BURST_STOP_LOCATIONS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_carrier_frequency(self, channel_string):
r"""Gets the carrier frequency. This value is expressed in Hz.
If you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.WHITENING_ENABLED` attribute to
NIBTSG_VAL_TRUE and the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PACKET_TYPE` attribute to any LE
packets, you should set a value for the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_FREQUENCY`
attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the carrier frequency. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CARRIER_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_carrier_frequency(self, channel_string, value):
r"""Sets the carrier frequency. This value is expressed in Hz.
If you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.WHITENING_ENABLED` attribute to
NIBTSG_VAL_TRUE and the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PACKET_TYPE` attribute to any LE
packets, you should set a value for the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_FREQUENCY`
attribute.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the carrier frequency. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CARRIER_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_carrier_frequency_offset(self, channel_string):
r"""Gets the carrier frequency offset from the value that you specify as the center frequency of the RF signal
generator. This value is expressed in Hz.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the carrier frequency offset from the value that you specify as the center frequency of the RF signal
generator. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CARRIER_FREQUENCY_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_carrier_frequency_offset(self, channel_string, value):
r"""Sets the carrier frequency offset from the value that you specify as the center frequency of the RF signal
generator. This value is expressed in Hz.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the carrier frequency offset from the value that you specify as the center frequency of the RF signal
generator. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CARRIER_FREQUENCY_OFFSET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_carrier_mode(self, channel_string):
r"""Gets whether the carrier is continuous or includes bursts.
If you set this attribute to NIBTSG_VAL_CARRIER_MODE_BURST, the BT Generation generates the burst signal by
adding zeros at the end of the packet to create one or more complete slots, depending on the packet type. In
this mode, the BT Generation also shapes the generated waveform to meet the burst ramp characteristics specified
in the Bluetooth Test Purposes (TP) specification 1.2/2.0+EDR/2.1/2.1+EDR/3.0/3.0+HS. If you set this attribute
to NIBTSG_VAL_CARRIER_MODE_CONTINUOUS, the BT Generation generates a phase continuous Bluetooth signal, which is
used as an interference signal. This mode is useful to generate an interference signal with pseudorandom bits
and continuous phase. In this mode, the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_IDLE_SLOTS` attribute is not used, and the number
of idle slots is assumed be zero. In this mode, NI recommends you to leave the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_UNIQUE_PACKETS`,
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE`, and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_ENABLED` attributes at their default values. Refer
to the Carrier Mode topic for more information about the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_MODE` attribute.
The default value is NIBTSG_VAL_CARRIER_MODE_BURST.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CarrierMode):
Specifies whether the carrier is continuous or includes bursts.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.CARRIER_MODE.value
)
attr_val = enums.CarrierMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_carrier_mode(self, channel_string, value):
r"""Sets whether the carrier is continuous or includes bursts.
If you set this attribute to NIBTSG_VAL_CARRIER_MODE_BURST, the BT Generation generates the burst signal by
adding zeros at the end of the packet to create one or more complete slots, depending on the packet type. In
this mode, the BT Generation also shapes the generated waveform to meet the burst ramp characteristics specified
in the Bluetooth Test Purposes (TP) specification 1.2/2.0+EDR/2.1/2.1+EDR/3.0/3.0+HS. If you set this attribute
to NIBTSG_VAL_CARRIER_MODE_CONTINUOUS, the BT Generation generates a phase continuous Bluetooth signal, which is
used as an interference signal. This mode is useful to generate an interference signal with pseudorandom bits
and continuous phase. In this mode, the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_IDLE_SLOTS` attribute is not used, and the number
of idle slots is assumed be zero. In this mode, NI recommends you to leave the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_UNIQUE_PACKETS`,
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE`, and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_ENABLED` attributes at their default values. Refer
to the Carrier Mode topic for more information about the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_MODE` attribute.
The default value is NIBTSG_VAL_CARRIER_MODE_BURST.
Args:
selector_string (string):
Pass an empty string.
value (enums.CarrierMode, int):
Specifies whether the carrier is continuous or includes bursts.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.CarrierMode else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.CARRIER_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_carrier_to_noise_ratio(self, channel_string):
r"""Gets the carrier-to-noise ratio (CNR)of the waveform generated. This value is expressed in dB. Noise
bandwidth is equal to half the value of the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.IQ_RATE`
attribute. Configure the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_TO_NOISE_RATIO` attribute
only if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AWGN_ENABLED` attribute to
NIBTSG_VAL_TRUE.
The default value is 50.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the carrier-to-noise ratio (CNR)of the waveform generated. This value is expressed in dB. Noise
bandwidth is equal to half the value of the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.IQ_RATE`
attribute. Configure the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_TO_NOISE_RATIO` attribute
only if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AWGN_ENABLED` attribute to
NIBTSG_VAL_TRUE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CARRIER_TO_NOISE_RATIO.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_carrier_to_noise_ratio(self, channel_string, value):
r"""Sets the carrier-to-noise ratio (CNR)of the waveform generated. This value is expressed in dB. Noise
bandwidth is equal to half the value of the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.IQ_RATE`
attribute. Configure the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_TO_NOISE_RATIO` attribute
only if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AWGN_ENABLED` attribute to
NIBTSG_VAL_TRUE.
The default value is 50.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the carrier-to-noise ratio (CNR)of the waveform generated. This value is expressed in dB. Noise
bandwidth is equal to half the value of the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.IQ_RATE`
attribute. Configure the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_TO_NOISE_RATIO` attribute
only if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AWGN_ENABLED` attribute to
NIBTSG_VAL_TRUE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CARRIER_TO_NOISE_RATIO.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_cs_phase_measurement_period(self, channel_string):
r"""Gets the phase measurement period in the generated CS packet. This property is applicable for all CS packet
formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is 10us. Valid values are 10 us, 20us and 40 us.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the phase measurement period in the generated CS packet. This property is applicable for all CS packet
formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is 10us. Valid values are 10 us, 20us and 40 us.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CS_PHASE_MEASUREMENT_PERIOD.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_cs_phase_measurement_period(self, channel_string, value):
r"""Sets the phase measurement period in the generated CS packet. This property is applicable for all CS packet
formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is 10us. Valid values are 10 us, 20us and 40 us.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the phase measurement period in the generated CS packet. This property is applicable for all CS packet
formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is 10us. Valid values are 10 us, 20us and 40 us.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.CS_PHASE_MEASUREMENT_PERIOD.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_cs_sync_sequence(self, channel_string):
r"""Gets whether the sounding sequence field is present in SYNC packet. This property is applicable for all CS
Packet formats except CS Tone. The default value is NIBTSG_VAL_SYNC_SEQUENCE_SOUNDING_SEQUENCE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CSSyncSequence):
Specifies whether the sounding sequence field is present in SYNC packet. This property is applicable for all CS
Packet formats except CS Tone. The default value is NIBTSG_VAL_SYNC_SEQUENCE_SOUNDING_SEQUENCE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.CS_SYNC_SEQUENCE.value
)
attr_val = enums.CSSyncSequence(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_cs_sync_sequence(self, channel_string, value):
r"""Sets whether the sounding sequence field is present in SYNC packet. This property is applicable for all CS
Packet formats except CS Tone. The default value is NIBTSG_VAL_SYNC_SEQUENCE_SOUNDING_SEQUENCE.
Args:
selector_string (string):
Pass an empty string.
value (enums.CSSyncSequence, int):
Specifies whether the sounding sequence field is present in SYNC packet. This property is applicable for all CS
Packet formats except CS Tone. The default value is NIBTSG_VAL_SYNC_SEQUENCE_SOUNDING_SEQUENCE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.CSSyncSequence else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.CS_SYNC_SEQUENCE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_cs_tone_extension_slot_enabled(self, channel_string):
r"""Gets whether CS tone extension slot is present in generated LE CS packets. This property is applicable for
all CS packet formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CSToneExtensionSlotEnabled):
Specifies whether CS tone extension slot is present in generated LE CS packets. This property is applicable for
all CS packet formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is NIBTSG_VAL_FALSE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.CS_TONE_EXTENSION_SLOT_ENABLED.value
)
attr_val = enums.CSToneExtensionSlotEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_cs_tone_extension_slot_enabled(self, channel_string, value):
r"""Sets whether CS tone extension slot is present in generated LE CS packets. This property is applicable for
all CS packet formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
value (enums.CSToneExtensionSlotEnabled, int):
Specifies whether CS tone extension slot is present in generated LE CS packets. This property is applicable for
all CS packet formats except NIBTSG_VAL_PACKET_FORMAT_SYNC. The default value is NIBTSG_VAL_FALSE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.CSToneExtensionSlotEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.CS_TONE_EXTENSION_SLOT_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_data_rate(self, channel_string):
r"""Gets the Higher Data Throughput (HDT) Bit Rate. This property is applicable only when you set the packet
type to LE-HDT. The default value is 2000000. Valid values are 2000000, 3000000, 4000000, 6000000, 7500000.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DataRate):
Specifies the Higher Data Throughput (HDT) Bit Rate. This property is applicable only when you set the packet
type to LE-HDT. The default value is 2000000. Valid values are 2000000, 3000000, 4000000, 6000000, 7500000.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DATA_RATE.value
)
attr_val = enums.DataRate(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_data_rate(self, channel_string, value):
r"""Sets the Higher Data Throughput (HDT) Bit Rate. This property is applicable only when you set the packet
type to LE-HDT. The default value is 2000000. Valid values are 2000000, 3000000, 4000000, 6000000, 7500000.
Args:
selector_string (string):
Pass an empty string.
value (enums.DataRate, int):
Specifies the Higher Data Throughput (HDT) Bit Rate. This property is applicable only when you set the packet
type to LE-HDT. The default value is 2000000. Valid values are 2000000, 3000000, 4000000, 6000000, 7500000.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.DataRate else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DATA_RATE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_antenna_switching_duration(self, channel_string):
r"""Gets the duration for which the transitions of phase and amplitude take place in the switching slots of the
constant tone extension (CTE) portion of the low energy (LE) packet. This attribute is applicable only when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute to
NIBTSG_VAL_TRUE.
The default value is 500n.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the duration for which the transitions of phase and amplitude take place in the switching slots of the
constant tone extension (CTE) portion of the low energy (LE) packet. This attribute is applicable only when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute to
NIBTSG_VAL_TRUE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_DURATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_antenna_switching_duration(self, channel_string, value):
r"""Sets the duration for which the transitions of phase and amplitude take place in the switching slots of the
constant tone extension (CTE) portion of the low energy (LE) packet. This attribute is applicable only when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute to
NIBTSG_VAL_TRUE.
The default value is 500n.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the duration for which the transitions of phase and amplitude take place in the switching slots of the
constant tone extension (CTE) portion of the low energy (LE) packet. This attribute is applicable only when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute to
NIBTSG_VAL_TRUE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_DURATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_antenna_switching_duration_used(self, channel_string):
r"""Gets the actual duration used to make the transitions of phase and amplitude in the switching slots of the
constant tone extension (CTE) portion of low energy (LE) packet. This attribute is applicable only when you set
the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute
to NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the actual duration used to make the transitions of phase and amplitude in the switching slots of the
constant tone extension (CTE) portion of low energy (LE) packet. This attribute is applicable only when you set
the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute
to NIBTSG_VAL_TRUE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_DURATION_USED.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_direction_finding_antenna_switching_enabled(self, channel_string):
r"""Gets whether antenna switching is enabled for the generated low energy (LE) packets. This attribute is
valid only when you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE`
attribute to NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or
NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AntennaSwitchingEnabled):
Specifies whether antenna switching is enabled for the generated low energy (LE) packets. This attribute is
valid only when you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE`
attribute to NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or
NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED.value,
)
attr_val = enums.AntennaSwitchingEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_antenna_switching_enabled(self, channel_string, value):
r"""Sets whether antenna switching is enabled for the generated low energy (LE) packets. This attribute is
valid only when you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE`
attribute to NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or
NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
value (enums.AntennaSwitchingEnabled, int):
Specifies whether antenna switching is enabled for the generated low energy (LE) packets. This attribute is
valid only when you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE`
attribute to NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or
NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.AntennaSwitchingEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_antenna_switching_pattern(self, channel_string):
r"""Gets the pattern in which the antennas switch in constant tone extension (CTE) portion of the low energy
(LE) packet. The current definition always treats A0 as the reference antenna. A1, A2, A3...Am are all
non-reference antennas. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the pattern in which the antennas switch in constant tone extension (CTE) portion of the low energy
(LE) packet. The current definition always treats A0 as the reference antenna. A1, A2, A3...Am are all
non-reference antennas. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_PATTERN.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_antenna_switching_pattern(self, channel_string, value):
r"""Sets the pattern in which the antennas switch in constant tone extension (CTE) portion of the low energy
(LE) packet. The current definition always treats A0 as the reference antenna. A1, A2, A3...Am are all
non-reference antennas. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the pattern in which the antennas switch in constant tone extension (CTE) portion of the low energy
(LE) packet. The current definition always treats A0 as the reference antenna. A1, A2, A3...Am are all
non-reference antennas. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_attribute_string( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_PATTERN.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_constant_tone_extension_length(self, channel_string):
r"""Gets the length of the constant tone extension field in the generated signal. This value is expressed in
seconds. This parameter is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE` attribute to either
NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
The default value is 0.00016.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the length of the constant tone extension field in the generated signal. This value is expressed in
seconds. This parameter is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE` attribute to either
NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_CONSTANT_TONE_EXTENSION_LENGTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_constant_tone_extension_length(self, channel_string, value):
r"""Sets the length of the constant tone extension field in the generated signal. This value is expressed in
seconds. This parameter is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE` attribute to either
NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
The default value is 0.00016.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the length of the constant tone extension field in the generated signal. This value is expressed in
seconds. This parameter is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_MODE` attribute to either
NIBTSG_VAL_DIRECTION_FINDING_MODE_ANGLE_OF_ARRIVAL or NIBTSG_DIRECTION_FINDING_MODE_ANGLE_OF_DEPARTURE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_CONSTANT_TONE_EXTENSION_LENGTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_constant_tone_extension_slot_duration(self, channel_string):
r"""Gets the length of the antenna switching and sampling slots in the constant tone extension field. This
value is expressed in seconds.
The default value is 1 us. Valid values are 1 us and 2 us.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the length of the antenna switching and sampling slots in the constant tone extension field. This
value is expressed in seconds.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_CONSTANT_TONE_EXTENSION_SLOT_DURATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_constant_tone_extension_slot_duration(self, channel_string, value):
r"""Sets the length of the antenna switching and sampling slots in the constant tone extension field. This
value is expressed in seconds.
The default value is 1 us. Valid values are 1 us and 2 us.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the length of the antenna switching and sampling slots in the constant tone extension field. This
value is expressed in seconds.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_CONSTANT_TONE_EXTENSION_SLOT_DURATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_mode(self, channel_string):
r"""Gets the mode for direction finding. The attribute is valid only for LE-TP, LE-TP EXT, LE-Enhanced and
LE-HDT packet type.
The default value is NIBTSG_VAL_DIRECTION_FINDING_MODE_DISABLE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DirectionFindingMode):
Specifies the mode for direction finding. The attribute is valid only for LE-TP, LE-TP EXT, LE-Enhanced and
LE-HDT packet type.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRECTION_FINDING_MODE.value
)
attr_val = enums.DirectionFindingMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_mode(self, channel_string, value):
r"""Sets the mode for direction finding. The attribute is valid only for LE-TP, LE-TP EXT, LE-Enhanced and
LE-HDT packet type.
The default value is NIBTSG_VAL_DIRECTION_FINDING_MODE_DISABLE.
Args:
selector_string (string):
Pass an empty string.
value (enums.DirectionFindingMode, int):
Specifies the mode for direction finding. The attribute is valid only for LE-TP, LE-TP EXT, LE-Enhanced and
LE-HDT packet type.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.DirectionFindingMode else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRECTION_FINDING_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_direction_finding_number_of_antennas(self, channel_string):
r"""Gets the number of antennas used to transmit or receive the constant tone extension (CTE) portion of low
energy (LE) packet. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of antennas used to transmit or receive the constant tone extension (CTE) portion of low
energy (LE) packet. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRECTION_FINDING_NUMBER_OF_ANTENNAS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_direction_finding_number_of_antennas(self, channel_string, value):
r"""Sets the number of antennas used to transmit or receive the constant tone extension (CTE) portion of low
energy (LE) packet. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of antennas used to transmit or receive the constant tone extension (CTE) portion of low
energy (LE) packet. This attribute is applicable only when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` to
NIBTSG_VAL_TRUE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.DIRECTION_FINDING_NUMBER_OF_ANTENNAS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_carrier_frequency_offset_set(self, channel_string):
r"""Gets the offset value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute. This attribute
is applicable with you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute. This attribute
is applicable with you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_CARRIER_FREQUENCY_OFFSET_SET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_carrier_frequency_offset_set(self, channel_string, value):
r"""Sets the offset value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute. This attribute
is applicable with you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute. This attribute
is applicable with you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.DIRTY_TX_CARRIER_FREQUENCY_OFFSET_SET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_enabled(self, channel_string):
r"""Gets whether to enable the dirty transmitter.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DirtyTxEnabled):
Specifies whether to enable the dirty transmitter.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_ENABLED.value
)
attr_val = enums.DirtyTxEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_enabled(self, channel_string, value):
r"""Sets whether to enable the dirty transmitter.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
value (enums.DirtyTxEnabled, int):
Specifies whether to enable the dirty transmitter.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.DirtyTxEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_mode(self, channel_string):
r"""Gets whether to enable the dirty transmitter with the standard settings, the user-defined settings or the
frequency drift.
The default value is NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DirtyTxMode):
Specifies whether to enable the dirty transmitter with the standard settings, the user-defined settings or the
frequency drift.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_MODE.value
)
attr_val = enums.DirtyTxMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_mode(self, channel_string, value):
r"""Sets whether to enable the dirty transmitter with the standard settings, the user-defined settings or the
frequency drift.
The default value is NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
value (enums.DirtyTxMode, int):
Specifies whether to enable the dirty transmitter with the standard settings, the user-defined settings or the
frequency drift.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.DirtyTxMode else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_modulation_index_set(self, channel_string):
r"""Gets the modulation index value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
This attribute is applicable when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Valid values are 0.28 to 0.4 for Basic Rate and EDR packets and 0.45 to 0.55 for LE packets, inclusive. The
valid values are 0.495 to 0.505, inclusive, for LE packets when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODULATION_INDEX_TYPE` attribute to
NIBTSG_VAL_DIRTY_TX_MODULATION_INDEX_TYPE_STABLE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the modulation index value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_MODULATION_INDEX_SET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_modulation_index_set(self, channel_string, value):
r"""Sets the modulation index value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
This attribute is applicable when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Valid values are 0.28 to 0.4 for Basic Rate and EDR packets and 0.45 to 0.55 for LE packets, inclusive. The
valid values are 0.495 to 0.505, inclusive, for LE packets when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODULATION_INDEX_TYPE` attribute to
NIBTSG_VAL_DIRTY_TX_MODULATION_INDEX_TYPE_STABLE.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the modulation index value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_vector_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_MODULATION_INDEX_SET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_modulation_index_type(self, channel_string):
r"""Gets whether the modulation index type is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD or
NIBTSG_VAL_DIRTY_TX_MODULATION_INDEX_TYPE_STABLE. This attribute is valid only for LE packets. This attribute is
applicable only if :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_ENABLED` attribute is set to
NIBTSG_VAL_TRUE. The default value is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DirtyTxModulationIndexType):
Specifies whether the modulation index type is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD or
NIBTSG_VAL_DIRTY_TX_MODULATION_INDEX_TYPE_STABLE. This attribute is valid only for LE packets. This attribute is
applicable only if :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_ENABLED` attribute is set to
NIBTSG_VAL_TRUE. The default value is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_MODULATION_INDEX_TYPE.value
)
attr_val = enums.DirtyTxModulationIndexType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_modulation_index_type(self, channel_string, value):
r"""Sets whether the modulation index type is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD or
NIBTSG_VAL_DIRTY_TX_MODULATION_INDEX_TYPE_STABLE. This attribute is valid only for LE packets. This attribute is
applicable only if :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_ENABLED` attribute is set to
NIBTSG_VAL_TRUE. The default value is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
value (enums.DirtyTxModulationIndexType, int):
Specifies whether the modulation index type is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD or
NIBTSG_VAL_DIRTY_TX_MODULATION_INDEX_TYPE_STABLE. This attribute is valid only for LE packets. This attribute is
applicable only if :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_ENABLED` attribute is set to
NIBTSG_VAL_TRUE. The default value is NIBTSG_DIRTY_TX_MODULATION_INDEX_TYPE_STANDARD.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.DirtyTxModulationIndexType else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_MODULATION_INDEX_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_parameters_enabled_set(self, channel_string):
r"""Gets the impairment sets that you must enable out of the ten sets in LE and BR or the three sets in EDR.
This attribute is applicable if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE`
attribute to NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute is set to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DirtyTxParametersEnabledSet):
Specifies the impairment sets that you must enable out of the ten sets in LE and BR or the three sets in EDR.
This attribute is applicable if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE`
attribute to NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute is set to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET.value
)
attr_val = [enums.DirtyTxParametersEnabledSet(v) for v in attr_val]
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_parameters_enabled_set(self, channel_string, value):
r"""Sets the impairment sets that you must enable out of the ten sets in LE and BR or the three sets in EDR.
This attribute is applicable if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE`
attribute to NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute is set to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
value (enums.DirtyTxParametersEnabledSet, int):
Specifies the impairment sets that you must enable out of the ten sets in LE and BR or the three sets in EDR.
This attribute is applicable if you set the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE`
attribute to NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute when the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute is set to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = (
[v.value for v in value]
if (
isinstance(value, list)
and all(isinstance(v, enums.DirtyTxParametersEnabledSet) for v in value)
)
else value
)
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_residual_fm_deviation(self, channel_string):
r"""Gets the frequency of the modulated signal to provide the additional frequency drift. This value is
expressed in Hz.
This attribute is applicable when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency of the modulated signal to provide the additional frequency drift. This value is
expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_RESIDUAL_FM_DEVIATION.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_residual_fm_deviation(self, channel_string, value):
r"""Sets the frequency of the modulated signal to provide the additional frequency drift. This value is
expressed in Hz.
This attribute is applicable when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency of the modulated signal to provide the additional frequency drift. This value is
expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_RESIDUAL_FM_DEVIATION.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_residual_fm_frequency(self, channel_string):
r"""Gets the frequency deviation of the modulated signal to provide the additional frequency drift. This value
is expressed in Hz.
This attribute is applicable when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency deviation of the modulated signal to provide the additional frequency drift. This value
is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_RESIDUAL_FM_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_residual_fm_frequency(self, channel_string, value):
r"""Sets the frequency deviation of the modulated signal to provide the additional frequency drift. This value
is expressed in Hz.
This attribute is applicable when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency deviation of the modulated signal to provide the additional frequency drift. This value
is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_RESIDUAL_FM_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dirty_tx_symbol_timing_error_set(self, channel_string):
r"""Gets the symbol timing error value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
This attribute is applicable with you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the symbol timing error value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_SYMBOL_TIMING_ERROR_SET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dirty_tx_symbol_timing_error_set(self, channel_string, value):
r"""Sets the symbol timing error value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
This attribute is applicable with you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_USER_DEFINED. The BT Generation ignores this attribute if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_MODE` attribute to
NIBTSG_VAL_DIRTY_TX_MODE_STANDARD.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the symbol timing error value of each of the impairment set that you enable in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRTY_TX_PARAMETERS_ENABLED_SET` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DIRTY_TX_SYMBOL_TIMING_ERROR_SET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dv_voice_payload_data_type(self, channel_string):
r"""Gets the type of payload for the data voice (DV) packet.
The default value is NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DVVoicePayloadDataType):
Specifies the type of payload for the data voice (DV) packet.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE.value
)
attr_val = enums.DVVoicePayloadDataType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dv_voice_payload_data_type(self, channel_string, value):
r"""Sets the type of payload for the data voice (DV) packet.
The default value is NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
Args:
selector_string (string):
Pass an empty string.
value (enums.DVVoicePayloadDataType, int):
Specifies the type of payload for the data voice (DV) packet.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.DVVoicePayloadDataType else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dv_voice_payload_pn_order(self, channel_string):
r"""Gets the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_ORDER` attribute.
The default value is 9. Valid values are 5 to 31, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_ORDER` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_PN_ORDER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dv_voice_payload_pn_order(self, channel_string, value):
r"""Sets the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_ORDER` attribute.
The default value is 9. Valid values are 5 to 31, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_ORDER` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_PN_ORDER.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dv_voice_payload_pn_seed(self, channel_string):
r"""Gets the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_SEED` attribute.
The default value is 497.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_SEED` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_PN_SEED.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dv_voice_payload_pn_seed(self, channel_string, value):
r"""Sets the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_SEED` attribute.
The default value is 497.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_PN_SEED` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_PN_SEED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_dv_voice_payload_user_defined_bits(self, channel_string):
r"""Gets a bit pattern as an array of zeros and ones.
If the array length is greater than the required payload length, the BT Generation uses a subset of the required
length from the beginning of the array for waveform generation. If the array length is less than the required
payload length, the BT Generation repeats the bit pattern until the required length is achieved. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_USER_DEFINED_BITS` attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies a bit pattern as an array of zeros and ones.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.DV_VOICE_PAYLOAD_USER_DEFINED_BITS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_dv_voice_payload_user_defined_bits(self, channel_string, value):
r"""Sets a bit pattern as an array of zeros and ones.
If the array length is greater than the required payload length, the BT Generation uses a subset of the required
length from the beginning of the array for waveform generation. If the array length is less than the required
payload length, the BT Generation repeats the bit pattern until the required length is achieved. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DV_VOICE_PAYLOAD_USER_DEFINED_BITS` attribute.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies a bit pattern as an array of zeros and ones.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.DV_VOICE_PAYLOAD_USER_DEFINED_BITS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_bd_address_lap(self, channel_string):
r"""Gets the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
lower address part (LAP) of the device that sends the FHS packet.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
lower address part (LAP) of the device that sends the FHS packet.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_BD_ADDRESS_LAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_bd_address_lap(self, channel_string, value):
r"""Sets the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
lower address part (LAP) of the device that sends the FHS packet.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
lower address part (LAP) of the device that sends the FHS packet.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_BD_ADDRESS_LAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_bd_address_nap(self, channel_string):
r"""Gets the 16-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
non-significant address part (NAP) of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the NAP field.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 16-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
non-significant address part (NAP) of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the NAP field.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_BD_ADDRESS_NAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_bd_address_nap(self, channel_string, value):
r"""Sets the 16-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
non-significant address part (NAP) of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the NAP field.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 16-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
non-significant address part (NAP) of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the NAP field.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_BD_ADDRESS_NAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_bd_address_uap(self, channel_string):
r"""Gets the 8-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
upper address part (UAP) of the device that sends the FHS packet.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 8-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
upper address part (UAP) of the device that sends the FHS packet.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_BD_ADDRESS_UAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_bd_address_uap(self, channel_string, value):
r"""Sets the 8-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
upper address part (UAP) of the device that sends the FHS packet.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 8-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
upper address part (UAP) of the device that sends the FHS packet.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_BD_ADDRESS_UAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_device_class(self, channel_string):
r"""Gets the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
class of device of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the device class field in the FHS packet payload.
The default value is 0. Valid values are 0 to 0xFFFFFF, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
class of device of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the device class field in the FHS packet payload.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_DEVICE_CLASS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_device_class(self, channel_string, value):
r"""Sets the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
class of device of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the device class field in the FHS packet payload.
The default value is 0. Valid values are 0 to 0xFFFFFF, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 24-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
class of device of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the device class field in the FHS packet payload.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_DEVICE_CLASS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_device_clock(self, channel_string):
r"""Gets the 26-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
value of the native clock of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of
the Bluetooth Specification v2.1+EDR for more information about the device clock field of the FHS packet
payload.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 26-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
value of the native clock of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of
the Bluetooth Specification v2.1+EDR for more information about the device clock field of the FHS packet
payload.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_DEVICE_CLOCK.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_device_clock(self, channel_string, value):
r"""Sets the 26-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
value of the native clock of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of
the Bluetooth Specification v2.1+EDR for more information about the device clock field of the FHS packet
payload.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 26-bit field in the frequency hop synchronization (FHS) packet payload. This field contains the
value of the native clock of the device that sends the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of
the Bluetooth Specification v2.1+EDR for more information about the device clock field of the FHS packet
payload.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_DEVICE_CLOCK.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_lt_address(self, channel_string):
r"""Gets the 3-bit logical transport (LT) address of the frequency hop synchronization (FHS) packet. Refer to
Section 6.5.1.4, Part B, Volume 2 of the Bluetooth specification v2.1+EDR for more information about the LT
address of the FHS packet.
The default value is 0. Valid values are 0 to 7, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 3-bit logical transport (LT) address of the frequency hop synchronization (FHS) packet. Refer to
Section 6.5.1.4, Part B, Volume 2 of the Bluetooth specification v2.1+EDR for more information about the LT
address of the FHS packet.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_LT_ADDRESS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_lt_address(self, channel_string, value):
r"""Sets the 3-bit logical transport (LT) address of the frequency hop synchronization (FHS) packet. Refer to
Section 6.5.1.4, Part B, Volume 2 of the Bluetooth specification v2.1+EDR for more information about the LT
address of the FHS packet.
The default value is 0. Valid values are 0 to 7, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 3-bit logical transport (LT) address of the frequency hop synchronization (FHS) packet. Refer to
Section 6.5.1.4, Part B, Volume 2 of the Bluetooth specification v2.1+EDR for more information about the LT
address of the FHS packet.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_LT_ADDRESS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_page_scan_mode(self, channel_string):
r"""Gets the 3-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
default scan mode used by the sender of the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the page scan mode field of the FHS packet payload.
The default value is 0. Valid values are 0 to 7, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 3-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
default scan mode used by the sender of the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the page scan mode field of the FHS packet payload.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_PAGE_SCAN_MODE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_page_scan_mode(self, channel_string, value):
r"""Sets the 3-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
default scan mode used by the sender of the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the page scan mode field of the FHS packet payload.
The default value is 0. Valid values are 0 to 7, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 3-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
default scan mode used by the sender of the FHS packet. Refer to Section 6.5.1.4, Part B, Volume 2 of the
Bluetooth Specification v2.1+EDR for more information about the page scan mode field of the FHS packet payload.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_PAGE_SCAN_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fhs_payload_scan_repetition(self, channel_string):
r"""Gets the 2-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
interval between two consecutive page scan windows. Refer to Section 6.5.1.4, Part B, Volume 2 of the Bluetooth
specification v2.1+EDR for more information about the payload scan repetition field of the FHS packet payload.
The default value is 0. Valid values are 0 to 3, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 2-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
interval between two consecutive page scan windows. Refer to Section 6.5.1.4, Part B, Volume 2 of the Bluetooth
specification v2.1+EDR for more information about the payload scan repetition field of the FHS packet payload.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_SCAN_REPETITION.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fhs_payload_scan_repetition(self, channel_string, value):
r"""Sets the 2-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
interval between two consecutive page scan windows. Refer to Section 6.5.1.4, Part B, Volume 2 of the Bluetooth
specification v2.1+EDR for more information about the payload scan repetition field of the FHS packet payload.
The default value is 0. Valid values are 0 to 3, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 2-bit field in the frequency hop synchronization (FHS) packet payload. This field indicates the
interval between two consecutive page scan windows. Refer to Section 6.5.1.4, Part B, Volume 2 of the Bluetooth
specification v2.1+EDR for more information about the payload scan repetition field of the FHS packet payload.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.FHS_PAYLOAD_SCAN_REPETITION.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_crc_seed(self, channel_string):
r"""Gets the 32 bit CRC initialization seed value. This property is applicable only when user set the Packet
Type to LE-HDT and :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT0 or NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1.
The default value is 0x00000000. The valid values are 0x00000000 to 0xFFFFFFFF.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 32 bit CRC initialization seed value. This property is applicable only when user set the Packet
Type to LE-HDT and :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT0 or NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i64( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_CRC_SEED.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_crc_seed(self, channel_string, value):
r"""Sets the 32 bit CRC initialization seed value. This property is applicable only when user set the Packet
Type to LE-HDT and :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT0 or NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1.
The default value is 0x00000000. The valid values are 0x00000000 to 0xFFFFFFFF.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 32 bit CRC initialization seed value. This property is applicable only when user set the Packet
Type to LE-HDT and :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT0 or NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i64( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_CRC_SEED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_hdt_phy_interval(self, channel_string):
r"""Gets the physical layer intervals. This property is only valid for Format1 packet format. This value is
expressed in seconds. The default value is 64us. Valid values are 64us, 128us, 192us and 256us.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the physical layer intervals. This property is only valid for Format1 packet format. This value is
expressed in seconds. The default value is 64us. Valid values are 64us, 128us, 192us and 256us.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.HDT_PHY_INTERVAL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_hdt_phy_interval(self, channel_string, value):
r"""Sets the physical layer intervals. This property is only valid for Format1 packet format. This value is
expressed in seconds. The default value is 64us. Valid values are 64us, 128us, 192us and 256us.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the physical layer intervals. This property is only valid for Format1 packet format. This value is
expressed in seconds. The default value is 64us. Valid values are 64us, 128us, 192us and 256us.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.HDT_PHY_INTERVAL.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_zadoff_chu_index(self, channel_string):
r"""Gets Zadoff-Chu Index for the Long Training Sequence in the preamble. The default value is 7. Valid values
are in the range of [1 - 16].
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies Zadoff-Chu Index for the Long Training Sequence in the preamble. The default value is 7. Valid values
are in the range of [1 - 16].
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.ZADOFF_CHU_INDEX.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_zadoff_chu_index(self, channel_string, value):
r"""Sets Zadoff-Chu Index for the Long Training Sequence in the preamble. The default value is 7. Valid values
are in the range of [1 - 16].
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies Zadoff-Chu Index for the Long Training Sequence in the preamble. The default value is 7. Valid values
are in the range of [1 - 16].
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.ZADOFF_CHU_INDEX.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_physical_channel_address(self, channel_string):
r"""Gets the 40-bit physical channel address of Higher Data Throughput (HDT) packet. The default value is
0x9F15555555.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 40-bit physical channel address of Higher Data Throughput (HDT) packet. The default value is
0x9F15555555.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i64( # type: ignore
channel_string, attributes.AttributeID.PHYSICAL_CHANNEL_ADDRESS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_physical_channel_address(self, channel_string, value):
r"""Sets the 40-bit physical channel address of Higher Data Throughput (HDT) packet. The default value is
0x9F15555555.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 40-bit physical channel address of Higher Data Throughput (HDT) packet. The default value is
0x9F15555555.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i64( # type: ignore
channel_string, attributes.AttributeID.PHYSICAL_CHANNEL_ADDRESS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_vhdt_mode_enabled(self, channel_string):
r"""
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.VHDT_MODE_ENABLED.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_vhdt_mode_enabled(self, channel_string, value):
r"""
Args:
selector_string (string):
Pass an empty string.
value (int):
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.VHDT_MODE_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_headroom(self, channel_string):
r"""Gets the value for the headroom. This value is expressed in dB. The BT Generation uses this attribute for
scaling the waveform when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AUTO_HEADROOM_ENABLED` attribute to NIBTSG_VAL_FALSE.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the value for the headroom. This value is expressed in dB. The BT Generation uses this attribute for
scaling the waveform when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AUTO_HEADROOM_ENABLED` attribute to NIBTSG_VAL_FALSE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.HEADROOM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_headroom(self, channel_string, value):
r"""Sets the value for the headroom. This value is expressed in dB. The BT Generation uses this attribute for
scaling the waveform when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AUTO_HEADROOM_ENABLED` attribute to NIBTSG_VAL_FALSE.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the value for the headroom. This value is expressed in dB. The BT Generation uses this attribute for
scaling the waveform when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.AUTO_HEADROOM_ENABLED` attribute to NIBTSG_VAL_FALSE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.HEADROOM.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_iq_gain_imbalance(self, channel_string):
r"""Gets the ratio of the mean amplitude of the in-phase (I) signal to the mean amplitude of the
quadrature-phase (Q) signal. This value is expressed in dB.
For more information on IQ gain imbalance equations, refer to the IQ Gain Imbalance topic in RFmx BT Generation
Help.
The default value is 0. Valid values are -6 to 6, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the ratio of the mean amplitude of the in-phase (I) signal to the mean amplitude of the
quadrature-phase (Q) signal. This value is expressed in dB.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.IQ_GAIN_IMBALANCE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_iq_gain_imbalance(self, channel_string, value):
r"""Sets the ratio of the mean amplitude of the in-phase (I) signal to the mean amplitude of the
quadrature-phase (Q) signal. This value is expressed in dB.
For more information on IQ gain imbalance equations, refer to the IQ Gain Imbalance topic in RFmx BT Generation
Help.
The default value is 0. Valid values are -6 to 6, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the ratio of the mean amplitude of the in-phase (I) signal to the mean amplitude of the
quadrature-phase (Q) signal. This value is expressed in dB.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.IQ_GAIN_IMBALANCE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_iq_rate(self, channel_string):
r"""Gets the sample rate for generation. This value is expressed in samples per second (S/s). The symbol rate of
the Bluetooth signal is 1 megasymbol per second. The sample rate of the generated signal is the product of the
symbol rate and the oversampling factor. The BT Generation uses an oversampling factor of 8.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the sample rate for generation. This value is expressed in samples per second (S/s). The symbol rate of
the Bluetooth signal is 1 megasymbol per second. The sample rate of the generated signal is the product of the
symbol rate and the oversampling factor. The BT Generation uses an oversampling factor of 8.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.IQ_RATE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_i_dc_offset(self, channel_string):
r"""Gets the value of the DC offset in the in-phase (I) signal as a percentage of the peak magnitude of the
complex I/Q signal.
The default value is 0. Valid values are -100 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the value of the DC offset in the in-phase (I) signal as a percentage of the peak magnitude of the
complex I/Q signal.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.I_DC_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_i_dc_offset(self, channel_string, value):
r"""Sets the value of the DC offset in the in-phase (I) signal as a percentage of the peak magnitude of the
complex I/Q signal.
The default value is 0. Valid values are -100 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the value of the DC offset in the in-phase (I) signal as a percentage of the peak magnitude of the
complex I/Q signal.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.I_DC_OFFSET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_le_tp_corrupt_alternate_crc(self, channel_string):
r"""Gets whether the BT Generation intentionally corrupts the cyclic redundancy check (CRC) portion of every
alternate packet generated. Refer to Section 6.3.7 of the Bluetooth Low Energy RF PHY Test Specification 4.0.0.
CRC corruption is done by toggling the seed used for CRC computation.
The default value is NIBTSG_VAL_FALSE.
Note: This attribute is applicable for LE packets.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.LETPCorruptAlternateCrc):
Specifies whether the BT Generation intentionally corrupts the cyclic redundancy check (CRC) portion of every
alternate packet generated. Refer to Section 6.3.7 of the Bluetooth Low Energy RF PHY Test Specification 4.0.0.
CRC corruption is done by toggling the seed used for CRC computation.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LE_TP_CORRUPT_ALTERNATE_CRC.value
)
attr_val = enums.LETPCorruptAlternateCrc(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_le_tp_corrupt_alternate_crc(self, channel_string, value):
r"""Sets whether the BT Generation intentionally corrupts the cyclic redundancy check (CRC) portion of every
alternate packet generated. Refer to Section 6.3.7 of the Bluetooth Low Energy RF PHY Test Specification 4.0.0.
CRC corruption is done by toggling the seed used for CRC computation.
The default value is NIBTSG_VAL_FALSE.
Note: This attribute is applicable for LE packets.
Args:
selector_string (string):
Pass an empty string.
value (enums.LETPCorruptAlternateCrc, int):
Specifies whether the BT Generation intentionally corrupts the cyclic redundancy check (CRC) portion of every
alternate packet generated. Refer to Section 6.3.7 of the Bluetooth Low Energy RF PHY Test Specification 4.0.0.
CRC corruption is done by toggling the seed used for CRC computation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.LETPCorruptAlternateCrc else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LE_TP_CORRUPT_ALTERNATE_CRC.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_le_access_address(self, channel_string):
r"""Gets the 32-bit LE access address.
The Bluetooth core specification recommends to use 0x71764129 as the LE access address for all test packets. The
preamble of LE-TP/LE-TP-EXT packets is either 01010101b or 10101010b, depending on the LSB of the LE access
address. If the LSB of the LE access address is 1, the preamble shall be 01010101b, otherwise the preamble shall
be 10101010b. This will be 0101010101010101b, 1010101010101010b respectively for LE-Enhanced packets.
The default value is 0x71764129.
Note: This attribute is applicable for LE packets.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 32-bit LE access address.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LE_ACCESS_ADDRESS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_le_access_address(self, channel_string, value):
r"""Sets the 32-bit LE access address.
The Bluetooth core specification recommends to use 0x71764129 as the LE access address for all test packets. The
preamble of LE-TP/LE-TP-EXT packets is either 01010101b or 10101010b, depending on the LSB of the LE access
address. If the LSB of the LE access address is 1, the preamble shall be 01010101b, otherwise the preamble shall
be 10101010b. This will be 0101010101010101b, 1010101010101010b respectively for LE-Enhanced packets.
The default value is 0x71764129.
Note: This attribute is applicable for LE packets.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 32-bit LE access address.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LE_ACCESS_ADDRESS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_le_tp_payload_type(self, channel_string):
r"""Gets the type of payload for the LE and LE CS packets.
The default value is NIBTSG_VAL_LE_TP_PAYLOAD_TYPE_PRBS9.
Note: This attribute is applicable for LE and LE CS packets.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.LETPPayloadType):
Specifies the type of payload for the LE and LE CS packets.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LE_TP_PAYLOAD_TYPE.value
)
attr_val = enums.LETPPayloadType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_le_tp_payload_type(self, channel_string, value):
r"""Sets the type of payload for the LE and LE CS packets.
The default value is NIBTSG_VAL_LE_TP_PAYLOAD_TYPE_PRBS9.
Note: This attribute is applicable for LE and LE CS packets.
Args:
selector_string (string):
Pass an empty string.
value (enums.LETPPayloadType, int):
Specifies the type of payload for the LE and LE CS packets.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.LETPPayloadType else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LE_TP_PAYLOAD_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_maximum_hardware_iq_rate(self, channel_string):
r"""Gets the maximum I/Q rate that the NI RF vector signal generator supports.
This property will be set according to the device model in the :py:meth:`rfsg_create_and_download_waveform`
function.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the maximum I/Q rate that the NI RF vector signal generator supports.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.MAXIMUM_HARDWARE_IQ_RATE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_maximum_hardware_iq_rate(self, channel_string, value):
r"""Sets the maximum I/Q rate that the NI RF vector signal generator supports.
This property will be set according to the device model in the :py:meth:`rfsg_create_and_download_waveform`
function.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the maximum I/Q rate that the NI RF vector signal generator supports.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.MAXIMUM_HARDWARE_IQ_RATE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_modulation_index(self, channel_string):
r"""Gets the modulation index value for the Gaussian frequency shift keying modulation in Bluetooth packets.
Valid values are 0 to 1, excluding 0. The default value is -1. NI recommends you to set the value of this
attribute to 0.32 for BR and EDR packets and 0.5 for LE packets.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the modulation index value for the Gaussian frequency shift keying modulation in Bluetooth packets.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.MODULATION_INDEX.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_modulation_index(self, channel_string, value):
r"""Sets the modulation index value for the Gaussian frequency shift keying modulation in Bluetooth packets.
Valid values are 0 to 1, excluding 0. The default value is -1. NI recommends you to set the value of this
attribute to 0.32 for BR and EDR packets and 0.5 for LE packets.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the modulation index value for the Gaussian frequency shift keying modulation in Bluetooth packets.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.MODULATION_INDEX.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_idle_slots(self, channel_string):
r"""Gets the number of idle slots that the BT Generation appends at the end of each valid packet.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of idle slots that the BT Generation appends at the end of each valid packet.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_IDLE_SLOTS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_idle_slots(self, channel_string, value):
r"""Sets the number of idle slots that the BT Generation appends at the end of each valid packet.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of idle slots that the BT Generation appends at the end of each valid packet.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_IDLE_SLOTS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_unique_packets(self, channel_string):
r"""Gets the number of unique packets for which the pseudonoise (PN) generator must run continuously. The BT
Generation resets the PN generator after it reaches the number of packets that you specify in this attribute.
For example, if you set this attribute to 1, the same payload is used for each packet, and if you set this
attribute to 2, the same payload is used after every 2 packets. Configure this attribute only if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
The value of this attribute must be the same as the value of the NIBTSG_BER_NUMBER_OF_UNIQUE_PACKETS attribute.
Refer to Dirty Transmitter topic for details of the restrictions on the value of the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_UNIQUE_PACKETS` attribute.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of unique packets for which the pseudonoise (PN) generator must run continuously. The BT
Generation resets the PN generator after it reaches the number of packets that you specify in this attribute.
For example, if you set this attribute to 1, the same payload is used for each packet, and if you set this
attribute to 2, the same payload is used after every 2 packets. Configure this attribute only if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_UNIQUE_PACKETS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_unique_packets(self, channel_string, value):
r"""Sets the number of unique packets for which the pseudonoise (PN) generator must run continuously. The BT
Generation resets the PN generator after it reaches the number of packets that you specify in this attribute.
For example, if you set this attribute to 1, the same payload is used for each packet, and if you set this
attribute to 2, the same payload is used after every 2 packets. Configure this attribute only if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
The value of this attribute must be the same as the value of the NIBTSG_BER_NUMBER_OF_UNIQUE_PACKETS attribute.
Refer to Dirty Transmitter topic for details of the restrictions on the value of the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_UNIQUE_PACKETS` attribute.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of unique packets for which the pseudonoise (PN) generator must run continuously. The BT
Generation resets the PN generator after it reaches the number of packets that you specify in this attribute.
For example, if you set this attribute to 1, the same payload is used for each packet, and if you set this
attribute to 2, the same payload is used after every 2 packets. Configure this attribute only if you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_UNIQUE_PACKETS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_oversampling_factor(self, channel_string):
r"""Gets the number of times the Nyquist sample rate is increased to obtain the final sample rate of a signal.
The default value is 8.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of times the Nyquist sample rate is increased to obtain the final sample rate of a signal.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.OVERSAMPLING_FACTOR.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_oversampling_factor(self, channel_string, value):
r"""Sets the number of times the Nyquist sample rate is increased to obtain the final sample rate of a signal.
The default value is 8.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of times the Nyquist sample rate is increased to obtain the final sample rate of a signal.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.OVERSAMPLING_FACTOR.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_packet_bit_sequence_trace_enabled(self, channel_string):
r"""Gets whether to enable the packet bit sequence trace.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PacketBitSequenceTraceEnabled):
Specifies whether to enable the packet bit sequence trace.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PACKET_BIT_SEQUENCE_TRACE_ENABLED.value
)
attr_val = enums.PacketBitSequenceTraceEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_packet_bit_sequence_trace_enabled(self, channel_string, value):
r"""Sets whether to enable the packet bit sequence trace.
The default value is NIBTSG_VAL_FALSE.
Args:
selector_string (string):
Pass an empty string.
value (enums.PacketBitSequenceTraceEnabled, int):
Specifies whether to enable the packet bit sequence trace.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.PacketBitSequenceTraceEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.PACKET_BIT_SEQUENCE_TRACE_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_packet_type(self, channel_string):
r"""Gets the Bluetooth packet type.
The default value is NIBTSG_VAL_PACKET_TYPE_DH1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PacketType):
Specifies the Bluetooth packet type.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PACKET_TYPE.value
)
attr_val = enums.PacketType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_packet_type(self, channel_string, value):
r"""Sets the Bluetooth packet type.
The default value is NIBTSG_VAL_PACKET_TYPE_DH1.
Args:
selector_string (string):
Pass an empty string.
value (enums.PacketType, int):
Specifies the Bluetooth packet type.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.PacketType else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PACKET_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_data_type(self, channel_string):
r"""Gets the type of payload for the packet.
The default value is NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PayloadDataType):
Specifies the type of payload for the packet.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_DATA_TYPE.value
)
attr_val = enums.PayloadDataType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_data_type(self, channel_string, value):
r"""Sets the type of payload for the packet.
The default value is NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE.
Args:
selector_string (string):
Pass an empty string.
value (enums.PayloadDataType, int):
Specifies the type of payload for the packet.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.PayloadDataType else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_DATA_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_length(self, channel_string):
r"""Gets the payload length, in bytes. If the length exceeds the maximum permissible length mentioned in the
Bluetooth specification, the BT Generation uses this maximum permissible length as the payload length. For
LE-TP-EXT and LE-Enhanced packet types, typical LE packet is generated length up to 255 bytes, and Hyper Length
LE packet is generated for length from 256 bytes to 8191 bytes. For LE HDT packet, Format0 supports payload
length up to 510 bytes, whereas Format1 supports up to 8191 bytes per payload. In the case of LE HDT Format1,
when the Payload Zone Configuration Mode is set to Auto and the Payload Length Mode is set to User Defined, you
must specify "payload x" as the active channel string to configure this property.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the payload length, in bytes. If the length exceeds the maximum permissible length mentioned in the
Bluetooth specification, the BT Generation uses this maximum permissible length as the payload length. For
LE-TP-EXT and LE-Enhanced packet types, typical LE packet is generated length up to 255 bytes, and Hyper Length
LE packet is generated for length from 256 bytes to 8191 bytes. For LE HDT packet, Format0 supports payload
length up to 510 bytes, whereas Format1 supports up to 8191 bytes per payload. In the case of LE HDT Format1,
when the Payload Zone Configuration Mode is set to Auto and the Payload Length Mode is set to User Defined, you
must specify "payload x" as the active channel string to configure this property.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_length(self, channel_string, value):
r"""Sets the payload length, in bytes. If the length exceeds the maximum permissible length mentioned in the
Bluetooth specification, the BT Generation uses this maximum permissible length as the payload length. For
LE-TP-EXT and LE-Enhanced packet types, typical LE packet is generated length up to 255 bytes, and Hyper Length
LE packet is generated for length from 256 bytes to 8191 bytes. For LE HDT packet, Format0 supports payload
length up to 510 bytes, whereas Format1 supports up to 8191 bytes per payload. In the case of LE HDT Format1,
when the Payload Zone Configuration Mode is set to Auto and the Payload Length Mode is set to User Defined, you
must specify "payload x" as the active channel string to configure this property.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the payload length, in bytes. If the length exceeds the maximum permissible length mentioned in the
Bluetooth specification, the BT Generation uses this maximum permissible length as the payload length. For
LE-TP-EXT and LE-Enhanced packet types, typical LE packet is generated length up to 255 bytes, and Hyper Length
LE packet is generated for length from 256 bytes to 8191 bytes. For LE HDT packet, Format0 supports payload
length up to 510 bytes, whereas Format1 supports up to 8191 bytes per payload. In the case of LE HDT Format1,
when the Payload Zone Configuration Mode is set to Auto and the Payload Length Mode is set to User Defined, you
must specify "payload x" as the active channel string to configure this property.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_LENGTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_length_mode(self, channel_string):
r"""Gets whether the BT Generation automatically sets the value of the LENGTH field in the payload header to
the maximum permissible length or whether it uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH` attribute.
The default value is NIBTSG_VAL_PAYLOAD_LENGTH_MODE_MAXIMUM_LENGTH.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PayloadLengthMode):
Specifies whether the BT Generation automatically sets the value of the LENGTH field in the payload header to
the maximum permissible length or whether it uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_LENGTH_MODE.value
)
attr_val = enums.PayloadLengthMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_length_mode(self, channel_string, value):
r"""Sets whether the BT Generation automatically sets the value of the LENGTH field in the payload header to
the maximum permissible length or whether it uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH` attribute.
The default value is NIBTSG_VAL_PAYLOAD_LENGTH_MODE_MAXIMUM_LENGTH.
Args:
selector_string (string):
Pass an empty string.
value (enums.PayloadLengthMode, int):
Specifies whether the BT Generation automatically sets the value of the LENGTH field in the payload header to
the maximum permissible length or whether it uses the value that you specify in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_LENGTH` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.PayloadLengthMode else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_LENGTH_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_payloads(self, channel_string):
r"""Gets the number of payloads for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1. The valid values are 1 to 4.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of payloads for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1. The valid values are 1 to 4.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_PAYLOADS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_payloads(self, channel_string, value):
r"""Sets the number of payloads for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1. The valid values are 1 to 4.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of payloads for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1. The valid values are 1 to 4.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_PAYLOADS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_txlen_sequence_number(self, channel_string):
r"""Gets the value of TxLen SN field of Tx Portion of PDU Header. This property is valid only for the LE-HDT
packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The default value is NIBTSG_VAL_TXLEN_SEQUENCE_NUMBER_11.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.TxlenSequenceNumber):
Specifies the value of TxLen SN field of Tx Portion of PDU Header. This property is valid only for the LE-HDT
packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.TXLEN_SEQUENCE_NUMBER.value
)
attr_val = enums.TxlenSequenceNumber(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_txlen_sequence_number(self, channel_string, value):
r"""Sets the value of TxLen SN field of Tx Portion of PDU Header. This property is valid only for the LE-HDT
packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The default value is NIBTSG_VAL_TXLEN_SEQUENCE_NUMBER_11.
Args:
selector_string (string):
Pass an empty string.
value (enums.TxlenSequenceNumber, int):
Specifies the value of TxLen SN field of Tx Portion of PDU Header. This property is valid only for the LE-HDT
packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.TxlenSequenceNumber else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.TXLEN_SEQUENCE_NUMBER.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_blocks(self, channel_string):
r"""Gets the number of blocks minus one that the payload is split into.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The default value is 15.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of blocks minus one that the payload is split into.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_BLOCKS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_blocks(self, channel_string, value):
r"""Sets the number of blocks minus one that the payload is split into.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The default value is 15.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of blocks minus one that the payload is split into.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_BLOCKS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_block_size(self, channel_string):
r"""Gets the block size of each block specified by
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_BLOCKS`.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The valid values are 32 to 511. The default value is 511.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the block size of each block specified by
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_BLOCKS`.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BLOCK_SIZE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_block_size(self, channel_string, value):
r"""Sets the block size of each block specified by
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_BLOCKS`.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The valid values are 32 to 511. The default value is 511.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the block size of each block specified by
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.NUMBER_OF_BLOCKS`.This property is valid only for the
LE-HDT packet when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.BLOCK_SIZE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_last_block_size(self, channel_string):
r"""Gets the block size of the last block. This property is valid only for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The valid values are 1 to 8191. The default value is 526.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the block size of the last block. This property is valid only for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LAST_BLOCK_SIZE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_last_block_size(self, channel_string, value):
r"""Sets the block size of the last block. This property is valid only for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The valid values are 1 to 8191. The default value is 526.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the block size of the last block. This property is valid only for the LE-HDT packet when
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.LAST_BLOCK_SIZE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_txblock_map(self, channel_string):
r"""Gets the TxBlockMap field of Tx Portion of PDU Header. The TxBlockMap field is 8 or 16 bits depending on
the value of :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.TXLEN_SEQUENCE_NUMBER`. It indicates which
blocks are actually being transmitted in the packet, with bit b set to 1 if block b (counting from 0) is
included and 0 if it is not. At least one bit shall be set. This property is valid only for the LE-HDT packet
when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The valid values are 1 to 0xFFFF. The default value is 0xFFFF.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the TxBlockMap field of Tx Portion of PDU Header. The TxBlockMap field is 8 or 16 bits depending on
the value of :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.TXLEN_SEQUENCE_NUMBER`. It indicates which
blocks are actually being transmitted in the packet, with bit b set to 1 if block b (counting from 0) is
included and 0 if it is not. At least one bit shall be set. This property is valid only for the LE-HDT packet
when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.TXBLOCK_MAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_txblock_map(self, channel_string, value):
r"""Sets the TxBlockMap field of Tx Portion of PDU Header. The TxBlockMap field is 8 or 16 bits depending on
the value of :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.TXLEN_SEQUENCE_NUMBER`. It indicates which
blocks are actually being transmitted in the packet, with bit b set to 1 if block b (counting from 0) is
included and 0 if it is not. At least one bit shall be set. This property is valid only for the LE-HDT packet
when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
You must use "payload x" as the active channel string to configure this property.
The valid values are 1 to 0xFFFF. The default value is 0xFFFF.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the TxBlockMap field of Tx Portion of PDU Header. The TxBlockMap field is 8 or 16 bits depending on
the value of :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.TXLEN_SEQUENCE_NUMBER`. It indicates which
blocks are actually being transmitted in the packet, with bit b set to 1 if block b (counting from 0) is
included and 0 if it is not. At least one bit shall be set. This property is valid only for the LE-HDT packet
when :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.HDT_PACKET_FORMAT` is set to
NIBTSG_VAL_HDT_PACKET_FORMAT_FORMAT1 and
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE` is set to
NIBTSG_VAL_FORMAT1_PAYLOAD_ZONE_CONFIGURATION_MODE_USER_DEFINED.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.TXBLOCK_MAP.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_zone_length(self, channel_string):
r"""Gets the payload zone length of LE-HDT packets. The payload zone length has all payloads and each payload
contains blocks followed by CRCs.
This property is valid only for the LE-HDT packet.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the payload zone length of LE-HDT packets. The payload zone length has all payloads and each payload
contains blocks followed by CRCs.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_ZONE_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_payload_pn_order(self, channel_string):
r"""Gets the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_ORDER` attribute.
The default value is 9. Valid values are 5 to 31, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_ORDER` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_PN_ORDER.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_pn_order(self, channel_string, value):
r"""Sets the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_ORDER` attribute.
The default value is 9. Valid values are 5 to 31, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the order (length of memory) of the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_ORDER` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_PN_ORDER.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_pn_seed(self, channel_string):
r"""Gets the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_SEED` attribute.
The default value is 497.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_SEED` attribute.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_PN_SEED.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_pn_seed(self, channel_string, value):
r"""Sets the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_SEED` attribute.
The default value is 497.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the initialization seed used for the pseudorandom bit sequence (PRBS) generator. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_USER_DEFINED_BITS, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_PN_SEED` attribute.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_PN_SEED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_payload_user_defined_bits(self, channel_string):
r"""Gets a bit pattern as an array of zeros and ones.
If the array length is greater than the required payload length, the BT Generation uses a subset of the required
length from the beginning of the array for waveform generation. If the array length is less than the required
payload length, the BT Generation repeats the bit pattern until the required length is achieved. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_USER_DEFINED_BITS` attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies a bit pattern as an array of zeros and ones.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_USER_DEFINED_BITS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_payload_user_defined_bits(self, channel_string, value):
r"""Sets a bit pattern as an array of zeros and ones.
If the array length is greater than the required payload length, the BT Generation uses a subset of the required
length from the beginning of the array for waveform generation. If the array length is less than the required
payload length, the BT Generation repeats the bit pattern until the required length is achieved. If you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_DATA_TYPE` attribute to
NIBTSG_VAL_PAYLOAD_DATA_TYPE_PN_SEQUENCE, the BT Generation ignores the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PAYLOAD_USER_DEFINED_BITS` attribute.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies a bit pattern as an array of zeros and ones.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.PAYLOAD_USER_DEFINED_BITS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_power_ramp_settling_time(self, channel_string):
r"""Gets the settling time of the burst. The settling time is the time interval from the time when output power
is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output power.
This value is expressed in seconds.
The default value is 4 microseconds. Valid values are from 1 microseconds to 20 microseconds, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the settling time of the burst. The settling time is the time interval from the time when output power
is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output power.
This value is expressed in seconds.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.POWER_RAMP_SETTLING_TIME.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_power_ramp_settling_time(self, channel_string, value):
r"""Sets the settling time of the burst. The settling time is the time interval from the time when output power
is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output power.
This value is expressed in seconds.
The default value is 4 microseconds. Valid values are from 1 microseconds to 20 microseconds, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the settling time of the burst. The settling time is the time interval from the time when output power
is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output power.
This value is expressed in seconds.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.POWER_RAMP_SETTLING_TIME.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_power_ramp_time(self, channel_string):
r"""Gets the ramp time of the burst. The settling time is the time interval from the time when output power (X
dBm) is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output
power. This value is expressed in seconds. The default value is 2 microseconds. Valid values are from 1
microseconds to 10 microseconds, inclusive.
Note: The value of ramp time should not exceed the value of settling time.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the ramp time of the burst. The settling time is the time interval from the time when output power (X
dBm) is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output
power. This value is expressed in seconds. The default value is 2 microseconds. Valid values are from 1
microseconds to 10 microseconds, inclusive.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.POWER_RAMP_TIME.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_power_ramp_time(self, channel_string, value):
r"""Sets the ramp time of the burst. The settling time is the time interval from the time when output power (X
dBm) is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output
power. This value is expressed in seconds. The default value is 2 microseconds. Valid values are from 1
microseconds to 10 microseconds, inclusive.
Note: The value of ramp time should not exceed the value of settling time.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the ramp time of the burst. The settling time is the time interval from the time when output power (X
dBm) is 40 dB less than the final output power to the time when the output power is ±1 dB of the final output
power. This value is expressed in seconds. The default value is 2 microseconds. Valid values are from 1
microseconds to 10 microseconds, inclusive.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.POWER_RAMP_TIME.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_quadrature_skew(self, channel_string):
r"""Gets the deviation in angle from 90 degrees between the in-phase (I) and quadrature-phase (Q) signals.
For more information on quadrature skew equations, refer to the IQ Gain Imbalance topic RFmx BT Generation Help.
The default value is 0. Valid values are -30 to 30, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the deviation in angle from 90 degrees between the in-phase (I) and quadrature-phase (Q) signals.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.QUADRATURE_SKEW.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_quadrature_skew(self, channel_string, value):
r"""Sets the deviation in angle from 90 degrees between the in-phase (I) and quadrature-phase (Q) signals.
For more information on quadrature skew equations, refer to the IQ Gain Imbalance topic RFmx BT Generation Help.
The default value is 0. Valid values are -30 to 30, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the deviation in angle from 90 degrees between the in-phase (I) and quadrature-phase (Q) signals.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.QUADRATURE_SKEW.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_q_dc_offset(self, channel_string):
r"""Gets the value of the DC offset in the quadrature-phase (Q) signal as percentage of the peak magnitude of
the complex I/Q signal.
The default value is 0. Valid values are -100 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the value of the DC offset in the quadrature-phase (Q) signal as percentage of the peak magnitude of
the complex I/Q signal.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.Q_DC_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_q_dc_offset(self, channel_string, value):
r"""Sets the value of the DC offset in the quadrature-phase (Q) signal as percentage of the peak magnitude of
the complex I/Q signal.
The default value is 0. Valid values are -100 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the value of the DC offset in the quadrature-phase (Q) signal as percentage of the peak magnitude of
the complex I/Q signal.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.Q_DC_OFFSET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_run_time_scaling(self, channel_string):
r"""
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.RUN_TIME_SCALING.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_run_time_scaling(self, channel_string, value):
r"""
Args:
selector_string (string):
Pass an empty string.
value (float):
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.RUN_TIME_SCALING.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sample_clock_offset(self, channel_string):
r"""Gets the offset in the Sample Clock frequency from the sample frequency for CS packets. This value is
expressed in parts per million (ppm).
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the offset in the Sample Clock frequency from the sample frequency for CS packets. This value is
expressed in parts per million (ppm).
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.SAMPLE_CLOCK_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sample_clock_offset(self, channel_string, value):
r"""Sets the offset in the Sample Clock frequency from the sample frequency for CS packets. This value is
expressed in parts per million (ppm).
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the offset in the Sample Clock frequency from the sample frequency for CS packets. This value is
expressed in parts per million (ppm).
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.SAMPLE_CLOCK_OFFSET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sounding_sequence_length(self, channel_string):
r"""Gets sounding sequence length, in bits. This property is applicable only when you set the CS SYNC Sequence
to Sounding Sequence. The default value is 32. Valid values are 32 and 96.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies sounding sequence length, in bits. This property is applicable only when you set the CS SYNC Sequence
to Sounding Sequence. The default value is 32. Valid values are 32 and 96.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.SOUNDING_SEQUENCE_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sounding_sequence_length(self, channel_string, value):
r"""Sets sounding sequence length, in bits. This property is applicable only when you set the CS SYNC Sequence
to Sounding Sequence. The default value is 32. Valid values are 32 and 96.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies sounding sequence length, in bits. This property is applicable only when you set the CS SYNC Sequence
to Sounding Sequence. The default value is 32. Valid values are 32 and 96.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.SOUNDING_SEQUENCE_LENGTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sounding_sequence_marker_positions(self, channel_string):
r"""Gets an array of sounding sequence marker positions at which sounding sequence marker signals are inserted.
This property is applicable only when you set the CS SYNC Sequence to Sounding Sequence. When sounding sequence
length property is set to 32, only the first element from the sounding sequence marker positions array is
considered, and remaining elements are discarded. Valid values are from 0 to 28. When sounding sequence length
property is set to 96, up to the first two elements from sounding sequence marker positions array are considered
and remaining elements are discarded. Valid values for array index 0 are from 0 to 63 and for array index 1 are
from 67 to 92. The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies an array of sounding sequence marker positions at which sounding sequence marker signals are inserted.
This property is applicable only when you set the CS SYNC Sequence to Sounding Sequence. When sounding sequence
length property is set to 32, only the first element from the sounding sequence marker positions array is
considered, and remaining elements are discarded. Valid values are from 0 to 28. When sounding sequence length
property is set to 96, up to the first two elements from sounding sequence marker positions array are considered
and remaining elements are discarded. Valid values for array index 0 are from 0 to 63 and for array index 1 are
from 67 to 92. The default value is 0.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.SOUNDING_SEQUENCE_MARKER_POSITIONS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sounding_sequence_marker_positions(self, channel_string, value):
r"""Sets an array of sounding sequence marker positions at which sounding sequence marker signals are inserted.
This property is applicable only when you set the CS SYNC Sequence to Sounding Sequence. When sounding sequence
length property is set to 32, only the first element from the sounding sequence marker positions array is
considered, and remaining elements are discarded. Valid values are from 0 to 28. When sounding sequence length
property is set to 96, up to the first two elements from sounding sequence marker positions array are considered
and remaining elements are discarded. Valid values for array index 0 are from 0 to 63 and for array index 1 are
from 67 to 92. The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies an array of sounding sequence marker positions at which sounding sequence marker signals are inserted.
This property is applicable only when you set the CS SYNC Sequence to Sounding Sequence. When sounding sequence
length property is set to 32, only the first element from the sounding sequence marker positions array is
considered, and remaining elements are discarded. Valid values are from 0 to 28. When sounding sequence length
property is set to 96, up to the first two elements from sounding sequence marker positions array are considered
and remaining elements are discarded. Valid values for array index 0 are from 0 to 63 and for array index 1 are
from 67 to 92. The default value is 0.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.SOUNDING_SEQUENCE_MARKER_POSITIONS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sounding_sequence_marker_signals(self, channel_string):
r"""Gets an array of sounding sequence marker signals. This property is applicable only when you set the CS
SYNC Sequence to Sounding Sequence. When sounding sequence length property is set to 32, only the first element
shall be inserted in the sounding sequence, and remaining elements shall be discarded. When sounding sequence
length property is set to 96, up to the first two elements shall be inserted in the sounding sequence, and
remaining elements shall be discarded. The default value is NIBTSG_VAL_SOUNDING_SEQUENCE_MARKER_SIGNALS_1100.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SoundingSequenceMarkerSignals):
Specifies an array of sounding sequence marker signals. This property is applicable only when you set the CS
SYNC Sequence to Sounding Sequence. When sounding sequence length property is set to 32, only the first element
shall be inserted in the sounding sequence, and remaining elements shall be discarded. When sounding sequence
length property is set to 96, up to the first two elements shall be inserted in the sounding sequence, and
remaining elements shall be discarded. The default value is NIBTSG_VAL_SOUNDING_SEQUENCE_MARKER_SIGNALS_1100.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.SOUNDING_SEQUENCE_MARKER_SIGNALS.value
)
attr_val = [enums.SoundingSequenceMarkerSignals(v) for v in attr_val]
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sounding_sequence_marker_signals(self, channel_string, value):
r"""Sets an array of sounding sequence marker signals. This property is applicable only when you set the CS
SYNC Sequence to Sounding Sequence. When sounding sequence length property is set to 32, only the first element
shall be inserted in the sounding sequence, and remaining elements shall be discarded. When sounding sequence
length property is set to 96, up to the first two elements shall be inserted in the sounding sequence, and
remaining elements shall be discarded. The default value is NIBTSG_VAL_SOUNDING_SEQUENCE_MARKER_SIGNALS_1100.
Args:
selector_string (string):
Pass an empty string.
value (enums.SoundingSequenceMarkerSignals, int):
Specifies an array of sounding sequence marker signals. This property is applicable only when you set the CS
SYNC Sequence to Sounding Sequence. When sounding sequence length property is set to 32, only the first element
shall be inserted in the sounding sequence, and remaining elements shall be discarded. When sounding sequence
length property is set to 96, up to the first two elements shall be inserted in the sounding sequence, and
remaining elements shall be discarded. The default value is NIBTSG_VAL_SOUNDING_SEQUENCE_MARKER_SIGNALS_1100.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = (
[v.value for v in value]
if (
isinstance(value, list)
and all(isinstance(v, enums.SoundingSequenceMarkerSignals) for v in value)
)
else value
)
error_code = self._interpreter.set_vector_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.SOUNDING_SEQUENCE_MARKER_SIGNALS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_time_delay(self, channel_string):
r"""Gets the time delay for CS packets This value is expressed in seconds.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the time delay for CS packets This value is expressed in seconds.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.TIME_DELAY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_time_delay(self, channel_string, value):
r"""Sets the time delay for CS packets This value is expressed in seconds.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the time delay for CS packets This value is expressed in seconds.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_f64( # type: ignore
channel_string, attributes.AttributeID.TIME_DELAY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_whitening_clock(self, channel_string):
r"""Gets the 28-bit master Bluetooth device clock. This attribute is applicable only to BR and EDR packets. The
BT Generation uses this attribute to initialize the linear feedback shift register used for calculating the
whitening word. The BT Generation uses bits 1 to 6 for this purpose. Refer to sections 1.1 and 7.2, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the Bluetooth device clock.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the 28-bit master Bluetooth device clock. This attribute is applicable only to BR and EDR packets. The
BT Generation uses this attribute to initialize the linear feedback shift register used for calculating the
whitening word. The BT Generation uses bits 1 to 6 for this purpose. Refer to sections 1.1 and 7.2, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the Bluetooth device clock.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.WHITENING_CLOCK.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_whitening_clock(self, channel_string, value):
r"""Sets the 28-bit master Bluetooth device clock. This attribute is applicable only to BR and EDR packets. The
BT Generation uses this attribute to initialize the linear feedback shift register used for calculating the
whitening word. The BT Generation uses bits 1 to 6 for this purpose. Refer to sections 1.1 and 7.2, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the Bluetooth device clock.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the 28-bit master Bluetooth device clock. This attribute is applicable only to BR and EDR packets. The
BT Generation uses this attribute to initialize the linear feedback shift register used for calculating the
whitening word. The BT Generation uses bits 1 to 6 for this purpose. Refer to sections 1.1 and 7.2, Part B,
Volume 2 of the Bluetooth Specification v2.1+EDR for more information about the Bluetooth device clock.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.WHITENING_CLOCK.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_whitening_enabled(self, channel_string):
r"""Gets whether to enable the whitening settings.
The default value is NIBTSG_VAL_FALSE.
If you set this attribute to NIBTSG_VAL_TRUE and the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PACKET_TYPE` attribute to any LE packets, you should set a
value for the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_FREQUENCY` attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.WhiteningEnabled):
Specifies whether to enable the whitening settings.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.WHITENING_ENABLED.value
)
attr_val = enums.WhiteningEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_whitening_enabled(self, channel_string, value):
r"""Sets whether to enable the whitening settings.
The default value is NIBTSG_VAL_FALSE.
If you set this attribute to NIBTSG_VAL_TRUE and the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.PACKET_TYPE` attribute to any LE packets, you should set a
value for the :py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.CARRIER_FREQUENCY` attribute.
Args:
selector_string (string):
Pass an empty string.
value (enums.WhiteningEnabled, int):
Specifies whether to enable the whitening settings.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
value = value.value if type(value) is enums.WhiteningEnabled else value
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.WHITENING_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_block_repetition_sequences(self, channel_string):
r"""
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attr_val, error_code = self._interpreter.get_scalar_attribute_i32( # type: ignore
channel_string, attributes.AttributeID.NUMBER_OF_BLOCK_REPETITION_SEQUENCES.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_block_repetition_sequences(self, channel_string, value):
r"""
Args:
selector_string (string):
Pass an empty string.
value (int):
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_scalar_attribute_i32( # type: ignore
channel_string,
attributes.AttributeID.NUMBER_OF_BLOCK_REPETITION_SEQUENCES.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def rfsg_store_iq_rate(self, rfsg_session, channel_string, waveform_name, iq_rate):
r"""Stores the I/Q rate, which you specify in the **iq_rate** parameter, in the RFSG database.
Args:
rfsg_session (object):
Identifies the instrument session. You can obtain this parameter from the niRFSG_init function or the
niRFSG_InitWithOptions function.
channel_string (string):
Set this parameter to "" (empty string) or NULL.
waveform_name (string):
Specifies the name of the waveform for which you want to store the I/Q rate. The BT Generation uses the
**waveform_name** parameter as the key to store the waveform attributes in the RFSG database.
iq_rate (float):
Specifies the I/Q rate to store in the RFSG database.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
rfsg_session_handle = _helper.get_session_handle(rfsg_session)
error_code = self._interpreter.rfsg_store_iq_rate( # type: ignore
rfsg_session_handle, channel_string, waveform_name, iq_rate
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def rfsg_clear_database(self, rfsg_session, channel_string, waveform_name):
r"""Clears the attributes stored in the RFSG database and clears the waveforms from the NI RF vector signal
generator memory.
This function clears the waveform and attributes of the waveform that you specify in the **waveform_name**
parameter. If you set the **waveform_name** parameter to an empty string, this function clears all the waveforms
and their attributes.
Args:
rfsg_session (object):
Identifies the instrument session. You can obtain this parameter from the niRFSG_init function or the
niRFSG_InitWithOptions function.
channel_string (string):
Set this parameter to "" (empty string) or NULL.
waveform_name (string):
Specifies the name of the waveform to clear. If you set this parameter as empty, the function clears all the
waveforms and their attributes.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
rfsg_session_handle = _helper.get_session_handle(rfsg_session)
error_code = self._interpreter.rfsg_clear_database( # type: ignore
rfsg_session_handle, channel_string, waveform_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def rfsg_store_headroom(self, rfsg_session, channel_string, waveform_name, headroom):
r"""Stores the headroom, which you specify in the **headroom** parameter, in the RFSG database.
Args:
rfsg_session (object):
Identifies the instrument session. You can obtain this parameter from the niRFSG_init function or the
niRFSG_InitWithOptions function.
channel_string (string):
Set this parameter to "" (empty string) or NULL.
waveform_name (string):
Specifies the name of the waveform for which you want to store the headroom. The BT Generation uses the
**waveform_name** parameter as the key to store the waveform attributes in the RFSG database.
headroom (float):
Specifies the headroom to store in the RFSG database. This value is expressed in dB.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
rfsg_session_handle = _helper.get_session_handle(rfsg_session)
error_code = self._interpreter.rfsg_store_headroom( # type: ignore
rfsg_session_handle, channel_string, waveform_name, headroom
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def channel_number_to_carrier_frequency(self, channel_number, standard):
r"""Computes the carrier frequency of the Bluetooth signal to generate based on the value that you specify in the
**channel_number** parameter. The BT Generation computes the center frequency according to section 2, Part A,
Volume 2 of the *Bluetooth Specification Version 4.2*.
The Bluetooth system operates in the 2.4 GHz ISM band. This frequency band is 2,400 MHz to 2,483.5 MHz. RF
channels are spaced 1 MHz apart and are ordered in channel number *k* according to the following formula: *f* =
2,402 + *k* MHz, where *k* = 0, 1, ..., 78 for Basic Rate/Enhanced Data Rate packets and *f* = 2,402 + (2 \*
*k*) MHz, where *k* = 0, 1, ..., 39 for a Low Energy packet, and *f* is the frequency of the RF channels.
Args:
channel_number (int):
Specifies the channel number.
standard (int):
Specifies the standard. The default value is NIBTSG_STANDARD_BASIC_OR_EDR.
+---------------------------------+------------------------------------------------------------------------+
| NIBTSG_STANDARD_BASIC_OR_EDR(0) | Specifies that the standard is basic rate or enhanced data rate (EDR). |
+---------------------------------+------------------------------------------------------------------------+
| NIBTSG_STANDARD_LE(1) | Specifies that the standard is low energy (LE). |
+---------------------------------+------------------------------------------------------------------------+
Returns:
Tuple (carrier_frequency, error_code):
carrier_frequency (float):
Returns the RF frequency (*f*) corresponding to the channel number *k*, where *f* = 2,402 + *k* MHz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
carrier_frequency, error_code = self._interpreter.channel_number_to_carrier_frequency( # type: ignore
channel_number, standard
)
finally:
self._session_function_lock.exit_read_lock()
return carrier_frequency, error_code
[docs]
@_raise_if_disposed
def load_configuration_from_file(self, file_path, reset):
r"""Reads values of session attributes (configuration) saved in a file and sets these values to the corresponding
attributes on the session, thus restoring the state of the BT Generation to the original state when the file was
saved.
Args:
file_path (string):
Specifies the absolute path to the file from which the BT Generation loads the configuration.
reset (bool):
Specifies whether BT Generation must reset all the attributes of the session to their default values before
setting the new values specified in the file. The default value is NIBTSG_VAL_TRUE.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.load_configuration_from_file( # type: ignore
file_path, int(reset)
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def reset_session(self):
r"""Resets all the attributes of the session to their default values.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.reset_session() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def save_configuration_to_file(self, file_path, operation):
r"""Saves attributes of the session, which you may have modified after opening the session, to a file located at the
specified path.
You can use this function to save the current state of the BT Generation session to a file. You can later load
the saved configuration using the :py:meth:`load_configuration_from_file` function.
Args:
file_path (string):
Specifies the absolute path to the TDMS file to which the BT Generation saves the configuration.
operation (int):
Specifies the operation to perform on the file. The default value is NIBTSG_FILE_OPERATION_MODE_CREATEORREPLACE.
+-----------------------------------------------+--------------------------------------------------------------------------+
| NIBTSG_FILE_OPERATION_MODE_OPEN(0) | Opens an existing file to write the niBT SG session attribute values. |
+-----------------------------------------------+--------------------------------------------------------------------------+
| NIBTSG_FILE_OPERATION_MODE_OPENORCREATE(1) | Opens an existing file or creates a new file if the file does not exist. |
+-----------------------------------------------+--------------------------------------------------------------------------+
| NIBTSG_FILE_OPERATION_MODE_CREATEORREPLACE(2) | Creates a new file or replaces an existing file. |
+-----------------------------------------------+--------------------------------------------------------------------------+
| NIBTSG_FILE_OPERATION_MODE_CREATE(3) | Creates a new file. |
+-----------------------------------------------+--------------------------------------------------------------------------+
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.save_configuration_to_file( # type: ignore
file_path, operation
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def set_antenna_relative_phase_and_amplitude(
self, channel_string, relative_amplitude_db, relative_phase_deg
):
r"""Sets the Relative Phase and Relative Amplitude values for the non reference antennas An (1\<n\<=256) relative to
the reference antenna A0 when you set the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_ENABLED` attribute to
NIBTSG_VAL_TRUE. The reference period and sampling slots in the constant tone extension (CTE) field are
modulated in amplitude and phase as specified in the
:py:attr:`~nirfmxbluetoothgen.attributes.AttributeID.DIRECTION_FINDING_ANTENNA_SWITCHING_PATTERN` attribute.
Args:
channel_string (string):
Specifies the RFSG device channel. Set this parameter to "" (empty string) or NULL.
relative_amplitude_db (float):
Specifies the array of amplitudes of each non-reference antenna An (1\<n\<=256) relative to the reference
antenna A0. The first element of the array corresponds to the amplitude of antenna A1, the second element of the
array corresponds to amplitude of antenna A2, and so on.
relative_phase_deg (float):
Specifies the array of phases of each non-reference antenna An (1\<n\<=256) relative to the reference antenna
A0. The first element of the array corresponds to the phase of antenna A1, the second element of the array
corresponds to phase of antenna A2, and so on.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
error_code = self._interpreter.set_antenna_relative_phase_and_amplitude( # type: ignore
channel_string, relative_amplitude_db, relative_phase_deg
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def reset_attribute(self, channel_string, attribute_id):
r"""Resets the attribute specified in the **attribute_id** parameter to its default value. You can reset only a
writable attribute using this function.
Args:
channel_string (string):
Set this parameter to "" (empty string) or NULL.
attribute_id (enums.AttributeID, int):
Specifies the ID of the niBT SG attribute that you want to reset.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
attribute_id = (
attribute_id.value if type(attribute_id) is attributes.AttributeID else attribute_id
)
error_code = self._interpreter.reset_attribute( # type: ignore
channel_string, attribute_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def carrier_frequency_to_channel_number(self, carrier_frequency, standard):
r"""Computes the channel number of the Bluetooth signal based on the carrier frequency you specify in the
**carrier_frequency** parameter. The BT Generation computes the channel number according to section 2, Part A,
Volume 2 of the *Bluetooth Specification Version 4.2*.
Args:
carrier_frequency (float):
Specifies the carrier frequency, in Hz, for which you want to compute the channel number.
standard (int):
Specifies the standard. The default value is NIBTSG_STANDARD_BASIC_OR_EDR.
+---------------------------------+------------------------------------------------------------------------+
| NIBTSG_STANDARD_BASIC_OR_EDR(0) | Specifies that the standard is basic rate or enhanced data rate (EDR). |
+---------------------------------+------------------------------------------------------------------------+
| NIBTSG_STANDARD_LE(1) | Specifies that the standard is low energy (LE). |
+---------------------------------+------------------------------------------------------------------------+
Returns:
Tuple (channel_number, error_code):
channel_number (int):
Returns the channel number corresponding to the specified carrier frequency.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
channel_number, error_code = self._interpreter.carrier_frequency_to_channel_number( # type: ignore
carrier_frequency, standard
)
finally:
self._session_function_lock.exit_read_lock()
return channel_number, error_code
[docs]
@_raise_if_disposed
def rfsg_retrieve_headroom(self, rfsg_session, channel_string, waveform_name):
r"""Returns the headroom stored in the RFSG database. This value is expressed in dB. The function uses the waveform
name as the key to retrieve the waveform attributes.
---- **Note**
----
Args:
rfsg_session (object):
Identifies the instrument session. You can obtain this parameter from the niRFSG_init function or the
niRFSG_InitWithOptions function.
channel_string (string):
Set this parameter to "" (empty string) or NULL.
waveform_name (string):
Specifies the name of the waveform for which you want to retrieve the headroom.
Returns:
Tuple (headroom, error_code):
headroom (float):
Returns the headroom stored in the RFSG database for the waveform that you specify in the **waveform_name**
parameter. This value is expressed in dB.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
rfsg_session_handle = _helper.get_session_handle(rfsg_session)
headroom, error_code = self._interpreter.rfsg_retrieve_headroom( # type: ignore
rfsg_session_handle, channel_string, waveform_name
)
finally:
self._session_function_lock.exit_read_lock()
return headroom, error_code
[docs]
@_raise_if_disposed
def rfsg_retrieve_iq_rate(self, rfsg_session, channel_string, waveform_name):
r"""Returns the I/Q rate stored in the RFSG database. The function uses the waveform name as the key to retrieve the
waveform attributes.
---- **Note**
----
Args:
rfsg_session (object):
Identifies the instrument session. You can obtain this parameter from the niRFSG_init function or the
niRFSG_InitWithOptions function.
channel_string (string):
Set this parameter to "" (empty string) or NULL.
waveform_name (string):
Specifies the name of the waveform for which you want to retrieve the I/Q rate. The BT Generation uses the
**waveform_name** parameter as the key to retrieve the waveform attributes from the RFSG database.
Returns:
Tuple (iq_rate, error_code):
iq_rate (float):
Returns the I/Q rate stored in the RFSG database for the waveform that you specify in the **waveform_name**
parameter.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
rfsg_session_handle = _helper.get_session_handle(rfsg_session)
iq_rate, error_code = self._interpreter.rfsg_retrieve_iq_rate( # type: ignore
rfsg_session_handle, channel_string, waveform_name
)
finally:
self._session_function_lock.exit_read_lock()
return iq_rate, error_code