Ignore:
Timestamp:
2011-04-29T16:51:02+02:00 (6 years ago)
Author:
jow
Message:

[PATCH] utils/collectd: fix modbus plugin
This patch makes some small corrections to my previous patch enabling the modbus plugin of collectd.
Signed-off-by: Daniel Golle <daniel.golle@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/utils/collectd/patches/300-fix-modbus.patch

    r26346 r26782  
    1 --- a/src/modbus.c      2011-03-28 14:51:41.000000000 +0200 
    2 +++ b/src/modbus.c      2011-03-28 14:52:12.000000000 +0200 
    3 @@ -293,10 +293,8 @@ 
     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 
    415       host->node, host->port); 
    516  
     
    1324   status = modbus_connect (&host->connection); 
    1425   if (status != 0) 
    15 @@ -366,7 +367,7 @@ 
    16    { 
    17      status = read_holding_registers (&host->connection, 
    18          /* slave = */ slave->id, /* start_addr = */ data->register_base, 
    19       /* num_registers = */ values_num, /* buffer = */ values); 
    20       /* num_registers = */ values_num, /* buffer = */ (uint16_t*)values); 
    21      if (status > 0) 
    22        break; 
    23   
     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 { 
     30int values[2]; 
     31uint16_t values[2]; 
     32   int values_num; 
     33   const data_set_t *ds; 
     34   int status; 
Note: See TracChangeset for help on using the changeset viewer.