Commit d2b288bedf4b3e5584fd85ba986704ae0ebbd716

Authored by Stéphane Raimbault
1 parent c1665d40

So many boring changes to the documentation ;)

Showing 53 changed files with 203 additions and 211 deletions
doc/libmodbus.txt
@@ -235,7 +235,7 @@ shall return either a NULL value (if returning a pointer) or a negative value @@ -235,7 +235,7 @@ shall return either a NULL value (if returning a pointer) or a negative value
235 (if returning an integer), and the actual error code shall be stored in the 235 (if returning an integer), and the actual error code shall be stored in the
236 'errno' variable. 236 'errno' variable.
237 237
238 -The _modbus_strerror()_ function is provided to translate libmodbus-specific 238 +The *modbus_strerror()* function is provided to translate libmodbus-specific
239 error codes into error message strings; for details refer to 239 error codes into error message strings; for details refer to
240 linkmb:modbus_strerror[3]. 240 linkmb:modbus_strerror[3].
241 241
doc/modbus_close.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_close()_ function shall close the connection established with the 17 +The *modbus_close()* function shall close the connection established with the
18 backend set in the context. 18 backend set in the context.
19 19
20 20
doc/modbus_connect.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_connect()_ function shall etablish a connection to a Modbus server, 17 +The *modbus_connect()* function shall etablish a connection to a Modbus server,
18 a network or a bus using the context information of libmodbus context given in 18 a network or a bus using the context information of libmodbus context given in
19 argument. 19 argument.
20 20
21 21
22 RETURN VALUE 22 RETURN VALUE
23 ------------ 23 ------------
24 -The modbus_connect() function shall return 0 if successful. Otherwise it shall  
25 -return -1 and set errno to one of the values defined by the system calls of the  
26 -underlying platform. 24 +The function shall return 0 if successful. Otherwise it shall return -1 and set
  25 +errno to one of the values defined by the system calls of the underlying
  26 +platform.
27 27
28 28
29 EXAMPLE 29 EXAMPLE
doc/modbus_flush.txt
@@ -14,13 +14,13 @@ SYNOPSIS @@ -14,13 +14,13 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_flush()_ function shall discard data received but not read to the 17 +The *modbus_flush()* function shall discard data received but not read to the
18 socket or file descriptor associated to the context 'ctx'. 18 socket or file descriptor associated to the context 'ctx'.
19 19
20 20
21 RETURN VALUE 21 RETURN VALUE
22 ------------ 22 ------------
23 -The _modbus_flush()_ function shall return 0 or the number of flushed bytes if 23 +The function shall return 0 or the number of flushed bytes if
24 successful. Otherwise it shall return -1 and set errno. 24 successful. Otherwise it shall return -1 and set errno.
25 25
26 26
doc/modbus_free.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_free()_ function shall free an allocated modbus_t structure. 17 +The *modbus_free()* function shall free an allocated modbus_t structure.
18 18
19 19
20 RETURN VALUE 20 RETURN VALUE
doc/modbus_get_byte_from_bits.txt
@@ -13,15 +13,14 @@ SYNOPSIS @@ -13,15 +13,14 @@ SYNOPSIS
13 13
14 DESCRIPTION 14 DESCRIPTION
15 ----------- 15 -----------
16 -The _modbus_get_byte_from_bits()_ function shall extract a value from many  
17 -bits. All 'nb_bits' bits from 'src' at position 'index' will be read as a 16 +The *modbus_get_byte_from_bits()* function shall extract a value from many
  17 +bits. All _nb_bits_ bits from _src_ at position _index_ will be read as a
18 single value. To obtain a full byte, set nb_bits to 8. 18 single value. To obtain a full byte, set nb_bits to 8.
19 19
20 20
21 RETURN VALUE 21 RETURN VALUE
22 ------------ 22 ------------
23 -The _modbus_get_byte_from_bits()_ function shall return a byte containing the  
24 -bits read. 23 +The function shall return a byte containing the bits read.
25 24
26 25
27 SEE ALSO 26 SEE ALSO
doc/modbus_get_byte_timeout.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_get_byte_timeout()_ function shall store the timeout interval 17 +The *modbus_get_byte_timeout()* function shall store the timeout interval
18 between two consecutive bytes of the same message in the _to_sec_ and _to_usec_ 18 between two consecutive bytes of the same message in the _to_sec_ and _to_usec_
19 arguments. 19 arguments.
20 20
doc/modbus_get_float.txt
@@ -14,15 +14,15 @@ SYNOPSIS @@ -14,15 +14,15 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_get_float()_ function shall get a float from 4 bytes in Modbus  
18 -format (ABCD order). The 'src' array must be pointer on two 16 bits values, for 17 +The *modbus_get_float()* function shall get a float from 4 bytes in Modbus
  18 +format (ABCD order). The _src_ array must be pointer on two 16 bits values, for
19 example, if the first word is set to 0x4465 and the second to 0x229a, the float 19 example, if the first word is set to 0x4465 and the second to 0x229a, the float
20 value will be 916.540649. 20 value will be 916.540649.
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_get_float()_ function shall return a float. 25 +The function shall return a float.
26 26
27 27
28 SEE ALSO 28 SEE ALSO
doc/modbus_get_float_dcba.txt
@@ -14,15 +14,15 @@ SYNOPSIS @@ -14,15 +14,15 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_get_float_dcba()_ function shall get a float from 4 bytes in  
18 -inversed Modbus format (DCBA order). The 'src' array must be pointer on two 16 17 +The *modbus_get_float_dcba()* function shall get a float from 4 bytes in
  18 +inversed Modbus format (DCBA order). The _src_ array must be pointer on two 16
19 bits values, for example, if the first word is set to 0x9a22 and the second to 19 bits values, for example, if the first word is set to 0x9a22 and the second to
20 0x6544, the float value read will be 916.540649. 20 0x6544, the float value read will be 916.540649.
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_get_float_dcba()_ function shall return a float. 25 +The function shall return a float.
26 26
27 27
28 SEE ALSO 28 SEE ALSO
doc/modbus_get_header_length.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_get_header_length()_ function shall retrieve the current header 17 +The *modbus_get_header_length()* function shall retrieve the current header
18 length from the backend. This function is convenient to manipulate a message and 18 length from the backend. This function is convenient to manipulate a message and
19 so its limited to low-level operations. 19 so its limited to low-level operations.
20 20
doc/modbus_get_response_timeout.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_get_response_timeout()_ function shall return the timeout interval 17 +The *modbus_get_response_timeout()* function shall return the timeout interval
18 used to wait for a response in the _to_sec_ and _to_usec_ arguments. 18 used to wait for a response in the _to_sec_ and _to_usec_ arguments.
19 19
20 20
doc/modbus_get_socket.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_get_socket()_ function shall return the current socket or file 17 +The *modbus_get_socket()* function shall return the current socket or file
18 descriptor of the libmodbus context. 18 descriptor of the libmodbus context.
19 19
20 20
doc/modbus_mapping_free.txt
@@ -14,8 +14,8 @@ SYNOPSIS @@ -14,8 +14,8 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_mapping_free()_ function shall free the four arrays of mb_mapping_t  
18 -structure and finally the mb_mapping_t referenced by 'mb_mapping'. 17 +The function shall free the four arrays of mb_mapping_t structure and finally
  18 +the mb_mapping_t referenced by _mb_mapping_.
