[PATCH] utils/collectd: fix modbus plugin
[openwrt/svn-archive/archive.git] / utils / collectd / patches / 300-fix-modbus.patch
1 --- a/src/modbus.c
2 +++ b/src/modbus.c
3 @@ -281,10 +281,8 @@ static int mb_init_connection (mb_host_t
4
5 modbus_set_debug (&host->connection, 1);
6
7 -#if 0
8 /* We'll do the error handling ourselves. */
9 modbus_set_error_handling (&host->connection, NOP_ON_ERROR);
10 -#endif
11
12 if ((host->port < 1) || (host->port > 65535))
13 host->port = MODBUS_TCP_DEFAULT_PORT;
14 @@ -293,10 +291,8 @@ static int mb_init_connection (mb_host_t
15 host->node, host->port);
16
17 modbus_init_tcp (&host->connection,
18 - /* host = */ host->node);
19 -#if 0
20 + /* host = */ host->node,
21 /* port = */ host->port);
22 -#endif
23
24 status = modbus_connect (&host->connection);
25 if (status != 0)
26 @@ -325,7 +321,7 @@ static int mb_init_connection (mb_host_t
27 static int mb_read_data (mb_host_t *host, mb_slave_t *slave, /* {{{ */
28 mb_data_t *data)
29 {
30 - int values[2];
31 + uint16_t values[2];
32 int values_num;
33 const data_set_t *ds;
34 int status;