BBox 8x8 Duo

class tlkcore.tmydev.DevBBoxDuo.BBoxDuo(*parent)

Bases: Device, FastBeamController

BBox 8x8 Duo class

getSysStatus()

Get the system status.

Returns:

RetData
  • DUT_SYSTEM_STATE: The system status, which can be one of the following:
    • NORMAL: If the system is operating normally.

    • SYS_ERROR: If the system is in an error state.

Return type:

RetType

Example

>>> sys_status = service.getSysStatus(sn)

Changed in version v2.5.0rc1: Change function return type to DUT_SYSTEM_STATE enum for better clarity.

setLoFreq(lo_freq: int = 21000000)

Set the lofrequency in kHz.

Parameters:

lo_freq (int) – Frequency value to set. (range: 18 GHz to 24 GHz, i.e. 18000000 to 24000000 kHz)

Returns:

RetCode

Return type:

RetType

Example

>>> service.setLoFreq(sn, lo_freq = 22000000)
getLoFreq()

Get the local oscillator frequency in kHz.

Returns:

RetCode
  • OK: If successful.

  • ERROR: If there is an error during the operation.

RetData
  • int: The local oscillator frequency in kHz if the operation is successful.

Return type:

RetType

Example

>>> lo_freq = service.getLoFreq(sn).RetData
>>> print("LO freq: %s kHz" % lo_freq)
>>> LO freq: 22000000 kHz
getLoStatus()

Get the local oscillator status.

Returns:

RetCode
  • OK: If successful.

  • ERROR: If there is an error during the operation or if the response format is unexpected.

RetData
  • UD_PLO: The local oscillator status, which can be one of the following:
    • LOCK: If the local oscillator is locked.

    • UNLOCK: If the local oscillator is unlocked.

Return type:

RetType

Example

>>> lo_status = service.getLoStatus(sn)

Changed in version v2.5.0rc1: Change function return type to UD_PLO enum for better clarity.

setRFFreq(rf_freq: int = 28000000)

Set the RF frequency.

Parameters:

rf_freq (int) – Frequency value to set. (range: 26 GHz to 29 GHz, i.e. 26000000 to 29000000 kHz, default: 28000000 kHz)

Returns:

RetCode
  • OK: If successful.

  • ERROR_UD_FREQ: If frequency is out of range.

  • ERROR: If there is an error during the operation.

Return type:

RetType

Example

>>> service.setRFFreq(sn, rf_freq = 28000000)
getRFFreq()

Get the RF frequency.

Returns:

RetCode
  • OK: If successful.

  • ERROR: If there is an error during the operation.

RetData
  • int: The RF frequency in kHz if the operation is successful.

Return type:

RetType

Example

>>> rf_freq = service.getRFFreq(sn).RetData
>>> print("RF freq: %s kHz" % rf_freq)
>>> RF freq: 28000000 kHz
setRefSource(source: int = 0)

Set the reference source.

Parameters:

source (int) – Reference source to set. (0: INTERNAL, 1: EXTERNAL_10M, default: INTERNAL)

Returns:

RetCode

Return type:

RetType

Example

>>> service.setRefSource(sn, source = 0)
getRefSource()

Get the reference source.

Returns:

RetCode
  • OK: If successful.

  • ERROR: If there is an error during the operation.

RetData
  • dict: The reference source information if the operation is successful, with following keys:
    • ”source”: Reference source, either “INTERNAL” or “EXTERNAL_10M”.

    • ”status”: Reference lock status, either “REF_LOCKED” or “REF_UNLOCKED”.

Return type:

RetType

Example

>>> ref_source = service.getRefSource(sn)
>>> print("Reference source: %s" % ref_source.RetData)
{
    "source": "INTERNAL",
    "status": "REF_LOCKED"
}
setRFMode(rf_mode: int)

Set the RF mode.

Parameters:

rf_mode (int) – RF mode to set. (-1: Standby mode, 0: TX mode, 1: RX mode)

Returns:

RetCode

Return type:

RetType

Example

>>> service.setRFMode(sn, CellRFMode.TX)
getRFMode()

Get the RF mode.

Returns:

RetCode
  • OK: If successful.

  • ERROR_BF_STATE: If RF mode value from device is invalid.

  • ERROR: If there is an error in retrieving the RF mode.