19 19
20 20
21 RETURN VALUE 21 RETURN VALUE
doc/modbus_mapping_new.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_mapping_new()_ function shall allocate four arrays to store bits, 17 +The *modbus_mapping_new()* function shall allocate four arrays to store bits,
18 input bits, registers and inputs registers. The pointers are stored in 18 input bits, registers and inputs registers. The pointers are stored in
19 modbus_mapping_t structure. All values of the arrays are initialized to zero. 19 modbus_mapping_t structure. All values of the arrays are initialized to zero.
20 20
@@ -26,8 +26,8 @@ This function is convenient to handle requests in a Modbus server/slave. @@ -26,8 +26,8 @@ This function is convenient to handle requests in a Modbus server/slave.
26 26
27 RETURN VALUE 27 RETURN VALUE
28 ------------ 28 ------------
29 -The _modbus_mapping_new()_ function shall return the new allocated structure if  
30 -successful. Otherwise it shall return NULL and set errno. 29 +The function shall return the new allocated structure if successful. Otherwise
  30 +it shall return NULL and set errno.
31 31
32 32
33 ERRORS 33 ERRORS
doc/modbus_mask_write_register.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_mask_write_register()_ function shall modify the value of the 17 +The *modbus_mask_write_register()* function shall modify the value of the
18 holding register at the address 'addr' of the remote device using the algorithm: 18 holding register at the address 'addr' of the remote device using the algorithm:
19 19
20 new value = (current value AND 'and') OR ('or' AND (NOT 'and')) 20 new value = (current value AND 'and') OR ('or' AND (NOT 'and'))
@@ -24,8 +24,8 @@ The function uses the Modbus function code 0x16 (mask single register). @@ -24,8 +24,8 @@ The function uses the Modbus function code 0x16 (mask single register).
24 24
25 RETURN VALUE 25 RETURN VALUE
26 ------------ 26 ------------
27 -The _modbus_mask_write_register()_ function shall return 1 if successful. Otherwise  
28 -it shall return -1 and set errno. 27 +The function shall return 1 if successful. Otherwise it shall return -1 and set
  28 +errno.
29 29
30 30
31 SEE ALSO 31 SEE ALSO
doc/modbus_new_rtu.txt
@@ -15,13 +15,12 @@ SYNOPSIS @@ -15,13 +15,12 @@ SYNOPSIS
15 15
16 DESCRIPTION 16 DESCRIPTION
17 ----------- 17 -----------
18 -  
19 -The _modbus_new_rtu()_ function shall allocate and initialize a modbus_t 18 +The *modbus_new_rtu()* function shall allocate and initialize a modbus_t
20 structure to communicate in RTU mode on a serial line. 19 structure to communicate in RTU mode on a serial line.
21 20
22 The _device_ argument specifies the name of the serial port handled by the OS, 21 The _device_ argument specifies the name of the serial port handled by the OS,
23 -eg. '/dev/ttyS0' or '/dev/ttyUSB0'. On Windows, it's necessary to prepend COM  
24 -name with '\\.\' for COM number greater than 9, eg. '\\\\.\\COM10'. See 22 +eg. "/dev/ttyS0" or "/dev/ttyUSB0". On Windows, it's necessary to prepend COM
  23 +name with "\\.\" for COM number greater than 9, eg. "\\\\.\\COM10". See
25 http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx for details 24 http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx for details
26 25
27 The _baud_ argument specifies the baud rate of the communication, eg. 9600, 26 The _baud_ argument specifies the baud rate of the communication, eg. 9600,
@@ -41,8 +40,8 @@ and 2. @@ -41,8 +40,8 @@ and 2.
41 40
42 RETURN VALUE 41 RETURN VALUE
43 ------------ 42 ------------
44 -The _modbus_new_rtu()_ function shall return a pointer to a *modbus_t* structure  
45 -if successful. Otherwise it shall return NULL and set errno to one of the values 43 +The function shall return a pointer to a _modbus_t_ structure if
  44 +successful. Otherwise it shall return NULL and set errno to one of the values
46 defined below. 45 defined below.
47 46
48 47
doc/modbus_new_tcp.txt
@@ -22,15 +22,15 @@ wants etablish a connection. A NULL value can be used to listen any addresses in @@ -22,15 +22,15 @@ wants etablish a connection. A NULL value can be used to listen any addresses in
22 server mode. 22 server mode.
23 23
24 The _port_ argument is the TCP port to use. Set the port to 24 The _port_ argument is the TCP port to use. Set the port to
25 -*MODBUS_TCP_DEFAULT_PORT* to use the default one (502). It’s convenient to use a 25 +`MODBUS_TCP_DEFAULT_PORT` to use the default one (502). It’s convenient to use a
26 port number greater than or equal to 1024 because it’s not necessary to have 26 port number greater than or equal to 1024 because it’s not necessary to have
27 administrator privileges. 27 administrator privileges.
28 28
29 29
30 RETURN VALUE 30 RETURN VALUE
31 ------------ 31 ------------
32 -The *modbus_new_tcp()* function shall return a pointer to a *modbus_t* structure  
33 -if successful. Otherwise it shall return NULL and set errno to one of the values 32 +The function shall return a pointer to a *modbus_t* structure if
  33 +successful. Otherwise it shall return NULL and set errno to one of the values
34 defined below. 34 defined below.
35 35
36 36
doc/modbus_new_tcp_pi.txt
@@ -29,8 +29,8 @@ necessary to have administrator privileges. @@ -29,8 +29,8 @@ necessary to have administrator privileges.
29 29
30 RETURN VALUE 30 RETURN VALUE
31 ------------ 31 ------------
32 -The *modbus_new_tcp_pi()* function shall return a pointer to a *modbus_t* structure  
33 -if successful. Otherwise it shall return NULL and set errno to one of the values 32 +The function shall return a pointer to a *modbus_t* structure if
  33 +successful. Otherwise it shall return NULL and set errno to one of the values
34 defined below. 34 defined below.
35 35
36 36
doc/modbus_read_bits.txt
@@ -14,20 +14,20 @@ SYNOPSIS @@ -14,20 +14,20 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_read_bits()_ function shall read the status of the 'nb' bits (coils)  
18 -to the address 'addr' of the remote device. The result of reading is stored in  
19 -'dest' array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_. 17 +The *modbus_read_bits()* function shall read the status of the _nb_ bits (coils)
  18 +to the address _addr_ of the remote device. The result of reading is stored in
  19 +_dest_ array as unsigned bytes (8 bits) set to `TRUE` or `FALSE`.
20 20
21 -You must take care to allocate enough memory to store the results in 'dest'  
22 -(at least 'nb' * sizeof(uint8_t)). 21 +You must take care to allocate enough memory to store the results in _dest_
  22 +(at least _nb_ * sizeof(uint8_t)).
