UD Series

UD Box 5G

class tlkcore.tmydev.DevUDBox.UDBox(*parent)

Bases: UDConverter

UDBox 5G

queryStaticIP()

Query the static IP address of the device.

Parameters:

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

Returns:

RetData
  • str: Static IP of the device.

Return type:

RetType

Note

Some FW versions of device not support this feature

Examples

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

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

Parameters:

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

Return type:

RetType

Note

Some FW versions of device not support this feature.

Examples

Set the static IP address of a device:
>>> from tlkcore.TLKCoreService import TLKCoreService
>>> service = TLKCoreService(".")
>>> sn = "UD-BD21080037-24"
>>> info = [sn, "192.168.100.112", 15]
>>> service.initDev(*tuple(info))
>>> service.resetStaticIP(sn, True)
getUDFreq()

Query frequency configuration from UD

Returns:

RetData
  • dict: the frequency configuration with the following keys
    • IFFreq: The IF range in kHz.

    • UDFreq: The UD frequency range in kHz.

    • RFFreq: The RF range in kHz.

Return type:

RetType

Changed in version TLKCore: v1.2.1 and UD5G v3.0.0 starts to support query real UD frequency configurations.

getUDState(item: UDState | int = UDState.NO_SET)

Retrieve all or a specific UD state.

Parameters:

item (Union[UDState, int], optional) – The specific UD state to retrieve. Defaults to UDState.NO_SET.

Returns:

RetData, and it returns the different types from the different queries.
  • dict: A dictionary of all UD states if item is UDState.NO_SET.

  • int: The value of the specific UD state if item is a specific state.

Return type:

RetType

Examples

  • Get the current state of the PLO lock:
    >>> state = service.getUDState(sn, UDState.PLO_LOCK)
    >>> print(state)
    1
    
  • Get all UD states:
    >>> state = service.getUDState(sn)
    >>> print(state)
    {'PLO_LOCK': 1, 'CH1': 1, 'CH2': 1, 'OUT_10M': 0, 'OUT_100M': 0, 'SOURCE_100M': 0, 'LED_100M': 1, 'PWR_5V': 0, 'PWR_9V': 0}
    
setUDState(newState, item: UDState | int = UDState.NO_SET)

Set all or a specific UD state.

..note::

PLO_LOCK does not allow to set.

Parameters:
  • newState (Union[dict, UD_REF, int]) –

    dict:
    • {UDState: value, …} if item use default value: NO_SET for ALL states.

    UD_REF:
    int:
    • int value if item uses single UD states: Use an integer value.

  • item (Union[UDState, int], optional) – The specific UD state to set. Defaults to NO_SET.

Returns:

RetData. An object containing the result of the operation.
  • dict: A dictionary of all UD states if item is NO_SET.

  • int: The value of the specific UD state if item is a specific state.

Return type:

RetType

Examples

  • Set the CH1 state off then on:
    >>> service.setUDState(sn, 0, UDState.CH1)
    >>> service.setUDState(sn, 1, UDState.CH1)
    
  • Switch 100M reference source to external, then please plug-in reference source:
    >>> service.setUDState(sn, UD_REF.EXTERNAL, UDState.SOURCE_100M)
    
  • Get ALL states, and modify partial states to set (e.g. set CH1 on and output 100M reference clock):
    state = service.getUDState(sn).RetData
    state.update({
        UDState.OUT_100M.name: 1,
        UDState.PWR_5V.name: 1
    })
    new_state = service.setUDState(sn, state)
    print(f"new_state: {new_state}")
    

    new_state: {‘PLO_LOCK’: 1, ‘CH1’: 1, ‘CH2’: 1, ‘OUT_10M’: 0, ‘OUT_100M’: 1, ‘SOURCE_100M’: 0, ‘LED_100M’: 1, ‘PWR_5V’: 1, ‘PWR_9V’: 0}

getDFUSupport()

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

Returns:

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

Return type:

RetType

getDevTypeName()

Retrieve current name of device

Returns:

Name of device

Examples

>>> service.getDevTypeName(sn)
'RIS'
getHarmonic(freq_ud: int | float, freq_if: int | float, bandwidth: int | float)

Check if the freq setting affected by harmonic (KHz), not check equation here.

Note

This function always return OK, please monitor the RetData.

Parameters:
  • freq_ud (Union[int,float]) – LO frequency as kHz

  • freq_if (Union[int,float]) – IF frequency as kHz

  • bandwidth (Union[int,float]) – bandwidth frequency as kHz

Returns:

RetData
  • bool: harmonic or not

Return type:

RetType

Examples

  • Normal case
    >>> ret = service.getHarmonic(sn, 24e6, 4e6, 100000)
    >>> print(ret)
    False
    
  • Harmonic case
    >>> ret = service.getHarmonic(sn, 24e6, 3e6, 100000)
    >>> print(ret)
    True
    

Changed in version TLKCore: v2.1.0 removed freq_rf parameter

getInjectionLO(freq_rf, freq_if)

Get the High-side / Low-side Injection LO frequency based on the RF and IF frequencies in kHz.

LSI

RF

HSI

LO=RF-IF

RF

LO=RF+IF

Parameters:
  • freq_rf (float) – The RF frequency with unit in kHz.

  • freq_if (float) – The IF frequency with unit in kHz.

Returns:

RetData
  • dict: A dictionary with the following keys
    • LSI (float): Low-side (LO<RF) LO frequency in kHz.

    • HSI (float): High-side (LO>RF) LO frequency in kHz.

Return type:

RetType

Examples

>>> inj = service.getInjectionLO(sn, 28e6, 2e6).RetData
>>> print(inj)
{'LSI': 26000000.0, 'HSI': 30000000.0}

Added in version v2.3.0.

getRecommendLO(freq_rf, freq_if, bandwidth)

Get the recommended local oscillator (LO) frequency based on the RF and IF frequencies.

Deprecated since version v2.3.0: Please use getInjectionLO instead.

queryFWVer()

Query FW version of the device.

Returns:

RetData
  • str: FW version.

Return type:

RetType

Examples

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

Query the hardware version of the device.

Returns:

RetData
  • str: The hardware version as a string.

Return type:

RetType

Examples

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

Query the bootloader version of the device.

Returns:

RetData
  • str: The bootloader version as a string.

Return type:

RetType

queryMAC()

Query the MAC address of the device.

Returns:

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

Return type:

RetType

Examples

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

Query the serial number of the device.

Returns:

RetData
  • str: The serial number of the device.

Return type:

RetType

reboot()

Reboot of the device.

Returns:

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

Return type:

RetType

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:

RetType

Examples

Set the static IP address of a device:
>>> service.setStaticIP(sn, "192.168.100.150", True)
setUDFreq(freq_ud: int | float, freq_rf: int | float = 0, freq_if: int | float = 0, bandwidth: int | float = 100000, forceSend=False)

Set UD frequency in kHz, it also calls getHarmonic() if not forced.

Note

Setting will make effect even if harmonic warning

Parameters:
  • freq_ud (Union[int, float]) – The UD frequency in kHz.

  • freq_rf (Union[int, float], optional) – The RF frequency in kHz. Defaults to 0.

  • freq_if (Union[int, float], optional) – The IF frequency in kHz. Defaults to 0.

  • bandwidth (Union[int, float], optional) – The bandwidth in kHz. Defaults to 100000.

  • forceSend (bool, optional) – True to force send the frequency. Defaults to False.

Return type:

RetType

Examples

  • Set UD frequency to 25GHz with RF frequency 28GHz and IF frequency 3GHz
    >>> ret = service.setUDFreq(sn, 25e6, 28e6, 3e6)
    >>> print(ret)
    [RetType] OK
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 25000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 24GHz with RF frequency 27GHz and IF frequency 3GHz -> Harmonic warning but still set
    >>> ret = service.setUDFreq(sn, 24e6, 27e6, 3e6)
    >>> print(ret)
    [RetType] WARNING_HARMONIC, Harmonic warning <LO:24000000,IF:3000000> by IF range: (2880000.0, 3120000.0)
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 24000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 26GHz only -> equation error due to default RF/IF frequency
    >>> ret = service.setUDFreq(sn, 26000000)
    >>> print(ret)
    [RetType] ERROR_FREQ_EQUATION, Frequency equation error !
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 24000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 26GHz forcefully
    >>> ret = service.setUDFreq(sn=sn, freq_ud=26000000, forceSend=True)
    >>> print(ret)
    [RetType] OK
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 26000000.0, 'RFFreq': 0, 'IFFreq': 0}
    

UD Module 0620

class tlkcore.tmydev.DevUDM.UDM(*parent)

Bases: UDConverter

querySN()

Query the serial number of the device.

Returns:

RetData
  • str: The serial number of the device.

Return type:

RetType

queryHWVer()

Query the hardware version of the device.

Returns:

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

Return type:

RetType

Examples

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

Query the firmware version of the device.

Returns:

RetData
  • str: FW version.

Return type:

RetType

Examples

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

