1MODBUS_REPLY(3) libmodbus Manual MODBUS_REPLY(3)
2
3
4
6 modbus_reply - send a response to the received request
7
9 *int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length,
10 modbus_mapping_t *mb_mapping);
11
13 The modbus_reply() function shall send a response to received request.
14 The request req given in argument is analyzed, a response is then built
15 and sent by using the information of the modbus context ctx.
16
17 If the request indicates to read or write a value the operation will
18 done in the modbus mapping mb_mapping according to the type of the
19 manipulated data.
20
21 If an error occurs, an exception response will be sent.
22
23 This function is designed for Modbus server.
24
26 The function shall return the length of the response sent if
27 successful. Otherwise it shall return -1 and set errno.
28
30 EMBMDATA
31 Sending has failed
32
33 See also the errors returned by the syscall used to send the response
34 (eg. send or write).
35
37 modbus_reply_exception(3) libmodbus(7)
38
40 The libmodbus documentation was written by Stéphane Raimbault
41 <stephane.raimbault@gmail.com>
42
43
44
45libmodbus v3.1.7 07/20/2023 MODBUS_REPLY(3)