23 23
24 The function uses the Modbus function code 0x01 (read coil status). 24 The function uses the Modbus function code 0x01 (read coil status).
25 25
26 26
27 RETURN VALUE 27 RETURN VALUE
28 ------------ 28 ------------
29 -The _modbus_read_bits()_ function shall return the number of read bits if  
30 -successful. Otherwise it shall return -1 and set errno. 29 +The function shall return the number of read bits if successful. Otherwise it
  30 +shall return -1 and set errno.
31 31
32 32
33 ERRORS 33 ERRORS
doc/modbus_read_input_bits.txt
@@ -14,20 +14,20 @@ SYNOPSIS @@ -14,20 +14,20 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_read_input_bits()_ function shall read the content of the 'nb' input  
18 -bits to the address 'addr' of the remote device. The result of reading is stored  
19 -in 'dest' array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_. 17 +The *modbus_read_input_bits()* function shall read the content of the _nb_ input
  18 +bits to the address _addr_ of the remote device. The result of reading is stored
  19 +in _dest_ array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_.
20 20
21 -You must take care to allocate enough memory to store the results in 'dest'  
22 -(at least 'nb' * sizeof(uint8_t)). 21 +You must take care to allocate enough memory to store the results in _dest_
  22 +(at least _nb_ * sizeof(uint8_t)).
23 23
24 The function uses the Modbus function code 0x02 (read input status). 24 The function uses the Modbus function code 0x02 (read input status).
25 25
26 26
27 RETURN VALUE 27 RETURN VALUE
28 ------------ 28 ------------
29 -The _modbus_read_input_status()_ function shall return the number of read  
30 -input status if successful. Otherwise it shall return -1 and set errno. 29 +The function shall return the number of read input status if
  30 +successful. Otherwise it shall return -1 and set errno.
31 31
32 32
33 ERRORS 33 ERRORS
doc/modbus_read_input_registers.txt
@@ -14,12 +14,12 @@ SYNOPSIS @@ -14,12 +14,12 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_read_input_registers()_ function shall read the content of the 'nb'  
18 -input registers to address 'addr' of the remote device. The result of the  
19 -reading is stored in 'dest' array as word values (16 bits). 17 +The *modbus_read_input_registers()* function shall read the content of the _nb_
  18 +input registers to address _addr_ of the remote device. The result of the
  19 +reading is stored in _dest_ array as word values (16 bits).
20 20
21 -You must take care to allocate enough memory to store the results in 'dest' (at  
22 -least 'nb' * sizeof(uint16_t)). 21 +You must take care to allocate enough memory to store the results in _dest_ (at
  22 +least _nb_ * sizeof(uint16_t)).
23 23
24 The function uses the Modbus function code 0x04 (read input registers). The 24 The function uses the Modbus function code 0x04 (read input registers). The
25 holding registers and input registers have different historical meaning, but 25 holding registers and input registers have different historical meaning, but
@@ -28,8 +28,8 @@ nowadays it's more common to use holding registers only. @@ -28,8 +28,8 @@ nowadays it's more common to use holding registers only.
28 28
29 RETURN VALUE 29 RETURN VALUE
30 ------------ 30 ------------
31 -The _modbus_read_input_registers()_ function shall return the number of read  
32 -input registers if successful. Otherwise it shall return -1 and set errno. 31 +The function shall return the number of read input registers if
  32 +successful. Otherwise it shall return -1 and set errno.
33 33
34 34
35 ERRORS 35 ERRORS
doc/modbus_read_registers.txt
@@ -14,19 +14,19 @@ SYNOPSIS @@ -14,19 +14,19 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_read_registers()_ function shall read the content of the 'nb'  
18 -holding registers to the address 'addr' of the remote device. The result of  
19 -reading is stored in 'dest' array as word values (16 bits). 17 +The *modbus_read_registers()* function shall read the content of the _nb_
  18 +holding registers to the address _addr_ of the remote device. The result of
  19 +reading is stored in _dest_ array as word values (16 bits).
20 20
21 -You must take care to allocate enough memory to store the results in 'dest'  
22 -(at least 'nb' * sizeof(uint16_t)). 21 +You must take care to allocate enough memory to store the results in _dest_
  22 +(at least _nb_ * sizeof(uint16_t)).
23 23
24 The function uses the Modbus function code 0x03 (read holding registers). 24 The function uses the Modbus function code 0x03 (read holding registers).
25 25
26 26
27 RETURN VALUE 27 RETURN VALUE
28 ------------ 28 ------------
29 -The _modbus_read_registers()_ function shall return the number of read registers 29 +The function shall return the number of read registers
30 if successful. Otherwise it shall return -1 and set errno. 30 if successful. Otherwise it shall return -1 and set errno.
31 31
32 32
doc/modbus_receive.txt
@@ -14,20 +14,20 @@ SYNOPSIS @@ -14,20 +14,20 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_receive()_ function shall receive an indication request from the  
18 -socket of the context 'ctx'. This function is used by Modbus slave/server to 17 +The *modbus_receive()* function shall receive an indication request from the
  18 +socket of the context _ctx_. This function is used by Modbus slave/server to
19 receive and analyze indication request sent by the masters/clients. 19 receive and analyze indication request sent by the masters/clients.
20 20
21 If you need to use another socket or file descriptor than the one defined in the 21 If you need to use another socket or file descriptor than the one defined in the
22 -context 'ctx', see the function linkmb:modbus_set_socket[3]. 22 +context _ctx_, see the function linkmb:modbus_set_socket[3].
23 23
24 24
25 RETURN VALUE 25 RETURN VALUE
26 ------------ 26 ------------
27 -The _modbus_receive()_ function shall store the indication request in 'req' and  
28 -return the request length if sucessful. The returned request length can be zero  
29 -if the indication request is ignored (eg. a query for another slave in RTU  
30 -mode). Otherwise it shall return -1 and set errno. 27 +The function shall store the indication request in _req_ and return the request
  28 +length if sucessful. The returned request length can be zero if the indication
  29 +request is ignored (eg. a query for another slave in RTU mode). Otherwise it
  30 +shall return -1 and set errno.
