Skip to content

Commit

Permalink
Merge pull request #29 from tmytek/Update-TLKCore
Browse files Browse the repository at this point in the history
Release TLKCore v1.1.3 for Python 3.6/3.8/3.10
  • Loading branch information
alinyo98 authored Jul 31, 2023
2 parents b36ff95 + 7abe261 commit 8bacbd9
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 16 deletions.
File renamed without changes.
16 changes: 8 additions & 8 deletions example_Linux/C_C++/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

This example directory contains two sub directories, please configure to your own envirenment:

1. example/files/ : place your calibration & antenna files into it
1. example/files/ : Place your calibration & antenna files into it
* BBox calibration tables, {SN}_{Freq}.csv
* BBox antenna table, {AAKIT_Name}.csv
2. example/config/
* device.conf, it mentions the device infomations for Beamform & UD.
* Beamform devices with SN as key then includes AAKIT name and the path to beam configruation.
* UD devices only include SN as key then includes STATE with json format.
* **device.conf**, it mentions the device infomations for Beamform & UD.
* <u>Beamform</u> devices with SN as key then includes AAKIT name and the path to beam configruation.
* <u>UD devices</u> only include SN as key then includes STATE with json format.
*. Beam configruation files, i.g. CustomBatchBeams_D2230E013-28.csv.
* You can edit/pre-config it via Office or any text editor, no matter what it is config to one of below options:
* You can edit/pre-config it via Office-like software or any text editor, no matter what it is config to one of below options:
* A whole beam (BeamType=0)
* beam_db: gain with float type, please DO NOT exceed the DR (dynamic range).
* beam_theta with integer degree
* beam_phi with integer degree
* custom beam (BeamType=1), suggest use TMXLAB Kit first to makes sure your settings.
* Custom beam (BeamType=1), suggest use TMXLAB Kit first to makes sure your settings.
* ch: Assigned channel to config
* ch_sw: 0 means channel is ON, 1 is OFF.
* ch_db: gain with float type.
* ch_deg: phase degree with int type.
3. there are some linked files, please build lib_tlkcore_cpp/ and lib_usrp_spi/ if necessary.
3. There are some linked files, please build lib_tlkcore_cpp/ and lib_usrp_spi/ if necessary.
* **libtlkcore_lib.so** -> ../lib_tlkcore_cpp/libtlkcore_lib.so
* **include/tlkcore_lib.hpp** -> ../../lib_tlkcore_cpp/include/tlkcore_lib.hpp
* **libusrp_fbs.so** -> ../lib_usrp_spi/libusrp_fbs.so
* **include/usrp_fbs.hpp** -> ../../lib_usrp_spi/include/usrp_fbs.hpp
4. After libraries built, according to your Python environment copy the extracted lib/ from **TLKCore_release/** to example/lib/, and we already placed libs for Python3.6 currently.
4. After libraries built, according to your Python environment, copy the extracted **lib/** from **TLKCore_release/** to **example/lib/**, and we already placed libs for Python3.6 as default.

# Building TLKCore+USRP Applications using CMake
After above process, to try it out, run these commands:
Expand Down
Binary file modified example_Linux/C_C++/examples/lib/TLKCoreService.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/TMYCommService.so
Binary file not shown.
26 changes: 20 additions & 6 deletions example_Linux/C_C++/examples/lib/TMYPublic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class BeamType(Enum):
CHANNEL = auto()

class RetCode(Enum):
#_baseVersion = "3.3.16.0"

OK = 0
WARNING = auto()
Expand All @@ -43,6 +42,8 @@ class RetCode(Enum):
ERROR_SEND_CMD = auto()
ERROR_RESP_CMD = auto()
ERROR_SEND_CMD_TIMEOUT = auto()
ERROR_COMPORT = auto()
ERROR_USB = auto()

# CMD to device
ERROR_CMD = 40
Expand All @@ -68,6 +69,11 @@ class RetCode(Enum):
# PD device
ERROR_PD_CALI = 150
ERROR_PD_SOURCE = auto()
# UDM device
ERROR_FREQ_RANGE = 240
ERROR_LICENSE_LENGTH = auto()
ERROR_LICENSE_KEY = auto()
ERROR_REF_CHANGE = auto()
# UD device
ERROR_FREQ_EQUATION = 250
WARNING_HARMONIC = auto()
Expand All @@ -88,11 +94,13 @@ class UDState(Enum):
PWR_5V = auto()
PWR_9V = auto()

class UDMState(Enum):
NO_SET = -1
SYSTEM = 0
PLO_LOCK = auto()
REF_LOCK = auto()
class UDMState(Flag):
NO_SET = 0
SYSTEM = auto()
PLO_LOCK = auto()
REF_LOCK = auto()
LICENSE = auto()
ALL = SYSTEM | PLO_LOCK | REF_LOCK | LICENSE

class UDM_SYS(Enum):
SYS_ERROR = -1
Expand All @@ -106,3 +114,9 @@ class UDM_REF(Enum):
UNLOCK = -1
INTERNAL = 0
EXTERNAL = auto()

class UDM_LICENSE(Enum):
VERIFY_FAIL_FLASH = -2
VERIFY_FAIL_DIGEST = -1
NON_LICENSE = 0
VERIFY_PASS = auto()
Binary file modified example_Linux/C_C++/examples/lib/TMYUtils.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/db/TMYDBQueryer.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/tmydev/DevBBox.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/tmydev/DevUDBox.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/tmydev/DevUDM.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/tmydev/TMYTableManager.so
Binary file not shown.
Binary file modified example_Linux/C_C++/examples/lib/tmydev/device.so
Binary file not shown.
5 changes: 4 additions & 1 deletion example_Linux/C_C++/lib_tlkcore_cpp/src/tlkcore_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ class tlkcore_lib_impl : public tlkcore_lib
cout << "[TLKCore] TMYConfig: " << dev_config_dict << endl;

cout << "[TLKCore] Calling scanDevices()..." << endl;
auto ret = service.attr("scanDevices")();
py::object DevInterface = py::module::import("lib.TMYPublic").attr("DevInterface");
// After TLKCore v1.1.3, we provides multiple interface for scanning,
// default is "LAN", and you can set to "ALL" for other TMY products.
auto ret = service.attr("scanDevices")(); //(DevInterface.attr("ALL"));
if (ret.attr("RetCode").attr("value").cast<int>() != RetCode.attr("OK").attr("value").cast<int>()) {
cout << "[TLKCore] Init failed: " + ret.attr("RetMsg").cast<string>() << endl;
printf("Called scanDevices() failed\r\n");
Expand Down
2 changes: 1 addition & 1 deletion example_Linux/C_C++/lib_usrp_spi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ To try it out, run these commands:
$ cmake ..
$ make install

This will find the [UHD libraries](https://github.com/EttusResearch/uhd), and link and compile the example program. Include header directories and library names are automatically gathered.
This will find the pre-installed libraries from [UHD libraries](https://github.com/EttusResearch/uhd) and [UHD Installation](https://files.ettus.com/manual/page_install.html#install_linux), then link and compile the example program. Include header directories and library names are automatically gathered.

See the CMakeLists.txt file to figure out how to set up a build system.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8bacbd9

Please sign in to comment.