From ddc82338ab219181cf0ed2c6d20cafbd5f2365a6 Mon Sep 17 00:00:00 2001 From: zzeroo Date: Sat, 21 Oct 2017 11:41:56 +0200 Subject: [PATCH] Fix wrong function name I hope this was the correct place to fix it. I don't know asciidoc. --- doc/modbus_mapping_new_start_address.txt | 6 +++--- src/modbus.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/modbus_mapping_new_start_address.txt b/doc/modbus_mapping_new_start_address.txt index 4fa196ae5..ec7bfdb35 100644 --- a/doc/modbus_mapping_new_start_address.txt +++ b/doc/modbus_mapping_new_start_address.txt @@ -28,7 +28,7 @@ make available registers from 10000 to 10009, you can use: [source,c] ------------------- -mb_mapping = modbus_mapping_offset_start_address(0, 0, 0, 0, 10000, 10, 0, 0); +mb_mapping = modbus_mapping_new_start_address(0, 0, 0, 0, 10000, 10, 0, 0); ------------------- With this code, only 10 registers (`uint16_t`) are allocated. @@ -41,7 +41,7 @@ This function is convenient to handle requests in a Modbus server/slave. RETURN VALUE ------------ -The _modbus_mapping_offset_new()_ function shall return the new allocated structure if +The _modbus_mapping_new_start_address()_ function shall return the new allocated structure if successful. Otherwise it shall return NULL and set errno. @@ -57,7 +57,7 @@ EXAMPLE ------------------- /* The first value of each array is accessible at the defined address. The end address is ADDRESS + NB - 1. */ -mb_mapping = modbus_mapping_offset_start_address(BITS_ADDRESS, BITS_NB, +mb_mapping = modbus_mapping_new_start_address(BITS_ADDRESS, BITS_NB, INPUT_BITS_ADDRESS, INPUT_BITS_NB, REGISTERS_ADDRESS, REGISTERS_NB, INPUT_REGISTERS_ADDRESS, INPUT_REGISTERS_NB); diff --git a/src/modbus.c b/src/modbus.c index a42c423a6..03d8da248 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -1761,7 +1761,7 @@ int modbus_set_debug(modbus_t *ctx, int flag) /* Allocates 4 arrays to store bits, input bits, registers and inputs registers. The pointers are stored in modbus_mapping structure. - The modbus_mapping_new_ranges() function shall return the new allocated + The modbus_mapping_new_start_address() function shall return the new allocated structure if successful. Otherwise it shall return NULL and set errno to ENOMEM. */ modbus_mapping_t* modbus_mapping_new_start_address(