From 2413e5f1faeee70920593a3a07f6b7ef997a5e65 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 24 Mar 2010 15:43:42 +0100 Subject: [PATCH] modbus plugin: Set the interval when dispatching values. --- src/modbus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modbus.c b/src/modbus.c index 656d9c83..78c43350 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -212,12 +212,16 @@ static int mb_submit (mb_host_t *host, mb_slave_t *slave, /* {{{ */ if ((host == NULL) || (slave == NULL) || (data == NULL)) return (EINVAL); + if (host->interval <= 0) + host->interval = interval_g; + if (slave->instance[0] == 0) ssnprintf (slave->instance, sizeof (slave->instance), "slave_%i", slave->id); vl.values = &value; vl.values_len = 1; + vl.interval = host->interval; sstrncpy (vl.host, host->host, sizeof (vl.host)); sstrncpy (vl.plugin, "modbus", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, slave->instance, sizeof (vl.plugin_instance)); -- 2.11.0