File: modbus_set_debug.md

package info (click to toggle)
libmodbus 3.1.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,112 kB
  • sloc: ansic: 5,495; javascript: 137; makefile: 90; sh: 26
file content (29 lines) | stat: -rw-r--r-- 762 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# modbus_set_debug

## Name

modbus_set_debug - set debug flag of the context

## Synopsis

```c
int modbus_set_debug(modbus_t *ctx, int flag);
```

## Description

The *modbus_set_debug()* function shall set the debug flag of the *modbus_t*
context by using the argument `flag`. By default, the boolean flag is set to
`FALSE`. When the `flag` value is set to `TRUE`, many verbose messages are
displayed on stdout and stderr. For example, this flag is useful to display the
bytes of the Modbus messages.

```text
[00][14][00][00][00][06][12][03][00][6B][00][03]
Waiting for a confirmation...
<00><14><00><00><00><09><12><03><06><02><2B><00><00><00><00>
```

## Return value

The function shall return 0 if successful. Otherwise it shall return -1 and set errno.