Examples

This section provides basic, runnable examples for using TLKCore. These examples assume you have installed TLKCore and have a compatible device connected.

Initialize TLKCoreService and Scan Devices

from tlkcore import TLKCoreService

# Initialize the service
service = TLKCoreService()

# Scan for devices
ret = service.scanDevices()
print(ret.RetData)  # List of discovered devices

Query Device Information

from tlkcore import TLKCoreService

service = TLKCoreService()
sn = "YOUR_DEVICE_SN"  # Replace with actual serial number

# Initialize device (example for LAN connection)
service.initDev(sn, "192.168.100.121", 9)  # SN, IP, DevType

# Query firmware version
ret = service.queryFWVer(sn)
print(f"FW Version: {ret.RetData}")

Set Operating Frequency and RF Mode

from tlkcore import TLKCoreService, RFMode

service = TLKCoreService()
sn = "YOUR_DEVICE_SN"

service.initDev(sn, "192.168.100.121", 9)

# Set frequency (e.g., 28 GHz)
service.setOperatingFreq(sn, 28.0)

# Set RF mode to TX
service.setRFMode(sn, RFMode.TX)