Commit 987d5af1498cdc10dce784a199bac68572a4c16d
1 parent
5ce6b8a9
Move migration content to libmodbus.org
Showing
2 changed files
with
1 additions
and
54 deletions
MIGRATION deleted
| 1 | -============================================= | ||
| 2 | -Migration notes from the 2.0 series (for 3.0) | ||
| 3 | -============================================= | ||
| 4 | - | ||
| 5 | -The 3.0 release use a brand new API and this document covers only the general | ||
| 6 | -changes: | ||
| 7 | - | ||
| 8 | -- the structure modbus_param_t is gone and is replaced by a new opaque and | ||
| 9 | -dynamically allocated structure modbus_t. | ||
| 10 | - | ||
| 11 | -- the slave argument is no more an argument of the Modbus functions, you need to | ||
| 12 | - call modbus_set_slave first. | ||
| 13 | - | ||
| 14 | -- the public header file is smaller so some internal defines aren't accessible | ||
| 15 | - anymore. | ||
| 16 | - | ||
| 17 | -- all function and constants are respectively prefixed by modbus_ or MODBUS_. | ||
| 18 | - | ||
| 19 | -- the POSIX error conventions are used (if an error occurred, -1 or NULL is | ||
| 20 | - returned and errno is set accordingly). | ||
| 21 | - | ||
| 22 | -- coil status and discretes inputs are just bits and force/preset actions have | ||
| 23 | - been renamed to write actions. | ||
| 24 | - | ||
| 25 | -We hope you'll enjoy the new API to accept the migration burden! | ||
| 26 | - | ||
| 27 | -============================================= | ||
| 28 | -Migration notes from the 1.2 series (for 2.0) | ||
| 29 | -============================================= | ||
| 30 | - | ||
| 31 | -Init | ||
| 32 | -==== | ||
| 33 | - | ||
| 34 | -modbus_init_tcp requires a third new argument, the port number. | ||
| 35 | - | ||
| 36 | -modbus_init_tcp(modbus_param_t *mb_param, char *ip_address, int port) | ||
| 37 | - | ||
| 38 | -Set the port to MODBUS_TCP_DEFAULT_PORT to use the default one | ||
| 39 | -(502). It's convenient to use a port number greater than or equal to | ||
| 40 | -1024 because it's not necessary to be root to use this port number. | ||
| 41 | - | ||
| 42 | - | ||
| 43 | -Pointers of data | ||
| 44 | -================ | ||
| 45 | - | ||
| 46 | -The coil and input status are now stored in an array of type uint8_t | ||
| 47 | -(in 1.2.X series, array of type int was used). So now, you need to | ||
| 48 | -pass a pointer of type uint8_t to use read_coil_status(), for example. | ||
| 49 | - | ||
| 50 | -The holding and input registers are now stored in an array of type | ||
| 51 | -uint16_t. | ||
| 52 | - | ||
| 53 | -These changes reduce the memory consumption. |
Makefile.am
| @@ -7,7 +7,7 @@ pkgconfig_DATA = libmodbus.pc | @@ -7,7 +7,7 @@ pkgconfig_DATA = libmodbus.pc | ||
| 7 | EXTRA_DIST = libmodbus.pc.in | 7 | EXTRA_DIST = libmodbus.pc.in |
| 8 | CLEANFILES += libmodbus.pc | 8 | CLEANFILES += libmodbus.pc |
| 9 | 9 | ||
| 10 | -dist_doc_DATA = MIGRATION README.md AUTHORS NEWS | 10 | +dist_doc_DATA = AUTHORS NEWS README.md |
| 11 | 11 | ||
| 12 | SUBDIRS = src | 12 | SUBDIRS = src |
| 13 | 13 |