1 modbus_receive_confirmation(3)
2 ==============================
7 modbus_receive_confirmation - receive a confirmation request
12 *int modbus_receive_confirmation(modbus_t *'ctx', uint8_t *'rsp');*
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
20 function can be used to receive request not handled by the library.
22 The maximum size of the response depends on the used backend, in RTU the _rsp_
23 array must be _MODBUS_RTU_MAX_ADU_LENGTH_ bytes and in TCP it must be
24 _MODBUS_TCP_MAX_ADU_LENGTH_ bytes. If you want to write code compatible with
25 both, you can use the constant _MODBUS_MAX_ADU_LENGTH_ (maximum value of all
26 libmodbus backends). Take care to allocate enough memory to store responses to
27 avoid crashes of your server.
32 The function shall store the confirmation request in _rsp_ and return the
33 response length if sucessful. The returned request length can be zero if the
34 indication request is ignored (eg. a query for another slave in RTU
35 mode). Otherwise it shall return -1 and set errno.
41 uint8_t rsp[MODBUS_MAX_ADU_LENGTH];
42 rc = modbus_receive_confirmation(ctx, rsp);
47 linkmb:modbus_send_raw_request[3]
52 The libmodbus documentation was written by Stéphane Raimbault
53 <stephane.raimbault@gmail.com>