1MODBUS_STRERROR(3) libmodbus Manual MODBUS_STRERROR(3)
2
3
4
6 modbus_strerror - return the error message
7
9 const char *modbus_strerror(int errnum);
10
12 The modbus_strerror() function shall return a pointer to an error
13 message string corresponding to the error number specified by the
14 errnum argument. As libmodbus defines additional error numbers over and
15 above those defined by the operating system, applications should use
16 modbus_strerror() in preference to the standard strerror() function.
17
19 The modbus_strerror() function shall return a pointer to an error
20 message string.
21
23 No errors are defined.
24
26 Display an error message when a Modbus connection cannot be
27 established.
28
29 if (modbus_connect(ctx) == -1) {
30 fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno));
31 abort();
32 }
33
34
36 linkmb:libmodbus
37
39 The libmodbus documentation was written by Stéphane Raimbault
40 <stephane.raimbault@gmail.com>
41
42
43
44libmodbus v3.1.6 02/04/2022 MODBUS_STRERROR(3)