Skip to content

Commit

Permalink
Merge 404b45c into 1298044
Browse files Browse the repository at this point in the history
  • Loading branch information
Pro committed Aug 14, 2019
2 parents 1298044 + 404b45c commit 01d6eae
Show file tree
Hide file tree
Showing 24 changed files with 592 additions and 221 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -363,7 +363,7 @@ after_failure: |
deploy:
provider: releases
api_key:
# Uses token from user open62541-travis-release (managed by @Pro)
# Uses token from user open62541-travis-release (managed by @Pro). Sets GITAUTH
secure: dtn6ayBGoWzeVMM6xYpSRZly1XOhS/2jdiwEHd0hYZIr0dNq18CxTiqbGrUwW1JsSiXoHaGSZhUVr06O1P/tfC3Ma6i7ugyun+yXz6FdZiwirjURI8HQe+XwR4Ui3hqgQSOHLMK/xtOkjM28AN1jg9u3//Zep69xJVIGAqNT0bE=
file:
- open62541-win32.zip
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -986,7 +986,7 @@ else()
target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src)

add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers})
add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport)
add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace)
target_include_directories(open62541-plugins PRIVATE ${PROJECT_SOURCE_DIR}/plugins)
target_include_directories(open62541-plugins PRIVATE ${PROJECT_BINARY_DIR}/src_generated)
target_compile_definitions(open62541-plugins PRIVATE -DUA_DYNAMIC_LINKING_EXPORT)
Expand Down Expand Up @@ -1047,7 +1047,7 @@ if (UA_ENABLE_DISCOVERY_MULTICAST)
target_compile_definitions(open62541 PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT)
endif()
# Generate properly versioned shared library links on Linux
SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION 0 VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}")
SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}")

##################################
# Architectures changes #
Expand Down
19 changes: 0 additions & 19 deletions appveyor.yml
Expand Up @@ -17,10 +17,6 @@ environment:
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9

matrix:
- CC_NAME: MinGW Makefiles
CC_SHORTNAME: mingw
GENERATOR: MinGW Makefiles
FORCE_CXX: OFF
- CC_NAME: Visual Studio 9 2008
CC_SHORTNAME: vs2008
GENERATOR: Visual Studio 9 2008
Expand All @@ -29,15 +25,6 @@ environment:
CC_SHORTNAME: vs2013
GENERATOR: Visual Studio 12 2013
FORCE_CXX: OFF
- CC_NAME: Visual Studio 15 2017
CC_SHORTNAME: vs2017
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATOR: Visual Studio 15 2017
FORCE_CXX: OFF
- CC_NAME: Clang
CC_SHORTNAME: clang-mingw
GENERATOR: MinGW Makefiles
FORCE_CXX: OFF

cache:
- C:\ProgramData\chocolatey\bin -> tools/appveyor/install.ps1
Expand All @@ -52,12 +39,6 @@ install:
- set PATH=C:\Users\appveyor\AppData\Roaming\Python\Scripts;%PATH%
- ps: '& "./tools/appveyor/install.ps1"'

before_build:
# Add installed tools to PATH
- set PATH=C:\msys64\mingw64\bin;%PATH%
# Workaround for CMake not wanting sh.exe on PATH for MinGW (necessary for CMake 3.12.2)
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%

build_script:
- ps: '& "./tools/appveyor/build.ps1"'

Expand Down
117 changes: 117 additions & 0 deletions azure-pipelines.yml
@@ -0,0 +1,117 @@
# Docs see here:
# https://aka.ms/yaml


pr:
autoCancel: true # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true

variables:
choco_cache: C:/ProgramData/chocolatey
vcpkg_cache: C:/vcpkg/installed

jobs:
- job: 'win_vs2017'
displayName: 'Windows (VS2017)'
pool:
vmImage: 'vs2017-win2016'
variables:
CC_NAME: Visual Studio 15 2017
CC_SHORTNAME: VS2017
GENERATOR: Visual Studio 15 2017
FORCE_CXX: OFF
steps:
- checkout: self
submodules: recursive

- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/tools/azure-devops/install.ps1
path: $(choco_cache)
displayName: Cache Choco
- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/tools/azure-devops/install.ps1
path: $(vcpkg_cache)
displayName: Cache vcpkg