Retrieve the maximum capability of the frequency range for IF, UD, and RF in kHz.

Returns:

RetData
  • dict: A dictionary with the maximum frequency capability (include min & max) for IF, UD, and RF.
    • IFFreq: The maximum IF range in kHz.

    • UDFreq: The maximum UD frequency range in kHz.

    • RFFreq: The maximum RF range in kHz.

Return type:

RetType

Examples

  • Get the frequency limits from UDB-0620:
    >>> freq_limit = service.getUDFreqLimit(sn).RetData
    >>> print(freq_limit)
    {
        'IFFreq': {'min': 1000000, 'max': 10000000},
        'UDFreq': {'min': 6000000.0, 'max': 20000000.0},
        'RFFreq': {'min': 6000000.0, 'max': 20000000.0}
    }
    
getUDFreqRange()

Retrieve the current available frequency range for IF, UD, and RF in kHz.

Returns:

RetData
  • dict: A dictionary with the available frequency ranges for IF, UD, and RF.
    • IFFreq: The IF range in kHz.

    • UDFreq: The UD frequency range in kHz.

    • RFFreq: The RF range in kHz.

Return type:

RetType

Examples

  • Get the frequency range from UDB-0620:
    >>> freq_range = service.getUDFreqRange(sn).RetData
    >>> print(freq_range)
    {
        'IFFreq': {'min': 1000000, 'max': 10000000},
        'UDFreq': {'min': 6000000.0, 'max': 10000000.0},
        'RFFreq': {'min': 6000000.0, 'max': 10000000.0}
    }
    
getUDFreq()

Query frequency configuration from UD

Returns:

RetData
  • dict: the frequency configuration with the following keys
    • IFFreq: The IF range in kHz.

    • UDFreq: The UD frequency range in kHz.

    • RFFreq: The RF range in kHz.

Return type:

RetType

getDFUSupport()

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

Returns:

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

Return type:

RetType

getDevTypeName()

Retrieve current name of device

Returns:

Name of device

Examples

>>> service.getDevTypeName(sn)
'RIS'
getHarmonic(freq_ud: int | float, freq_if: int | float, bandwidth: int | float)

Check if the freq setting affected by harmonic (KHz), not check equation here.

Note

This function always return OK, please monitor the RetData.

Parameters:
  • freq_ud (Union[int,float]) – LO frequency as kHz

  • freq_if (Union[int,float]) – IF frequency as kHz

  • bandwidth (Union[int,float]) – bandwidth frequency as kHz

Returns:

RetData
  • bool: harmonic or not

Return type:

RetType

Examples

  • Normal case
    >>> ret = service.getHarmonic(sn, 24e6, 4e6, 100000)
    >>> print(ret)
    False
    
  • Harmonic case
    >>> ret = service.getHarmonic(sn, 24e6, 3e6, 100000)
    >>> print(ret)
    True
    

Changed in version TLKCore: v2.1.0 removed freq_rf parameter

getInjectionLO(freq_rf, freq_if)

Get the High-side / Low-side Injection LO frequency based on the RF and IF frequencies in kHz.

LSI

RF

HSI

LO=RF-IF

RF

LO=RF+IF

Parameters:
  • freq_rf (float) – The RF frequency with unit in kHz.

  • freq_if (float) – The IF frequency with unit in kHz.

Returns:

RetData
  • dict: A dictionary with the following keys
    • LSI (float): Low-side (LO<RF) LO frequency in kHz.

    • HSI (float): High-side (LO>RF) LO frequency in kHz.

Return type:

RetType

Examples

>>> inj = service.getInjectionLO(sn, 28e6, 2e6).RetData
>>> print(inj)
{'LSI': 26000000.0, 'HSI': 30000000.0}

Added in version v2.3.0.

getOutputReference()

Retrieve the output reference source from internal reference source enabled or not, and always get False if EXTERNAL

Returns:

RetData
  • bool: Whether the output reference source is enabled.

Return type:

RetType

Examples

>>> out = service.getOutputReference(sn).RetData
>>> print(out)
False
getRecommendLO(freq_rf, freq_if, bandwidth)

Get the recommended local oscillator (LO) frequency based on the RF and IF frequencies.

Deprecated since version v2.3.0: Please use getInjectionLO instead.

getRefConfig(returnIntSource=False)

Get last reference clock source configuration (default is internal)

Parameters:

returnIntSource (bool, optional) –

  • If True, returns the reference source configuration as an integer.

  • If False, returns the reference source configuration as an enum. Defaults to False.

Returns:

RetData
  • UD_REF: The reference source configuration.

Return type:

RetType

Examples

  • Get reference source configuration as enum:
    >>> source = service.getRefConfig(sn).RetData
    >>> print(source)
    UD_REF.INTERNAL
    
  • Get reference source configuration as interger:
    >>> source = service.getRefConfig(sn, True).RetData
    >>> print(source)
    0
    
getRefFrequencyList(source: UD_REF | int)

Retrieve the list of supported reference frequencies for the given reference source.

Parameters:

source (Union[UD_REF, int]) – The reference source.

Returns:

RetData

list: A list of supported frequencies in kHz for the specified reference source.

Return type:

RetType

Examples

  • Get supported frequencies for internal reference source:
    >>> freq_list = service.getRefFrequencyList(sn, UD_REF.INTERNAL).RetData
    >>> print(freq_list)
    [10000, 100000]
    
getUDState(item: ~tlkcore.TMYPublic.UDMState | int = <UDMState.ALL: 15>, returnIntState=False)

Retrieve single or multiple UD state.

Parameters:
  • item (Union[UDMState, int], optional) – The selected UD state to retrieve, you can use bitwise OR to combine multiple states. Defaults to ALL.

  • returnIntState (bool) – Whether to return the state as an integer value.

Returns:

RetData, and it returns the different types from the different queries.
  • dict: A dictionary of UD states includes selected items.

Return type:

RetType

Examples

  • Get the current state of the PLO lock:
    >>> state = service.getUDState(sn, UDState.PLO_LOCK)
    >>> print(state)
    {'PLO_LOCK': <UD_PLO.LOCK: 0>}
    
  • Get partial UD states:
    >>> state = service.getUDState(sn, UDMState.REF_LOCK | UDMState.SYSTEM | UDMState.PLO_LOCK)
    >>> print(state)
    {'SYSTEM': <UDM_SYS.NORMAL: 0>, 'PLO_LOCK': <UD_PLO.LOCK: 0>, 'REF_LOCK': <UD_REF.INTERNAL: 0>}
    
  • Get all UD states:
    >>> state = service.getUDState(sn)
    >>> print(state)
    {'SYSTEM': <UDM_SYS.NORMAL: 0>, 'PLO_LOCK': <UD_PLO.LOCK: 0>, 'REF_LOCK': <UD_REF.INTERNAL: 0>, 'LICENSE': <UDM_LICENSE.VERIFY_PASS: 1>}
    
  • Get all UD states with integer values:
    >>> state = service.getUDState(sn, UDMState.ALL, True)
    >>> print(state)
    {'SYSTEM': 0, 'PLO_LOCK': 0, 'REF_LOCK': 0, 'LICENSE': 1}
    
queryLoaderVer()

Query the bootloader version of the device.

Returns:

RetData
  • str: The bootloader version as a string.

Return type:

RetType

queryMAC()

Query the MAC address of the device.

Returns:

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

Return type:

RetType

Examples

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

Query the static IP address of the device.

Parameters:

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

Returns:

RetData
  • str: Static IP of the device.

Return type:

RetType

Note

Some FW versions of device not support this feature

Examples

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

Reboot of the device.

Returns:

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

Return type:

RetType

setOutputReference(output: bool, ref_freq=0)

Set internal reference source enabling output or not.

Note

Please reference getRefFrequencyList() first, then takes one of the supported frequencies.

Parameters:
  • output (bool) – Whether to enable the output reference.

  • ref_freq (int, optional) – The reference frequency in kHz. Defaults to 0.

Return type:

RetType

Examples

>>> freq_list = service.getRefFrequencyList(sn, UD_REF.INTERNAL).RetData
>>> service.setOutputReference(sn, True, freq_list[0])
setRefSource(source: UD_REF | int, ext_ref_freq=0, timeout=0)

Set the reference clock source configuration.

Note

Please reference getRefFrequencyList() first, then takes one of the supported frequencies.

Note

If set to EXTERNAL and does not plug-in signal cable, you will get the reference lock status is INTERNAL from calling getUDState().

Parameters:
  • source (Union[UD_REF, int]) – The reference source.

  • ext_ref_freq (int, optional) – The external reference frequency in kHz if the source set to EXTERNAL. Defaults to 0.

  • timeout (float, optional) – The timeout value in seconds. Defaults to 0.

Return type:

RetType

Examples

  • Current reference is internal, set to external and choose freq from getRefFrequencyList()
    >>> freq_list = service.getRefFrequencyList(sn, UD_REF.INTERNAL).RetData
    >>> service.setRefSource(sn, UD_REF.EXTERNAL, freq_list[0])
    
  • Current reference is external, set to internal
    >>> service.setRefSource(sn, UD_REF.INTERNAL)
    
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:

RetType

Examples

Set the static IP address of a device:
>>> service.setStaticIP(sn, "192.168.100.150", True)
setUDFreq(freq_ud: int | float, freq_rf: int | float = 0, freq_if: int | float = 0, bandwidth: int | float = 100000, forceSend=False)

Set UD frequency in kHz, it also calls getHarmonic() if not forced.

Note

Setting will make effect even if harmonic warning

Parameters:
  • freq_ud (Union[int, float]) – The UD frequency in kHz.

  • freq_rf (Union[int, float], optional) – The RF frequency in kHz. Defaults to 0.

  • freq_if (Union[int, float], optional) – The IF frequency in kHz. Defaults to 0.

  • bandwidth (Union[int, float], optional) – The bandwidth in kHz. Defaults to 100000.

  • forceSend (bool, optional) – True to force send the frequency. Defaults to False.

Return type:

RetType

Examples

  • Set UD frequency to 25GHz with RF frequency 28GHz and IF frequency 3GHz
    >>> ret = service.setUDFreq(sn, 25e6, 28e6, 3e6)
    >>> print(ret)
    [RetType] OK
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 25000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 24GHz with RF frequency 27GHz and IF frequency 3GHz -> Harmonic warning but still set
    >>> ret = service.setUDFreq(sn, 24e6, 27e6, 3e6)
    >>> print(ret)
    [RetType] WARNING_HARMONIC, Harmonic warning <LO:24000000,IF:3000000> by IF range: (2880000.0, 3120000.0)
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 24000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 26GHz only -> equation error due to default RF/IF frequency
    >>> ret = service.setUDFreq(sn, 26000000)
    >>> print(ret)
    [RetType] ERROR_FREQ_EQUATION, Frequency equation error !
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 24000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 26GHz forcefully
    >>> ret = service.setUDFreq(sn=sn, freq_ud=26000000, forceSend=True)
    >>> print(ret)
    [RetType] OK
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 26000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
unlockUDFreqRange(unlock_key_str)

Unlock maximum frequency range via license key and must reboot to make effect.

Note

Please request sales to acquire the license key.

Parameters:

unlock_key_str (str) – The license key string to unlock the frequency range.

Return type:

RetType

Examples

  • Unlock frequency range with a valid key then reboot
    >>> unlock_key = "808d5b00002d31010647a88299153a16404073215d69a6936ce49c69d48055ed354c58a1f563b241"
    >>> service.unlockUDFreqRange(sn, unlock_key)
    >>> service.reboot(sn)
    

UD Box 0630

class tlkcore.tmydev.DevUDB.UDB(*parent)

Bases: UDConverter

querySN(sn_type: ~tlkcore.TMYPublic.UD_SN_TYPE | int = <UD_SN_TYPE.UD_BOX: 1>)

Query serial number of UDB

Parameters:

sn_type (Union[UD_SN_TYPE, int]) – The type of serial number to query.

Returns:

RetData
  • dict: The result of the operation containing the serial number if multiple types are queried.

  • str: The serial number as a string if only one type is queried.

Return type:

RetType

Examples

  • Only query the serial number of the UDB:
    >>> sn = "UDB-2428001-0630"
    >>> sn_get = service.querySN().RetData
    >>> print(sn_get)
    UDB-2428001-0630
    
  • Query the serial number of UDB and its module:
    >>> sn = "UDB-2428001-0630"
    >>> sn_get = service.querySN(sn, UD_SN_TYPE.ALL).RetData
    >>> print(sn_get)
    {
        'UD_BOX': 'UDB-2428001-0630',
        'UD_MODULE': 'UDM-2428001-0630'
    }
    
getLOConfig(returnIntValue: bool = False)

Get the LO configuration.

Parameters:

returnIntValue (bool, optional) –

  • If True, returns the LO configuration as an integer.

  • If False, returns the LO configuration as an enum. Defaults to False.

Returns:

RetData
  • dict: A dictionary with the LO configuration.
    • lo: The LO configuration as an enum (UD_LO_CONFIG) or an integer, depending on returnIntValue.

Return type:

RetType

Examples

  • Get the LO configuration as an enum:
    >>> lo_config = service.getLOConfig(sn).RetData
    >>> print(lo_config)
    {
        'lo': <UD_LO_CONFIG.LO_CFG_INTERNAL: 0>
    }
    
  • Get the LO configuration as an integer:
    >>> lo_config = service.getLOConfig(sn, returnIntValue=True).RetData
    >>> print(lo_config)
    {
        'lo': 0
    }
    