RetData
  • CellRFMode: The current RF mode, which can be one of the following:
    • TX: If the device is in TX mode.

    • RX: If the device is in RX mode.

    • STANDBY: If the device is in Standby mode.

Return type:

RetType

Example

>>> rf_mode = service.getRFMode(sn)

Changed in version v2.5.0rc1: Change function return type to CellRFMode enum for better clarity.

getUdRange() RetType

Get the RF/IF/LO range.

Returns:

RetCode
  • OK: If successful.

  • ERROR: If there is an error in retrieving the range.

RetData
  • dict: The RF/IF/LO range information, with the following keys:
    • ”RF”: Tuple of (min RF frequency in kHz, max RF frequency in kHz).

    • ”IF”: Tuple of (min IF frequency in kHz, max IF frequency in kHz).

    • ”LO”: Tuple of (min LO frequency in kHz, max LO frequency in kHz).

Return type:

RetType

setUdGain(polar: POLARIZATION_TYPE | int, rf_mode: CellRFMode | int, gain_db: float)

Set the gain in dB for specified RF mode.

Parameters:
  • polar (Union[POL, int]) – Polarization state to set. (Accept: 0 or 1, where 0: POL.POL_1 and 1: POL.POL_2)

  • rf_mode (Union[CellRFMode, int]) – RF mode to set gain for. (Accept: 0 or 1, where 0: CellRFMode.TX and 1: CellRFMode.RX)

  • gain_db (float) – Gain value to set in dB. (Range: 0-30 dB)

Returns:

RetCode

Return type:

RetType

Example

>>> service.setUdGain(sn, polar = POL.POL_1, rf_mode = CellRFMode.TX, gain_db = 20)
>>> service.setUdGain(sn, polar = POL.POL_1, rf_mode = CellRFMode.RX, gain_db = 20)
checkHarmonic(lo_freq: int, if_freq: int, bandwidth: int)

Check the harmonic.

Parameters:
  • lo_freq (int) – LO frequency in kHz.

  • if_freq (int) – IF frequency in kHz.

  • bandwidth (int) – Bandwidth in kHz.

Returns:

RetCode
  • OK: If successful.

  • WARNING: If there is a harmonic warning.

  • ERROR: If there is an error in checking the harmonic.

RetData
  • bool: True if harmonic warning, False if no harmonic issue.

Return type:

RetType

Example

>>> harmonic = service.checkHarmonic(sn, lo_freq = 22000000, if_freq = 6000000, bandwidth = 2000000)
>>> print("Harmonic: %s" % harmonic.RetData)
>>> Harmonic: True
setBeamAngle(polar: POLARIZATION_TYPE | int, rf_mode: CellRFMode | int, angle: AzElAngle | ThetaPhiAngle, gain_db: float = 0.0)

Set the beam using angle.

For single-polarization types (POL_1, POL_2), sends one SETBEAM command. For synthesis polarization types (POL_H, POL_V, POL_RC, POL_LC), sends two SETBEAM commands — one for POL_1 (offset=0) and one for POL_2 (offset=0/180 for H/V, offset=90/270 for RC/LC).

Parameters:
  • polar (Union[POL, int]) – Polarization state to set. (Range: 0: POL_1, 1: POL_2, 2: POL_H, 3: POL_V, 4: POL_RC, 5: POL_LC)

  • rf_mode (Union[CellRFMode, int]) – RF mode to set. (Accept: 0 or 1, where 0: CellRFMode.TX and 1: CellRFMode.RX)

  • angle (Union[AzElAngle, ThetaPhiAngle]) – Angle to set, can be either AzElAngle or ThetaPhiAngle

  • gain_db (float) – Gain = UD gain + BF total gain (com + ele) in dB. The service will automatically split the gain between UD and BF based on the maximum gain capability of UD. (range: 0-40 dB with spec allowance)

Returns:

RetCode
  • OK: If successful.

  • ERROR_INVALID_PARAMETER: If any of the input parameters is invalid (e.g. invalid angle type, invalid polarization or RF mode value, gain_db out of range).

  • ERROR: If there is an error in setting the beam angle.

Return type:

RetType

Example

