Stefan Profanter 05667bbb06 Add support for Arduino and ESP32 | 6 years ago | |
---|---|---|
.. | ||
arduino | 6 years ago | |
freertos | 6 years ago | |
posix | 6 years ago | |
vxworks | 6 years ago | |
win32 | 6 years ago | |
CMakeLists.txt | 6 years ago | |
Readme.md | 6 years ago | |
ua_architecture_functions.h | 6 years ago | |
ua_network_tcp.c | 6 years ago | |
ua_network_tcp.h | 6 years ago | |
ua_network_udp.c | 6 years ago | |
ua_network_udp.h | 6 years ago |
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 */
```