- powershell: ./tools/azure-devops/install.ps1
displayName: Install Requirements
- powershell: ./tools/azure-devops/build.ps1
displayName: "Build: $(CC_NAME)"

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: open62541-$(CC_SHORTNAME)
# publishing artifacts from PRs from a fork is currently blocked
condition: succeeded()
displayName: "Publish Artifact: open62541-$(CC_SHORTNAME)"


- job: 'win_msys64'
displayName: 'Windows (msys64)'
pool:
vmImage: 'windows-latest'
variables:
CC_NAME: MinGW Makefiles
CC_SHORTNAME: mingw
GENERATOR: MinGW Makefiles
FORCE_CXX: OFF
MSYS2_ROOT: C:/msys64
steps:
- checkout: self
submodules: recursive
- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/tools/azure-devops/install.ps1
path: $(choco_cache)
displayName: Cache Choco

- powershell: ./tools/azure-devops/install.ps1
displayName: Install Requirements
- powershell: ./tools/azure-devops/build.ps1
displayName: "Build: $(CC_NAME)"
errorActionPreference: continue # Nodeset Compiler prints to stderror

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: open62541-$(CC_SHORTNAME)
# publishing artifacts from PRs from a fork is currently blocked
condition: succeeded()
displayName: "Publish Artifact: open62541-$(CC_SHORTNAME)"



- job: 'win_clang'
displayName: 'Windows (clang)'
pool:
vmImage: 'windows-latest'
variables:
CC_NAME: Clang
CC_SHORTNAME: clang-mingw
GENERATOR: MinGW Makefiles
FORCE_CXX: OFF
MSYS2_ROOT: C:/msys64
steps:
- checkout: self
submodules: recursive
- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/tools/azure-devops/install.ps1
path: $(choco_cache)
displayName: Cache Choco

- powershell: ./tools/azure-devops/install.ps1
displayName: Install Requirements
- powershell: ./tools/azure-devops/build.ps1
displayName: "Build: $(CC_NAME)"
errorActionPreference: continue # Nodeset Compiler prints to stderror

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: open62541-$(CC_SHORTNAME)
# publishing artifacts from PRs from a fork is currently blocked
condition: succeeded()
displayName: "Publish Artifact: open62541-$(CC_SHORTNAME)"
10 changes: 5 additions & 5 deletions debian/control → debian/control-template
Expand Up @@ -12,25 +12,25 @@ Homepage: https://open62541.org/
Vcs-Git: https://github.com/open62541/open62541.git
Vcs-Browser: https://github.com/open62541/open62541

Package: open62541-dev
Package: libopen62541-<soname>-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: open62541 (= ${binary:Version}), ${misc:Depends}
Depends: libopen62541-<soname> (= ${binary:Version}), ${misc:Depends}
Description: Development header files for open62541
open62541 is an open source C (C99) implementation of the OPC UA standard

Package: open62541
Package: libopen62541-<soname>
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541
open62541 is an open source C (C99) implementation of the OPC UA standard

Package: open62541-dbg
Package: libopen62541-<soname>-dbg
Section: debug
Architecture: any
Priority: extra
Depends: open62541 (= ${binary:Version}), ${misc:Depends}
Depends: libopen62541-<soname> (= ${binary:Version}), ${misc:Depends}
Description: Debugging symbols for open62541
open62541 is an open source C (C99) implementation of the OPC UA standard
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion debian/rules → debian/rules-template
Expand Up @@ -11,7 +11,7 @@ override_dh_auto_test:
dh_auto_test -- ARGS+=--output-on-failure

override_dh_strip:
dh_strip --dbg-package=open62541-dbg
dh_strip --dbg-package=libopen62541-<soname>-dbg

%:
dh $@ --buildsystem=cmake --parallel
Expand Down
48 changes: 0 additions & 48 deletions debian/update_changelog.py

This file was deleted.

5 changes: 5 additions & 0 deletions doc/building.rst
Expand Up @@ -3,6 +3,11 @@
Building open62541
==================

