From bcb66b1b9d109986ed6c5d0f46d363d7a14d72bb Mon Sep 17 00:00:00 2001 From: Terekhin Alexandr Date: Fri, 13 Oct 2023 17:17:41 +0300 Subject: [PATCH] Last data as data los timestamp in "offline mode" --- yabl/protocol.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yabl/protocol.go b/yabl/protocol.go index d8ba314..58971c2 100644 --- a/yabl/protocol.go +++ b/yabl/protocol.go @@ -156,6 +156,14 @@ func (c *converter) CheckTimeouts(isOffline bool) ([]*Event, bool) { Value: nil, } + if isOffline { + // last received data + event.Updated = fld.last + } else { + // actual detection moment + event.Updated = &now + } + var mask uint64 = ^(ALL_BITS << fld.length) mask = mask << from fld.value = mask