diff --git a/configure.ac b/configure.ac index 29e73282..8484320e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,14 +11,16 @@ AC_CHECK_HEADERS([arpa/inet.h \ pthread.h \ sys/ioctl.h \ sys/select.h \ + sys/time.h \ + time.h \ termios.h]) AC_CHECK_LIB([pthread], [pthread_setname_np], AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], [1], ["Define to 1 if pthread has pthread_setname_np."]), AC_MSG_RESULT([Could not find pthread_setname_np in pthread.])) -AC_CHECK_FUNC([pselect], [AC_DEFINE(HAVE_PSELECT, [1], [Define to 1 if pselect() is available.])]) -AC_CHECK_FUNC([ppoll], [AC_DEFINE(HAVE_PPOLL, [1], [Define to 1 if ppoll() is available.])]) +AC_CHECK_FUNC([pselect], [AC_DEFINE(HAVE_PSELECT, [1], ["Define to 1 if pselect() is available."])]) +AC_CHECK_FUNC([ppoll], [AC_DEFINE(HAVE_PPOLL, [1], ["Define to 1 if ppoll() is available."])]) AC_CONFIG_AUX_DIR([build]) AC_CONFIG_SRCDIR([src/ebusd/ebusd.cpp]) @@ -44,4 +46,6 @@ AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AC_PROG_RANLIB +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + AC_OUTPUT diff --git a/src/ebusd/Makefile.am b/src/ebusd/Makefile.am index b1f2b13f..a5a747dd 100644 --- a/src/ebusd/Makefile.am +++ b/src/ebusd/Makefile.am @@ -1,8 +1,8 @@ AM_CXXFLAGS = -fpic \ -Wall \ -Wextra \ - -I$(top_srcdir)/src/lib/utils \ - -I$(top_srcdir)/src/lib/ebus + -isystem$(top_srcdir)/src/lib/utils \ + -isystem$(top_srcdir)/src/lib/ebus bin_PROGRAMS = ebusd diff --git a/src/lib/ebus/Makefile.am b/src/lib/ebus/Makefile.am index a0c1c0e2..9b53e6e7 100644 --- a/src/lib/ebus/Makefile.am +++ b/src/lib/ebus/Makefile.am @@ -1,7 +1,7 @@ AM_CXXFLAGS = -fpic \ -Wall \ -Wextra \ - -I$(top_srcdir)/src/lib/utils + -isystem$(top_srcdir)/src/lib/utils noinst_LIBRARIES = libebus.a diff --git a/src/lib/ebus/port.cpp b/src/lib/ebus/port.cpp index df169e45..297be502 100644 --- a/src/lib/ebus/port.cpp +++ b/src/lib/ebus/port.cpp @@ -294,12 +294,13 @@ ssize_t Port::recv(const long timeout, size_t maxCount, unsigned char* buffer) ssize_t ret = m_device->recvBytes(timeout, maxCount, buffer); if (buffer && ret > 0) { if (m_logRaw == true && m_logRawFunc != NULL) { - for (size_t pos = 0; pos < ret; pos++) + for (ssize_t pos = 0; pos < ret; pos++) (*m_logRawFunc)(buffer[pos], true); } if (m_dumpRaw == true && m_dumpRawStream.is_open() == true) { m_dumpRawStream.write((char*)buffer, ret); + m_dumpRawStream.flush(); if (m_dumpRawStream.tellp() >= m_dumpRawMaxSize * 1024) { string oldfile = m_dumpRawFile + ".old"; diff --git a/src/lib/ebus/test/Makefile.am b/src/lib/ebus/test/Makefile.am index ac8369f7..81622ba6 100644 --- a/src/lib/ebus/test/Makefile.am +++ b/src/lib/ebus/test/Makefile.am @@ -1,8 +1,8 @@ AM_CXXFLAGS = -fpic \ -Wall \ -Wextra \ - -I$(top_srcdir)/src/lib/ebus \ - -I$(top_srcdir)/src/lib/utils + -isystem$(top_srcdir)/src/lib/ebus \ + -isystem$(top_srcdir)/src/lib/utils noinst_PROGRAMS = test_port \ test_symbol \ diff --git a/src/lib/ebus/test/command.csv b/src/lib/ebus/test/command.csv deleted file mode 100644 index 9e2cb5f6..00000000 --- a/src/lib/ebus/test/command.csv +++ /dev/null @@ -1,4 +0,0 @@ -# type;class;cmd;comment;QQ;ZZ;PBSB;NN;D1D2D3;elements;sub;part;position;datatype;factor;unit;valid;comment;sub;part;position;datatype;factor;unit;valid;comment;sub;part;position;datatype;factor;unit;valid;comment;sub;part;position;datatype;factor;unit;valid;comment -c;broad;date_time_temp;Datum, Uhrzeit und Aussentempertur;;FE;0700;9;-;4;temp;md;1,2;d2b;1.0;°C;-;Temperatur;day;md;8;bdy;-;-;-;Wochentag;date;md;6,7,9;bda;-;-;-;Datum;time;md;5,4,3;bti;-;-;-;Uhrzeit -g;ci;Password;Kennwort;;15;B509;3;0D2C00;4;pin1;sd;1;uch;-;-;-;Pin 1;pin2;sd;2;uch;-;-;-;Pin 2;pin3;sd;3;uch;-;-;-;Pin 3;pin4;sd;4;uch;-;-;-;Pin 4 -s;vwxmk;DesiredTemp;Solltemperatur;;50;B509;4;0E3200;1;-;sd;1;d1c;1.0;°C;-;-;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index 5c0a025a..e09cfe04 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -1,8 +1,8 @@ AM_CXXFLAGS = -fpic \ -Wall \ -Wextra \ - -I$(top_srcdir)/src/lib/utils \ - -I$(top_srcdir)/src/lib/ebus + -isystem$(top_srcdir)/src/lib/utils \ + -isystem$(top_srcdir)/src/lib/ebus bin_PROGRAMS = ebusctl \ ebusfeed