setLOConfig(config: UD_LO_CONFIG | int)

Set the Local Oscillator (LO) configuration to internal, external, or output.

Parameters:

config (Union[UD_LO_CONFIG, int]) – The LO configuration to set. It can be an enum value or an integer.

Returns:

An object containing the result of the operation.
  • OK: If the LO configuration is successfully set.

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

Return type:

RetType

Examples

  • Set the LO configuration to internal:
    >>> service.setLOConfig(sn, UD_LO_CONFIG.LO_CFG_INTERNAL)
    
  • Set the LO configuration to output:
    >>> service.setLOConfig(sn, UD_LO_CONFIG.LO_CFG_INTERNAL_OUT)
    
  • Set the LO configuration to external:
    >>> service.setLOConfig(sn, UD_LO_CONFIG.LO_CFG_EXTERNAL_IN)
    
getDFUSupport()

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

Returns:

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

Return type:

RetType

getDevTypeName()

Retrieve current name of device

Returns:

Name of device

Examples

>>> service.getDevTypeName(sn)
'RIS'
getHarmonic(freq_ud: int | float, freq_if: int | float, bandwidth: int | float)

Check if the freq setting affected by harmonic (KHz), not check equation here.

Note

This function always return OK, please monitor the RetData.

Parameters:
  • freq_ud (Union[int,float]) – LO frequency as kHz

  • freq_if (Union[int,float]) – IF frequency as kHz

  • bandwidth (Union[int,float]) – bandwidth frequency as kHz

Returns:

RetData
  • bool: harmonic or not

Return type:

RetType

Examples

  • Normal case
    >>> ret = service.getHarmonic(sn, 24e6, 4e6, 100000)
    >>> print(ret)
    False
    
  • Harmonic case
    >>> ret = service.getHarmonic(sn, 24e6, 3e6, 100000)
    >>> print(ret)
    True
    

Changed in version TLKCore: v2.1.0 removed freq_rf parameter

getInjectionLO(freq_rf, freq_if)

Get the High-side / Low-side Injection LO frequency based on the RF and IF frequencies in kHz.

LSI

RF

HSI

LO=RF-IF

RF

LO=RF+IF

Parameters:
  • freq_rf (float) – The RF frequency with unit in kHz.

  • freq_if (float) – The IF frequency with unit in kHz.

Returns:

RetData
  • dict: A dictionary with the following keys
    • LSI (float): Low-side (LO<RF) LO frequency in kHz.

    • HSI (float): High-side (LO>RF) LO frequency in kHz.

Return type:

RetType

Examples

>>> inj = service.getInjectionLO(sn, 28e6, 2e6).RetData
>>> print(inj)
{'LSI': 26000000.0, 'HSI': 30000000.0}

Added in version v2.3.0.

getOutputReference()

Retrieve the output reference source from internal reference source enabled or not, and always get False if EXTERNAL

Returns:

RetData
  • bool: Whether the output reference source is enabled.

Return type:

RetType

Examples

>>> out = service.getOutputReference(sn).RetData
>>> print(out)
False
getRecommendLO(freq_rf, freq_if, bandwidth)

Get the recommended local oscillator (LO) frequency based on the RF and IF frequencies.

Deprecated since version v2.3.0: Please use getInjectionLO instead.

getRefConfig(returnIntSource=False)

Get last reference clock source configuration (default is internal)

Parameters:

returnIntSource (bool, optional) –

  • If True, returns the reference source configuration as an integer.

  • If False, returns the reference source configuration as an enum. Defaults to False.

Returns:

RetData
  • UD_REF: The reference source configuration.

Return type:

RetType

Examples

  • Get reference source configuration as enum:
    >>> source = service.getRefConfig(sn).RetData
    >>> print(source)
    UD_REF.INTERNAL
    
  • Get reference source configuration as interger:
    >>> source = service.getRefConfig(sn, True).RetData
    >>> print(source)
    0
    
getRefFrequencyList(source: UD_REF | int)

Retrieve the list of supported reference frequencies for the given reference source.

Parameters:

source (Union[UD_REF, int]) – The reference source.

Returns:

RetData

list: A list of supported frequencies in kHz for the specified reference source.

Return type:

RetType

Examples

  • Get supported frequencies for internal reference source:
    >>> freq_list = service.getRefFrequencyList(sn, UD_REF.INTERNAL).RetData
    >>> print(freq_list)
    [10000, 100000]
    
getUDFreq()

Query frequency configuration from UD