31 31
32 32
33 SEE ALSO 33 SEE ALSO
doc/modbus_receive_confirmation.txt
@@ -14,18 +14,18 @@ SYNOPSIS @@ -14,18 +14,18 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_receive_confirmation()_ function shall receive a request via the  
18 -socket of the context 'ctx'. This function must be used for debugging purposes 17 +The *modbus_receive_confirmation(*_ function shall receive a request via the
  18 +socket of the context _ctx_. This function must be used for debugging purposes
19 because the received response isn't checked against the initial request. This 19 because the received response isn't checked against the initial request. This
20 function can be used to receive request not handled by the library. 20 function can be used to receive request not handled by the library.
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_receive_confirmation()_ function shall store the confirmation  
26 -request in 'rsp' and return the response length if sucessful. The returned  
27 -request length can be zero if the indication request is ignored (eg. a query for  
28 -another slave in RTU mode). Otherwise it shall return -1 and set errno. 25 +The function shall store the confirmation request in _rsp_ and return the
  26 +response length if sucessful. The returned request length can be zero if the
  27 +indication request is ignored (eg. a query for another slave in RTU
  28 +mode). Otherwise it shall return -1 and set errno.
29 29
30 30
31 SEE ALSO 31 SEE ALSO
doc/modbus_receive_from.txt
@@ -14,15 +14,15 @@ SYNOPSIS @@ -14,15 +14,15 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_receive_from()_ function shall receive an indication request from  
18 -the socket/file descriptor given in argument 'sockfd. This function is used by 17 +The *modbus_receive_from()* function shall receive an indication request from
  18 +the socket/file descriptor given in argument _sockfd_. This function is used by
19 Modbus slave/server to receive and analyze indication request sent by the 19 Modbus slave/server to receive and analyze indication request sent by the
20 masters/clients. 20 masters/clients.
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_receive_from()_ function shall store the indication request in 'req' 25 +The function shall store the indication request in _req_
26 and return the request length if sucessful. Otherwise it shall return -1 and set 26 and return the request length if sucessful. Otherwise it shall return -1 and set
27 errno. 27 errno.
28 28
doc/modbus_reply.txt
@@ -13,12 +13,12 @@ SYNOPSIS @@ -13,12 +13,12 @@ SYNOPSIS
13 13
14 DESCRIPTION 14 DESCRIPTION
15 ----------- 15 -----------
16 -The _modbus_reply()_ function shall send a response to received request. The  
17 -request 'req' given in argument is analyzed, a response is then built and sent  
18 -by using the information of the modbus context 'ctx'. 16 +The *modbus_reply()* function shall send a response to received request. The
  17 +request _req_ given in argument is analyzed, a response is then built and sent
  18 +by using the information of the modbus context _ctx_.
19 19
20 If the request indicates to read or write a value the operation will done in the 20 If the request indicates to read or write a value the operation will done in the
21 -modbus mapping 'mb_mapping' according to the type of the manipulated data. 21 +modbus mapping _mb_mapping_ according to the type of the manipulated data.
22 22
23 If an error occurs, an exception response will be sent. 23 If an error occurs, an exception response will be sent.
24 24
@@ -27,7 +27,7 @@ This function is designed for Modbus server. @@ -27,7 +27,7 @@ This function is designed for Modbus server.
27 27
28 RETURN VALUE 28 RETURN VALUE
29 ------------ 29 ------------
30 -The _modbus_reply()_ function shall return the length of the response sent if 30 +The function shall return the length of the response sent if
31 successful. Otherwise it shall return -1 and set errno. 31 successful. Otherwise it shall return -1 and set errno.
32 32
33 33
doc/modbus_reply_exception.txt
@@ -13,7 +13,7 @@ SYNOPSIS @@ -13,7 +13,7 @@ SYNOPSIS
13 13
14 DESCRIPTION 14 DESCRIPTION
15 ----------- 15 -----------
16 -The _modbus_reply_exception()_ function shall send an exception response based 16 +The *modbus_reply_exception()* function shall send an exception response based
17 on the 'exception_code' in argument. 17 on the 'exception_code' in argument.
18 18
19 The libmodbus provides the following exception codes: 19 The libmodbus provides the following exception codes:
@@ -30,12 +30,12 @@ The libmodbus provides the following exception codes: @@ -30,12 +30,12 @@ The libmodbus provides the following exception codes:
30 * MODBUS_EXCEPTION_GATEWAY_PATH (10) 30 * MODBUS_EXCEPTION_GATEWAY_PATH (10)
31 * MODBUS_EXCEPTION_GATEWAY_TARGET (11) 31 * MODBUS_EXCEPTION_GATEWAY_TARGET (11)
32 32
33 -The initial request 'req' is required to build a valid response. 33 +The initial request _req_ is required to build a valid response.
34 34
35 35
36 RETURN VALUE 36 RETURN VALUE
37 ------------ 37 ------------
38 -The _modbus_reply_exception()_ function shall return the length of the response sent if 38 +The function shall return the length of the response sent if
39 successful. Otherwise it shall return -1 and set errno. 39 successful. Otherwise it shall return -1 and set errno.
40 40
41 41
doc/modbus_report_slave_id.txt
@@ -14,10 +14,10 @@ SYNOPSIS @@ -14,10 +14,10 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_report_slave_id()_ function shall send a request to the controller 17 +The *modbus_report_slave_id()* function shall send a request to the controller
18 to obtain a description of the controller. 18 to obtain a description of the controller.
19 19
20 -The response stored in 'dest' contains: 20 +The response stored in _dest_ contains:
21 21
22 * the slave ID, this unique ID is in reality not unique at all so it's not 22 * the slave ID, this unique ID is in reality not unique at all so it's not
23 possible to depend on it to know how the information are packed in the 23 possible to depend on it to know how the information are packed in the
@@ -26,16 +26,15 @@ The response stored in 'dest' contains: @@ -26,16 +26,15 @@ The response stored in 'dest' contains:
26 * additional data specific to each controller. For example, libmodbus returns 26 * additional data specific to each controller. For example, libmodbus returns
27 the version of the library as a string. 27 the version of the library as a string.
28 28
29 -The function write at most 'max_dest' bytes from the response to 'dest'. 29 +The function write at most _max_dest_ bytes from the response to _dest_.
30 30
31 RETURN VALUE 31 RETURN VALUE
32 ------------ 32 ------------
33 -The _modbus_report_slave_id()_ function shall return the number of read data if  
34 -successful. 33 +The function shall return the number of read data if successful.
35 34
36 -If the output was truncated due to the 'max_dest' limit then the return value is  
37 -the number of bytes which would have been written to 'dest' if enough space had  
38 -been available. Thus, a return value greater than 'max_dest' means that the 35 +If the output was truncated due to the _max_dest_ limit then the return value is
  36 +the number of bytes which would have been written to _dest_ if enough space had
  37 +been available. Thus, a return value greater than _max_dest_ means that the
39 response data was truncated. 38 response data was truncated.
40 39
41 Otherwise it shall return -1 and set errno. 40 Otherwise it shall return -1 and set errno.
doc/modbus_rtu_get_rts.txt
@@ -14,9 +14,8 @@ SYNOPSIS @@ -14,9 +14,8 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -  
18 -The _modbus_rtu_get_rts()_ function shall get the current Request To Send mode  
19 -of the libmodbus context 'ctx'. The possible returned values are: 17 +The *modbus_rtu_get_rts()* function shall get the current Request To Send mode
  18 +of the libmodbus context _ctx_. The possible returned values are:
20 19
21 * MODBUS_RTU_RTS_NONE 20 * MODBUS_RTU_RTS_NONE
22 * MODBUS_RTU_RTS_UP 21 * MODBUS_RTU_RTS_UP
@@ -27,8 +26,8 @@ This function can only be used with a context using a RTU backend. @@ -27,8 +26,8 @@ This function can only be used with a context using a RTU backend.
27 26
28 RETURN VALUE 27 RETURN VALUE
29 ------------ 28 ------------
30 -The _modbus_rtu_get_rts()_ function shall return the current RTS mode if  
31 -successful. Otherwise it shall return -1 and set errno. 29 +The function shall return the current RTS mode if successful. Otherwise it shall
  30 +return -1 and set errno.
32 31
33 32
34 ERRORS 33 ERRORS
doc/modbus_rtu_get_serial_mode.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_rtu_get_serial_mode()_ function shall return the serial mode 17 +The *modbus_rtu_get_serial_mode()* function shall return the serial mode
18 currently used by the libmodbus context: 18 currently used by the libmodbus context:
19 19
20 *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232 20 *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232
@@ -36,9 +36,9 @@ used with a context using a RTU backend. @@ -36,9 +36,9 @@ used with a context using a RTU backend.
36 36
37 RETURN VALUE 37 RETURN VALUE
38 ------------ 38 ------------
39 -The _modbus_rtu_get_serial_mode()_ function shall return 'MODBUS_RTU_RS232' or  
40 -'MODBUS_RTU_RS485' if successful. Otherwise it shall return -1 and set errno to  
41 -one of the values defined below. 39 +The function shall return `MODBUS_RTU_RS232` or `MODBUS_RTU_RS485` if
  40 +successful. Otherwise it shall return -1 and set errno to one of the values
  41 +defined below.
42 42
43 43
44 ERRORS 44 ERRORS
doc/modbus_rtu_set_rts.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_rtu_set_rts()_ function shall set the Request To Send mode to 17 +The *modbus_rtu_set_rts()* function shall set the Request To Send mode to
18 communicate on a RS485 serial bus. By default, the mode is set to 18 communicate on a RS485 serial bus. By default, the mode is set to
19 -MODBUS_RTU_RTS_NONE and no signal is issued before writing data on the wire. 19 +`MODBUS_RTU_RTS_NONE` and no signal is issued before writing data on the wire.
20 20
21 -To enable the RTS mode, the values MODBUS_RTU_RTS_UP or MODBUS_RTU_RTS_DOWN must 21 +To enable the RTS mode, the values `MODBUS_RTU_RTS_UP` or `MODBUS_RTU_RTS_DOWN` must
22 be used, these modes enable the RTS mode and set the polarity at the same 22 be used, these modes enable the RTS mode and set the polarity at the same
23 -time. When MODBUS_RTU_RTS_UP is used, an ioctl call is made with RTS flag 23 +time. When `MODBUS_RTU_RTS_UP` is used, an ioctl call is made with RTS flag
24 enabled then data is written on the bus after a delay of 1ms, then another ioctl 24 enabled then data is written on the bus after a delay of 1ms, then another ioctl
25 call is made with the RTS flag disabled and again a delay of 1ms occurs. 25 call is made with the RTS flag disabled and again a delay of 1ms occurs.
26 -The MODBUS_RTU_RTS_DOWN mode applies the same procedure but with an inversed 26 +The `MODBUS_RTU_RTS_DOWN` mode applies the same procedure but with an inversed
27 RTS flag. 27 RTS flag.
28 28
29 This function can only be used with a context using a RTU backend. 29 This function can only be used with a context using a RTU backend.
@@ -31,8 +31,8 @@ This function can only be used with a context using a RTU backend. @@ -31,8 +31,8 @@ This function can only be used with a context using a RTU backend.
31 31
32 RETURN VALUE 32 RETURN VALUE
33 ------------ 33 ------------
34 -The _modbus_rtu_set_rts()_ function shall return 0 if successful. Otherwise it  
35 -shall return -1 and set errno to one of the values defined below. 34 +The function shall return 0 if successful. Otherwise it shall return -1 and set
  35 +errno to one of the values defined below.
36 36
37 37
38 ERRORS 38 ERRORS
doc/modbus_rtu_set_serial_mode.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_rtu_set_serial_mode()_ function shall set the selected serial 17 +The *modbus_rtu_set_serial_mode()* function shall set the selected serial
18 mode: 18 mode:
19 19
20 *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232 20 *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232
@@ -35,8 +35,8 @@ This function is only supported on Linux kernels 2.6.28 onwards. @@ -35,8 +35,8 @@ This function is only supported on Linux kernels 2.6.28 onwards.
35 35
36 RETURN VALUE 36 RETURN VALUE
37 ------------ 37 ------------
38 -The _modbus_set_serial_mode()_ function shall return 0 if successful. Otherwise  
39 -it shall return -1 and set errno to one of the values defined below. 38 +The function shall return 0 if successful. Otherwise it shall return -1 and set
  39 +errno to one of the values defined below.
40 40
41 41
42 ERRORS 42 ERRORS
doc/modbus_send_raw_request.txt
@@ -9,28 +9,28 @@ modbus_send_raw_request - send a raw request @@ -9,28 +9,28 @@ modbus_send_raw_request - send a raw request
9 9
10 SYNOPSIS 10 SYNOPSIS
11 -------- 11 --------
12 -*int modbus_send_raw_request(modbus_t *'ctx', uint8_t *'raw_req, int 'raw_req_length');* 12 +*int modbus_send_raw_request(modbus_t *'ctx', uint8_t *'raw_req', int 'raw_req_length');*
13 13
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_send_raw_request()_ function shall send a request via the socket of  
18 -the context 'ctx'. This function must be used for debugging purposes because you 17 +The *modbus_send_raw_request()* function shall send a request via the socket of
  18 +the context _ctx_. This function must be used for debugging purposes because you
19 have to take care to make a valid request by hand. The function only adds to the 19 have to take care to make a valid request by hand. The function only adds to the
20 -message, the header or CRC of the selected backend, so 'raw_req' must start and 20 +message, the header or CRC of the selected backend, so _raw_req_ must start and
21 contain at least a slave/unit identifier and a function code. This function can 21 contain at least a slave/unit identifier and a function code. This function can
22 be used to send request not handled by the library. 22 be used to send request not handled by the library.
23 23
24 The public header of libmodbus provides a list of supported Modbus functions 24 The public header of libmodbus provides a list of supported Modbus functions
25 -codes, prefixed by `MODBUS_FC_` (eg. MODBUS_FC_READ_HOLDING_REGISTERS), to help 25 +codes, prefixed by `MODBUS_FC_` (eg. `MODBUS_FC_READ_HOLDING_REGISTERS`), to help
26 build of raw requests. 26 build of raw requests.
27 27
28 28
29 RETURN VALUE 29 RETURN VALUE
30 ------------ 30 ------------
31 -The _modbus_send_raw_request()_ function shall return the full message length,  
32 -counting the extra data relating to the backend, if successful. Otherwise it  
33 -shall return -1 and set errno. 31 +The function shall return the full message length, counting the extra data
  32 +relating to the backend, if successful. Otherwise it shall return -1 and set
  33 +errno.
34 34
35 35
36 EXAMPLE 36 EXAMPLE
doc/modbus_set_bits_from_byte.txt
@@ -14,9 +14,9 @@ SYNOPSIS @@ -14,9 +14,9 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_bits_from_byte_ function shall set many bits from a single byte.  
18 -All 8 bits from the byte 'value' will be written to 'dest' array starting at  
19 -'index' position. 17 +The *modbus_set_bits_from_byte()* function shall set many bits from a single byte.
  18 +All 8 bits from the byte _value_ will be written to _dest_ array starting at
  19 +_index_ position.
20 20
21 21
22 RETURN VALUE 22 RETURN VALUE
doc/modbus_set_bits_from_bytes.txt
@@ -14,9 +14,9 @@ SYNOPSIS @@ -14,9 +14,9 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_bits_from_bytes_ function shall set bits by reading an array of 17 +The *modbus_set_bits_from_bytes* function shall set bits by reading an array of
18 bytes. All the bits of the bytes read from the first position of the array 18 bytes. All the bits of the bytes read from the first position of the array
19 -'tab_byte' are written as bits in the 'dest' array starting at position 'index'. 19 +_tab_byte_ are written as bits in the _dest_ array starting at position _index_.
20 20
21 21
22 RETURN VALUE 22 RETURN VALUE
doc/modbus_set_byte_timeout.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_byte_timeout()_ function shall set the timeout interval between 17 +The *modbus_set_byte_timeout()* function shall set the timeout interval between
18 two consecutive bytes of the same message. The timeout is an upper bound on the 18 two consecutive bytes of the same message. The timeout is an upper bound on the
19 -amount of time elapsed before _select()_ returns, if the time elapsed is longer  
20 -than the defined timeout, an 'ETIMEDOUT' error will be raised by the 19 +amount of time elapsed before *select()* returns, if the time elapsed is longer
  20 +than the defined timeout, an `ETIMEDOUT` error will be raised by the
21 function waiting for a response. 21 function waiting for a response.
22 22
23 The value of _to_usec_ argument must be in the range 0 to 999999. 23 The value of _to_usec_ argument must be in the range 0 to 999999.
24 24
25 If both _to_sec_ and _to_usec_ are zero, this timeout will not be used at all. 25 If both _to_sec_ and _to_usec_ are zero, this timeout will not be used at all.
26 -In this case, _modbus_set_response_timeout()_ governs the entire handling of the 26 +In this case, *modbus_set_response_timeout()* governs the entire handling of the
27 response, the full confirmation response must be received before expiration of 27 response, the full confirmation response must be received before expiration of
28 the response timeout. When a byte timeout is set, the response timeout is only 28 the response timeout. When a byte timeout is set, the response timeout is only
29 used to wait for until the first byte of the response. 29 used to wait for until the first byte of the response.
doc/modbus_set_debug.txt
@@ -13,9 +13,9 @@ SYNOPSIS @@ -13,9 +13,9 @@ SYNOPSIS
13 13
14 DESCRIPTION 14 DESCRIPTION
15 ----------- 15 -----------
16 -The _modbus_set_debug()_ function shall set the debug flag of the *modbus_t*  
17 -context by using the argument 'flag'. By default, the boolean flag is set to  
18 -'FALSE'. When the 'flag' value is set to 'TRUE', many verbose messages are 16 +The *modbus_set_debug()* function shall set the debug flag of the *modbus_t*
  17 +context by using the argument _flag_. By default, the boolean flag is set to
  18 +`FALSE`. When the _flag_ value is set to `TRUE`, many verbose messages are
19 displayed on stdout and stderr. For example, this flag is useful to display the 19 displayed on stdout and stderr. For example, this flag is useful to display the
20 bytes of the Modbus messages. 20 bytes of the Modbus messages.
21 21
doc/modbus_set_error_recovery.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_error_recovery()_ function shall set the error recovery mode to 17 +The *modbus_set_error_recovery()* function shall set the error recovery mode to
18 apply when the connection fails or the byte received is not expected. The 18 apply when the connection fails or the byte received is not expected. The
19 -argument 'error_recovery' may be bitwise-or'ed with zero or more of the 19 +argument _error_recovery_ may be bitwise-or'ed with zero or more of the
20 following constants. 20 following constants.
21 21
22 -By default there is no error recovery ('MODBUS_ERROR_RECOVERY_NONE') so the 22 +By default there is no error recovery (`MODBUS_ERROR_RECOVERY_NONE`) so the
23 application is responsible for controlling the error values returned by 23 application is responsible for controlling the error values returned by
24 libmodbus functions and for handling them if necessary. 24 libmodbus functions and for handling them if necessary.
25 25
26 -When 'MODBUS_ERROR_RECOVERY_LINK' is set, the library will attempt an 26 +When `MODBUS_ERROR_RECOVERY_LINK` is set, the library will attempt an
27 reconnection after a delay defined by response timeout of the libmodbus context. 27 reconnection after a delay defined by response timeout of the libmodbus context.
28 This mode will try a infinite close/connect loop until success on send call and 28 This mode will try a infinite close/connect loop until success on send call and
29 will just try one time to retablish the connection on select/read calls (if the 29 will just try one time to retablish the connection on select/read calls (if the
@@ -33,7 +33,7 @@ after a delay based on the current response timeout in some situations (eg. @@ -33,7 +33,7 @@ after a delay based on the current response timeout in some situations (eg.
33 timeout of select call). The reconnection attempt can hang for several seconds 33 timeout of select call). The reconnection attempt can hang for several seconds
34 if the network to the remote target unit is down. 34 if the network to the remote target unit is down.
35 35
36 -When 'MODBUS_ERROR_RECOVERY_PROTOCOL' is set, a sleep and flush sequence will be 36 +When `MODBUS_ERROR_RECOVERY_PROTOCOL` is set, a sleep and flush sequence will be
37 used to cleanup the ongoing communication, this can occurs when the message 37 used to cleanup the ongoing communication, this can occurs when the message
38 length is invalid, the TID is wrong or the received function code is not the 38 length is invalid, the TID is wrong or the received function code is not the
39 expected one. The response timeout delay will be used to sleep. 39 expected one. The response timeout delay will be used to sleep.
@@ -45,15 +45,14 @@ It's not recommended to enable error recovery for slave/server. @@ -45,15 +45,14 @@ It's not recommended to enable error recovery for slave/server.
45 45
46 RETURN VALUE 46 RETURN VALUE
47 ------------ 47 ------------
48 -The _modbus_set_error_recovery()_ function shall return 0 if  
49 -successful. Otherwise it shall return -1 and set errno to one of the values  
50 -defined below. 48 +The function shall return 0 if successful. Otherwise it shall return -1 and set
  49 +errno to one of the values defined below.
51 50
52 51
53 ERRORS 52 ERRORS
54 ------ 53 ------
55 *EINVAL*:: 54 *EINVAL*::
56 -The value of the argument 'error_recovery' is not positive. 55 +The value of the argument _error_recovery_ is not positive.
57 56
58 57
59 EXAMPLE 58 EXAMPLE
doc/modbus_set_float.txt
@@ -14,14 +14,14 @@ SYNOPSIS @@ -14,14 +14,14 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_float()_ function shall set a float to 4 bytes in Modbus format  
18 -(ABCD). The 'dest' array must be pointer on two 16 bits values to be able to 17 +The *modbus_set_float()* function shall set a float to 4 bytes in Modbus format
  18 +(ABCD). The _dest_ array must be pointer on two 16 bits values to be able to
19 store the full result of the conversion. 19 store the full result of the conversion.
20 20
21 21
22 RETURN VALUE 22 RETURN VALUE
23 ------------ 23 ------------
24 -The is no return values. 24 +There is no return values.
25 25
26 26
27 SEE ALSO 27 SEE ALSO
doc/modbus_set_float_dcba.txt
@@ -14,14 +14,14 @@ SYNOPSIS @@ -14,14 +14,14 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_float_dcba()_ function shall set a float to 4 bytes in inversed  
18 -Modbus format (DCBA order). The 'dest' array must be pointer on two 16 bits 17 +The *modbus_set_float_dcba()* function shall set a float to 4 bytes in inversed
  18 +Modbus format (DCBA order). The _dest_ array must be pointer on two 16 bits
19 values to be able to store the full result of the conversion. 19 values to be able to store the full result of the conversion.
20 20
21 21
22 RETURN VALUE 22 RETURN VALUE
23 ------------ 23 ------------
24 -The is no return values. 24 +There is no return values.
25 25
26 26
27 SEE ALSO 27 SEE ALSO
doc/modbus_set_response_timeout.txt
@@ -14,15 +14,14 @@ SYNOPSIS @@ -14,15 +14,14 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -  
18 -The _modbus_set_response_timeout()_ function shall set the timeout interval used 17 +The *modbus_set_response_timeout()* function shall set the timeout interval used
19 to wait for a response. When a byte timeout is set, if elapsed time for the 18 to wait for a response. When a byte timeout is set, if elapsed time for the
20 -first byte of response is longer than the given timeout, an 'ETIMEDOUT' error 19 +first byte of response is longer than the given timeout, an `ETIMEDOUT` error
21 will be raised by the function waiting for a response. When byte timeout is 20 will be raised by the function waiting for a response. When byte timeout is
22 disabled, the full confirmation response must be received before expiration of 21 disabled, the full confirmation response must be received before expiration of
23 the response timeout. 22 the response timeout.
24 23
25 -The value of to_usec argument must be in the range 0 to 999999. 24 +The value of _to_usec_ argument must be in the range 0 to 999999.
26 25
27 26
28 RETURN VALUE 27 RETURN VALUE
doc/modbus_set_slave.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_slave()_ function shall set the slave number in the libmodbus 17 +The *modbus_set_slave()* function shall set the slave number in the libmodbus
18 context. 18 context.
19 19
20 The behavior depends of network and the role of the device: 20 The behavior depends of network and the role of the device:
@@ -26,17 +26,17 @@ only accept message holing its slave number or the special broadcast number. @@ -26,17 +26,17 @@ only accept message holing its slave number or the special broadcast number.
26 26
27 *TCP*:: 27 *TCP*::
28 The slave number is only required in TCP if the message must reach a device 28 The slave number is only required in TCP if the message must reach a device
29 -on a serial network. The special value 'MODBUS_TCP_SLAVE' (0xFF) can be used in TCP mode to restore 29 +on a serial network. The special value `MODBUS_TCP_SLAVE` (0xFF) can be used in TCP mode to restore
30 the default value. 30 the default value.
31 31
32 -The broadcast address is 'MODBUS_BROADCAST_ADDRESS'. This special value must be 32 +The broadcast address is `MODBUS_BROADCAST_ADDRESS`. This special value must be
33 use when you want all Modbus devices of the network receive the request. 33 use when you want all Modbus devices of the network receive the request.
34 34
35 35
36 RETURN VALUE 36 RETURN VALUE
37 ------------ 37 ------------
38 -The _modbus_set_slave()_ function shall return 0 if successful. Otherwise it  
39 -shall return -1 and set errno to one of the values defined below. 38 +The function shall return 0 if successful. Otherwise it shall return -1 and set
  39 +errno to one of the values defined below.
40 40
41 41
42 ERRORS 42 ERRORS
doc/modbus_set_socket.txt
@@ -14,7 +14,7 @@ SYNOPSIS @@ -14,7 +14,7 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_set_socket()_ function shall set the socket or file descriptor in 17 +The *modbus_set_socket()* function shall set the socket or file descriptor in
18 the libmodbus context. This function is useful for managing multiple client 18 the libmodbus context. This function is useful for managing multiple client
19 connections to the same server. 19 connections to the same server.
20 20
doc/modbus_strerror.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_strerror()_ function shall return a pointer to an error message  
18 -string corresponding to the error number specified by the 'errnum' argument. As 17 +The *modbus_strerror()* function shall return a pointer to an error message
  18 +string corresponding to the error number specified by the _errnum_ argument. As
19 libmodbus defines additional error numbers over and above those defined by the 19 libmodbus defines additional error numbers over and above those defined by the
20 -operating system, applications should use _modbus_strerror()_ in preference to  
21 -the standard _strerror()_ function. 20 +operating system, applications should use *modbus_strerror()* in preference to
  21 +the standard *strerror()* function.
22 22
23 23
24 RETURN VALUE 24 RETURN VALUE
25 ------------ 25 ------------
26 -The _modbus_strerror()_ function shall return a pointer to an error message 26 +The *modbus_strerror()* function shall return a pointer to an error message
27 string. 27 string.
28 28
29 29
doc/modbus_tcp_accept.txt
@@ -14,15 +14,15 @@ SYNOPSIS @@ -14,15 +14,15 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_tcp_accept()_ function shall extract the first connection on the 17 +The *modbus_tcp_accept()* function shall extract the first connection on the
18 queue of pending connections, create a new socket and store it in libmodbus 18 queue of pending connections, create a new socket and store it in libmodbus
19 -context given in argument. If available, _accept4()_ with *SOCK_CLOEXEC* will be  
20 -called instead of _accept()_. 19 +context given in argument. If available, _accept4()_ with `SOCK_CLOEXEC` will be
  20 +called instead of *accept()*.
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_tcp_accept()_ function shall return a new socket if successful. 25 +The function shall return a new socket if successful.
26 Otherwise it shall return -1 and set errno. 26 Otherwise it shall return -1 and set errno.
27 27
28 28
doc/modbus_tcp_listen.txt
@@ -17,14 +17,14 @@ DESCRIPTION @@ -17,14 +17,14 @@ 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 o NULL, any addresses will be 20 +set the IP address to listen, if IP address is set to NULL, any addresses will be
21 listen. 21 listen.
22 22
23 23
24 RETURN VALUE 24 RETURN VALUE
25 ------------ 25 ------------
26 -The *modbus_tcp_listen()* function shall return a new socket if  
27 -successful. Otherwise it shall return -1 and set errno. 26 +The function shall return a new socket if successful. Otherwise it shall return
  27 +-1 and set errno.
28 28
29 29
30 EXAMPLE 30 EXAMPLE
doc/modbus_tcp_pi_accept.txt
@@ -14,16 +14,15 @@ SYNOPSIS @@ -14,16 +14,15 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -  
18 -The _modbus_tcp_pi_accept()_ function shall extract the first connection on the 17 +The *modbus_tcp_pi_accept()* function shall extract the first connection on the
19 queue of pending connections, create a new socket and store it in libmodbus 18 queue of pending connections, create a new socket and store it in libmodbus
20 -context given in argument. If available, _accept4()_ with *SOCK_CLOEXEC* will be  
21 -called instead of _accept()_. 19 +context given in argument. If available, _accept4()_ with `SOCK_CLOEXEC` will be
  20 +called instead of *accept()*.
22 21
23 22
24 RETURN VALUE 23 RETURN VALUE
25 ------------ 24 ------------
26 -The _modbus_tcp_pi_accept()_ function shall return a new socket if successful. 25 +The function shall return a new socket if successful.
27 Otherwise it shall return -1 and set errno. 26 Otherwise it shall return -1 and set errno.
28 27
29 28
doc/modbus_tcp_pi_listen.txt
@@ -23,8 +23,8 @@ listen. @@ -23,8 +23,8 @@ listen.
23 23
24 RETURN VALUE 24 RETURN VALUE
25 ------------ 25 ------------
26 -The *modbus_tcp_listen()* function shall return a new socket if  
27 -successful. Otherwise it shall return -1 and set errno. 26 +The function shall return a new socket if successful. Otherwise it shall return
  27 +-1 and set errno.
28 28
29 29
30 EXAMPLE 30 EXAMPLE
doc/modbus_write_and_read_registers.txt
@@ -14,22 +14,22 @@ SYNOPSIS @@ -14,22 +14,22 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_write_and_read_registers()_ function shall write the content of the  
18 -'write_nb' holding registers from the array 'src' to the address 'write_addr' of  
19 -the remote device then shall read the content of the 'read_nb' holding registers  
20 -to the address 'read_addr' of the remote device. The result of reading is stored  
21 -in 'dest' array as word values (16 bits). 17 +The *modbus_write_and_read_registers()* function shall write the content of the
  18 +_write_nb_ holding registers from the array 'src' to the address _write_addr_ of
  19 +the remote device then shall read the content of the _read_nb_ holding registers
  20 +to the address _read_addr_ of the remote device. The result of reading is stored
  21 +in _dest_ array as word values (16 bits).
22 22
23 -You must take care to allocate enough memory to store the results in 'dest'  
24 -(at least 'nb' * sizeof(uint16_t)). 23 +You must take care to allocate enough memory to store the results in _dest_
  24 +(at least _nb_ * sizeof(uint16_t)).
25 25
26 The function uses the Modbus function code 0x17 (write/read registers). 26 The function uses the Modbus function code 0x17 (write/read registers).
27 27
28 28
29 RETURN VALUE 29 RETURN VALUE
30 ------------ 30 ------------
31 -The _modbus_write_and_read_registers()_ function shall return the number of read  
32 -registers if successful. Otherwise it shall return -1 and set errno. 31 +The function shall return the number of read registers if successful. Otherwise
  32 +it shall return -1 and set errno.
33 33
34 34
35 ERRORS 35 ERRORS
doc/modbus_write_bit.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_write_bit()_ function shall write the status of 'status' at the  
18 -address 'addr' of the remote device. The value must be set to _TRUE_ or _FALSE_. 17 +The *modbus_write_bit()* function shall write the status of _status_ at the
  18 +address _addr_ of the remote device. The value must be set to `TRUE` or `FALSE`.
19 19
20 The function uses the Modbus function code 0x05 (force single coil). 20 The function uses the Modbus function code 0x05 (force single coil).
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_write_bit()_ function shall return 1 if successful. Otherwise it  
26 -shall return -1 and set errno. 25 +The function shall return 1 if successful. Otherwise it shall return -1 and set
  26 +errno.
27 27
28 28
29 SEE ALSO 29 SEE ALSO
doc/modbus_write_bits.txt
@@ -14,17 +14,17 @@ SYNOPSIS @@ -14,17 +14,17 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_write_bits()_ function shall write the status of the 'nb' bits  
18 -(coils) from 'src' at the address 'addr' of the remote device. The  
19 -'src' array must contains bytes set to _TRUE_ or _FALSE_. 17 +The *modbus_write_bits()* function shall write the status of the _nb_ bits
  18 +(coils) from _src_ at the address _addr_ of the remote device. The
  19 +_src_ array must contains bytes set to `TRUE` or `FALSE`.
20 20
21 The function uses the Modbus function code 0x0F (force multiple coils). 21 The function uses the Modbus function code 0x0F (force multiple coils).
22 22
23 23
24 RETURN VALUE 24 RETURN VALUE
25 ------------ 25 ------------
26 -The _modbus_write_bits()_ function shall return the number of written bits if  
27 -successful. Otherwise it shall return -1 and set errno. 26 +The function shall return the number of written bits if successful. Otherwise it
  27 +shall return -1 and set errno.
28 28
29 29
30 ERRORS 30 ERRORS
doc/modbus_write_register.txt
@@ -14,16 +14,16 @@ SYNOPSIS @@ -14,16 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_write_register()_ function shall write the value of 'value'  
18 -holding registers at the address 'addr' of the remote device. 17 +The *modbus_write_register()* function shall write the value of _value_
  18 +holding registers at the address _addr_ of the remote device.
19 19
20 The function uses the Modbus function code 0x06 (preset single register). 20 The function uses the Modbus function code 0x06 (preset single register).
21 21
22 22
23 RETURN VALUE 23 RETURN VALUE
24 ------------ 24 ------------
25 -The _modbus_write_register()_ function shall return 1 if successful. Otherwise  
26 -it shall return -1 and set errno. 25 +The function shall return 1 if successful. Otherwise it shall return -1 and set
  26 +errno.
27 27
28 28
29 SEE ALSO 29 SEE ALSO
doc/modbus_write_registers.txt
@@ -14,17 +14,16 @@ SYNOPSIS @@ -14,17 +14,16 @@ SYNOPSIS
14 14
15 DESCRIPTION 15 DESCRIPTION
16 ----------- 16 -----------
17 -The _modbus_write_registers()_ function shall write the content of the 'nb'  
18 -holding registers from the array 'src' at address 'addr' of the  
19 -remote device. 17 +The *modbus_write_registers()* function shall write the content of the _nb_
  18 +holding registers from the array _src_ at address _addr_ of the remote device.
20 19
21 The function uses the Modbus function code 0x10 (preset multiple registers). 20 The function uses the Modbus function code 0x10 (preset multiple registers).
22 21
23 22
24 RETURN VALUE 23 RETURN VALUE
25 ------------ 24 ------------
26 -The _modbus_write_registers()_ function shall return the number of written  
27 -registers if successful. Otherwise it shall return -1 and set errno. 25 +The function shall return the number of written registers if
  26 +successful. Otherwise it shall return -1 and set errno.
28 27
29 28
30 SEE ALSO 29 SEE ALSO