>>> service.setBeamAngle(sn, polar=POL.POL_1, rf_mode=CellRFMode.TX, angle=AzElAngle(azimuth=45.0, elevation=30.0), gain_db=10)
>>> service.setBeamAngle(sn, polar=POL.POL_H,  rf_mode=CellRFMode.TX, angle=ThetaPhiAngle(theta=30, phi=60), gain_db=10)
setBficConfig(config: BFICConfig | dict)

Set the BFIC config.

Parameters:

config (Union[BFICConfig, dict]) – BFIC config to set. Can be a BFICConfig dataclass, a dict.

Returns:

RetCode

Return type:

RetType

Example

>>> bfic_config = {
        "tx": {
            "pol_1": {
                "1": {
                    "enable": [1, 1, 1, 1],
                    "com_gain_db": 5,
                    "ele_gain_db": [1, 2, 3, 4],
                    "phase_deg": [1, 10, 40, 63]
                },
                "2": {
                    "enable": [1, 1, 1, 1],
                    "com_gain_db": 5,
                    "ele_gain_db": [1, 2, 3, 4],
                    "phase_deg": [1, 10, 40, 63]
                }
            },
            "pol_2": {
                "3": {
                    "enable": [1, 1, 1, 1],
                    "com_gain_db": 5,
                    "ele_gain_db": [1, 2, 3, 4],
                    "phase_deg": [1, 10, 40, 63]
                },
                "4": {
                    "enable": [1, 1, 1, 1],
                    "com_gain_db": 5,
                    "ele_gain_db": [1, 2, 3, 4],
                    "phase_deg": [1, 10, 40, 63]
                }
            }
        }
    }
>>> service.setBficConfig(sn, config = bfic_config)
setAllBficEnable(polar: POLARIZATION_TYPE | int, rf_mode: CellRFMode | int, enable: bool)

Set all BFIC beams enable or disable.

Parameters:
  • polar (Union[POL, int]) – Polarization to set. (0: POL_1, 1: POL_2)

  • rf_mode (Union[CellRFMode, int]) – RF mode to set. (0: TX, 1: RX)

  • enable (bool) – True to enable all BFIC beams, False to disable all BFIC beams.

Returns:

RetCode

Return type:

RetType

Example

>>> service.setAllBficEnable(sn, polar = POL.POL_1, rf_mode = CellRFMode.TX, enable = True)
estimateEIRP(polar: POLARIZATION_TYPE | int)

Estimate the EIRP based on gain and bandwidth.

Parameters:

polar (Union[POL, int]) – Polarization to estimate EIRP for. (0: POL_1, 1: POL_2)

Returns:

RetCode
RetData
  • float: The estimated EIRP value in dBm if the operation is successful.

Return type:

RetType

Example

>>> eirp_estimation = service.estimateEIRP(sn, polar = POL.POL_1)
>>> print("Estimated EIRP: %s dBm" % eirp_estimation.RetData)
>>> Estimated EIRP: 45.0 dBm

Added in version v2.4.9: Adding function to estimate EIRP based on gain and bandwidth.

getFastBeamGain(rf_mode: RFMode | int, beam_id: int) RetType

Get the fast beam gain in memory.

Parameters:
  • rf_mode – The RF mode for which to get the fast beam gain.

  • beam_id – The ID of the fast beam for which to get the gain.

Returns:

RetCode

Return type:

RetType

Example

>>> ret = service.getFastBeamGain(rf_mode=RFMode.TX, beam_id=0)
getFastBeamPattern(beam_id: int) RetType

Get the fast beam pattern in memory.

Parameters:

beam_id – The ID of the fast beam for which to get the pattern. (range: 0 to 511)

Returns:

RetCode

Return type:

RetType

Example

>>> ret = service.getFastBeamPattern(beam_id=0)
setFastBeamGain(rf_mode: RFMode, beam_id: int, enable: bool, com_gain: int = 0, ele_gain: int = 0) RetType

Set the fast beam gain in memory.

Parameters:
  • rf_mode – The RF mode for which to set the fast beam gain.

  • beam_id – The ID of the fast beam for which to set the gain. (range: 0 to 511)

  • enable – Whether to enable the fast beam.

  • com_gain – The common gain in dB. Defaults to 0. (range: 0 to 5)

  • ele_gain – The elevation gain in dB. Defaults to 0. (range: 0 to 5)