open62541 uses CMake to build the library and binaries. The library version is automatically
detected using ``git describe``. This command returns a valid version string based on the current tag.
If you did not directly clone the sources, but use the tar or zip package from a release, you need
to manually specify the version. In that case use e.g. ``cmake -DOPEN62541_VERSION=v1.0.3``.

Building the Examples
---------------------

Expand Down
9 changes: 9 additions & 0 deletions doc/installing.rst
Expand Up @@ -78,3 +78,12 @@ Debian packages can be found in our official PPA:

* Daily Builds (based on master branch): https://launchpad.net/~open62541-team/+archive/ubuntu/daily
* Release Builds (starting with Version 0.4): https://launchpad.net/~open62541-team/+archive/ubuntu/ppa

Install them with:


.. code-block:: bash
sudo add-apt-repository ppa:open62541-team/ppa
sudo apt-get update
sudo apt-get install libopen62541-dev
9 changes: 5 additions & 4 deletions include/open62541/server.h
Expand Up @@ -547,8 +547,8 @@ UA_Server_unregister_discovery(UA_Server *server, struct UA_Client *client);
* @param client the client which is used to call the RegisterServer.
* It must not yet be connected and will be connected for every register call
* to the given discoveryServerUrl.
* @param discoveryServerUrl if set to NULL, the default value
* 'opc.tcp://localhost:4840' will be used
* @param discoveryServerUrl where this server should register itself.
* The string will be copied internally. Therefore you can free it after calling this method.
* @param intervalMs
* @param delayFirstRegisterMs
* @param periodicCallbackId */
Expand All @@ -564,8 +564,9 @@ typedef void (*UA_Server_registerServerCallback)(const UA_RegisteredServer *regi
void* data);

/* Set the callback which is called if another server registeres or unregisters
* with this instance. If called multiple times, previous data will be
* overwritten.
* with this instance. This callback is called every time the server gets a register
* call. This especially means that for every periodic server register the callback will
* be called.
*
* @param server
* @param cb the callback
Expand Down
2 changes: 2 additions & 0 deletions src/server/ua_discovery_manager.c
Expand Up @@ -162,6 +162,8 @@ UA_DiscoveryManager_deleteMembers(UA_DiscoveryManager *dm, UA_Server *server) {
periodicServerRegisterCallback_entry *ps, *ps_tmp;
LIST_FOREACH_SAFE(ps, &dm->periodicServerRegisterCallbacks, pointers, ps_tmp) {
LIST_REMOVE(ps, pointers);
if (ps->callback->discovery_server_url)
UA_free(ps->callback->discovery_server_url);
UA_free(ps->callback);
UA_free(ps);
}
Expand Down
9 changes: 9 additions & 0 deletions src/server/ua_discovery_manager.h
Expand Up @@ -31,6 +31,15 @@ typedef struct registeredServer_list_entry {
UA_DateTime lastSeen;
} registeredServer_list_entry;

struct PeriodicServerRegisterCallback {
UA_UInt64 id;
UA_Double this_interval;
UA_Double default_interval;
UA_Boolean registered;
struct UA_Client* client;
char* discovery_server_url;
};

typedef struct periodicServerRegisterCallback_entry {
#ifdef UA_ENABLE_MULTITHREADING
UA_DelayedCallback delayedCleanup;
Expand Down
10 changes: 9 additions & 1 deletion src/server/ua_server_discovery_mdns.c
Expand Up @@ -488,8 +488,16 @@ mdns_record_received(const struct resource *r, void *data) {
entry->lastSeen = UA_DateTime_nowMonotonic();

/* TXT and SRV are already set */
if(entry->txtSet && entry->srvSet)
if(entry->txtSet && entry->srvSet) {
// call callback for every mdns package we received.
// This will also call the callback multiple times
if (server->discoveryManager.serverOnNetworkCallback &&
!mdns_is_self_announce(server, entry))
server->discoveryManager.
serverOnNetworkCallback(&entry->serverOnNetwork, true, entry->txtSet,
server->discoveryManager.serverOnNetworkCallbackData);
return;
}

/* Add the resources */
if(r->type == QTYPE_TXT && !entry->txtSet)
Expand Down

0 comments on commit 01d6eae

Please sign in to comment.