Note

Default UD frequency is 24GHz, RF frequency / IF frequency is not recorded -> get 0 kHz.

Returns:

RetData
  • dict: the frequency configuration with the following keys
    • IFFreq: The IF range in kHz.

    • UDFreq: The UD frequency range in kHz.

    • RFFreq: The RF range in kHz.

Return type:

RetType

Changed in version TLKCore: v1.2.1 and UD5G v3.0.0 starts to support query real UD frequency configurations.

getUDFreqLimit()

Retrieve the maximum capability of the frequency range for IF, UD, and RF in kHz.

Returns:

RetData
  • dict: A dictionary with the maximum frequency capability (include min & max) for IF, UD, and RF.
    • IFFreq: The maximum IF range in kHz.

    • UDFreq: The maximum UD frequency range in kHz.

    • RFFreq: The maximum RF range in kHz.

Return type:

RetType

Examples

  • Get the frequency limits from UDB-0630:
    >>> freq_limit = service.getUDFreqLimit(sn).RetData
    >>> print(freq_limit)
    {
        'IFFreq': {'min': 1000000, 'max': 8000000},
        'UDFreq': {'min': 6000000.0, 'max': 30000000.0},
        'RFFreq': {'min': 6000000.0, 'max': 30000000.0}
    }
    
getUDFreqRange()

Retrieve the current available frequency range for IF, UD, and RF in kHz.

Returns:

RetData
  • dict: A dictionary with the available frequency ranges for IF, UD, and RF.
    • IFFreq: The IF range in kHz.

    • UDFreq: The UD frequency range in kHz.

    • RFFreq: The RF range in kHz.

Return type:

RetType

Examples

  • Get the frequency range from UDB-0630:
    >>> freq_range = service.getUDFreqRange(sn).RetData
    >>> print(freq_range)
    {
        'IFFreq': {'min': 1000000, 'max': 8000000},
        'UDFreq': {'min': 6000000.0, 'max': 10000000.0},
        'RFFreq': {'min': 6000000.0, 'max': 10000000.0}
    }
    
getUDState(item: ~tlkcore.TMYPublic.UDMState | int = <UDMState.ALL: 15>, returnIntState=False)

Retrieve single or multiple UD state.

Parameters:
  • item (Union[UDMState, int], optional) – The selected UD state to retrieve, you can use bitwise OR to combine multiple states. Defaults to ALL.

  • returnIntState (bool) – Whether to return the state as an integer value.

Returns:

RetData, and it returns the different types from the different queries.
  • dict: A dictionary of UD states includes selected items.

Return type:

RetType

Examples

  • Get the current state of the PLO lock:
    >>> state = service.getUDState(sn, UDState.PLO_LOCK)
    >>> print(state)
    {'PLO_LOCK': <UD_PLO.LOCK: 0>}
    
  • Get partial UD states:
    >>> state = service.getUDState(sn, UDMState.REF_LOCK | UDMState.SYSTEM | UDMState.PLO_LOCK)
    >>> print(state)
    {'SYSTEM': <UDM_SYS.NORMAL: 0>, 'PLO_LOCK': <UD_PLO.LOCK: 0>, 'REF_LOCK': <UD_REF.INTERNAL: 0>}
    
  • Get all UD states:
    >>> state = service.getUDState(sn)
    >>> print(state)
    {'SYSTEM': <UDM_SYS.NORMAL: 0>, 'PLO_LOCK': <UD_PLO.LOCK: 0>, 'REF_LOCK': <UD_REF.INTERNAL: 0>, 'LICENSE': <UDM_LICENSE.VERIFY_PASS: 1>}
    
  • Get all UD states with integer values:
    >>> state = service.getUDState(sn, UDMState.ALL, True)
    >>> print(state)
    {'SYSTEM': 0, 'PLO_LOCK': 0, 'REF_LOCK': 0, 'LICENSE': 1}
    
processDFU(file_path: str, dfu_dev_info: dict)

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

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

  • dfu_dev_info (dict) –

    Information about the DFU device.

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

    • address (str): Address of the device.

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

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

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

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

Returns:

An object containing the result of the DFU process.

Return type:

RetType

queryFWVer()

Query FW version of the device.

Returns:

RetData
  • str: FW version.

Return type:

RetType

Examples

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

Query the hardware version of the device.

Returns:

RetData
  • str: The hardware version as a string.

Return type:

RetType

Examples

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

Query the bootloader version of the device.

Returns:

RetData
  • str: The bootloader version as a string.

Return type:

RetType

queryMAC()

Query the MAC address of the device.

