From e41aa35ccc87c57566b6b4de843b95a0bea3857d Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Wed, 6 Apr 2011 15:36:11 +0200 Subject: [PATCH] [fluksod] determine threshold based on current unix time --- mote/v2/openwrt/package/flukso/luasrc/fluksod.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mote/v2/openwrt/package/flukso/luasrc/fluksod.lua b/mote/v2/openwrt/package/flukso/luasrc/fluksod.lua index 25f043a..aa4c3c9 100755 --- a/mote/v2/openwrt/package/flukso/luasrc/fluksod.lua +++ b/mote/v2/openwrt/package/flukso/luasrc/fluksod.lua @@ -141,7 +141,7 @@ end function wan_buffer(child) return coroutine.create(function(sensor_id, timestamp, counter) local measurements = data.new() - local threshold = timestamp + WAN_INTERVAL + local threshold = os.time() + WAN_INTERVAL local previous = {} while true do @@ -166,7 +166,7 @@ function wan_buffer(child) if timestamp > threshold and next(measurements) then --checking whether table is not empty coroutine.resume(child, measurements) - threshold = timestamp + WAN_INTERVAL + threshold = os.time() + WAN_INTERVAL end sensor_id, timestamp, counter = coroutine.yield()