'\" t .\" Title: modbus_strerror .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 11/30/2016 .\" Manual: Libmodbus Manual .\" Source: libmodbus 3.0.6 .\" Language: English .\" .TH "MODBUS_STRERROR" "3" "11/30/2016" "libmodbus 3\&.0\&.6" "Libmodbus Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" modbus_strerror \- return the error message .SH "SYNOPSIS" .sp \fBconst char *modbus_strerror(*int \fR\fB\fIerrnum\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fImodbus_strerror()\fR function shall return a pointer to an error message string corresponding to the error number specified by the \fIerrnum\fR argument\&. As libmodbus defines additional error numbers over and above those defined by the operating system, applications should use \fImodbus_strerror()\fR in preference to the standard \fIstrerror()\fR function\&. .SH "RETURN VALUE" .sp The \fImodbus_strerror()\fR function shall return a pointer to an error message string\&. .SH "ERRORS" .sp No errors are defined\&. .SH "EXAMPLE" .PP \fBDisplaying an error message when a Modbus connection cannot be established\fR. .sp .if n \{\ .RS 4 .\} .nf if (modbus_connect(ctx) == \-1) { fprintf(stderr, "Connection failed: %s\en", modbus_strerror(errno)); abort(); } .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp linkmb:libmodbus .SH "AUTHORS" .sp The libmodbus documentation was written by St\('ephane Raimbault <\m[blue]\fBstephane\&.raimbault@gmail\&.com\fR\m[]\&\s-2\u[1]\d\s+2> .SH "NOTES" .IP " 1." 4 stephane.raimbault@gmail.com .RS 4 \%mailto:stephane.raimbault@gmail.com .RE