Commit a002b3897d3039c57956346262139bd3662e21c8
1 parent
269e943a
[doc] Add entry points for accept/listen in libmodbus index
Showing
4 changed files
with
16 additions
and
11 deletions
README.md
| @@ -64,7 +64,7 @@ as manual pages after installation. | @@ -64,7 +64,7 @@ as manual pages after installation. | ||
| 64 | 64 | ||
| 65 | The documentation is based on | 65 | The documentation is based on |
| 66 | [AsciiDoc](http://www.methods.co.nz/asciidoc/). Only man pages are built | 66 | [AsciiDoc](http://www.methods.co.nz/asciidoc/). Only man pages are built |
| 67 | -by default with `make` command, you can run `make htmldoc` in *docs* directory | 67 | +by default with `make` command, you can run `make htmldoc` in *doc* directory |
| 68 | to generate HTML files. | 68 | to generate HTML files. |
| 69 | 69 | ||
| 70 | Testing | 70 | Testing |
| @@ -87,4 +87,4 @@ It's also possible to run the unit tests with `make check`. | @@ -87,4 +87,4 @@ It's also possible to run the unit tests with `make check`. | ||
| 87 | To report a bug or to contribute | 87 | To report a bug or to contribute |
| 88 | -------------------------------- | 88 | -------------------------------- |
| 89 | 89 | ||
| 90 | -See [CONTRIBUTING](CONTRIBUTING.md) document. | ||
| 91 | \ No newline at end of file | 90 | \ No newline at end of file |
| 91 | +See [CONTRIBUTING](CONTRIBUTING.md) document. |
doc/libmodbus.txt
| @@ -223,20 +223,25 @@ Reply an exception:: | @@ -223,20 +223,25 @@ Reply an exception:: | ||
| 223 | Server | 223 | Server |
| 224 | ~~~~~~ | 224 | ~~~~~~ |
| 225 | The server is waiting for request from clients and must answer when it is | 225 | The server is waiting for request from clients and must answer when it is |
| 226 | -concerned by the request. The libmodbus offers the following functions to | ||
| 227 | -handle requests: | 226 | +concerned by the request. |
| 228 | 227 | ||
| 229 | -Data mapping: | ||
| 230 | - linkmb:modbus_mapping_new[3] | ||
| 231 | - linkmb:modbus_mapping_free[3] | 228 | +In TCP mode, you must not use the usual linkmb:modbus_connect[3] to establish the connection but a pair of accept/listen calls:: |
| 229 | + linkmb:modbus_tcp_listen[3] | ||
| 230 | + linkmb:modbus_tcp_accept[3] | ||
| 231 | + linkmb:modbus_tcp_pi_listen[3] | ||
| 232 | + linkmb:modbus_tcp_pi_accept[3] | ||
| 232 | 233 | ||
| 233 | -Receive:: | 234 | +then the data can be received with:: |
| 234 | linkmb:modbus_receive[3] | 235 | linkmb:modbus_receive[3] |
| 235 | 236 | ||
| 236 | -Reply:: | 237 | +and a response can be send with:: |
| 237 | linkmb:modbus_reply[3] | 238 | linkmb:modbus_reply[3] |
| 238 | linkmb:modbus_reply_exception[3] | 239 | linkmb:modbus_reply_exception[3] |
| 239 | 240 | ||
| 241 | +To handle the mapping of your Modbus data, you must use: | ||
| 242 | + linkmb:modbus_mapping_new[3] | ||
| 243 | + linkmb:modbus_mapping_free[3] | ||
| 244 | + | ||
| 240 | 245 | ||
| 241 | ERROR HANDLING | 246 | ERROR HANDLING |
| 242 | -------------- | 247 | -------------- |
doc/modbus_tcp_listen.txt
| @@ -17,7 +17,7 @@ DESCRIPTION | @@ -17,7 +17,7 @@ DESCRIPTION | ||
| 17 | The *modbus_tcp_listen()* function shall create a socket and listen to maximum | 17 | The *modbus_tcp_listen()* function shall create a socket and listen to maximum |
| 18 | _nb_connection_ incoming connections on the specified IP address. The context | 18 | _nb_connection_ incoming connections on the specified IP address. The context |
| 19 | _ctx _must be allocated and initialized with linkmb:modbus_new_tcp[3] before to | 19 | _ctx _must be allocated and initialized with linkmb:modbus_new_tcp[3] before to |
| 20 | -set the IP address to listen, if IP address is set to NULL, any addresses will be | 20 | +set the IP address to listen, if IP address is set to NULL or '0.0.0.0', any addresses will be |
| 21 | listen. | 21 | listen. |
| 22 | 22 | ||
| 23 | 23 |
doc/modbus_tcp_pi_listen.txt
| @@ -17,7 +17,7 @@ DESCRIPTION | @@ -17,7 +17,7 @@ DESCRIPTION | ||
| 17 | The *modbus_tcp_pi_listen()* function shall create a socket and listen to | 17 | The *modbus_tcp_pi_listen()* function shall create a socket and listen to |
| 18 | maximum _nb_connection_ incoming connections on the specified nodes. The | 18 | maximum _nb_connection_ incoming connections on the specified nodes. The |
| 19 | context *ctx* must be allocated and initialized with linkmb:modbus_new_tcp_pi[3] | 19 | context *ctx* must be allocated and initialized with linkmb:modbus_new_tcp_pi[3] |
| 20 | -before to set the node to listen, if node is set to NULL, any addresses will be | 20 | +before to set the node to listen, if node is set to NULL or '0.0.0.0', any addresses will be |
| 21 | listen. | 21 | listen. |
| 22 | 22 | ||
| 23 | 23 |