Returns:

RetCode

Return type:

RetType

Example

>>> ret = service.setFastBeamGain(rf_mode=RFMode.TX, beam_id=0, enable=True, com_gain=1, ele_gain=2)

Note

Need to syncFastBeamConfig() to sync all the changes to the device after setting the fast beam pattern in memory.

setFastBeamPatternThetaPhi(beam_id: int, rf_freq: float, theta: float, phi: float) RetType

Set the fast beam pattern in memory.

Parameters:
  • beam_id – The ID of the fast beam for which to set the pattern. (range: 0 to 511)

  • rf_freq – The RF frequency in kHz.

  • theta – The theta angle in degrees.

  • phi – The phi angle in degrees.

Returns:

RetCode

Return type:

RetType

Example

>>> ret = service.setFastBeamPatternThetaPhi(beam_id=0, rf_freq=28000000, theta=10, phi=20)

Note

Need to syncFastBeamConfig() to sync all the changes to the device after setting the fast beam pattern in memory.

setFastBeamPatternAzEl(beam_id: int, rf_freq: float, azimuth: float, elevation: float) RetType

Set the fast beam pattern in memory.

Parameters:
  • beam_id – The ID of the fast beam for which to set the pattern. (range: 0 to 511)

  • rf_freq – The RF frequency in kHz.

  • azimuth – The azimuth angle in degrees.

  • elevation – The elevation angle in degrees.

Returns:

RetCode

Return type:

RetType

Example

>>> ret = service.setFastBeamPatternAzEl(beam_id=0, rf_freq=28000000, azimuth=10, elevation=20)

Note

Need to syncFastBeamConfig() to sync all the changes to the device after setting the fast beam pattern in memory.

property beam_pattern_mgr: BeamPatternManager

Lazily create the device-specific BeamPatternManager on first use.

BeamPatternManager pre-allocates a beam instance per (mode, beam_id), which is memory-heavy and only needed by users who actually call FastBeamController methods, so it must not be created eagerly in __init__.

checkFPGAVersion(min_version: VER, msg: str = '') RetType

Check if the current FPGA version is greater than or equal to the minimum required version.

Parameters:

min_version (VER) – The minimum required FPGA version.

Returns:

RetData
  • bool: True if the current FPGA version is sufficient, False otherwise.

Return type:

RetType

checkFWVersion(min_version: VER, msg: str = '') RetType

Check if the current firmware version is greater than or equal to the minimum required version.

Parameters:

min_version (VER) – The minimum required firmware version.

Returns:

RetData
  • bool: True if the current firmware version is sufficient, False otherwise.

Return type:

RetType

checkHWVersion(versions: List[VER], msg: str = '', check_version: VER = None) RetType

Check if the current hardware version is greater than or equal to the minimum required version.

Parameters:

version (VER) – The minimum required hardware version.

Returns:

RetData
  • bool: True if the current hardware version is sufficient, False otherwise.

Return type:

RetType

eraseFastBeamConfig() RetType

Erase the fast beam configuration.

external_control_enabled: bool = False
getDFUSupport()

Check if the device supports Device Firmware Upgrade (DFU).

Returns:

RetData
  • bool: True if DFU is supported, False otherwise.

Return type:

RetType

getDevTypeName()

Retrieve current name of device.

Returns:

Name of device

Examples

>>> service.getDevTypeName(sn)
'BBoxDuo'
getFastParallelMode() RetType

Get the fast parallel mode.

processDFU(file_path: str, dfu_dev_info: dict)

Process the Device Firmware Upgrade (DFU) at the local side.

Parameters:
  • file_path (str) – The file path to the firmware file to be uploaded.

  • dfu_dev_info (dict) –

    Information about the DFU device.

    • sn (str): Serial number of the device.

    • address (str): Address of the device.

    • devtype (int): Device type as defined in TMYDevType.

    • in_dfu (bool): Indicates if the device is already in DFU mode.

    • fw_ver (str): Firmware version of the device.

    • hw_ver (str): Hardware version of the device.

Returns:

An object containing the result of the DFU process.

Return type:

RetType

queryFWVer()

Query FW version of the device.

Returns:

