Skip to content

Commit 3455349

Browse files
author
Karl Herbig
committed
adjust all defines and function call to libmodbus-ascii-support
1 parent b84b345 commit 3455349

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ check_symbol_exists(TIOCSRS485 sys/ioctl.h MODBUSPP_HAVE_TIOCRS485)
123123
check_symbol_exists(TIOCM_RTS sys/ioctl.h MODBUSPP_HAVE_TIOCM_RTS)
124124

125125
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBMODBUS_NAME})
126-
check_symbol_exists(modbus_rtu_set_recv_filter ${LIBMODBUS_NAME}/modbus-rtu.h MODBUSPP_HAVE_RTU_MULTI_SLAVES)
126+
check_symbol_exists(modbus_serial_set_recv_filter ${LIBMODBUS_NAME}/modbus-serial.h MODBUSPP_HAVE_SERIAL_MULTI_SLAVES)
127127

128128
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
129129
${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
@@ -308,7 +308,7 @@ if (CPACK_GENERATOR STREQUAL "DEB")
308308
set(CPACK_DEBIAN_DEV_PACKAGE_NAME "libmodbuspp-dev")
309309
set(CPACK_COMPONENT_DEV_DESCRIPTION "${CPACK_DEBIAN_LIB_PACKAGE_NAME} - ${PROJECT_DESCRIPTION} (development files)\n${PROJECT_DESCRIPTION_TEXT}\n This package provides the development files.")
310310
set(CPACK_DEBIAN_DEV_FILE_NAME "lib${PROJECT_NAME}-dev_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
311-
set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "${CPACK_DEBIAN_LIB_PACKAGE_NAME} (= ${CPACK_PACKAGE_VERSION}),pkg-config,git-core,${LIBMODBUSDEV_PACKAGE} (>= ${LIBMODBUS_VERSION})")
311+
set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "${CPACK_DEBIAN_LIB_PACKAGE_NAME} (= ${CPACK_PACKAGE_VERSION}),pkg-fconfig,git-core,${LIBMODBUSDEV_PACKAGE} (>= ${LIBMODBUS_VERSION})")
312312
set(CPACK_DEBIAN_DEV_PACKAGE_SECTION "libdevel")
313313
#set(CPACK_PACKAGE_DESCRIPTION_FILE "${MODBUSPP_SRC_DIR}/doc/README-deb.md")
314314

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ _"Filter on the Modbus unit identifier (slave) in RTU mode to avoid useless CRC
299299
To benefit from the routing capacity of the Router and Server classes in RTU,
300300
you must therefore use the fork of libmodbus named **libmodbusepsi**.
301301
In this fork released from the [piduino](http://apt.piduino.org)
302-
repository, filtering can be disabled (with _modbus_rtu_set_recv_filter()_).
302+
repository, filtering can be disabled (with _modbus_serial_set_recv_filter()_).
303303
Thus, it is the Server class which performs this filtering (after checking the
304304
CRC therefore). Effectively, this has the effect of loading the microprocessor,
305305
but, at present, the computing power of our machines is such that it does not

config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
#include "version.h"
2020
#cmakedefine01 MODBUSPP_HAVE_TIOCRS485
2121
#cmakedefine01 MODBUSPP_HAVE_TIOCM_RTS
22-
#cmakedefine01 MODBUSPP_HAVE_RTU_MULTI_SLAVES
22+
#cmakedefine01 MODBUSPP_HAVE_SERIAL_MULTI_SLAVES
2323

2424
/* ========================================================================== */

include/modbuspp/global.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ namespace Modbus {
105105
* The @b RtsDown mode applies the same procedure but with an inverted RTS flag.
106106
*/
107107
enum SerialRts {
108-
RtsNone = MODBUS_RTU_RTS_NONE, ///< no use of the RTS.
109-
RtsUp = MODBUS_RTU_RTS_UP, ///< RTS flag ON during communication, OFF outside.
110-
RtsDown = MODBUS_RTU_RTS_DOWN, ///< RTS flag OFF during communication, ON outside.
108+
RtsNone = MODBUS_SERIAL_RTS_NONE, ///< no use of the RTS.
109+
RtsUp = MODBUS_SERIAL_RTS_UP, ///< RTS flag ON during communication, OFF outside.
110+
RtsDown = MODBUS_SERIAL_RTS_DOWN, ///< RTS flag OFF during communication, ON outside.
111111
UnknownRts = Unknown ///< Unknown RTS mode.
112112
};
113113

src/rtulayer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ namespace Modbus {
104104
SerialMode RtuLayer::serialMode() {
105105
PIMP_D (RtuLayer);
106106

107-
int m = modbus_rtu_get_serial_mode (d->ctx);
107+
int m = modbus_serial_get_serial_mode (d->ctx);
108108
if (m != -1) {
109109
return static_cast<SerialMode> (m);
110110
}
@@ -115,14 +115,14 @@ namespace Modbus {
115115
bool RtuLayer::setSerialMode (SerialMode mode) {
116116
PIMP_D (RtuLayer);
117117

118-
return (modbus_rtu_set_serial_mode (d->ctx, static_cast<int> (mode)) != -1);
118+
return (modbus_serial_set_serial_mode (d->ctx, static_cast<int> (mode)) != -1);
119119
}
120120

121121
// ---------------------------------------------------------------------------
122122
SerialRts RtuLayer::rts() {
123123
PIMP_D (RtuLayer);
124124

125-
int r = modbus_rtu_get_rts (d->ctx);
125+
int r = modbus_serial_get_rts (d->ctx);
126126
if (r != -1) {
127127

128128
return static_cast<SerialRts> (r);
@@ -134,21 +134,21 @@ namespace Modbus {
134134
bool RtuLayer::setRts (SerialRts r) {
135135
PIMP_D (RtuLayer);
136136

137-
return (modbus_rtu_set_rts (d->ctx, static_cast<int> (r)) != -1);
137+
return (modbus_serial_set_rts (d->ctx, static_cast<int> (r)) != -1);
138138
}
139139

140140
// ---------------------------------------------------------------------------
141141
int RtuLayer::rtsDelay() {
142142
PIMP_D (RtuLayer);
143143

144-
return modbus_rtu_get_rts_delay (d->ctx);
144+
return modbus_serial_get_rts_delay (d->ctx);
145145
}
146146

147147
// ---------------------------------------------------------------------------
148148
bool RtuLayer::setRtsDelay (int delay) {
149149
PIMP_D (RtuLayer);
150150

151-
return (modbus_rtu_set_rts_delay (d->ctx, delay) != -1);
151+
return (modbus_serial_set_rts_delay (d->ctx, delay) != -1);
152152
}
153153

154154
// ---------------------------------------------------------------------------
@@ -308,7 +308,7 @@ namespace Modbus {
308308
"Unable to create RTU Modbus Backend("
309309
+ port + "," + settings + ")\n" + lastError());
310310
}
311-
oneByteTime = modbus_rtu_get_rts_delay (ctx);
311+
oneByteTime = modbus_serial_get_rts_delay (ctx);
312312
}
313313
}
314314

src/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ namespace Modbus {
252252
const std::string & settings) {
253253

254254
Device::Private::setBackend (net, connection, settings);
255-
#if MODBUSPP_HAVE_RTU_MULTI_SLAVES
255+
#if MODBUSPP_HAVE_SERIAL_MULTI_SLAVES
256256
if (net == Rtu) {
257-
modbus_rtu_set_recv_filter (ctx(), FALSE);
257+
modbus_serial_set_recv_filter (ctx(), FALSE);
258258
}
259259
#endif
260260
}

0 commit comments

Comments
 (0)