From 0a671c234c1af74d07ee17554d422484069ff8a4 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 4 Aug 2010 23:02:21 +0200 Subject: [PATCH] Add modbus-version.h.in --- .gitignore | 2 +- configure.ac | 2 +- src/Makefile.am | 15 +++++++++------ src/modbus-version.h.in | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/modbus.h | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/modbus.h.in | 233 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 6 files changed, 267 insertions(+), 241 deletions(-) create mode 100644 src/modbus-version.h.in create mode 100644 src/modbus.h delete mode 100644 src/modbus.h.in diff --git a/.gitignore b/.gitignore index 081bddb..332146d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ libtool ltmain.sh missing libmodbus.pc -modbus.h +modbus-version.h .deps .libs *.la diff --git a/configure.ac b/configure.ac index c06830f..3b458f5 100644 --- a/configure.ac +++ b/configure.ac @@ -76,7 +76,7 @@ AC_CHECK_FUNCS([gettimeofday inet_ntoa memset select socket strerror]) AC_CONFIG_FILES([ Makefile src/Makefile - src/modbus.h + src/modbus-version.h tests/Makefile libmodbus.pc ]) diff --git a/src/Makefile.am b/src/Makefile.am index 0f1a558..4260250 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,11 +1,14 @@ lib_LTLIBRARIES = libmodbus.la -libmodbus_la_SOURCES = modbus.c modbus.h +libmodbus_la_SOURCES = \ + modbus.c \ + modbus.h \ + modbus-version.h libmodbus_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBMODBUS_LT_VERSION_INFO) -# Include files to install -libmodbusincludedir = $(includedir) -libmodbusinclude_HEADERS = modbus.h +# Header files to install +libmodbusincludedir = $(includedir)/modbus +libmodbusinclude_HEADERS = modbus.h modbus-version.h -DISTCLEANFILES = modbus.h -EXTRA_DIST = modbus.h.in +DISTCLEANFILES = modbus-version.h +EXTRA_DIST = modbus-version.h.in CLEANFILES = *~ diff --git a/src/modbus-version.h.in b/src/modbus-version.h.in new file mode 100644 index 0000000..a5be00f --- /dev/null +++ b/src/modbus-version.h.in @@ -0,0 +1,52 @@ +/* + * Copyright © 2010 Stéphane Raimbault + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with this program. If not, see . + */ + +#ifndef _MODBUS_VERSION_H_ +#define _MODBUS_VERSION_H_ + +/* The major version, (1, if %LIBMODBUS_VERSION is 1.2.3) */ +#define LIBMODBUS_VERSION_MAJOR (@LIBMODBUS_VERSION_MAJOR@) + +/* The minor version (2, if %LIBMODBUS_VERSION is 1.2.3) */ +#define LIBMODBUS_VERSION_MINOR (@LIBMODBUS_VERSION_MINOR@) + +/* The micro version (3, if %LIBMODBUS_VERSION is 1.2.3) */ +#define LIBMODBUS_VERSION_MICRO (@LIBMODBUS_VERSION_MICRO@) + +/* The full version, like 1.2.3 */ +#define LIBMODBUS_VERSION @LIBMODBUS_VERSION@ + +/* The full version, in string form (suited for string concatenation) + */ +#define LIBMODBUS_VERSION_STRING "@LIBMODBUS_VERSION@" + +/* Numerically encoded version, like 0x010203 */ +#define LIBMODBUS_VERSION_HEX ((LIBMODBUS_MAJOR_VERSION << 24) | \ + (LIBMODBUS_MINOR_VERSION << 16) | \ + (LIBMODBUS_MICRO_VERSION << 8)) + +/* Evaluates to True if the version is greater than @major, @minor and @micro + */ +#define LIBMODBUS_VERSION_CHECK(major,minor,micro) \ + (LIBMODBUS_VERSION_MAJOR > (major) || \ + (LIBMODBUS_VERSION_MAJOR == (major) && \ + LIBMODBUS_VERSION_MINOR > (minor)) || \ + (LIBMODBUS_VERSION_MAJOR == (major) && \ + LIBMODBUS_VERSION_MINOR == (minor) && \ + LIBMODBUS_VERSION_MICRO >= (micro))) + +#endif /* _MODBUS_VERSION_H_ */ diff --git a/src/modbus.h b/src/modbus.h new file mode 100644 index 0000000..367d973 --- /dev/null +++ b/src/modbus.h @@ -0,0 +1,204 @@ +/* + * Copyright © 2001-2010 Stéphane Raimbault + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with this program. If not, see . + */ + +#ifndef _MODBUS_H_ +#define _MODBUS_H_ + +/* Add this for macros that defined unix flavor */ +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include +#endif + +#ifdef HAVE_INTTYPES_H +#include +#endif +#ifdef HAVE_STDINT_H +#include +#endif +#include +#if defined(OpenBSD) || (defined(__FreeBSD__ ) && __FreeBSD__ < 5) +#include +#endif +#include +#include +#include +#include + +#include "modbus-version.h" + +#ifdef __cplusplus +# define MODBUS_BEGIN_DECLS extern "C" { +# define MODBUS_END_DECLS } +#else +# define MODBUS_BEGIN_DECLS +# define MODBUS_END_DECLS +#endif + +MODBUS_BEGIN_DECLS + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef OFF +#define OFF 0 +#endif + +#ifndef ON +#define ON 1 +#endif + +#define MODBUS_TCP_DEFAULT_PORT 502 +#define MODBUS_BROADCAST_ADDRESS 0 +#define MODBUS_TCP_SLAVE 0xFF + +/* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5: + * - RS232 / RS485 ADU = 253 bytes + slave (1 byte) + CRC (2 bytes) = 256 bytes + * - TCP MODBUS ADU = 253 bytes + MBAP (7 bytes) = 260 bytes + */ +#define MODBUS_MAX_ADU_LENGTH_RTU 256 +#define MODBUS_MAX_ADU_LENGTH_TCP 260 + +/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 1 page 12) + * Quantity of Coils (2 bytes): 1 to 2000 (0x7D0) + */ +#define MODBUS_MAX_BITS 2000 + +/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 3 page 15) + * Quantity of Registers (2 bytes): 1 to 125 (0x7D) + */ +#define MODBUS_MAX_REGISTERS 125 + +/* Random number to avoid errno conflicts */ +#define MODBUS_ENOBASE 112345678 + +/* Protocol exceptions */ +enum { + MODBUS_EXCEPTION_ILLEGAL_FUNCTION = 0x01, + MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, + MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, + MODBUS_EXCEPTION_SLAVE_OR_SERVER_FAILURE, + MODBUS_EXCEPTION_ACKNOWLEDGE, + MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY, + MODBUS_EXCEPTION_NEGATIVE_ACKNOWLEDGE, + MODBUS_EXCEPTION_MEMORY_PARITY, + MODBUS_EXCEPTION_NOT_DEFINED, + MODBUS_EXCEPTION_GATEWAY_PATH, + MODBUS_EXCEPTION_GATEWAY_TARGET, + MODBUS_EXCEPTION_MAX +}; + +#define EMBXILFUN (MODBUS_ENOBASE + MODBUS_EXCEPTION_ILLEGAL_FUNCTION) +#define EMBXILADD (MODBUS_ENOBASE + MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS) +#define EMBXILVAL (MODBUS_ENOBASE + MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE) +#define EMBXSFAIL (MODBUS_ENOBASE + MODBUS_EXCEPTION_SLAVE_OR_SERVER_FAILURE) +#define EMBXACK (MODBUS_ENOBASE + MODBUS_EXCEPTION_ACKNOWLEDGE) +#define EMBXSBUSY (MODBUS_ENOBASE + MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY) +#define EMBXNACK (MODBUS_ENOBASE + MODBUS_EXCEPTION_NEGATIVE_ACKNOWLEDGE) +#define EMBXMEMPAR (MODBUS_ENOBASE + MODBUS_EXCEPTION_MEMORY_PARITY) +#define EMBXGPATH (MODBUS_ENOBASE + MODBUS_EXCEPTION_GATEWAY_PATH) +#define EMBXGTAR (MODBUS_ENOBASE + MODBUS_EXCEPTION_GATEWAY_TARGET) + +/* Native libmodbus error codes */ +#define EMBBADCRC (EMBXGTAR + 1) +#define EMBBADDATA (EMBXGTAR + 2) +#define EMBBADEXC (EMBXGTAR + 3) +#define EMBUNKEXC (EMBXGTAR + 4) +#define EMBMDATA (EMBXGTAR + 5) + +extern const unsigned int libmodbus_version_major; +extern const unsigned int libmodbus_version_minor; +extern const unsigned int libmodbus_version_micro; + +typedef struct _modbus modbus_t; + +typedef struct { + int nb_bits; + int nb_input_bits; + int nb_input_registers; + int nb_registers; + uint8_t *tab_bits; + uint8_t *tab_input_bits; + uint16_t *tab_input_registers; + uint16_t *tab_registers; +} modbus_mapping_t; + +modbus_t* modbus_new_rtu(const char *device, int baud, char parity, int data_bit, + int stop_bit, int slave); +int modbus_set_slave(modbus_t* ctx, int slave); + +modbus_t* modbus_new_tcp(const char *ip_address, int port); + +int modbus_set_error_recovery(modbus_t *ctx, int enabled); + +void modbus_get_timeout_begin(modbus_t *ctx, struct timeval *timeout); +void modbus_set_timeout_begin(modbus_t *ctx, const struct timeval *timeout); + +void modbus_get_timeout_end(modbus_t *ctx, struct timeval *timeout); +void modbus_set_timeout_end(modbus_t *ctx, const struct timeval *timeout); + +int modbus_connect(modbus_t *ctx); +void modbus_close(modbus_t *ctx); + +void modbus_free(modbus_t *ctx); + +int modbus_flush(modbus_t *ctx); +void modbus_set_debug(modbus_t *ctx, int boolean); + +const char *modbus_strerror(int errnum); + +int modbus_read_bits(modbus_t *ctx, int addr, int nb, uint8_t *dest); +int modbus_read_input_bits(modbus_t *ctx, int addr, int nb, uint8_t *dest); +int modbus_read_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest); +int modbus_read_input_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest); +int modbus_write_bit(modbus_t *ctx, int coil_addr, int state); +int modbus_write_register(modbus_t *ctx, int reg_addr, int value); +int modbus_write_bits(modbus_t *ctx, int addr, int nb, const uint8_t *data); +int modbus_write_registers(modbus_t *ctx, int addr, int nb, const uint16_t *data); +int modbus_report_slave_id(modbus_t *ctx, uint8_t *dest); + +modbus_mapping_t* modbus_mapping_new(int nb_coil_status, int nb_input_status, + int nb_holding_registers, int nb_input_registers); +void modbus_mapping_free(modbus_mapping_t *mb_mapping); + +int modbus_listen(modbus_t *ctx, int nb_connection); +int modbus_accept(modbus_t *ctx, int *socket); +int modbus_receive(modbus_t *ctx, int sockfd, uint8_t *req); +int modbus_reply(modbus_t *ctx, const uint8_t *req, + int req_length, modbus_mapping_t *mb_mapping); + +/** + * UTILS FUNCTIONS + **/ + +#define MODBUS_GET_HIGH_BYTE(data) ((data >> 8) & 0xFF) +#define MODBUS_GET_LOW_BYTE(data) (data & 0xFF) + +void modbus_set_bits_from_byte(uint8_t *dest, int address, const uint8_t value); +void modbus_set_bits_from_bytes(uint8_t *dest, int address, unsigned int nb_bits, + const uint8_t *tab_byte); +uint8_t modbus_get_byte_from_bits(const uint8_t *src, int address, unsigned int nb_bits); +float modbus_get_float(const uint16_t *src); +void modbus_set_float(float real, uint16_t *dest); + +MODBUS_END_DECLS + +#endif /* _MODBUS_H_ */ diff --git a/src/modbus.h.in b/src/modbus.h.in deleted file mode 100644 index 4470eb5..0000000 --- a/src/modbus.h.in +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright © 2001-2010 Stéphane Raimbault - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser Public License for more details. - * - * You should have received a copy of the GNU Lesser Public License - * along with this program. If not, see . - */ - -#ifndef _MODBUS_H_ -#define _MODBUS_H_ - -/* Add this for macros that defined unix flavor */ -#if (defined(__unix__) || defined(unix)) && !defined(USG) -#include -#endif - -#ifdef HAVE_INTTYPES_H -#include -#endif -#ifdef HAVE_STDINT_H -#include -#endif -#include -#if defined(OpenBSD) || (defined(__FreeBSD__ ) && __FreeBSD__ < 5) -#include -#endif -#include -#include -#include -#include - -#ifdef __cplusplus -# define MODBUS_BEGIN_DECLS extern "C" { -# define MODBUS_END_DECLS } -#else -# define MODBUS_BEGIN_DECLS -# define MODBUS_END_DECLS -#endif - -MODBUS_BEGIN_DECLS - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef OFF -#define OFF 0 -#endif - -#ifndef ON -#define ON 1 -#endif - -#define MODBUS_TCP_DEFAULT_PORT 502 -#define MODBUS_BROADCAST_ADDRESS 0 -#define MODBUS_TCP_SLAVE 0xFF - -/* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5: - * - RS232 / RS485 ADU = 253 bytes + slave (1 byte) + CRC (2 bytes) = 256 bytes - * - TCP MODBUS ADU = 253 bytes + MBAP (7 bytes) = 260 bytes - */ -#define MODBUS_MAX_ADU_LENGTH_RTU 256 -#define MODBUS_MAX_ADU_LENGTH_TCP 260 - -/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 1 page 12) - * Quantity of Coils (2 bytes): 1 to 2000 (0x7D0) - */ -#define MODBUS_MAX_BITS 2000 - -/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 3 page 15) - * Quantity of Registers (2 bytes): 1 to 125 (0x7D) - */ -#define MODBUS_MAX_REGISTERS 125 - -/* Random number to avoid errno conflicts */ -#define MODBUS_ENOBASE 112345678 - -/* Protocol exceptions */ -enum { - MODBUS_EXCEPTION_ILLEGAL_FUNCTION = 0x01, - MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, - MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, - MODBUS_EXCEPTION_SLAVE_OR_SERVER_FAILURE, - MODBUS_EXCEPTION_ACKNOWLEDGE, - MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY, - MODBUS_EXCEPTION_NEGATIVE_ACKNOWLEDGE, - MODBUS_EXCEPTION_MEMORY_PARITY, - MODBUS_EXCEPTION_NOT_DEFINED, - MODBUS_EXCEPTION_GATEWAY_PATH, - MODBUS_EXCEPTION_GATEWAY_TARGET, - MODBUS_EXCEPTION_MAX -}; - -#define EMBXILFUN (MODBUS_ENOBASE + MODBUS_EXCEPTION_ILLEGAL_FUNCTION) -#define EMBXILADD (MODBUS_ENOBASE + MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS) -#define EMBXILVAL (MODBUS_ENOBASE + MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE) -#define EMBXSFAIL (MODBUS_ENOBASE + MODBUS_EXCEPTION_SLAVE_OR_SERVER_FAILURE) -#define EMBXACK (MODBUS_ENOBASE + MODBUS_EXCEPTION_ACKNOWLEDGE) -#define EMBXSBUSY (MODBUS_ENOBASE + MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY) -#define EMBXNACK (MODBUS_ENOBASE + MODBUS_EXCEPTION_NEGATIVE_ACKNOWLEDGE) -#define EMBXMEMPAR (MODBUS_ENOBASE + MODBUS_EXCEPTION_MEMORY_PARITY) -#define EMBXGPATH (MODBUS_ENOBASE + MODBUS_EXCEPTION_GATEWAY_PATH) -#define EMBXGTAR (MODBUS_ENOBASE + MODBUS_EXCEPTION_GATEWAY_TARGET) - -/* Native libmodbus error codes */ -#define EMBBADCRC (EMBXGTAR + 1) -#define EMBBADDATA (EMBXGTAR + 2) -#define EMBBADEXC (EMBXGTAR + 3) -#define EMBUNKEXC (EMBXGTAR + 4) -#define EMBMDATA (EMBXGTAR + 5) - -/* The major version, (1, if %LIBMODBUS_VERSION is 1.2.3) */ -#define LIBMODBUS_VERSION_MAJOR (@LIBMODBUS_VERSION_MAJOR@) - -/* The minor version (2, if %LIBMODBUS_VERSION is 1.2.3) */ -#define LIBMODBUS_VERSION_MINOR (@LIBMODBUS_VERSION_MINOR@) - -/* The micro version (3, if %LIBMODBUS_VERSION is 1.2.3) */ -#define LIBMODBUS_VERSION_MICRO (@LIBMODBUS_VERSION_MICRO@) - -/* The full version, like 1.2.3 */ -#define LIBMODBUS_VERSION @LIBMODBUS_VERSION@ - -/* The full version, in string form (suited for string concatenation) - */ -#define LIBMODBUS_VERSION_STRING "@LIBMODBUS_VERSION@" - -/* Numerically encoded version, like 0x010203 */ -#define LIBMODBUS_VERSION_HEX ((LIBMODBUS_MAJOR_VERSION << 24) | \ - (LIBMODBUS_MINOR_VERSION << 16) | \ - (LIBMODBUS_MICRO_VERSION << 8)) - -/* Evaluates to True if the version is greater than @major, @minor and @micro - */ -#define LIBMODBUS_VERSION_CHECK(major,minor,micro) \ - (LIBMODBUS_VERSION_MAJOR > (major) || \ - (LIBMODBUS_VERSION_MAJOR == (major) && \ - LIBMODBUS_VERSION_MINOR > (minor)) || \ - (LIBMODBUS_VERSION_MAJOR == (major) && \ - LIBMODBUS_VERSION_MINOR == (minor) && \ - LIBMODBUS_VERSION_MICRO >= (micro))) - -extern const unsigned int libmodbus_version_major; -extern const unsigned int libmodbus_version_minor; -extern const unsigned int libmodbus_version_micro; - -typedef struct _modbus modbus_t; - -typedef struct { - int nb_bits; - int nb_input_bits; - int nb_input_registers; - int nb_registers; - uint8_t *tab_bits; - uint8_t *tab_input_bits; - uint16_t *tab_input_registers; - uint16_t *tab_registers; -} modbus_mapping_t; - -modbus_t* modbus_new_rtu(const char *device, int baud, char parity, int data_bit, - int stop_bit, int slave); -int modbus_set_slave(modbus_t* ctx, int slave); - -modbus_t* modbus_new_tcp(const char *ip_address, int port); - -int modbus_set_error_recovery(modbus_t *ctx, int enabled); - -void modbus_get_timeout_begin(modbus_t *ctx, struct timeval *timeout); -void modbus_set_timeout_begin(modbus_t *ctx, const struct timeval *timeout); - -void modbus_get_timeout_end(modbus_t *ctx, struct timeval *timeout); -void modbus_set_timeout_end(modbus_t *ctx, const struct timeval *timeout); - -int modbus_connect(modbus_t *ctx); -void modbus_close(modbus_t *ctx); - -void modbus_free(modbus_t *ctx); - -int modbus_flush(modbus_t *ctx); -void modbus_set_debug(modbus_t *ctx, int boolean); - -const char *modbus_strerror(int errnum); - -int modbus_read_bits(modbus_t *ctx, int addr, int nb, uint8_t *dest); -int modbus_read_input_bits(modbus_t *ctx, int addr, int nb, uint8_t *dest); -int modbus_read_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest); -int modbus_read_input_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest); -int modbus_write_bit(modbus_t *ctx, int coil_addr, int state); -int modbus_write_register(modbus_t *ctx, int reg_addr, int value); -int modbus_write_bits(modbus_t *ctx, int addr, int nb, const uint8_t *data); -int modbus_write_registers(modbus_t *ctx, int addr, int nb, const uint16_t *data); -int modbus_report_slave_id(modbus_t *ctx, uint8_t *dest); - -modbus_mapping_t* modbus_mapping_new(int nb_coil_status, int nb_input_status, - int nb_holding_registers, int nb_input_registers); -void modbus_mapping_free(modbus_mapping_t *mb_mapping); - -int modbus_listen(modbus_t *ctx, int nb_connection); -int modbus_accept(modbus_t *ctx, int *socket); -int modbus_receive(modbus_t *ctx, int sockfd, uint8_t *req); -int modbus_reply(modbus_t *ctx, const uint8_t *req, - int req_length, modbus_mapping_t *mb_mapping); - -/** - * UTILS FUNCTIONS - **/ - -#define MODBUS_GET_HIGH_BYTE(data) ((data >> 8) & 0xFF) -#define MODBUS_GET_LOW_BYTE(data) (data & 0xFF) - -void modbus_set_bits_from_byte(uint8_t *dest, int address, const uint8_t value); -void modbus_set_bits_from_bytes(uint8_t *dest, int address, unsigned int nb_bits, - const uint8_t *tab_byte); -uint8_t modbus_get_byte_from_bits(const uint8_t *src, int address, unsigned int nb_bits); -float modbus_get_float(const uint16_t *src); -void modbus_set_float(float real, uint16_t *dest); - -MODBUS_END_DECLS - -#endif /* _MODBUS_H_ */ -- libgit2 0.21.4