Beamforming Series
BBoxOne (26/28/39GHz)
- class tlkcore.tmydev.DevBBoxOne.BBoxOne(*parent)
Bases:
BBox- checkCaliTableLocation()
Check if calibration table (*.csv) file exists
- deleteAAKitInfo(kitName, callback=None, check=True)
Delete customized AA-Kit csv file by AA-Kit name
- Parameters:
kitName (str) – The name of the AA-Kit to delete.
- Return type:
- exportDevLog(export_folder='.')
Dump device log and export to file
- getAAKitInfo(kitName=None, local=False)
Get AA-Kit information as dict format by AA-Kit name
- Parameters:
kitName (str, optional) – The name of the AA-Kit. Defaults to None and provides latest AA-Kit information after called
selectAAKit()- Returns:
RetData- dict: A dictionary with the following keys:
DEV_TYPE: TMYTEK device type
TYPE: AA-Kit type
SPACING: Antenna x,y spacing between elements
STEERING_H: Horizontal steering angles
STEERING_V: Vertical steering angles
OFFSET_TX: TX phase offset steps in list, includes all antenna channels. Or in dict which includes all antenna channels per polarization.
OFFSET_RX: RX phase offset steps in list, includes all antenna channels. Or in dict which includes all antenna channels per polarization.
- Return type:
Examples
- [BBoxOne] Get AA-Kit information after called
selectAAKit(): >>> service.selectAAKit(sn, "TMYTEK_28ONE_4x4_C2123E001-28") >>> service.getAAKitInfo(sn) { 'DEV_TYPE': 9, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- [BBoxOne] Get AA-Kit information after called
- [BBoxOne] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "TMYTEK_28ONE_4x4_C2123E001-28") { 'DEV_TYPE': 9, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- [BBoxLite] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "TMYTEK_28LITE_4x4_C2224L008-28") { 'DEV_TYPE': 12, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [0, 0], 'OFFSET_TX': [0, 5, 15, 10], 'OFFSET_RX': [0, 5, 15, 10] }
- [CloverCell] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "Clover2x2") { 'DEV_TYPE': 25, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-60.0, 60.0], 'STEERING_V': [-60.0, 60.0], 'OFFSET_TX': { 'HORIZON': [180, 0, 0, 180], 'VERTICAL': [0, 0, 180, 180] }, 'OFFSET_RX': { 'HORIZON': [180, 0, 0, 180], 'VERTICAL': [0, 0, 180, 180] } }
- getAAKitList(force_refresh=False, callback=None)
Get AA-Kit name string list from AAKIT_*.csv under file/
- Parameters:
force_refresh (bool, optional) – Whether to force refresh/refetch the list from files/. Defaults to False.
callback (func, optional) – A callback function to process the list. Defaults to None.
- Returns:
RetDatalist: The list of AA-Kit name
- Return type:
Examples
>>> aakit_list = service.getAAKitList(sn, True).RetData >>> print(aaKit_list) ["TMYTEK_28ONE_4x4_C2123E001-28", "TMYTEK_28ONE_4x4_C2144E015-28"]
- getBeamGainList(polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Get all channel gain settings with current mode which stored in TLKCore, and returns float list.
Note
Must called
setBeamAngle()before getting gain config for beam.Note
CloverCell series must assign polarization and it does not allow getting dual polarizations.
Todo
Directly fetch current settings from device.
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.- Returns:
- Return type:
- getBeamIdStorage()
Get the MAX number of beam id can storage for each RF mode.
- getBeamPattern(mode: RFMode | int, beamId)
Get beam pattern configuration by beamId from physical file(.json), default (if not set) is
CHANNELconfigNote
Beam id range is 1 ~ value of
getBeamIdStorage()- Parameters:
mode (Union[RFMode, int]) – The RF mode.
beamId (int) – The specific beam ID.
- Returns:
RetDatadict: The beam pattern configuration.
- Return type:
Examples
- Get beam id from BBoxOne if not set before
>>> pattern = service.getBeamPattern(RFMode.TX, 1).RetData >>> print(pattern)
execution result{ 'beam_description': '', 'beam_type': 1, 'channel_config': { 'board_1': { 'common_db': 10.0, 'channel_1': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 3.5, 'deg': 0}}, 'board_2': { 'common_db': 11.0, 'channel_1': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 1.0, 'deg': 0}}, 'board_3': { 'common_db': 10.0, 'channel_1': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 3.5, 'deg': 0}}, 'board_4': { 'common_db': 10.5, 'channel_1': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 2.5, 'deg': 0} } }
- getBeamPhaseList(polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Get all channel phase settings with current mode which stored in TLKCore, and returns int list.
Note
Must called
setBeamAngle()before getting phase config for beam.Note
CloverCell series must assign polarization and it does not allow getting dual polarizations.
Todo
Directly fetch current settings from device.
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.- Returns:
- Return type:
Examples
- BBoxOne
>>> service.getBeamPhaseList(sn).RetData [ [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0] ]
- getBoardCount()
Get total number of RF boards/ICs in device
Examples
- Get from BBoxOne
>>> count = service.getBoardCount(sn).RetData >>> print(count) 4
- Get from BBoxLite
>>> count = service.getBoardCount(sn).RetData >>> print(count) 1
- getCOMDR()
Get current common arm dynamic range (COMDR) gain information from calibration table.
Note
Must called
setOperatingFreq()before using calibration table.- Returns:
RetDatalist: Current COMDR values for both TX/RX RF mode.
The list structure:
BBox series[ [ [TX_Brd1_MIN, TX_Brd1_MAX], [TX_Brd2_MIN, TX_Brd2_MAX], ... ], [ [RX_Brd1_MIN, RX_Brd1_MAX], [RX_Brd2_MIN, RX_Brd2_MAX], ... ] ]or
CloverCell series[ [ {'HORIZON': [TX_Brd1_H_MIN, TX_Brd1_H_MAX], 'VERTICAL': [TX_Brd1_V_MIN, TX_Brd1_V_MAX]}, {'HORIZON': [TX_Brd2_H_MIN, TX_Brd2_H_MAX], 'VERTICAL': [TX_Brd2_V_MIN, TX_Brd2_V_MAX]}, ... ], [ {'HORIZON': [RX_Brd1_H_MIN, RX_Brd1_H_MAX], 'VERTICAL': [RX_Brd1_V_MIN, RX_Brd1_V_MAX]}, {'HORIZON': [RX_Brd2_H_MIN, RX_Brd2_H_MAX], 'VERTICAL': [RX_Brd2_V_MIN, RX_Brd2_V_MAX]}, ... ] ]
- Return type:
Examples
BBoxOne / CloverCell series
target_freq = 28 service.setOperatingFreq(sn, target_freq) com_dr = service.getCOMDR(sn).RetData print(com_dr)
Execution result for BBoxOne[ [ [-6.5, 10.0], [-5.0, 11.0], [-6.0, 10.0], [-5.0, 10.5] ], [ [-16.5, 0.0], [-15.0, 1.0], [-16.5, 0.0], [-15.0, 0.5] ] ]
Execution result for CloverCell series[ [ {'HORIZON': [-9.5, -2.0], 'VERTICAL': [-8.0, -0.5]} ], [ {'HORIZON': [-5.0, 2.5], 'VERTICAL': [-6.0, 1.5]} ] ]
- getChannelCount(inBoard=False)
Get total number of channel in device (or in one RF board)
- Parameters:
inBoard (bool, optional) – If True, get channel count in one board. Defaults to False.
- Returns:
RetDataint: The channel count of device
- Return type:
Examples
- Get total number of channel
>>> count = service.getChannelCount(sn).RetData >>> print(count) 16
- Get total number of channel in Board/IC
>>> count = service.getChannelCount(sn, inBoard=True).RetData >>> print(count) 4
- getChannelSwitch(mode: RFMode | CellRFMode | int, polar: POLARIZATION | int = None, chain=1)
Retrieve all channel disable settings for the specific RF mode.
Note
0 is channel enabled, 1 is channel disabled
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – The operating mode, e.g., Tx, Rx.
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to None.
- Returns:
RetDatalist: Disable settings for all channels in double list with 0 or 1.
- Return type:
Examples
- BBox series, BBoard gets switch status under TX mode
>>> dis_list = service.getChannelSwitch(sn, RFMode.TX).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under TX mode and H plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.TX, POLARIZATION.HORIZON).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under RX mode and H/V plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.RX, POLARIZATION.DUAL).RetData >>> print(dis_list) [[0, 0, 0, 0], [1, 1, 1, 1]]
- getDFUSupport()
Check if the device supports Device Firmware Upgrade (DFU).
- getDR(rf_mode: RFMode | CellRFMode | int = None)
Get current dynamic range (DR) gain information from calibration table, so we can know the gain setting limit from the DR, then setting the suitable gain for the beamsteering.
Note
Must called
setOperatingFreq()before using calibration table.- Parameters:
rf_mode (Union[RFMode, CellRFMode, int]) – target RF mode. Defaults to None.
- Returns:
RetDatadict: Current dynamic range (DR) values for both TX/RX RF mode if rf_mode is None OR CloverCell series.
list: Current dynamic range (DR) values for specific RF mode.
- Return type:
Examples
- [BBox series] Get current DR values for both TX/RX RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn).RetData print(dr)
{‘TX’: [-10, -5], ‘RX’: [-12, -6]}
- [BBox series] Get current DR values for specific RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn, RFMode.TX).RetData print(dr)
[-10, -5]
- [CloverCell series] Get current DR values for both TX/RX RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn).RetData print(dr)
execution result{ 'TX': { 'HORIZON': [-9.5, 5.0], 'VERTICAL': [-8.0, 7.0] }, 'RX': { 'HORIZON': [-5.0, 10.0], 'VERTICAL': [-6.0, 9.0] } }
- getDevTypeName()
Retrieve current name of device
- Returns:
Name of device
Examples
>>> service.getDevTypeName(sn) 'RIS'
- getELEDR()
Get current TX/RX board element-arm dynamic range (ELEDR) gain information from calibration table, and it always in the range between 0 ~ ELEDR.
Note
Must called
setOperatingFreq()before using calibration table.- Returns:
RetDatalist: Current ELEDR values for both TX/RX RF mode.
The list structure:
BBox series[ [ TX_Brd1_LIMIT, TX_Brd2_LIMIT, ... ], [ RX_Brd1_LIMIT, RX_Brd2_LIMIT, ... ] ]or
CloverCell series[ [ {'HORIZON': TX_Brd1_H_LIMIT, 'VERTICAL': TX_Brd1_V_LIMIT}, {'HORIZON': TX_Brd2_H_LIMIT, 'VERTICAL': TX_Brd2_V_LIMIT}, ... ], [ {'HORIZON': RX_Brd1_H_LIMIT, 'VERTICAL': RX_Brd1_V_LIMIT}, {'HORIZON': RX_Brd2_H_LIMIT, 'VERTICAL': RX_Brd2_V_LIMIT}, ... ] ],
- Return type:
Examples
BBoxOne / CloverCell series
target_freq = 28 service.setOperatingFreq(sn, target_freq) ele_dr = service.getELEDR(sn).RetData print(ele_dr)
Execution result for BBoxOne[ [ 3.5, 1.0, 3.5, 2.5 ], [ 5.5, 2.0, 4.5, 5.0 ] ]
Execution result for CloverCell series[ [ {'HORIZON': 7.0, 'VERTICAL': 7.5} ], [ {'HORIZON': 4.0, 'VERTICAL': 5.5} ] ],
- getFastParallelMode()
Get ready or not for fast parallel mode, it checks both of current IC status and external SPI status.
- getFrequencyList(force_refresh=False)
Get supported frequency list in GHz, it respresents the search result of calibration files named
({SN}_{Freq}GHz.csv)underfiles/.
- getOperatingFreq()
Get current operating frequency if called
setOperatingFreq()before.
- getRFMode()
Get the current RF mode which stored in TLKCore.
Note
Must called
setRFMode()before getting RF mode.Todo
Directly fetch current RF mode from device.
Examples
- Get the current RF mode of the device:
>>> service.setRFMode(sn, RFMode.TX) # Set the RF mode first >>> rf_mode = service.getRFMode(sn).RetData >>> print(rf_mode.name) TX
- getTemperatureADC()
Retrieve all temperature ADC value from each Board/IC of device
- 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:
- queryCaliTableVer()
Query calibration table version
Note
Must called
setOperatingFreq()before using calibration table.
- queryFWVer()
Query FW version of the device.
Examples
>>> fw_version = service.queryFWVer(sn).RetData >>> print(f"FW Version: {fw_version}") v1.0.0
- 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
- queryTCConfig()
Query dynamic temperature compensation (TC) configuration from device, and the config list should be in the order of [TXC, TXQ, RXC, RXQ].
Note
The TXC and TXQ are the common/element gain attenuation for TX channels respectively. TX/RX C contributes about 1dB gain, and TX/RX Q contributes about 0.5 dB gain, step range is 0-31.
- Returns:
RetCodelist: TC config with trible list format, each board/IC includes [TXC,TXQ,RXC,RXQ]
- Return type:
Examples
>>> service.queryTCConfig(sn) [[[8, 6, 2, 11]]]
- queryTCEnable()
Query dynamic temperature compensation (TC) enable status from device.
- reboot()
Reboot of the device.
- saveAAKitFile(kitName=None, callback=None, check=True, context=None)
Save to AA-Kit csv file with AA-Kit name if customized
Note
Must called
setAAKitInfo()before using saving to file.- Parameters:
kitName (str, optional) – The name of the AAKit to save. Defaults to None.
- Return type:
Examples
Set new custom AA-Kit information to BBoxOne:
custAAKitName = "MyAAKIT" aakit_info = { "kitName": custAAKitName, "spacing": [5.0, 5.0], "steeringH": [-45.0, 45.0], "steeringV": [-45.0, 45.0], "offsetTx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "offsetRx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } service.setAAKitInfo(sn, aakit_info) service.saveAAKitFile(sn, custAAKitName) print(service.getAAKitInfo(sn, custAAKitName).RetData)
Execution result{ 'DEV_TYPE': 9, 'TYPE': 1, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- selectAAKit(kitName)
Set operating AA-Kit by AAKIT_NAME, this name is from AAKIT_*.csv or one of fetched result from
getAAKitList()Note
File name rule of AA-Kit antenna table -> AAKIT_{AAKitName}.csv
- Parameters:
kitName (str) – The name of the AA-Kit to select.
- Returns:
- Return type:
Examples
- Direct selection for specific AA-Kit
>>> aakit_name = "TMYTEK_28ONE_4x4_C2123E001-28" >>> service.selectAAKit(sn, aakit_name)
Select from available AA-Kits, you can iterate through the list and select each one, here we select the first AA-Kit as example.
aakit_list = service.getAAKitList(sn).RetData for index, aakit_name in enumerate(aakit_list): # print(f"Index: {index}, Value: {aakit_name}") if index == 0: service.selectAAKit(sn, aakit_name)
- setAAKitInfo(kitName: str, spacing: list, steeringH: list, steeringV: list, offsetTx: list | dict, offsetRx: list | dict, custom=1, callback=None, dev_type=None, newKitName=None)
Set AA-Kit information, and this function is used to set or update the AA-Kit information in the AA-Kit table.
- Parameters:
kitName (str) – The name of the AA-Kit.
spacing (list) – Antenna x,y spacing between elements.
steeringH (list) – Horizontal steering angles.
steeringV (list) – Vertical steering angles.
offsetTx (Union[list, dict]) – TX phase offset steps, the number of list includes all polarizations, and each polarization includes all antenna channels.
offsetRx (Union[list, dict]) – RX phase offset steps, the number of list includes all polarizations, and each polarization includes all antenna channels.
custom (int, optional) – The custom flag. Defaults to 1.
callback (function, optional) – The callback function. Defaults to None.
dev_type (int, optional) – The device type. Defaults to None.
newKitName (str, optional) – The new kit name. Defaults to None.
- Returns:
RetDatastr: New AA-Kit name
- Return type:
Examples
Set new custom AA-Kit information to BBoxOne:
aakit = { "kitName": "MyAAKIT", "spacing": [5.0, 5.0], "steeringH": [-45.0, 45.0], "steeringV": [-45.0, 45.0], "offsetTx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "offsetRx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } service.setAAKitInfo(sn, aakit)
- setBeamAngle(gain_db, theta, phi, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, mode: ~tlkcore.TMYPublic.RFMode | int = None)
Perform beamsteering with the gain,angle,polarization parameters.
Note
Must call
setOperatingFreq()andselectAAKit()andgetDR()before setting the beam angle.- Parameters:
gain_db (float) – Gain setting in the range of
getDR().theta (int) – Theta angle in the range of STEERING_H field from
getAAKitInfo().phi (int) – Phi angle in the range of 0-359.
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.mode (Union[RFMode, CellRFMode, int]) – Specific RF mode. Defaults to None for the current RF Mode.
- Returns:
- Return type:
Examples
- Set beam angle for BBoxOne/BBoxLite:
mode = RFMode.TX # or RFMode.RX service.setRFMode(sn, mode) # 1. Get available frequency first, it reference from files/ freq_list = service.getFrequencyList(sn).RetData if len(freq_list) == 0: print("CAN NOT find your calibration files in 'files' -> exit") return # print(f"Available frequency list: {freq_list}") # 2. Set the operating frequency # Note: The frequency must be in the available frequency list. # If you want to set a specific frequency, please check the available frequency list first. target_freq = 28.0 if target_freq not in freq_list: print(f"Not support your target freq:{target_freq} in freq list!") return service.setOperatingFreq(sn, target_freq) # 3. Set the AA-Kit, please reference from files/ and AA-Kit name aakit_name = "TMYTEK_28ONE_4x4_C2123E001-28" service.selectAAKit(sn, aakit_name) # 4. Configure gain parameter, it must in the range of DR rng = service.getDR(sn, mode).RetData gain_max = rng[1] # Gain setting # 5. Set beam angle with gain, theta, phi and polarization # Note: Polarization is optional, if not set, it will use the default polarization. theta = 30 # Theta angle phi = 45 # Phi angle service.setBeamAngle(sn, gain_max, theta, phi)
- setBeamPattern(mode: RFMode | int, beamId: int, beamType: BeamType | int, config: dict = None, description: str = None, save=True)
Set user-defined beam patterns in local memory, it allows partial modification based on the default beam pattern.
- Parameters:
mode (Union[RFMode, int]) – The RF mode.
beamId (int) – The specific beam ID.
beamType (Union[BeamType, int]) – The beam type.
config (dict, optional) – The config for specific
BEAMorCHANNELconfig. Defaults to None.description (str, optional) – The description string. Defaults to None.
save (bool, optional) – Whether to save the changes into files. Defaults to True.
- Return type:
Examples
- Set a beam pattern for BBoxOne
config = { 'db': 3.5, 'theta': 0, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 1, BeamType.BEAM, config, "BoresightBeam")
- setChannelGainPhase(channel: int, gain_db: float | list, phase_deg: float | list, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, board: int = -1, applySetting=True)
Set Gain and Phase setting for the specific channel or ALL channels for the current RF mode (set from
setRFMode()).- Parameters:
channel (int) – Channel number, range is starts from 1 to the result of
getChannelCount(). it also for ALL channels if sets 0.gain_db (Union[float, list]) – gain with db
phase_deg (Union[float, list]) – phase with degree
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to
DUALboard (int) – The board/IC number starts from 1 to the result of
getBoardCount(). Defaults to -1, which means all board/ICs.applySetting (bool, optional) – Batch apply for WEB-TLK. Defaults to True.
- Returns:
- Return type:
Warning
Please carefully set the gain for a single channel because it might differ from the other channels which gain exceeds the allowable limit (element gain). An error might occur while setting all channels iteratively.
Examples
- Set Gain and Phase for a specific channel on a specific board/IC
channel = 2 # Channel number starts from 1 gain_db = -3.5 # Gain in dB phase_deg = 285 # Phase in degree board = 1 # Board/IC number starts from 1 service.setChannelGainPhase(sn, channel, gain_db, phase_deg, board)
- Set Gain and Phase for all channels on a all board/ICs
- Correct example
gain_list = [-3.5, -3.5, -4, -3.5, -14, -14, -10.5, -10.5, -3, -3, -3, -3, -2, -2, -2, -2] phase_list = [0, 285, 210, 135, 25, 310, 235, 160, 50, 335, 260, 185, 70, 355, 280, 205] channel = 0 # Set all channels service.setChannelGainPhase(sn, channel, gain_list, phase_list)
Incorrect example (set all channel iteratively)for i in range(len(gain_list)): service.setChannelGainPhase(sn, i+1, gain_list[i], phase_list[i])
Changed in version v2.1.0: polar added for multi-polarization beamformer device
- setFastParallelMode(toEnable: bool)
Sync all default & user-defined beam patterns to devices and enable/disable external SPI control after call
setBeamPattern()- Parameters:
toEnable (bool) – To enable/disable fast parallel mode and external SPI.
- Returns:
- An object containing the result of the operation.
OK: If the operation is successful.ERROR_FW_NOT_SUPPORT: If the firmware version does not support this feature.ERROR: If there is an error during the operation.
- Return type:
Examples
- [BBoxOne] Set 2 user-defined beam patterns and sync to device
# User-defined beam id 1 & 2 config = { 'db': 3.5, 'theta': 0, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 1, BeamType.BEAM, config) config = { 'db': 3, 'theta': 30, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 2, BeamType.BEAM, config) # Sync all user-defined beam patterns to device and start fast parallel mode service.setFastParallelMode(sn, True)
- setIcChannelGain(board: int, ch_gain: list, common_gain: list | float = None, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, applySetting=True)
Set Gain settings for all channels in the specific/all board/IC for the current RF mode (set from
setRFMode()).- Parameters:
board (int) – board/IC number, starts from 1 to the result of
getBoardCount(), and 0 means for all boards.ch_gain (list) – Channel gain list includes 4 channels in one board, and should be in the range of 0 -
getDR()if common_gain is None or in the range of 0 -getELEDR()if common_gain is notNone.common_gain (Union[list, float], optional) – common gain is a gain base within 4 channels in one board or a list structure for all boards(board=0), and must in the range of
getCOMDR(). Defaults to None while ignore setting common gain.polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.applySetting (bool, optional) – batch apply and it used by WEB-TLK. Defaults to True.
- Return type:
Examples
- [BBoxOne] Set IC channel gain for all board/ICs without common gain
- Here we consider it as total channel gain if without common gain
mode = RFMode.TX board = 0 # for all boards dr = service.getDR(sn, mode).RetData dr_test = (dr[0] + dr[1]) / 2 # just take a sample service.setIcChannelGain(sn, board, [dr_test]*4)
- [BBoxOne] Set IC channel gain for all board/ICs with common gain
Warning
Must carefully the taken com step should in range of COMDRs of all boards, basically we don’t recommend to set common gain for all boards.
Here we consider the channel gain will be summation of element gain and common gain if common_gain is not Nonemode = RFMode.TX board = 0 # for all boards total_board = service.getBoardCount(sn).RetData com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][0] # here use 1st com dr, but shall check COMDRs of all boards common_gain_max = common_gain_rng[1] ele_dr = service.getELEDR(sn).RetData ele_g_max = ele_dr[mode.value][0] # here use 1st ele dr service.setIcChannelGain(sn, board, [ele_g_max]*4, common_gain_max)
- [BBoxOne] Set IC channel gain for specific board/IC without common gain
- Here we consider it as total channel gain if without common gain
mode = RFMode.TX board = 1 # here we use 1st board as example dr = service.getDR(sn, mode).RetData dr_test = (dr[0] + dr[1]) / 2 # just take a sample service.setIcChannelGain(sn, board, [dr_test]*4)
- [BBoxOne] Set IC channel gain for specific board/IC with common gain
- Here we consider the channel gain will be summation of element gain and common gain if common_gain is not None
mode = RFMode.TX board = 1 # here we use 1st board as example com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][board-1] # here use 1st com dr ele_dr = service.getELEDR(sn).RetData ele_g_max = ele_dr[mode.value][board-1] # here use 1st ele dr service.setIcChannelGain(sn, board, [ele_g_max]*4, common_gain_rng[1])
Changed in version v2.1.0: polar added for multi polarization beamform device
- setOperatingFreq(freq: int | float)
Set frequency in GHz and reload cali/beam tables, the frequency range is called from
getFrequencyList()- Parameters:
freq (float) – Frequency point in GHz
- Returns:
- Return type:
Examples
- Direct to set frequency with 28GHz
>>> target_freq = 28 >>> service.setOperatingFreq(sn, target_freq)
- Get frequency list before setting (set 28GHz here)
freq_list = service.getFrequencyList(sn).RetData if len(freq_list) == 0: print("CAN NOT find your calibration files in 'files' -> exit") return print(f"Available frequency list: {freq_list}") # Please set your target freq target_freq = 28.0 if target_freq not in freq_list: print(f"Not support your target freq:{target_freq} in freq list!") return service.setOperatingFreq(sn, target_freq)
- setRFMode(mode: RFMode | CellRFMode | int, slots: list = None)
Set target RF mode to device
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – Target RF mode
- Returns:
- Return type:
Examples
>>> service.setRFMode(sn, RFMode.TX)
- setStaticIP(ip, reboot=False)
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 False.
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)
- switchChannel(channel, disable: bool, board=-1)
Disable/enable the specific channel power or not for the current RF mode (set from
setRFMode()).Note
Disable/enable ALL channels if
channelfield sets 0.- Parameters:
channel (int) – Channel number, range is starts from 1 to the result of
getChannelCount().disable (bool, optional) – disable or not
board (int, optional) – The board/IC number starts from 1 to the result of
getBoardCount(). Defaults to -1, which means all board/ICs.
- Returns:
- Return type:
Examples
- Disable a specific channel on a specific board/IC:
>>> channel = 2 # Channel number starts from 1 >>> board = 1 # Board/IC number starts from 1 >>> service.switchChannel(sn, channel, True, board)
BBoxLite (26/28/39GHz)
- class tlkcore.tmydev.DevBBoxLite.BBoxLite(*parent)
Bases:
BBox- checkCaliTableLocation()
Check if calibration table (*.csv) file exists
- deleteAAKitInfo(kitName, callback=None, check=True)
Delete customized AA-Kit csv file by AA-Kit name
- Parameters:
kitName (str) – The name of the AA-Kit to delete.
- Return type:
- exportDevLog(export_folder='.')
Dump device log and export to file
- getAAKitInfo(kitName=None, local=False)
Get AA-Kit information as dict format by AA-Kit name
- Parameters:
kitName (str, optional) – The name of the AA-Kit. Defaults to None and provides latest AA-Kit information after called
selectAAKit()- Returns:
RetData- dict: A dictionary with the following keys:
DEV_TYPE: TMYTEK device type
TYPE: AA-Kit type
SPACING: Antenna x,y spacing between elements
STEERING_H: Horizontal steering angles
STEERING_V: Vertical steering angles
OFFSET_TX: TX phase offset steps in list, includes all antenna channels. Or in dict which includes all antenna channels per polarization.
OFFSET_RX: RX phase offset steps in list, includes all antenna channels. Or in dict which includes all antenna channels per polarization.
- Return type:
Examples
- [BBoxOne] Get AA-Kit information after called
selectAAKit(): >>> service.selectAAKit(sn, "TMYTEK_28ONE_4x4_C2123E001-28") >>> service.getAAKitInfo(sn) { 'DEV_TYPE': 9, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- [BBoxOne] Get AA-Kit information after called
- [BBoxOne] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "TMYTEK_28ONE_4x4_C2123E001-28") { 'DEV_TYPE': 9, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- [BBoxLite] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "TMYTEK_28LITE_4x4_C2224L008-28") { 'DEV_TYPE': 12, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [0, 0], 'OFFSET_TX': [0, 5, 15, 10], 'OFFSET_RX': [0, 5, 15, 10] }
- [CloverCell] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "Clover2x2") { 'DEV_TYPE': 25, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-60.0, 60.0], 'STEERING_V': [-60.0, 60.0], 'OFFSET_TX': { 'HORIZON': [180, 0, 0, 180], 'VERTICAL': [0, 0, 180, 180] }, 'OFFSET_RX': { 'HORIZON': [180, 0, 0, 180], 'VERTICAL': [0, 0, 180, 180] } }
- getAAKitList(force_refresh=False, callback=None)
Get AA-Kit name string list from AAKIT_*.csv under file/
- Parameters:
force_refresh (bool, optional) – Whether to force refresh/refetch the list from files/. Defaults to False.
callback (func, optional) – A callback function to process the list. Defaults to None.
- Returns:
RetDatalist: The list of AA-Kit name
- Return type:
Examples
>>> aakit_list = service.getAAKitList(sn, True).RetData >>> print(aaKit_list) ["TMYTEK_28ONE_4x4_C2123E001-28", "TMYTEK_28ONE_4x4_C2144E015-28"]
- getBeamGainList(polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Get all channel gain settings with current mode which stored in TLKCore, and returns float list.
Note
Must called
setBeamAngle()before getting gain config for beam.Note
CloverCell series must assign polarization and it does not allow getting dual polarizations.
Todo
Directly fetch current settings from device.
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.- Returns:
- Return type:
- getBeamIdStorage()
Get the MAX number of beam id can storage for each RF mode.
- getBeamPattern(mode: RFMode | int, beamId)
Get beam pattern configuration by beamId from physical file(.json), default (if not set) is
CHANNELconfigNote
Beam id range is 1 ~ value of
getBeamIdStorage()- Parameters:
mode (Union[RFMode, int]) – The RF mode.
beamId (int) – The specific beam ID.
- Returns:
RetDatadict: The beam pattern configuration.
- Return type:
Examples
- Get beam id from BBoxOne if not set before
>>> pattern = service.getBeamPattern(RFMode.TX, 1).RetData >>> print(pattern)
execution result{ 'beam_description': '', 'beam_type': 1, 'channel_config': { 'board_1': { 'common_db': 10.0, 'channel_1': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 3.5, 'deg': 0}}, 'board_2': { 'common_db': 11.0, 'channel_1': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 1.0, 'deg': 0}}, 'board_3': { 'common_db': 10.0, 'channel_1': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 3.5, 'deg': 0}}, 'board_4': { 'common_db': 10.5, 'channel_1': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 2.5, 'deg': 0} } }
- getBeamPhaseList(polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Get all channel phase settings with current mode which stored in TLKCore, and returns int list.
Note
Must called
setBeamAngle()before getting phase config for beam.Note
CloverCell series must assign polarization and it does not allow getting dual polarizations.
Todo
Directly fetch current settings from device.
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.- Returns:
- Return type:
Examples
- BBoxOne
>>> service.getBeamPhaseList(sn).RetData [ [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0] ]
- getBoardCount()
Get total number of RF boards/ICs in device
Examples
- Get from BBoxOne
>>> count = service.getBoardCount(sn).RetData >>> print(count) 4
- Get from BBoxLite
>>> count = service.getBoardCount(sn).RetData >>> print(count) 1
- getCOMDR()
Get current common arm dynamic range (COMDR) gain information from calibration table.
Note
Must called
setOperatingFreq()before using calibration table.- Returns:
RetDatalist: Current COMDR values for both TX/RX RF mode.
The list structure:
BBox series[ [ [TX_Brd1_MIN, TX_Brd1_MAX], [TX_Brd2_MIN, TX_Brd2_MAX], ... ], [ [RX_Brd1_MIN, RX_Brd1_MAX], [RX_Brd2_MIN, RX_Brd2_MAX], ... ] ]or
CloverCell series[ [ {'HORIZON': [TX_Brd1_H_MIN, TX_Brd1_H_MAX], 'VERTICAL': [TX_Brd1_V_MIN, TX_Brd1_V_MAX]}, {'HORIZON': [TX_Brd2_H_MIN, TX_Brd2_H_MAX], 'VERTICAL': [TX_Brd2_V_MIN, TX_Brd2_V_MAX]}, ... ], [ {'HORIZON': [RX_Brd1_H_MIN, RX_Brd1_H_MAX], 'VERTICAL': [RX_Brd1_V_MIN, RX_Brd1_V_MAX]}, {'HORIZON': [RX_Brd2_H_MIN, RX_Brd2_H_MAX], 'VERTICAL': [RX_Brd2_V_MIN, RX_Brd2_V_MAX]}, ... ] ]
- Return type:
Examples
BBoxOne / CloverCell series
target_freq = 28 service.setOperatingFreq(sn, target_freq) com_dr = service.getCOMDR(sn).RetData print(com_dr)
Execution result for BBoxOne[ [ [-6.5, 10.0], [-5.0, 11.0], [-6.0, 10.0], [-5.0, 10.5] ], [ [-16.5, 0.0], [-15.0, 1.0], [-16.5, 0.0], [-15.0, 0.5] ] ]
Execution result for CloverCell series[ [ {'HORIZON': [-9.5, -2.0], 'VERTICAL': [-8.0, -0.5]} ], [ {'HORIZON': [-5.0, 2.5], 'VERTICAL': [-6.0, 1.5]} ] ]
- getChannelCount(inBoard=False)
Get total number of channel in device (or in one RF board)
- Parameters:
inBoard (bool, optional) – If True, get channel count in one board. Defaults to False.
- Returns:
RetDataint: The channel count of device
- Return type:
Examples
- Get total number of channel
>>> count = service.getChannelCount(sn).RetData >>> print(count) 16
- Get total number of channel in Board/IC
>>> count = service.getChannelCount(sn, inBoard=True).RetData >>> print(count) 4
- getChannelSwitch(mode: RFMode | CellRFMode | int, polar: POLARIZATION | int = None, chain=1)
Retrieve all channel disable settings for the specific RF mode.
Note
0 is channel enabled, 1 is channel disabled
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – The operating mode, e.g., Tx, Rx.
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to None.
- Returns:
RetDatalist: Disable settings for all channels in double list with 0 or 1.
- Return type:
Examples
- BBox series, BBoard gets switch status under TX mode
>>> dis_list = service.getChannelSwitch(sn, RFMode.TX).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under TX mode and H plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.TX, POLARIZATION.HORIZON).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under RX mode and H/V plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.RX, POLARIZATION.DUAL).RetData >>> print(dis_list) [[0, 0, 0, 0], [1, 1, 1, 1]]
- getDFUSupport()
Check if the device supports Device Firmware Upgrade (DFU).
- getDR(rf_mode: RFMode | CellRFMode | int = None)
Get current dynamic range (DR) gain information from calibration table, so we can know the gain setting limit from the DR, then setting the suitable gain for the beamsteering.
Note
Must called
setOperatingFreq()before using calibration table.- Parameters:
rf_mode (Union[RFMode, CellRFMode, int]) – target RF mode. Defaults to None.
- Returns:
RetDatadict: Current dynamic range (DR) values for both TX/RX RF mode if rf_mode is None OR CloverCell series.
list: Current dynamic range (DR) values for specific RF mode.
- Return type:
Examples
- [BBox series] Get current DR values for both TX/RX RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn).RetData print(dr)
{‘TX’: [-10, -5], ‘RX’: [-12, -6]}
- [BBox series] Get current DR values for specific RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn, RFMode.TX).RetData print(dr)
[-10, -5]
- [CloverCell series] Get current DR values for both TX/RX RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn).RetData print(dr)
execution result{ 'TX': { 'HORIZON': [-9.5, 5.0], 'VERTICAL': [-8.0, 7.0] }, 'RX': { 'HORIZON': [-5.0, 10.0], 'VERTICAL': [-6.0, 9.0] } }
- getDevTypeName()
Retrieve current name of device
- Returns:
Name of device
Examples
>>> service.getDevTypeName(sn) 'RIS'
- getELEDR()
Get current TX/RX board element-arm dynamic range (ELEDR) gain information from calibration table, and it always in the range between 0 ~ ELEDR.
Note
Must called
setOperatingFreq()before using calibration table.- Returns:
RetDatalist: Current ELEDR values for both TX/RX RF mode.
The list structure:
BBox series[ [ TX_Brd1_LIMIT, TX_Brd2_LIMIT, ... ], [ RX_Brd1_LIMIT, RX_Brd2_LIMIT, ... ] ]or
CloverCell series[ [ {'HORIZON': TX_Brd1_H_LIMIT, 'VERTICAL': TX_Brd1_V_LIMIT}, {'HORIZON': TX_Brd2_H_LIMIT, 'VERTICAL': TX_Brd2_V_LIMIT}, ... ], [ {'HORIZON': RX_Brd1_H_LIMIT, 'VERTICAL': RX_Brd1_V_LIMIT}, {'HORIZON': RX_Brd2_H_LIMIT, 'VERTICAL': RX_Brd2_V_LIMIT}, ... ] ],
- Return type:
Examples
BBoxOne / CloverCell series
target_freq = 28 service.setOperatingFreq(sn, target_freq) ele_dr = service.getELEDR(sn).RetData print(ele_dr)
Execution result for BBoxOne[ [ 3.5, 1.0, 3.5, 2.5 ], [ 5.5, 2.0, 4.5, 5.0 ] ]
Execution result for CloverCell series[ [ {'HORIZON': 7.0, 'VERTICAL': 7.5} ], [ {'HORIZON': 4.0, 'VERTICAL': 5.5} ] ],
- getFastParallelMode()
Get ready or not for fast parallel mode, it checks both of current IC status and external SPI status.
- getFrequencyList(force_refresh=False)
Get supported frequency list in GHz, it respresents the search result of calibration files named
({SN}_{Freq}GHz.csv)underfiles/.
- getOperatingFreq()
Get current operating frequency if called
setOperatingFreq()before.
- getRFMode()
Get the current RF mode which stored in TLKCore.
Note
Must called
setRFMode()before getting RF mode.Todo
Directly fetch current RF mode from device.
Examples
- Get the current RF mode of the device:
>>> service.setRFMode(sn, RFMode.TX) # Set the RF mode first >>> rf_mode = service.getRFMode(sn).RetData >>> print(rf_mode.name) TX
- getTemperatureADC()
Retrieve all temperature ADC value from each Board/IC of device
- 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:
- queryCaliTableVer()
Query calibration table version
Note
Must called
setOperatingFreq()before using calibration table.
- queryFWVer()
Query FW version of the device.
Examples
>>> fw_version = service.queryFWVer(sn).RetData >>> print(f"FW Version: {fw_version}") v1.0.0
- 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
- queryTCConfig()
Query dynamic temperature compensation (TC) configuration from device, and the config list should be in the order of [TXC, TXQ, RXC, RXQ].
Note
The TXC and TXQ are the common/element gain attenuation for TX channels respectively. TX/RX C contributes about 1dB gain, and TX/RX Q contributes about 0.5 dB gain, step range is 0-31.
- Returns:
RetCodelist: TC config with trible list format, each board/IC includes [TXC,TXQ,RXC,RXQ]
- Return type:
Examples
>>> service.queryTCConfig(sn) [[[8, 6, 2, 11]]]
- queryTCEnable()
Query dynamic temperature compensation (TC) enable status from device.
- reboot()
Reboot of the device.
- saveAAKitFile(kitName=None, callback=None, check=True, context=None)
Save to AA-Kit csv file with AA-Kit name if customized
Note
Must called
setAAKitInfo()before using saving to file.- Parameters:
kitName (str, optional) – The name of the AAKit to save. Defaults to None.
- Return type:
Examples
Set new custom AA-Kit information to BBoxOne:
custAAKitName = "MyAAKIT" aakit_info = { "kitName": custAAKitName, "spacing": [5.0, 5.0], "steeringH": [-45.0, 45.0], "steeringV": [-45.0, 45.0], "offsetTx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "offsetRx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } service.setAAKitInfo(sn, aakit_info) service.saveAAKitFile(sn, custAAKitName) print(service.getAAKitInfo(sn, custAAKitName).RetData)
Execution result{ 'DEV_TYPE': 9, 'TYPE': 1, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- selectAAKit(kitName)
Set operating AA-Kit by AAKIT_NAME, this name is from AAKIT_*.csv or one of fetched result from
getAAKitList()Note
File name rule of AA-Kit antenna table -> AAKIT_{AAKitName}.csv
- Parameters:
kitName (str) – The name of the AA-Kit to select.
- Returns:
- Return type:
Examples
- Direct selection for specific AA-Kit
>>> aakit_name = "TMYTEK_28ONE_4x4_C2123E001-28" >>> service.selectAAKit(sn, aakit_name)
Select from available AA-Kits, you can iterate through the list and select each one, here we select the first AA-Kit as example.
aakit_list = service.getAAKitList(sn).RetData for index, aakit_name in enumerate(aakit_list): # print(f"Index: {index}, Value: {aakit_name}") if index == 0: service.selectAAKit(sn, aakit_name)
- setAAKitInfo(kitName: str, spacing: list, steeringH: list, steeringV: list, offsetTx: list | dict, offsetRx: list | dict, custom=1, callback=None, dev_type=None, newKitName=None)
Set AA-Kit information, and this function is used to set or update the AA-Kit information in the AA-Kit table.
- Parameters:
kitName (str) – The name of the AA-Kit.
spacing (list) – Antenna x,y spacing between elements.
steeringH (list) – Horizontal steering angles.
steeringV (list) – Vertical steering angles.
offsetTx (Union[list, dict]) – TX phase offset steps, the number of list includes all polarizations, and each polarization includes all antenna channels.
offsetRx (Union[list, dict]) – RX phase offset steps, the number of list includes all polarizations, and each polarization includes all antenna channels.
custom (int, optional) – The custom flag. Defaults to 1.
callback (function, optional) – The callback function. Defaults to None.
dev_type (int, optional) – The device type. Defaults to None.
newKitName (str, optional) – The new kit name. Defaults to None.
- Returns:
RetDatastr: New AA-Kit name
- Return type:
Examples
Set new custom AA-Kit information to BBoxOne:
aakit = { "kitName": "MyAAKIT", "spacing": [5.0, 5.0], "steeringH": [-45.0, 45.0], "steeringV": [-45.0, 45.0], "offsetTx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "offsetRx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } service.setAAKitInfo(sn, aakit)
- setBeamAngle(gain_db, theta, phi, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, mode: ~tlkcore.TMYPublic.RFMode | int = None)
Perform beamsteering with the gain,angle,polarization parameters.
Note
Must call
setOperatingFreq()andselectAAKit()andgetDR()before setting the beam angle.- Parameters:
gain_db (float) – Gain setting in the range of
getDR().theta (int) – Theta angle in the range of STEERING_H field from
getAAKitInfo().phi (int) – Phi angle in the range of 0-359.
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.mode (Union[RFMode, CellRFMode, int]) – Specific RF mode. Defaults to None for the current RF Mode.
- Returns:
- Return type:
Examples
- Set beam angle for BBoxOne/BBoxLite:
mode = RFMode.TX # or RFMode.RX service.setRFMode(sn, mode) # 1. Get available frequency first, it reference from files/ freq_list = service.getFrequencyList(sn).RetData if len(freq_list) == 0: print("CAN NOT find your calibration files in 'files' -> exit") return # print(f"Available frequency list: {freq_list}") # 2. Set the operating frequency # Note: The frequency must be in the available frequency list. # If you want to set a specific frequency, please check the available frequency list first. target_freq = 28.0 if target_freq not in freq_list: print(f"Not support your target freq:{target_freq} in freq list!") return service.setOperatingFreq(sn, target_freq) # 3. Set the AA-Kit, please reference from files/ and AA-Kit name aakit_name = "TMYTEK_28ONE_4x4_C2123E001-28" service.selectAAKit(sn, aakit_name) # 4. Configure gain parameter, it must in the range of DR rng = service.getDR(sn, mode).RetData gain_max = rng[1] # Gain setting # 5. Set beam angle with gain, theta, phi and polarization # Note: Polarization is optional, if not set, it will use the default polarization. theta = 30 # Theta angle phi = 45 # Phi angle service.setBeamAngle(sn, gain_max, theta, phi)
- setBeamPattern(mode: RFMode | int, beamId: int, beamType: BeamType | int, config: dict = None, description: str = None, save=True)
Set user-defined beam patterns in local memory, it allows partial modification based on the default beam pattern.
- Parameters:
mode (Union[RFMode, int]) – The RF mode.
beamId (int) – The specific beam ID.
beamType (Union[BeamType, int]) – The beam type.
config (dict, optional) – The config for specific
BEAMorCHANNELconfig. Defaults to None.description (str, optional) – The description string. Defaults to None.
save (bool, optional) – Whether to save the changes into files. Defaults to True.
- Return type:
Examples
- Set a beam pattern for BBoxOne
config = { 'db': 3.5, 'theta': 0, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 1, BeamType.BEAM, config, "BoresightBeam")
- setChannelGainPhase(channel: int, gain_db: float | list, phase_deg: float | list, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, board: int = -1, applySetting=True)
Set Gain and Phase setting for the specific channel or ALL channels for the current RF mode (set from
setRFMode()).- Parameters:
channel (int) – Channel number, range is starts from 1 to the result of
getChannelCount(). it also for ALL channels if sets 0.gain_db (Union[float, list]) – gain with db
phase_deg (Union[float, list]) – phase with degree
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to
DUALboard (int) – The board/IC number starts from 1 to the result of
getBoardCount(). Defaults to -1, which means all board/ICs.applySetting (bool, optional) – Batch apply for WEB-TLK. Defaults to True.
- Returns:
- Return type:
Warning
Please carefully set the gain for a single channel because it might differ from the other channels which gain exceeds the allowable limit (element gain). An error might occur while setting all channels iteratively.
Examples
- Set Gain and Phase for a specific channel on a specific board/IC
channel = 2 # Channel number starts from 1 gain_db = -3.5 # Gain in dB phase_deg = 285 # Phase in degree board = 1 # Board/IC number starts from 1 service.setChannelGainPhase(sn, channel, gain_db, phase_deg, board)
- Set Gain and Phase for all channels on a all board/ICs
- Correct example
gain_list = [-3.5, -3.5, -4, -3.5, -14, -14, -10.5, -10.5, -3, -3, -3, -3, -2, -2, -2, -2] phase_list = [0, 285, 210, 135, 25, 310, 235, 160, 50, 335, 260, 185, 70, 355, 280, 205] channel = 0 # Set all channels service.setChannelGainPhase(sn, channel, gain_list, phase_list)
Incorrect example (set all channel iteratively)for i in range(len(gain_list)): service.setChannelGainPhase(sn, i+1, gain_list[i], phase_list[i])
Changed in version v2.1.0: polar added for multi-polarization beamformer device
- setFastParallelMode(toEnable: bool)
Sync all default & user-defined beam patterns to devices and enable/disable external SPI control after call
setBeamPattern()- Parameters:
toEnable (bool) – To enable/disable fast parallel mode and external SPI.
- Returns:
- An object containing the result of the operation.
OK: If the operation is successful.ERROR_FW_NOT_SUPPORT: If the firmware version does not support this feature.ERROR: If there is an error during the operation.
- Return type:
Examples
- [BBoxOne] Set 2 user-defined beam patterns and sync to device
# User-defined beam id 1 & 2 config = { 'db': 3.5, 'theta': 0, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 1, BeamType.BEAM, config) config = { 'db': 3, 'theta': 30, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 2, BeamType.BEAM, config) # Sync all user-defined beam patterns to device and start fast parallel mode service.setFastParallelMode(sn, True)
- setIcChannelGain(board: int, ch_gain: list, common_gain: list | float = None, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, applySetting=True)
Set Gain settings for all channels in the specific/all board/IC for the current RF mode (set from
setRFMode()).- Parameters:
board (int) – board/IC number, starts from 1 to the result of
getBoardCount(), and 0 means for all boards.ch_gain (list) – Channel gain list includes 4 channels in one board, and should be in the range of 0 -
getDR()if common_gain is None or in the range of 0 -getELEDR()if common_gain is notNone.common_gain (Union[list, float], optional) – common gain is a gain base within 4 channels in one board or a list structure for all boards(board=0), and must in the range of
getCOMDR(). Defaults to None while ignore setting common gain.polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.applySetting (bool, optional) – batch apply and it used by WEB-TLK. Defaults to True.
- Return type:
Examples
- [BBoxOne] Set IC channel gain for all board/ICs without common gain
- Here we consider it as total channel gain if without common gain
mode = RFMode.TX board = 0 # for all boards dr = service.getDR(sn, mode).RetData dr_test = (dr[0] + dr[1]) / 2 # just take a sample service.setIcChannelGain(sn, board, [dr_test]*4)
- [BBoxOne] Set IC channel gain for all board/ICs with common gain
Warning
Must carefully the taken com step should in range of COMDRs of all boards, basically we don’t recommend to set common gain for all boards.
Here we consider the channel gain will be summation of element gain and common gain if common_gain is not Nonemode = RFMode.TX board = 0 # for all boards total_board = service.getBoardCount(sn).RetData com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][0] # here use 1st com dr, but shall check COMDRs of all boards common_gain_max = common_gain_rng[1] ele_dr = service.getELEDR(sn).RetData ele_g_max = ele_dr[mode.value][0] # here use 1st ele dr service.setIcChannelGain(sn, board, [ele_g_max]*4, common_gain_max)
- [BBoxOne] Set IC channel gain for specific board/IC without common gain
- Here we consider it as total channel gain if without common gain
mode = RFMode.TX board = 1 # here we use 1st board as example dr = service.getDR(sn, mode).RetData dr_test = (dr[0] + dr[1]) / 2 # just take a sample service.setIcChannelGain(sn, board, [dr_test]*4)
- [BBoxOne] Set IC channel gain for specific board/IC with common gain
- Here we consider the channel gain will be summation of element gain and common gain if common_gain is not None
mode = RFMode.TX board = 1 # here we use 1st board as example com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][board-1] # here use 1st com dr ele_dr = service.getELEDR(sn).RetData ele_g_max = ele_dr[mode.value][board-1] # here use 1st ele dr service.setIcChannelGain(sn, board, [ele_g_max]*4, common_gain_rng[1])
Changed in version v2.1.0: polar added for multi polarization beamform device
- setOperatingFreq(freq: int | float)
Set frequency in GHz and reload cali/beam tables, the frequency range is called from
getFrequencyList()- Parameters:
freq (float) – Frequency point in GHz
- Returns:
- Return type:
Examples
- Direct to set frequency with 28GHz
>>> target_freq = 28 >>> service.setOperatingFreq(sn, target_freq)
- Get frequency list before setting (set 28GHz here)
freq_list = service.getFrequencyList(sn).RetData if len(freq_list) == 0: print("CAN NOT find your calibration files in 'files' -> exit") return print(f"Available frequency list: {freq_list}") # Please set your target freq target_freq = 28.0 if target_freq not in freq_list: print(f"Not support your target freq:{target_freq} in freq list!") return service.setOperatingFreq(sn, target_freq)
- setRFMode(mode: RFMode | CellRFMode | int, slots: list = None)
Set target RF mode to device
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – Target RF mode
- Returns:
- Return type:
Examples
>>> service.setRFMode(sn, RFMode.TX)
- setStaticIP(ip, reboot=False)
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 False.
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)
- switchChannel(channel, disable: bool, board=-1)
Disable/enable the specific channel power or not for the current RF mode (set from
setRFMode()).Note
Disable/enable ALL channels if
channelfield sets 0.- Parameters:
channel (int) – Channel number, range is starts from 1 to the result of
getChannelCount().disable (bool, optional) – disable or not
board (int, optional) – The board/IC number starts from 1 to the result of
getBoardCount(). Defaults to -1, which means all board/ICs.
- Returns:
- Return type:
Examples
- Disable a specific channel on a specific board/IC:
>>> channel = 2 # Channel number starts from 1 >>> board = 1 # Board/IC number starts from 1 >>> service.switchChannel(sn, channel, True, board)
BBoard (26/28/39GHz)
- class tlkcore.tmydev.DevBBoard.BBoard(*parent)
Bases:
BBoxBBoard, a simple beamforming device but only provide basic functionalities.
This class inherits from BBox but disables many advanced features to provide a simplified interface suitable for basic beamforming operations.
Disabled features include: - Calibration table management - Antenna array kit management - Advanced beam pattern operations - Complex channel gain/phase settings
Supported operations: - Basic channel phase/gain step control - Temperature compensation configuration - Common gain step control
- classmethod get_disabled_methods() tuple
Get the list of methods that are disabled in this class.
- Returns:
Tuple of disabled method names
- classmethod is_method_disabled(method_name: str) bool
Check if a specific method is disabled in this class.
- Parameters:
method_name – Name of the method to check
- Returns:
True if method is disabled, False otherwise
- setTCConfig(config: list, board: int = 1)
Set temperature compensation (TC) parameters if dynamic TC disabled, and the config list should be in the order of [TXC, TXQ, RXC, RXQ].
Note
The TXC and TXQ are the common/element gain attenuation for TX channels respectively. TX/RX C contributes about 1dB gain, and TX/RX Q contributes about 0.5 dB gain, step range is 0-31.
- Parameters:
config (list) – The TC parameters include [TXC, TXQ, RXC, RXQ] with range from 0 to 31.
board (int, optional) – The board number. Defaults to 1.
- Return type:
Examples
>>> service.setTCConfig(sn, [8, 6, 2, 9])
- setChannelPhaseStep(channel: int, phase_step: int, board: int = -1)
Set phase step for specific channel
- Parameters:
channel (int) – The channel number of BBoard, the range is 1-4.
phase_step (int) – The phase step value, the range is 0-63.
board (int, optional) – The board number. Defaults to -1.
- Return type:
Examples
>>> ch = 1 >>> ps = 32 >>> service.setChannelPhaseStep(sn, ch, ps, board)
- setChannelGainStep(channel: int, gain_step: int, board: int = -1)
Set gain step for specific channel
Note
The step range is 0-15, and represent ~0.5 dB attenuation for each step increased.
- Parameters:
channel (int) – The channel number of BBoard, the range is 1-4.
gain_step (int) – The gain step value, the range is 0-31.
board (int, optional) – The board number. Defaults to -1.
- Return type:
Examples
>>> ch = 3 >>> gs = 32 >>> service.setChannelGainStep(sn, ch, gs, board)
- setComGainStep(gain_step: int, board: int = -1)
Set common gain step to the BBoard
Note
The step range is 0-15, and represent ~1 dB attenuation for each step increased.
- Parameters:
gain_step (int) – The common-arm gain step value within 4 channels.
board (int, optional) – The board number. Defaults to -1.
- Return type:
Examples
>>> cgs = 14 >>> service.setComGainStep(sn, cgs, board)
- exportDevLog(export_folder='.')
Dump device log and export to file
- getBoardCount()
Get total number of RF boards/ICs in device
Examples
- Get from BBoxOne
>>> count = service.getBoardCount(sn).RetData >>> print(count) 4
- Get from BBoxLite
>>> count = service.getBoardCount(sn).RetData >>> print(count) 1
- getChannelCount(inBoard=False)
Get total number of channel in device (or in one RF board)
- Parameters:
inBoard (bool, optional) – If True, get channel count in one board. Defaults to False.
- Returns:
RetDataint: The channel count of device
- Return type:
Examples
- Get total number of channel
>>> count = service.getChannelCount(sn).RetData >>> print(count) 16
- Get total number of channel in Board/IC
>>> count = service.getChannelCount(sn, inBoard=True).RetData >>> print(count) 4
- getChannelSwitch(mode: RFMode | CellRFMode | int, polar: POLARIZATION | int = None, chain=1)
Retrieve all channel disable settings for the specific RF mode.
Note
0 is channel enabled, 1 is channel disabled
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – The operating mode, e.g., Tx, Rx.
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to None.
- Returns:
RetDatalist: Disable settings for all channels in double list with 0 or 1.
- Return type:
Examples
- BBox series, BBoard gets switch status under TX mode
>>> dis_list = service.getChannelSwitch(sn, RFMode.TX).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under TX mode and H plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.TX, POLARIZATION.HORIZON).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under RX mode and H/V plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.RX, POLARIZATION.DUAL).RetData >>> print(dis_list) [[0, 0, 0, 0], [1, 1, 1, 1]]
- 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'
- getRFMode()
Get the current RF mode which stored in TLKCore.
Note
Must called
setRFMode()before getting RF mode.Todo
Directly fetch current RF mode from device.
Examples
- Get the current RF mode of the device:
>>> service.setRFMode(sn, RFMode.TX) # Set the RF mode first >>> rf_mode = service.getRFMode(sn).RetData >>> print(rf_mode.name) TX
- getTemperatureADC()
Retrieve all temperature ADC value from each Board/IC of device
- 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
- 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
- queryTCConfig()
Query dynamic temperature compensation (TC) configuration from device, and the config list should be in the order of [TXC, TXQ, RXC, RXQ].
Note
The TXC and TXQ are the common/element gain attenuation for TX channels respectively. TX/RX C contributes about 1dB gain, and TX/RX Q contributes about 0.5 dB gain, step range is 0-31.
- Returns:
RetCodelist: TC config with trible list format, each board/IC includes [TXC,TXQ,RXC,RXQ]
- Return type:
Examples
>>> service.queryTCConfig(sn) [[[8, 6, 2, 11]]]
- queryTCEnable()
Query dynamic temperature compensation (TC) enable status from device.
- reboot()
Reboot of the device.
- setRFMode(mode: RFMode | CellRFMode | int, slots: list = None)
Set target RF mode to device
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – Target RF mode
- Returns:
- Return type:
Examples
>>> service.setRFMode(sn, RFMode.TX)
- setStaticIP(ip, reboot=False)
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 False.
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)
- switchChannel(channel, disable: bool, board=-1)
Disable/enable the specific channel power or not for the current RF mode (set from
setRFMode()).Note
Disable/enable ALL channels if
channelfield sets 0.- Parameters:
channel (int) – Channel number, range is starts from 1 to the result of
getChannelCount().disable (bool, optional) – disable or not
board (int, optional) – The board/IC number starts from 1 to the result of
getBoardCount(). Defaults to -1, which means all board/ICs.
- Returns:
- Return type:
Examples
- Disable a specific channel on a specific board/IC:
>>> channel = 2 # Channel number starts from 1 >>> board = 1 # Board/IC number starts from 1 >>> service.switchChannel(sn, channel, True, board)
CloverCell (28GHz)
- class tlkcore.tmydev.DevCloverCell.CloverCellEvb(*parent)
Bases:
CloverCellEVB: 2x2 28GHz
- checkCaliTableLocation()
Check if calibration table (*.csv) file exists
- deleteAAKitInfo(kitName, callback=None, check=True)
Delete customized AA-Kit csv file by AA-Kit name
- Parameters:
kitName (str) – The name of the AA-Kit to delete.
- Return type:
- exportDevLog(export_folder='.')
Dump device log and export to file
- getAAKitInfo(kitName=None, local=False)
Get AA-Kit information as dict format by AA-Kit name
- Parameters:
kitName (str, optional) – The name of the AA-Kit. Defaults to None and provides latest AA-Kit information after called
selectAAKit()- Returns:
RetData- dict: A dictionary with the following keys:
DEV_TYPE: TMYTEK device type
TYPE: AA-Kit type
SPACING: Antenna x,y spacing between elements
STEERING_H: Horizontal steering angles
STEERING_V: Vertical steering angles
OFFSET_TX: TX phase offset steps in list, includes all antenna channels. Or in dict which includes all antenna channels per polarization.
OFFSET_RX: RX phase offset steps in list, includes all antenna channels. Or in dict which includes all antenna channels per polarization.
- Return type:
Examples
- [BBoxOne] Get AA-Kit information after called
selectAAKit(): >>> service.selectAAKit(sn, "TMYTEK_28ONE_4x4_C2123E001-28") >>> service.getAAKitInfo(sn) { 'DEV_TYPE': 9, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- [BBoxOne] Get AA-Kit information after called
- [BBoxOne] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "TMYTEK_28ONE_4x4_C2123E001-28") { 'DEV_TYPE': 9, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- [BBoxLite] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "TMYTEK_28LITE_4x4_C2224L008-28") { 'DEV_TYPE': 12, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [0, 0], 'OFFSET_TX': [0, 5, 15, 10], 'OFFSET_RX': [0, 5, 15, 10] }
- [CloverCell] Get AA-Kit information by name:
>>> service.getAAKitInfo(sn, "Clover2x2") { 'DEV_TYPE': 25, 'TYPE': 0, 'SPACING': [5.0, 5.0], 'STEERING_H': [-60.0, 60.0], 'STEERING_V': [-60.0, 60.0], 'OFFSET_TX': { 'HORIZON': [180, 0, 0, 180], 'VERTICAL': [0, 0, 180, 180] }, 'OFFSET_RX': { 'HORIZON': [180, 0, 0, 180], 'VERTICAL': [0, 0, 180, 180] } }
- getAAKitList(force_refresh=False, callback=None)
Get AA-Kit name string list from AAKIT_*.csv under file/
- Parameters:
force_refresh (bool, optional) – Whether to force refresh/refetch the list from files/. Defaults to False.
callback (func, optional) – A callback function to process the list. Defaults to None.
- Returns:
RetDatalist: The list of AA-Kit name
- Return type:
Examples
>>> aakit_list = service.getAAKitList(sn, True).RetData >>> print(aaKit_list) ["TMYTEK_28ONE_4x4_C2123E001-28", "TMYTEK_28ONE_4x4_C2144E015-28"]
- getBeamGainList(polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Get all channel gain settings with current mode which stored in TLKCore, and returns float list.
Note
Must called
setBeamAngle()before getting gain config for beam.Note
CloverCell series must assign polarization and it does not allow getting dual polarizations.
Todo
Directly fetch current settings from device.
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.- Returns:
- Return type:
- getBeamIdStorage()
Get the MAX number of beam id can storage for each RF mode.
- getBeamPattern(mode: RFMode | int, beamId)
Get beam pattern configuration by beamId from physical file(.json), default (if not set) is
CHANNELconfigNote
Beam id range is 1 ~ value of
getBeamIdStorage()- Parameters:
mode (Union[RFMode, int]) – The RF mode.
beamId (int) – The specific beam ID.
- Returns:
RetDatadict: The beam pattern configuration.
- Return type:
Examples
- Get beam id from BBoxOne if not set before
>>> pattern = service.getBeamPattern(RFMode.TX, 1).RetData >>> print(pattern)
execution result{ 'beam_description': '', 'beam_type': 1, 'channel_config': { 'board_1': { 'common_db': 10.0, 'channel_1': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 3.5, 'deg': 0}}, 'board_2': { 'common_db': 11.0, 'channel_1': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 1.0, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 1.0, 'deg': 0}}, 'board_3': { 'common_db': 10.0, 'channel_1': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 3.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 3.5, 'deg': 0}}, 'board_4': { 'common_db': 10.5, 'channel_1': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_2': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_3': { 'sw': 0, 'db': 2.5, 'deg': 0}, 'channel_4': { 'sw': 0, 'db': 2.5, 'deg': 0} } }
- getBeamPhaseList(polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Get all channel phase settings with current mode which stored in TLKCore, and returns int list.
Note
Must called
setBeamAngle()before getting phase config for beam.Note
CloverCell series must assign polarization and it does not allow getting dual polarizations.
Todo
Directly fetch current settings from device.
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.- Returns:
- Return type:
Examples
- BBoxOne
>>> service.getBeamPhaseList(sn).RetData [ [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0] ]
- getBoardCount()
Get total number of RF boards/ICs in device
Examples
- Get from BBoxOne
>>> count = service.getBoardCount(sn).RetData >>> print(count) 4
- Get from BBoxLite
>>> count = service.getBoardCount(sn).RetData >>> print(count) 1
- getCOMDR()
Get current common arm dynamic range (COMDR) gain information from calibration table.
Note
Must called
setOperatingFreq()before using calibration table.- Returns:
RetDatalist: Current COMDR values for both TX/RX RF mode.
The list structure:
BBox series[ [ [TX_Brd1_MIN, TX_Brd1_MAX], [TX_Brd2_MIN, TX_Brd2_MAX], ... ], [ [RX_Brd1_MIN, RX_Brd1_MAX], [RX_Brd2_MIN, RX_Brd2_MAX], ... ] ]or
CloverCell series[ [ {'HORIZON': [TX_Brd1_H_MIN, TX_Brd1_H_MAX], 'VERTICAL': [TX_Brd1_V_MIN, TX_Brd1_V_MAX]}, {'HORIZON': [TX_Brd2_H_MIN, TX_Brd2_H_MAX], 'VERTICAL': [TX_Brd2_V_MIN, TX_Brd2_V_MAX]}, ... ], [ {'HORIZON': [RX_Brd1_H_MIN, RX_Brd1_H_MAX], 'VERTICAL': [RX_Brd1_V_MIN, RX_Brd1_V_MAX]}, {'HORIZON': [RX_Brd2_H_MIN, RX_Brd2_H_MAX], 'VERTICAL': [RX_Brd2_V_MIN, RX_Brd2_V_MAX]}, ... ] ]
- Return type:
Examples
BBoxOne / CloverCell series
target_freq = 28 service.setOperatingFreq(sn, target_freq) com_dr = service.getCOMDR(sn).RetData print(com_dr)
Execution result for BBoxOne[ [ [-6.5, 10.0], [-5.0, 11.0], [-6.0, 10.0], [-5.0, 10.5] ], [ [-16.5, 0.0], [-15.0, 1.0], [-16.5, 0.0], [-15.0, 0.5] ] ]
Execution result for CloverCell series[ [ {'HORIZON': [-9.5, -2.0], 'VERTICAL': [-8.0, -0.5]} ], [ {'HORIZON': [-5.0, 2.5], 'VERTICAL': [-6.0, 1.5]} ] ]
- getChannelCount(inBoard=False)
Get total number of channel in device (or in one RF board)
- Parameters:
inBoard (bool, optional) – If True, get channel count in one board. Defaults to False.
- Returns:
RetDataint: The channel count of device
- Return type:
Examples
- Get total number of channel
>>> count = service.getChannelCount(sn).RetData >>> print(count) 16
- Get total number of channel in Board/IC
>>> count = service.getChannelCount(sn, inBoard=True).RetData >>> print(count) 4
- getChannelSwitch(mode: RFMode | CellRFMode | int, polar: POLARIZATION | int = None, chain=1)
Retrieve all channel disable settings for the specific RF mode.
Note
0 is channel enabled, 1 is channel disabled
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – The operating mode, e.g., Tx, Rx.
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to None.
- Returns:
RetDatalist: Disable settings for all channels in double list with 0 or 1.
- Return type:
Examples
- BBox series, BBoard gets switch status under TX mode
>>> dis_list = service.getChannelSwitch(sn, RFMode.TX).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under TX mode and H plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.TX, POLARIZATION.HORIZON).RetData >>> print(dis_list) [[0, 0, 0, 0]]
- CloverCell series (dual polarization) gets switch status under RX mode and H/V plane
>>> dis_list = service.getChannelSwitch(sn, CellRFMode.RX, POLARIZATION.DUAL).RetData >>> print(dis_list) [[0, 0, 0, 0], [1, 1, 1, 1]]
- getDFUSupport()
Check if the device supports Device Firmware Upgrade (DFU).
- getDR(rf_mode: RFMode | CellRFMode | int = None)
Get current dynamic range (DR) gain information from calibration table, so we can know the gain setting limit from the DR, then setting the suitable gain for the beamsteering.
Note
Must called
setOperatingFreq()before using calibration table.- Parameters:
rf_mode (Union[RFMode, CellRFMode, int]) – target RF mode. Defaults to None.
- Returns:
RetDatadict: Current dynamic range (DR) values for both TX/RX RF mode if rf_mode is None OR CloverCell series.
list: Current dynamic range (DR) values for specific RF mode.
- Return type:
Examples
- [BBox series] Get current DR values for both TX/RX RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn).RetData print(dr)
{‘TX’: [-10, -5], ‘RX’: [-12, -6]}
- [BBox series] Get current DR values for specific RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn, RFMode.TX).RetData print(dr)
[-10, -5]
- [CloverCell series] Get current DR values for both TX/RX RF mode:
target_freq = 28 service.setOperatingFreq(sn, target_freq) dr = service.getDR(sn).RetData print(dr)
execution result{ 'TX': { 'HORIZON': [-9.5, 5.0], 'VERTICAL': [-8.0, 7.0] }, 'RX': { 'HORIZON': [-5.0, 10.0], 'VERTICAL': [-6.0, 9.0] } }
- getDevTypeName()
Retrieve current name of device
- Returns:
Name of device
Examples
>>> service.getDevTypeName(sn) 'RIS'
- getELEDR()
Get current TX/RX board element-arm dynamic range (ELEDR) gain information from calibration table, and it always in the range between 0 ~ ELEDR.
Note
Must called
setOperatingFreq()before using calibration table.- Returns:
RetDatalist: Current ELEDR values for both TX/RX RF mode.
The list structure:
BBox series[ [ TX_Brd1_LIMIT, TX_Brd2_LIMIT, ... ], [ RX_Brd1_LIMIT, RX_Brd2_LIMIT, ... ] ]or
CloverCell series[ [ {'HORIZON': TX_Brd1_H_LIMIT, 'VERTICAL': TX_Brd1_V_LIMIT}, {'HORIZON': TX_Brd2_H_LIMIT, 'VERTICAL': TX_Brd2_V_LIMIT}, ... ], [ {'HORIZON': RX_Brd1_H_LIMIT, 'VERTICAL': RX_Brd1_V_LIMIT}, {'HORIZON': RX_Brd2_H_LIMIT, 'VERTICAL': RX_Brd2_V_LIMIT}, ... ] ],
- Return type:
Examples
BBoxOne / CloverCell series
target_freq = 28 service.setOperatingFreq(sn, target_freq) ele_dr = service.getELEDR(sn).RetData print(ele_dr)
Execution result for BBoxOne[ [ 3.5, 1.0, 3.5, 2.5 ], [ 5.5, 2.0, 4.5, 5.0 ] ]
Execution result for CloverCell series[ [ {'HORIZON': 7.0, 'VERTICAL': 7.5} ], [ {'HORIZON': 4.0, 'VERTICAL': 5.5} ] ],
- getFastParallelMode()
Get ready or not for fast parallel mode, it checks both of current IC status and external SPI status.
- getFrequencyList(force_refresh=False)
Get supported frequency list in GHz, it respresents the search result of calibration files named
({SN}_{Freq}GHz.csv)underfiles/.
- getOperatingConfig(mode: CellRFMode | int)
Retrieve current operating register config from the device and RFMode.
- Parameters:
mode (Union[CellRFMode, int]) – The RF mode to query.
- Returns:
RetData- dict: all current operating register config,
- structure
{ "HORIZON": { "DISABLE":[ [ disable_list_in_chain1_ic1, ... ], [ disable_list_in_chain2_ic1, ... ], ... ], "PHASE":[ [ phase_list_in_chain1_ic1, ... ], [ phase_list_in_chain2_ic1, ... ], ], "GAIN":[ [ gain_list_in_chain1_ic1, ... ], [ gain_list_in_chain2_ic1, ... ], ], "COM_STEP": [ [ com_step_in_chain1_ic1, ... ] ], }, "VERTICAL": { ... } }
- Return type:
Examples
>>> cfg = service.getOperatingConfig(CellRFMode.TX).RetData >>> print(cfg) { 'HORIZON': { 'DISABLE': [[[0, 0, 0, 0]]], 'PHASE': [[[0, 0, 0, 0]]], 'GAIN': [[[0, 0, 0, 0]]], 'COM_STEP': [[0]] }, 'VERTICAL': { 'DISABLE': [[[0, 0, 0, 0]]], 'PHASE': [[[0, 0, 0, 0]]], 'GAIN': [[[0, 0, 0, 0]]], 'COM_STEP': [[0]] } }
- getOperatingFreq()
Get current operating frequency if called
setOperatingFreq()before.
- getOperatingStatus()
Get IC operating status include H/V power detection, temperature and power consumption
- Returns:
- Return type:
Examples
>>> stat = service.getOperatingStatus(sn).RetData >>> print(stat) { 'pdet': { 'horizon': [2, 4, 4, 3], 'vertical': [2, 3, 3, 4] }, 'temperature': 80.84, 'power': { 'vddPa': {'V': 1784, 'I': 8, 'P': 14}, 'vdd1v8': {'V': 1800, 'I': 398, 'P': 716} } }
- getRFMode()
Retrieve the current RF mode from device.
- Returns:
RetDataCellRFMode: Cell RF mode
- Return type:
Examples
- Get the current RF mode of the device:
>>> rf_mode = service.getRFMode(sn).RetData >>> print(rf_mode.name) TX
- getTemperatureADC()
Retrieve all temperature ADC value from each Board/IC of device
- 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:
- queryCaliTableVer()
Query calibration table version
Note
Must called
setOperatingFreq()before using calibration table.
- queryFWVer()
Query FW version of the device.
Examples
>>> fw_version = service.queryFWVer(sn).RetData >>> print(f"FW Version: {fw_version}") v1.0.0
- 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
- queryTCConfig()
Query dynamic temperature compensation (TC) configuration from device, and the config list should be in the order of [TXC, TXQ, RXC, RXQ].
Note
The TXC and TXQ are the common/element gain attenuation for TX channels respectively. TX/RX C contributes about 1dB gain, and TX/RX Q contributes about 0.5 dB gain, step range is 0-31.
- Returns:
RetCodelist: TC config with trible list format, each board/IC includes [TXC,TXQ,RXC,RXQ]
- Return type:
Examples
>>> service.queryTCConfig(sn) [[[8, 6, 2, 11]]]
- queryTCEnable()
Query dynamic temperature compensation (TC) enable status from device.
- reboot()
Reboot of the device.
- saveAAKitFile(kitName=None, callback=None, check=True, context=None)
Save to AA-Kit csv file with AA-Kit name if customized
Note
Must called
setAAKitInfo()before using saving to file.- Parameters:
kitName (str, optional) – The name of the AAKit to save. Defaults to None.
- Return type:
Examples
Set new custom AA-Kit information to BBoxOne:
custAAKitName = "MyAAKIT" aakit_info = { "kitName": custAAKitName, "spacing": [5.0, 5.0], "steeringH": [-45.0, 45.0], "steeringV": [-45.0, 45.0], "offsetTx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "offsetRx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } service.setAAKitInfo(sn, aakit_info) service.saveAAKitFile(sn, custAAKitName) print(service.getAAKitInfo(sn, custAAKitName).RetData)
Execution result{ 'DEV_TYPE': 9, 'TYPE': 1, 'SPACING': [5.0, 5.0], 'STEERING_H': [-45.0, 45.0], 'STEERING_V': [-45.0, 45.0], 'OFFSET_TX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'OFFSET_RX': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
- selectAAKit(kitName)
Set operating AA-Kit by AAKIT_NAME, this name is from AAKIT_*.csv or one of fetched result from
getAAKitList()Note
File name rule of AA-Kit antenna table -> AAKIT_{AAKitName}.csv
- Parameters:
kitName (str) – The name of the AA-Kit to select.
- Returns:
- Return type:
Examples
- Direct selection for specific AA-Kit
>>> aakit_name = "TMYTEK_28ONE_4x4_C2123E001-28" >>> service.selectAAKit(sn, aakit_name)
Select from available AA-Kits, you can iterate through the list and select each one, here we select the first AA-Kit as example.
aakit_list = service.getAAKitList(sn).RetData for index, aakit_name in enumerate(aakit_list): # print(f"Index: {index}, Value: {aakit_name}") if index == 0: service.selectAAKit(sn, aakit_name)
- setAAKitInfo(kitName: str, spacing: list, steeringH: list, steeringV: list, offsetTx: list | dict, offsetRx: list | dict, custom=1, callback=None, dev_type=None, newKitName=None)
Set AA-Kit information, and this function is used to set or update the AA-Kit information in the AA-Kit table.
- Parameters:
kitName (str) – The name of the AA-Kit.
spacing (list) – Antenna x,y spacing between elements.
steeringH (list) – Horizontal steering angles.
steeringV (list) – Vertical steering angles.
offsetTx (Union[list, dict]) – TX phase offset steps, the number of list includes all polarizations, and each polarization includes all antenna channels.
offsetRx (Union[list, dict]) – RX phase offset steps, the number of list includes all polarizations, and each polarization includes all antenna channels.
custom (int, optional) – The custom flag. Defaults to 1.
callback (function, optional) – The callback function. Defaults to None.
dev_type (int, optional) – The device type. Defaults to None.
newKitName (str, optional) – The new kit name. Defaults to None.
- Returns:
RetDatastr: New AA-Kit name
- Return type:
Examples
Set new custom AA-Kit information to BBoxOne:
aakit = { "kitName": "MyAAKIT", "spacing": [5.0, 5.0], "steeringH": [-45.0, 45.0], "steeringV": [-45.0, 45.0], "offsetTx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "offsetRx": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } service.setAAKitInfo(sn, aakit)
- setBeamAngle(gain_db, theta, phi, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, mode: ~tlkcore.TMYPublic.RFMode | int = None)
Perform beamsteering with the gain,angle,polarization parameters.
Note
Must call
setOperatingFreq()andselectAAKit()andgetDR()before setting the beam angle.- Parameters:
gain_db (float) – Gain setting in the range of
getDR().theta (int) – Theta angle in the range of STEERING_H field from
getAAKitInfo().phi (int) – Phi angle in the range of 0-359.
polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.mode (Union[RFMode, CellRFMode, int]) – Specific RF mode. Defaults to None for the current RF Mode.
- Returns:
- Return type:
Examples
- Set beam angle for BBoxOne/BBoxLite:
mode = RFMode.TX # or RFMode.RX service.setRFMode(sn, mode) # 1. Get available frequency first, it reference from files/ freq_list = service.getFrequencyList(sn).RetData if len(freq_list) == 0: print("CAN NOT find your calibration files in 'files' -> exit") return # print(f"Available frequency list: {freq_list}") # 2. Set the operating frequency # Note: The frequency must be in the available frequency list. # If you want to set a specific frequency, please check the available frequency list first. target_freq = 28.0 if target_freq not in freq_list: print(f"Not support your target freq:{target_freq} in freq list!") return service.setOperatingFreq(sn, target_freq) # 3. Set the AA-Kit, please reference from files/ and AA-Kit name aakit_name = "TMYTEK_28ONE_4x4_C2123E001-28" service.selectAAKit(sn, aakit_name) # 4. Configure gain parameter, it must in the range of DR rng = service.getDR(sn, mode).RetData gain_max = rng[1] # Gain setting # 5. Set beam angle with gain, theta, phi and polarization # Note: Polarization is optional, if not set, it will use the default polarization. theta = 30 # Theta angle phi = 45 # Phi angle service.setBeamAngle(sn, gain_max, theta, phi)
- setBeamPattern(mode: RFMode | int, beamId: int, beamType: BeamType | int, config: dict = None, description: str = None, save=True)
Set user-defined beam patterns in local memory, it allows partial modification based on the default beam pattern.
- Parameters:
mode (Union[RFMode, int]) – The RF mode.
beamId (int) – The specific beam ID.
beamType (Union[BeamType, int]) – The beam type.
config (dict, optional) – The config for specific
BEAMorCHANNELconfig. Defaults to None.description (str, optional) – The description string. Defaults to None.
save (bool, optional) – Whether to save the changes into files. Defaults to True.
- Return type:
Examples
- Set a beam pattern for BBoxOne
config = { 'db': 3.5, 'theta': 0, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 1, BeamType.BEAM, config, "BoresightBeam")
- setChannelGainPhase(channel: int, gain_db: float | list, phase_deg: float | list, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, board: int = -1, applySetting=True)
Set Gain and Phase setting for the specific channel or ALL channels for the current RF mode (set from
setRFMode()).- Parameters:
channel (int) – Channel number, range is starts from 1 to the result of
getChannelCount(). it also for ALL channels if sets 0.gain_db (Union[float, list]) – gain with db
phase_deg (Union[float, list]) – phase with degree
polar (Union[POLARIZATION, int], optional) – Polarization configuration for CloverCell. Defaults to
DUALboard (int) – The board/IC number starts from 1 to the result of
getBoardCount(). Defaults to -1, which means all board/ICs.applySetting (bool, optional) – Batch apply for WEB-TLK. Defaults to True.
- Returns:
- Return type:
Warning
Please carefully set the gain for a single channel because it might differ from the other channels which gain exceeds the allowable limit (element gain). An error might occur while setting all channels iteratively.
Examples
- Set Gain and Phase for a specific channel on a specific board/IC
channel = 2 # Channel number starts from 1 gain_db = -3.5 # Gain in dB phase_deg = 285 # Phase in degree board = 1 # Board/IC number starts from 1 service.setChannelGainPhase(sn, channel, gain_db, phase_deg, board)
- Set Gain and Phase for all channels on a all board/ICs
- Correct example
gain_list = [-3.5, -3.5, -4, -3.5, -14, -14, -10.5, -10.5, -3, -3, -3, -3, -2, -2, -2, -2] phase_list = [0, 285, 210, 135, 25, 310, 235, 160, 50, 335, 260, 185, 70, 355, 280, 205] channel = 0 # Set all channels service.setChannelGainPhase(sn, channel, gain_list, phase_list)
Incorrect example (set all channel iteratively)for i in range(len(gain_list)): service.setChannelGainPhase(sn, i+1, gain_list[i], phase_list[i])
Changed in version v2.1.0: polar added for multi-polarization beamformer device
- setFastParallelMode(toEnable: bool)
Sync all default & user-defined beam patterns to devices and enable/disable external SPI control after call
setBeamPattern()- Parameters:
toEnable (bool) – To enable/disable fast parallel mode and external SPI.
- Returns:
- An object containing the result of the operation.
OK: If the operation is successful.ERROR_FW_NOT_SUPPORT: If the firmware version does not support this feature.ERROR: If there is an error during the operation.
- Return type:
Examples
- [BBoxOne] Set 2 user-defined beam patterns and sync to device
# User-defined beam id 1 & 2 config = { 'db': 3.5, 'theta': 0, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 1, BeamType.BEAM, config) config = { 'db': 3, 'theta': 30, 'phi': 0 } service.setBeamPattern(sn, RFMode.TX, 2, BeamType.BEAM, config) # Sync all user-defined beam patterns to device and start fast parallel mode service.setFastParallelMode(sn, True)
- setIcChannelGain(board: int, ch_gain: list, common_gain: list | float = None, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>, applySetting=True)
Set Gain settings for all channels in the specific/all board/IC for the current RF mode (set from
setRFMode()).- Parameters:
board (int) – board/IC number, starts from 1 to the result of
getBoardCount(), and 0 means for all boards.ch_gain (list) – Channel gain list includes 4 channels in one board, and should be in the range of 0 -
getDR()if common_gain is None or in the range of 0 -getELEDR()if common_gain is notNone.common_gain (Union[list, float], optional) – common gain is a gain base within 4 channels in one board or a list structure for all boards(board=0), and must in the range of
getCOMDR(). Defaults to None while ignore setting common gain.polar (Union[POLARIZATION, int]) – Polarization configuration for CloverCell. Defaults to
DUAL.applySetting (bool, optional) – batch apply and it used by WEB-TLK. Defaults to True.
- Return type:
Examples
- [BBoxOne] Set IC channel gain for all board/ICs without common gain
- Here we consider it as total channel gain if without common gain
mode = RFMode.TX board = 0 # for all boards dr = service.getDR(sn, mode).RetData dr_test = (dr[0] + dr[1]) / 2 # just take a sample service.setIcChannelGain(sn, board, [dr_test]*4)
- [BBoxOne] Set IC channel gain for all board/ICs with common gain
Warning
Must carefully the taken com step should in range of COMDRs of all boards, basically we don’t recommend to set common gain for all boards.
Here we consider the channel gain will be summation of element gain and common gain if common_gain is not Nonemode = RFMode.TX board = 0 # for all boards total_board = service.getBoardCount(sn).RetData com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][0] # here use 1st com dr, but shall check COMDRs of all boards common_gain_max = common_gain_rng[1] ele_dr = service.getELEDR(sn).RetData ele_g_max = ele_dr[mode.value][0] # here use 1st ele dr service.setIcChannelGain(sn, board, [ele_g_max]*4, common_gain_max)
- [BBoxOne] Set IC channel gain for specific board/IC without common gain
- Here we consider it as total channel gain if without common gain
mode = RFMode.TX board = 1 # here we use 1st board as example dr = service.getDR(sn, mode).RetData dr_test = (dr[0] + dr[1]) / 2 # just take a sample service.setIcChannelGain(sn, board, [dr_test]*4)
- [BBoxOne] Set IC channel gain for specific board/IC with common gain
- Here we consider the channel gain will be summation of element gain and common gain if common_gain is not None
mode = RFMode.TX board = 1 # here we use 1st board as example com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][board-1] # here use 1st com dr ele_dr = service.getELEDR(sn).RetData ele_g_max = ele_dr[mode.value][board-1] # here use 1st ele dr service.setIcChannelGain(sn, board, [ele_g_max]*4, common_gain_rng[1])
Changed in version v2.1.0: polar added for multi polarization beamform device
- setIcComGain(polar: POLARIZATION | int, board: int, common_gain: float)
Only set common gain for specific polarization and board/IC
- Parameters:
polar (Union[POLARIZATION, int]) – Polarization
board (int) – Board/IC number, starts from 1, and 0 means for all boards/ICs
common_gain (float) – common gain is a gain base within 4 channels in one board, must in the range of
getCOMDR().
- Returns:
- Return type:
Examples
- Set common gain for board/IC 1 and polarization horizontal
mode = RFMode.TX polar = POLARIZATION.HORIZONTAL board = 1 com_dr = service.getCOMDR(sn).RetData common_gain_rng = com_dr[mode.value][0] # here use 1st com dr, but shall check COMDRs of all boards common_gain_max = common_gain_rng[1] service.setIcComGain(sn, polar, board, common_gain_max)
- setOperatingFreq(freq: int | float)
Set frequency in GHz and reload cali/beam tables, the frequency range is called from
getFrequencyList()- Parameters:
freq (float) – Frequency point in GHz
- Returns:
- Return type:
Examples
- Direct to set frequency with 28GHz
>>> target_freq = 28 >>> service.setOperatingFreq(sn, target_freq)
- Get frequency list before setting (set 28GHz here)
freq_list = service.getFrequencyList(sn).RetData if len(freq_list) == 0: print("CAN NOT find your calibration files in 'files' -> exit") return print(f"Available frequency list: {freq_list}") # Please set your target freq target_freq = 28.0 if target_freq not in freq_list: print(f"Not support your target freq:{target_freq} in freq list!") return service.setOperatingFreq(sn, target_freq)
- setRFMode(mode: RFMode | CellRFMode | int, slots: list = None)
Set target RF mode to device
- Parameters:
mode (Union[RFMode, CellRFMode, int]) – Target RF mode
- Returns:
- Return type:
Examples
>>> service.setRFMode(sn, RFMode.TX)
- setStaticIP(ip, reboot=False)
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 False.
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)
- switchChannel(channel=0, disable: bool = False, polar: ~tlkcore.TMYPublic.POLARIZATION | int = <POLARIZATION.DUAL: 3>)
Disable/enable the specific channel power or not for the current RF mode.
Note
Disable/enable ALL channels if
channelfield sets 0.- Parameters:
channel (int, optional) – Channel number, range is starts from 1 to the result of
getChannelCount(). Defaults to 0disable (bool, optional) – Whether to disable the channel. Defaults to False.
polar (Union[POLARIZATION, int], optional) – The polarization type. Defaults to
DUAL.
- Returns:
- Return type:
Examples
- Disable a specific channel on horizon polarization
>>> channel = 2 # Channel number starts from 1 >>> service.switchChannel(sn, channel, True, POLARIZATION.HORIZON)