RetData
  • str: FW version.

Return type:

RetType

Examples

>>> fw_version = service.queryFWVer(sn).RetData
>>> print(f"FW Version: {fw_version}")
v1.0.0
queryFpgaVer()

Query the FPGA version of the device.

Returns:

An object containing the FPGA version of the device.
  • str: The FPGA version as a string.

Return type:

RetType

Examples

Query the FPGA version of the device
>>> fpga_version = service.queryFpgaVer(sn).RetData
>>> print(f"FPGA Version: {fpga_version}")
FPGA Version: v1.0.0

Note

Only support for BBox 8x8 Duo.

queryHWVer()

Query the hardware version of the device.

Returns:

RetData
  • str: The hardware version as a string.

Return type:

RetType

Examples

  • Query the hardware version of the device
    >>> hw_version = service.queryHWVer(sn).RetData
    >>> print(f"Hardware Version: {hw_version}")
    
queryLoaderVer()

Query the bootloader version of the device.

Returns:

RetData
  • str: The bootloader version as a string.

Return type:

RetType

queryMAC()

Query the MAC address of the device.

Returns:

An object containing the MAC address of the device.
  • str: The MAC address as a string.

Return type:

RetType

Examples

Query the MAC address of the device
>>> mac_address = service.queryMAC(sn).RetData
>>> print(f"MAC Address: {mac_address}")
MAC Address: 00:0C:FE:AA:BB:01
querySN()

Query the serial number of the device.

Returns:

RetData
  • str: The serial number of the device.

Return type:

RetType

queryStaticIP()

Query the static IP address of the device.

Parameters:

sn (str) – The serial number of the device.

Returns:

RetData
  • str: Static IP of the device.

Return type:

RetType

Note

Some FW versions of device not support this feature

Examples

Query the static IP address of a device:
>>> static_ip = service.queryStaticIP(sn).RetData
>>> print(f"Static IP Address: {static_ip}")
Static IP Address: 192.168.100.111
reboot()

Reboot of the device.

Returns:

An object containing the result of the reboot process.
  • OK: If the reboot process completes successfully.

Return type:

RetType

setFastParallelMode(toEnable: bool, fbs_mode: FBSMode = FBSMode.FULL_GAIN_PHASE) RetType

Set the fast parallel mode.

Parameters:
  • toEnable (bool) – Whether to enable or disable the fast parallel mode.

  • fbs_mode (FBSMode) – The fast beam steering mode to set. Defaults to FULL_GAIN_PHASE.

setStaticIP(ip, reboot=True)

Set the static IP address of the device, and reboot or not.

Note

Support LAN device only,

Parameters:
  • ip (str) – IP with x.x.x.x format

  • reboot (bool, optional) – reboot device after setting static IP. Defaults to True.

Note

Some FW versions of device not support this reboot feature.

Return type:

RetType

Examples

Set the static IP address of a device:
>>> service.setStaticIP(sn, "192.168.100.150", True)

Changed in version v2.4.7: for UD Box 0630, UD Box 5G, and BBox 8x8 Duo devices. Rebooting after an IP address change is now enabled by default.

syncFastBeamConfig() RetType

Sync the fast beam config to device.

Returns:

RetCode

Return type:

RetType

Example

>>> ret = service.syncFastBeamConfig()
setFastBeamConfig(data: dict) RetType

Set the fast beam config and sync it to the device.

Parameters:

data (dict) –

The fast beam config data.

  • phase beam ID range: 0~511

  • tx_gain beam ID range: 0~63

  • rx_gain beam ID range: 0~63

Returns:

RetCode

Return type:

RetType

Example

>>> # data = {
>>> #     "phase": {
>>> #         "0": {"rf_mhz": 28000, "theta": 10, "phi": 20},
>>> #         "1": {"rf_mhz": 27000, "az": 30, "el": -10},
>>> #     },
>>> #     "tx_gain": {"0": {"enable": 1, "com": 1, "ele": 2}, "1": {"enable": 0, "com": 4, "ele": 3}},
>>> #     "rx_gain": {"0": {"enable": 0, "com": 3, "ele": 4}, "1": {"enable": 1, "com": 2, "ele": 1}},
>>> # }
>>> ret = service.setFastBeamConfig(data)