BBox 8x8 Duo
- class tlkcore.tmydev.DevBBoxDuo.BBoxDuo(*parent)
Bases:
DeviceBBox 8x8 Duo class
- getSysStatus()
Get the system status.
- Returns:
RetDataDUT_SYSTEM_STATE: The system status, which can be one of the following:
- Return type:
Example
>>> sys_status = service.getSysStatus(sn)
Changed in version v2.5.0rc1: Change function return type to
DUT_SYSTEM_STATEenum 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:
RetCodeOKif successful.ERROR_UD_FREQif frequency is out of range.ERRORfor other errors.
- Return type:
Example
>>> service.setLoFreq(sn, lo_freq = 22000000)
- getLoFreq()
Get the local oscillator frequency in kHz.
- Returns:
- Return type:
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:
- Return type:
Example
>>> lo_status = service.getLoStatus(sn)
Changed in version v2.5.0rc1: Change function return type to
UD_PLOenum 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:
RetCodeOK: If successful.ERROR_UD_FREQ: If frequency is out of range.ERROR: If there is an error during the operation.
- Return type:
Example
>>> service.setRFFreq(sn, rf_freq = 28000000)
- getRFFreq()
Get the RF frequency.
- Returns:
- Return type:
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:
RetCodeOK: If successful.ERROR_INVALID_PARAMETER: If source value is invalid.ERROR: For other errors.
- Return type:
Example
>>> service.setRefSource(sn, source = 0)
- getRefSource()
Get the reference source.
- Returns:
- Return type:
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:
RetCodeOK: If successful.ERROR_INVALID_PARAMETER: If RF mode value is invalid.ERROR: For other errors.
- Return type:
Example
>>> service.setRFMode(sn, CellRFMode.TX)
- getRFMode()
Get the RF mode.
- Returns:
RetCodeOK: If successful.ERROR_BF_STATE: If RF mode value from device is invalid.ERROR: If there is an error in retrieving the RF mode.
RetDataCellRFMode: The current RF mode, which can be one of the following:
- Return type:
Example
>>> rf_mode = service.getRFMode(sn)
Changed in version v2.5.0rc1: Change function return type to
CellRFModeenum for better clarity.
- 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:
RetCodeOK: If successful.ERROR_INVALID_PARAMETER: If RF mode or gain value is invalid.ERROR: If there is an error in setting the UD gain.
- Return type:
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:
- Return type:
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
AzElAngleorThetaPhiAnglegain_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:
RetCodeOK: 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:
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
BFICConfigdataclass, a dict.- Returns:
RetCodeOK: If successful.ERROR_INVALID_PARAMETER: If config format is invalid.ERROR: If there is an error in setting the BFIC config.
- Return type:
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:
RetCodeOK: If successful.ERROR_INVALID_PARAMETER: If polar or rf_mode value is invalid.ERROR: If there is an error in setting all BFIC beams enable.
- Return type:
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:
RetCodeOK: If successful.ERROR: If estimated fails or response format is unexpected.ERROR_INVALID_PARAMETER: If polarization value is invalid.ERROR_BF_STATE: If RF mode is not in TX mode.ERROR_UD_FREQ: If failed to get LO frequency for bandwidth determination.
RetDatafloat: The estimated EIRP value in dBm if the operation is successful.
- Return type:
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.
- checkFWVersion(min_version: VER, msg: str = '') RetType
Check if the current firmware version is greater than or equal to the minimum required version.
- 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.
- getDFUSupport()
Check if the device supports Device Firmware Upgrade (DFU).
- getDevTypeName()
Retrieve current name of device.
- Returns:
Name of device
Examples
>>> service.getDevTypeName(sn) 'RIS'
- 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.
OK: If the DFU process completes successfully.ERROR_METHOD_NOT_SUPPORT: If DFU is not supported on the device.ERROR_DFU: If the DFU process encounters an error.
- Return type:
- queryFWVer()
Query FW version of the device.
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:
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.
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.
- 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:
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.
- queryStaticIP()
Query the static IP address of the device.
- Parameters:
sn (str) – The serial number of the device.
- Returns:
RetDatastr: Static IP of the device.
- Return type:
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.
- 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:
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.