summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2021-03-24 09:30:18 -0500
committerJason Reiss <jreiss@multitech.com>2021-03-24 09:30:18 -0500
commit7beff67c70488ec5c6cd60633aeb459c70221dd1 (patch)
treed8da3859686f2bef37374f354554ced48298229c
parent9e756ddc166ed7f5c1dc1cf62d467d44561479ca (diff)
downloadpacket_forwarder_mtac_full-7beff67c70488ec5c6cd60633aeb459c70221dd1.tar.gz
packet_forwarder_mtac_full-7beff67c70488ec5c6cd60633aeb459c70221dd1.tar.bz2
packet_forwarder_mtac_full-7beff67c70488ec5c6cd60633aeb459c70221dd1.zip
Update lora_pkt_fwd.c - add periodic restart of PKF4.0.4-1
-rw-r--r--lora_pkt_fwd/src/lora_pkt_fwd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c
index e3c08cf..08aaf43 100644
--- a/lora_pkt_fwd/src/lora_pkt_fwd.c
+++ b/lora_pkt_fwd/src/lora_pkt_fwd.c
@@ -1997,8 +1997,17 @@ int main(int argc, char** argv)
MSG("WARNING: lgw page was unexpectedly changed, process is exiting.\n");
break;
}
-
- /* read the currrent temperature */
+
+ static uint32_t last_tstamp = 0;
+ static uint32_t rollover_cnt = 0;
+ if (trig_tstamp < last_tstamp) {
+ if (rollover_cnt++ > 10) {
+ exit_sig = true;
+ MSG("INFO: periodic restart, process is exiting.\n");
+ break;
+ }
+ }
+ last_tstamp = trig_tstamp;
pthread_mutex_unlock(&mx_concent);
if (i != LGW_HAL_SUCCESS) {