Returns:

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

Return type:

RetType

Examples

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

Query the static IP address of the device.

Parameters:

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

Returns:

RetData
  • str: Static IP of the device.

Return type:

RetType

Note

Some FW versions of device not support this feature

Examples

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

Reboot of the device.

Returns:

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

Return type:

RetType

setOutputReference(output: bool, ref_freq=0)

Set internal reference source enabling output or not.

Note

Please reference getRefFrequencyList() first, then takes one of the supported frequencies.

Parameters:
  • output (bool) – Whether to enable the output reference.

  • ref_freq (int, optional) – The reference frequency in kHz. Defaults to 0.

Return type:

RetType

Examples

>>> freq_list = service.getRefFrequencyList(sn, UD_REF.INTERNAL).RetData
>>> service.setOutputReference(sn, True, freq_list[0])
setRefSource(source: UD_REF | int, ext_ref_freq=0, timeout=0)

Set the reference clock source configuration.

Note

Please reference getRefFrequencyList() first, then takes one of the supported frequencies.

Note

If set to EXTERNAL and does not plug-in signal cable, you will get the reference lock status is INTERNAL from calling getUDState().

Parameters:
  • source (Union[UD_REF, int]) – The reference source.

  • ext_ref_freq (int, optional) – The external reference frequency in kHz if the source set to EXTERNAL. Defaults to 0.

  • timeout (float, optional) – The timeout value in seconds. Defaults to 0.

Return type:

RetType

Examples

  • Current reference is internal, set to external and choose freq from getRefFrequencyList()
    >>> freq_list = service.getRefFrequencyList(sn, UD_REF.INTERNAL).RetData
    >>> service.setRefSource(sn, UD_REF.EXTERNAL, freq_list[0])
    
  • Current reference is external, set to internal
    >>> service.setRefSource(sn, UD_REF.INTERNAL)
    
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:

RetType

Examples

Set the static IP address of a device:
>>> service.setStaticIP(sn, "192.168.100.150", True)
setUDFreq(freq_ud: int | float, freq_rf: int | float = 0, freq_if: int | float = 0, bandwidth: int | float = 100000, forceSend=False)

Set UD frequency in kHz, it also calls getHarmonic() if not forced.

Note

Setting will make effect even if harmonic warning

Parameters:
  • freq_ud (Union[int, float]) – The UD frequency in kHz.

  • freq_rf (Union[int, float], optional) – The RF frequency in kHz. Defaults to 0.

  • freq_if (Union[int, float], optional) – The IF frequency in kHz. Defaults to 0.

  • bandwidth (Union[int, float], optional) – The bandwidth in kHz. Defaults to 100000.

  • forceSend (bool, optional) – True to force send the frequency. Defaults to False.

Return type:

RetType

Examples

  • Set UD frequency to 25GHz with RF frequency 28GHz and IF frequency 3GHz
    >>> ret = service.setUDFreq(sn, 25e6, 28e6, 3e6)
    >>> print(ret)
    [RetType] OK
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 25000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 24GHz with RF frequency 27GHz and IF frequency 3GHz -> Harmonic warning but still set
    >>> ret = service.setUDFreq(sn, 24e6, 27e6, 3e6)
    >>> print(ret)
    [RetType] WARNING_HARMONIC, Harmonic warning <LO:24000000,IF:3000000> by IF range: (2880000.0, 3120000.0)
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 24000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 26GHz only -> equation error due to default RF/IF frequency
    >>> ret = service.setUDFreq(sn, 26000000)
    >>> print(ret)
    [RetType] ERROR_FREQ_EQUATION, Frequency equation error !
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 24000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
  • Set UD frequency to 26GHz forcefully
    >>> ret = service.setUDFreq(sn=sn, freq_ud=26000000, forceSend=True)
    >>> print(ret)
    [RetType] OK
    >>> ret = service.getUDFreq(sn)
    >>> print(ret)
    {'UDFreq': 26000000.0, 'RFFreq': 0, 'IFFreq': 0}
    
unlockUDFreqRange(unlock_key_str)

Unlock maximum frequency range via license key and must reboot to make effect.

Note

Please request sales to acquire the license key.

Parameters:

unlock_key_str (str) – The license key string to unlock the frequency range.

Return type:

RetType

Examples

  • Unlock frequency range with a valid key then reboot
    >>> unlock_key = "808d5b00002d31010647a88299153a16404073215d69a6936ce49c69d48055ed354c58a1f563b241"
    >>> service.unlockUDFreqRange(sn, unlock_key)
    >>> service.reboot(sn)