Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AdsLib/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.h text eol=lf
*.cpp text eol=lf
7 changes: 7 additions & 0 deletions AdsLib/AdsLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

#include "Sockets.h"

#ifdef __cplusplus
extern "C" {
#endif
/**
* Reads data synchronously from an ADS server.
* @param[in] port port number of an Ads port that had previously been opened with AdsPortOpenEx().
Expand Down Expand Up @@ -188,3 +191,7 @@ long GetRemoteAddress(const std::string &remote, AmsNetId &netId);
#define AdsAddRoute bhf::ads::AddLocalRoute
#define AdsDelRoute bhf::ads::DelLocalRoute
#define AdsSetLocalAddress bhf::ads::SetLocalAddress

#ifdef __cplusplus
}
#endif
2 changes: 2 additions & 0 deletions AdsLib/standalone/AdsLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "AdsLib.h"
#include "AmsRouter.h"

extern "C" {
static AmsRouter &GetRouter()
{
static AmsRouter router;
Expand Down Expand Up @@ -286,3 +287,4 @@ long AdsSyncSetTimeoutEx(long port, uint32_t timeout)
ASSERT_PORT(port);
return GetRouter().SetTimeout((uint16_t)port, timeout);
}
}
7 changes: 6 additions & 1 deletion AdsLib/standalone/AdsLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#pragma once

#include "AdsDef.h"

#ifdef __cplusplus
extern "C" {
#endif
/**
* The connection (communication port) to the message router is
* closed. The port to be closed must previously have been opened via
Expand Down Expand Up @@ -38,3 +40,6 @@ long AdsGetLocalAddressEx(long port, AmsAddr *pAddr);
* @return [ADS Return Code](https://infosys.beckhoff.com/content/1031/tcadscommon/html/ads_returncodes.htm?id=1666172286265530469)
*/
long AdsSyncSetTimeoutEx(long port, uint32_t timeout);
#ifdef __cplusplus
}
#endif
9 changes: 9 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ adslib = static_library('AdsLib',
install: true,
)

adslib_so = shared_library('adslib',
[common_files, router_files],
include_directories: inc,
install: true,
name_prefix: '',
name_suffix: 'so',
dependencies: [dependency('threads')],
)

install_libs = [ adslib ]

adslib_dep = declare_dependency(
Expand Down