This is the static library (linux-x86) of TCNOpen project for train communication. Train real time data protocol TRDP is the major protocol in train communication network.
- Clone the repository, put the repository under your project's
include
folder. - In your code, include the needed librarys like this:
#include <tcn-open-static-lib/api/trdp_if_light.h>
#include <tcn-open-static-lib/api/tau_marshall.h>
#include <tcn-open-static-lib/vos/api/vos_utils.h>
...
- Then you are able to use the functions in the library, here you could find some examples codes.
- To compile your project with those libraries, link the static library in
CMakeLists.txt
file like this:
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
add_library(${PROJECT_NAME} STATIC ${PROJECT_SOURCE})
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS} ${PROJECT_SOURCE_DIR}/include/tcn-open-static-lib/libtrdp.a)
- Clone source repository: TCNOpen.
cd TCNopen/trdp/config
; Copy your needed configuration from*_config
toconfig.mk
and save.cd ..; make
- Find the generated static library from
trdp/bld/output
. - Put the
*.a
files and source code files into a folder as the target library to use.