Stefan Profanter 56bb742e2b Stack: Add check for successful network layer allocation | vor 6 Jahren | |
---|---|---|
.. | ||
common | vor 6 Jahren | |
eCos | vor 6 Jahren | |
freertosLWIP | vor 6 Jahren | |
posix | vor 6 Jahren | |
vxworks | vor 6 Jahren | |
wec7 | vor 6 Jahren | |
win32 | vor 6 Jahren | |
CMakeLists.txt | vor 6 Jahren | |
Readme.md | vor 6 Jahren | |
ua_architecture_base.h | vor 6 Jahren | |
ua_architecture_definitions.h | vor 6 Jahren | |
ua_architecture_functions.h | vor 6 Jahren | |
ua_network_tcp.c | vor 6 Jahren | |
ua_network_tcp.h | vor 6 Jahren | |
ua_network_udp.c | vor 6 Jahren | |
ua_network_udp.h | vor 6 Jahren |
add_subdirectory(new_arch)
at the end of itUse the following template for it (remember that when you see new_arch you should replace with the name of your architecture)
# ---------------------------------------------------
# ---- Beginning of the CMakeLists.txt template -----
# ---------------------------------------------------
SET(SOURCE_GROUP ${SOURCE_GROUP}\\new_arch)
ua_add_architecture("new_arch")
if("${UA_ARCHITECTURE}" STREQUAL "new_arch")
ua_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
ua_add_architecture_file(${CMAKE_CURRENT_SOURCE_DIR}/ua_clock.c)
#
# Add here below all the things that are specific for your architecture
#
#You can use the following available CMake functions:
#ua_include_directories() include some directories specific to your architecture when compiling the open62541 stack
#ua_architecture_remove_definitions() remove compiler flags from the general ../../CMakeLists.txt file that won't work with your architecture
#ua_architecture_add_definitions() add compiler flags that your architecture needs
#ua_architecture_append_to_library() add libraries to be linked to the open62541 that are needed by your architecture
#ua_add_architecture_header() add header files to compilation (Don't add the file ua_architecture.h)
#ua_add_architecture_file() add .c files to compilation
endif()
# ---------------------------------------------------
# ---- End of the CMakeLists.txt template -----
# ---------------------------------------------------
Create a ua_clock.c file that implements the following functions defined in ua_types.h:
UA_DateTime UA_DateTime_now(void); UA_Int64 UA_DateTime_localTimeUtcOffset(void); UA_DateTime UA_DateTime_nowMonotonic(void);
Create a file in the folder new_arch called ua_architecture.h
Use the following template for it: a: Change YEAR, YOUR_NAME and YOUR_COMPANY in the header b: Change NEW_ARCH at the beginning in PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTUREH for your own name in uppercase
```C /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
#ifndef PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTUREH #define PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTUREH
/*
/*
/*
//#define UA_IPV6 1 //or 0
//#define UA_SOCKET
//#define UA_INVALID_SOCKET
//#define UA_ERRNO
//#define UA_INTERRUPTED
//#define UA_AGAIN
//#define UA_EAGAIN
//#define UA_WOULDBLOCK
//#define UA_ERR_CONNECTION_PROGRESS
//#define UA_INTERRUPTED
/*
/*
/*
#include "../ua_architecture_functions.h"
#endif /* PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTUREH */
```