TMYPublic
- class tlkcore.TMYPublic.RetCode(*values)
Bases:
EnumError code to represent the status of operations in TLKCore.
- OK = 0
- WARNING = 1
- ERROR = 2
- NO_RESPONSE = 3
- ERROR_GET_SN = 10
- ERROR_DEV_TYPE = 11
- ERROR_SCAN = 12
- ERROR_INIT_OBJECT = 13
- ERROR_DEV_NOT_INIT = 14
- ERROR_METHOD_NOT_FOUND = 15
- ERROR_METHOD_NOT_SUPPORT = 16
- ERROR_REFLECTION = 17
- ERROR_POWER = 18
- ERROR_EXPORT_LOG = 19
- ERROR_FW_NOT_SUPPORT = 20
- ERROR_COMM_NOT_INIT = 30
- ERROR_COMM_INIT = 31
- ERROR_DISCONNECT = 32
- ERROR_SOCKET = 33
- ERROR_SEND_CMD = 34
- ERROR_RESP_CMD = 35
- ERROR_SEND_CMD_TIMEOUT = 36
- ERROR_COMPORT = 37
- ERROR_USB = 38
- ERROR_CMD = 40
- ERROR_CMD_INIT = 41
- ERROR_CMD_PARAM = 42
- ERROR_DB_SERVER = 50
- ERROR_DB_FEEDBACK = 51
- ERROR_DFU = 60
- ERROR_DFU_NOT_SUPPORT = 61
- ERROR_DFU_TYPE = 62
- ERROR_DFU_HEADER = 63
- ERROR_DFU_TRANSMIT = 64
- ERROR_BF_STATE = 100
- ERROR_BF_AAKIT = 101
- ERROR_BF_NO_AAKIT = 102
- ERROR_BF_CALI_PATH = 103
- ERROR_BF_BEAM = 104
- ERROR_BF_GAIN = 105
- ERROR_BF_PHASE = 106
- ERROR_BF_RFMODE = 107
- ERROR_BF_CALI_INCOMPLTE = 108
- ERROR_BF_CALI_PARSE = 109
- ERROR_BF_TC = 110
- ERROR_BF_BEAM_FILE = 111
- ERROR_PD_CALI = 150
- ERROR_PD_SOURCE = 151
- ERROR_RIS_MODULE = 160
- ERROR_RIS_CONFIG = 161
- ERROR_FREQ_RANGE = 240
- ERROR_LICENSE_LENGTH = 241
- ERROR_LICENSE_KEY = 242
- ERROR_REF_CHANGE = 243
- ERROR_UD_FREQ = 245
- ERROR_FREQ_EQUATION = 250
- WARNING_HARMONIC = 251
- ERROR_HARMONIC_BLOCK = 252
- ERROR_PLO_UNLOCK = 253
- ERROR_PLO_CRC = 254
- ERROR_UD_STATE = 255
- class tlkcore.TMYPublic.DevInterface(*values)
Bases:
FlagDefines device connect interface for scanning. Used in
scanDevices().- UNKNOWN = 0
- LAN = 1
- COMPORT = 2
- USB = 4
- ALL = 7
- class tlkcore.TMYPublic.ScanFilter(*values)
Bases:
FlagDefines scan filter flags for device scanning. Used in
getScanInfo().- NONE = 0
- NORMAL = 1
- DFU = 2
- ALL = 3
- class tlkcore.TMYPublic.IPMode(*values)
Bases:
EnumDefines device IP mode as DHCP or static IP mode.
- DHCP = 0
- STATIC_IP = 1
- class tlkcore.TMYPublic.RFMode(*values)
Bases:
EnumDefines RF mode of beamform devices series.
- TX = 0
- RX = 1
- class tlkcore.TMYPublic.CellRFMode(*values)
Bases:
EnumDefines RF mode of cell devices series.
- STANDBY = -1
- TX = 0
- RX = 1
- class tlkcore.TMYPublic.BeamType(*values)
Bases:
EnumDefines beam type of beamform devices series for beam configuration with dict structure. Used in
setBeamPattern().- Beam config includes keys:
db: The gain setting in the range of
getDR()theta: In the range of STEERING_H field from
getAAKitInfo()phi: In the range of 0-359
Default Beam config{ "db": MAX value of dynamic range (DR), "theta": 0, "phi": 0 }
- Channel config includes keys:
- board_{N}: the board index, starts from 1
common_db: common gain setting for all channels in the board
- channel_{N}: channel index, starts from 1
sw: Disable switch, 0: enable/on, 1: disable/off
db: The gain setting, in the range of 0 -
getELEDR()deg: The phase degree in the range of 0-359.
Default Channel config{ "board_1": { "common_db": MAX value of COMDR, "channel_1": { "sw": 0, "db": MAX value of ELEDR, "deg": 0 }, "channel_2": { "sw": 0, "db": MAX value of ELEDR, "deg": 0 }, ... }, "board_2": { ... }, ... }
- BEAM = 0
- CHANNEL = 1
- class tlkcore.TMYPublic.UDFreq(*values)
Bases:
EnumUD frequency related categories, also used for key name of dict when calling
getUDFreq()- UDFreq = 0
- RFFreq = 1
- IFFreq = 2
- class tlkcore.TMYPublic.UDState(*values)
Bases:
EnumThe state of UDBox5G, the key, value pairs are defined as follows:
State
Description
Value
NO_SET
All status
PLO_LOCK
Lock status
0: unlock, 1: locked
CH1
CH1 enable
0: disable, 1: enable
CH2
CH2 enable
0: disable, 1: enable
OUT_10M
10MHz output
0: disable, 1: enable
OUT_100M
100MHz output
0: disable, 1: enable
SOURCE_100M
100MHz source
0: Internal, 1: External or
UD_REFLED_100M
LED state indicator
0: OFF, 1: WHITE, 2: BLUE
PWR_5V
5V power output
0: disable, 1: enable
PWR_9V
9V power output
0: disable, 1: enable
- NO_SET = -1
- PLO_LOCK = 0
- CH1 = 1
- CH2 = 2
- OUT_10M = 3
- OUT_100M = 4
- SOURCE_100M = 5
- LED_100M = 6
- PWR_5V = 7
- PWR_9V = 8
- class tlkcore.TMYPublic.UDMState(*values)
Bases:
FlagThe state of UDM
State
Description
Reference class/enum
SYSTEM
System state
PLO_LOCK
PLO Lock state
REF_LOCK
Reference Lock state
LICENSE
License state
- NO_SET = 0
- SYSTEM = 1
- PLO_LOCK = 2
- REF_LOCK = 4
- LICENSE = 8
- ALL = 15
- class tlkcore.TMYPublic.UDM_SYS(*values)
Bases:
EnumIt defines the
UDMState.SYSTEMstate of UDM- SYS_ERROR = -1
- NORMAL = 0
- class tlkcore.TMYPublic.UD_PLO(*values)
Bases:
EnumIt defines the
UDMState.PLO_LOCKstate of UD series- UNLOCK = -1
- LOCK = 0
- class tlkcore.TMYPublic.UD_REF(*values)
Bases:
EnumIt defines the
UDMState.REF_LOCKstate of UD series- UNLOCK = -1
- INTERNAL = 0
- EXTERNAL = 1
- class tlkcore.TMYPublic.UDM_LICENSE(*values)
Bases:
EnumIt defines the
UDMState.LICENSEstate of UDM- VERIFY_FAIL_FLASH = -2
- VERIFY_FAIL_DIGEST = -1
- NON_LICENSE = 0
- VERIFY_PASS = 1
- class tlkcore.TMYPublic.UD_SN_TYPE(*values)
Bases:
FlagThe SN type of UD
- UD_BOX = 1
- UD_MODULE = 2
- ALL = 3
- class tlkcore.TMYPublic.UD_LO_CONFIG(*values)
Bases:
EnumIt defines the LO config for UDB series
Config (enum)
integer
Description
LO_CFG_INTERNAL
0
Set the LO to internal mode
LO_CFG_INTERNAL_OUT
1
Set the LO to output mode
LO_CFG_EXTERNAL_IN
2
Set the LO to external mode
- LO_CFG_INTERNAL = 0
- LO_CFG_INTERNAL_OUT = 1
- LO_CFG_EXTERNAL_IN = 2
- class tlkcore.TMYPublic.POLARIZATION(*values)
Bases:
FlagDefines the polarization states for beamforming devices.
- HORIZON = 1
- VERTICAL = 2
- DUAL = 3
- class tlkcore.TMYPublic.POLAR_SYNTHESIS(*values)
Bases:
IntEnumDefines the polarization synthesis states for beamforming devices.
- FORWARD = 0
- BACKWARD = 180
- RIGHT_HAND_CIRCULAR = 90
- LEFT_HAND_CIRCULAR = 270
- conjugate()
Returns self, the complex conjugate of any int.
- bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- to_bytes(length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
- real
the real part of a complex number
- imag
the imaginary part of a complex number
- numerator
the numerator of a rational number in lowest terms
- denominator
the denominator of a rational number in lowest terms
- class tlkcore.TMYPublic.RIS_Dir(distance, angle: int | tuple = (0, 0))
Bases:
dictA dict structure for RIS direction includes distance and angle. Used in
setRISAngle().- Parameters:
distance (float) – Distance from RIS to the source/target
angle (tuple) – Angle of the target, given in (theta, phi) format or theta only with phi=0, Defaults to (0,0)
Examples
- For a distance of 1 meter and an angle of (0, 0):
>>> RIS_Dir(1)
- For a distance of 1 meter and an angle of (0, 0):
>>> RIS_Dir(1, (0, 0))
- For a distance of 1 meter and an angle of (30, 0):
>>> RIS_Dir(1, (30, 0))
Added in version v2.3.0.
- clear() None. Remove all items from D.
- copy() a shallow copy of D
- classmethod fromkeys(iterable, value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values
- class tlkcore.TMYPublic.RIS_ModuleConfig(central_freq_mhz: float, module: int | list = 1, module_rotate=None)
Bases:
dictA data structure for RIS module configuration. Used in
setRISAngle().- Parameters:
central_freq_mhz (int) – Operating central frequency in MHz.
module (Union[int, list]) – Specifies the target module partition to control. It can be a single value (e.g. 1), or a list (e.g. [1, 2]), or a nested list (e.g. [[1, 2]] or [[1, 2], [3, 4]]). Defaults to 1.
module_rotate (dict) – Specifies the clockwise rotation degree for each module, therefore the actual pattern will be counter-clockwise rotation The degree must be a multiple of 90.
Examples
- 28GHz with only module 1, no rotation:
>>> RIS_ModuleConfig(28000, 1)
- 28GHz with module 1 and 2 in landscape orientation, no rotation:
>>> RIS_ModuleConfig(28000, [1, 2])
- 28GHz with module 1 and 2 in portrait orientation, rotate module 1 by 90 degrees:
>>> RIS_ModuleConfig(28000, [[1], [2]], {'1': 90})
- 28GHz with module 1 and 2 in landscape orientation, rotate module 1 by 90 degrees and module 2 by 180 degrees:
>>> RIS_ModuleConfig(28000, [1, 2], {'1': 90, '2': 180})
- 28GHz with module 1,2,3,4 in landscape orientation, no rotation:
>>> RIS_ModuleConfig(28000, [1, 2, 3, 4])
- 28GHz with module 1,2,3,4 in portrait orientation, no rotation:
>>> RIS_ModuleConfig(28000, [[1], [2], [3], [4]])
- 28GHz with module 1,2,3,4 in square orientation, rotate module 1 by 90 degrees and module 2 by 180 degrees:
>>> RIS_ModuleConfig(28000, [[1, 2], [3, 4]], {'1': 90, '2': 180})
Added in version v2.3.0.
- clear() None. Remove all items from D.
- copy() a shallow copy of D
- classmethod fromkeys(iterable, value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values