Stefan Profanter 0c3423036d Only define UA_sleep_ms if not yet defined (align with master) | 6 anos atrás | |
---|---|---|
.. | ||
arduino | 6 anos atrás | |
eCos | 6 anos atrás | |
freertos | 6 anos atrás | |
posix | 6 anos atrás | |
vxworks | 6 anos atrás | |
win32 | 6 anos atrás | |
CMakeLists.txt | 6 anos atrás | |
Readme.md | 6 anos atrás | |
ua_architecture_functions.h | 6 anos atrás | |
ua_network_tcp.c | 6 anos atrás | |
ua_network_tcp.h | 6 anos atrás | |
ua_network_udp.c | 6 anos atrás | |
ua_network_udp.h | 6 anos atrás |
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 */
```