Skip to content

Commit 5fb132f

Browse files
committed
fix: build against latest libethercat 0.7.2
1 parent 859fe86 commit 5fb132f

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MainProject(ConanFile):
99
url = "https://rmc-github.robotic.dlr.de/robotkernel/module_ethercat"
1010
exports_sources = ["*", "!.gitignore"]
1111
requires = [
12-
"libethercat/[>=0.7.0]@common/stable",
12+
"libethercat/[>=0.7.2]@common/stable",
1313
"robotkernel/[~6]@robotkernel/unstable",
1414
"service_provider_memory_inspection/[~6]@robotkernel/unstable",
1515
"service_provider_canopen_protocol/[~6]@robotkernel/unstable",

configure.ac.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ PKG_CHECK_MODULES([LIBETHERCAT], [libethercat])
3434

3535
# Checks for header files.
3636
AC_CHECK_HEADERS([stdlib.h string.h])
37+
AC_CHECK_HEADERS([arpa/inet.h])
3738

3839
# Checks for typedefs, structures, and compiler characteristics.
3940
AC_TYPE_SIZE_T

src/hw_stream.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#include "hw_stream.h"
2525

26-
#include <libethercat/config.h>
2726
#include <libethercat/hw.h>
2827
#include <libethercat/ec.h>
2928
#include <libethercat/idx.h>
@@ -39,18 +38,26 @@
3938
#include <stdlib.h>
4039
#include <inttypes.h>
4140

42-
#if LIBETHERCAT_HAVE_NETINET_IN_H == 1
41+
#ifdef HAVE_CONFIG_H
42+
#include "config.h"
43+
#endif
44+
45+
#if HAVE_NETINET_IN_H == 1
4346
#include <netinet/in.h>
4447
#endif
4548

46-
#if LIBETHERCAT_HAVE_WINSOCK_H == 1
49+
#if HAVE_WINSOCK_H == 1
4750
#include <winsock.h>
4851
#endif
4952

50-
#if LIBETHERCAT_HAVE_NET_UTIL_INET_H == 1
53+
#if HAVE_NET_UTIL_INET_H == 1
5154
#include <net/util/inet.h>
5255
#endif
53-
56+
57+
#if HAVE_ARPA_INET_H == 1
58+
#include <arpa/inet.h>
59+
#endif
60+
5461
// forward decls
5562
int hw_device_stream_recv(struct hw_common *phw);
5663
int hw_device_stream_get_tx_buffer(struct hw_common *phw, ec_frame_t **ppframe);

src/hw_stream.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@
2424
#ifndef MODULE_ETHERCAT__HW_STREAM_H
2525
#define MODULE_ETHERCAT__HW_STREAM_H
2626

27-
#include "libethercat/config.h"
2827
#include "libethercat/common.h"
2928
#include "libethercat/hw.h"
3029

30+
#include "libosal/osal.h"
31+
#include "libosal/task.h"
32+
#include "libosal/types.h"
33+
3134
typedef size_t (*stream_read_t)(void *user, void *buf, size_t nbyte);
3235
typedef size_t (*stream_write_t)(void *user, void *buf, size_t nbyte);
3336

src/master.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "slave.h"
4040
#include "hw_stream.h"
4141

42-
#include "libethercat/config.h"
42+
#include "libethercat/settings.h"
4343
#include "libethercat/common.h"
4444
#include "libethercat/ec.h"
4545
#include "libethercat/slave.h"

src/slave.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#include <iomanip>
4646
#include <stdio.h>
4747

48+
#include "libethercat/slave.h"
49+
4850
using namespace std;
4951
using namespace robotkernel;
5052
using namespace module_ethercat;

0 commit comments

Comments
 (0)