From 4d652616f541b02b5e73702e17eff81d9595579e Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Fri, 2 Jan 2015 16:16:50 -0500 Subject: [PATCH] 2015-01-02 Fred Gleason * Fixed a bug in 'lib/rdlivewire.cpp' and 'lib/rdlivewire.h' that caused GPIO event reporting to fail after a watchdog reset. --- ChangeLog | 5 ++++- lib/rdlivewire.cpp | 11 +++++++++-- lib/rdlivewire.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1e7ba62..2c3f4655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14686,10 +14686,13 @@ * Refactored the 'RDCut::autoSegue()' method to fetch trim data via 'RDTrimAudio'. * Added language in the rdimport(1) man page to resolve ambiguity - regarding how the --segue-level location is dteremined when + regarding how the --segue-level location is determined when normalization is specified. 2014-12-08 Fred Gleason * Added an RLM for Live 365 in 'rlm/rlm_live365.c'. 2014-12-08 Fred Gleason * Fixed a bug in 'rlm/rlm_live365.c' where the 'album' field was not escaped correctly. +2015-01-02 Fred Gleason + * Fixed a bug in 'lib/rdlivewire.cpp' and 'lib/rdlivewire.h' that + caused GPIO event reporting to fail after a watchdog reset. diff --git a/lib/rdlivewire.cpp b/lib/rdlivewire.cpp index 3fc3bfd3..cc5e0287 100644 --- a/lib/rdlivewire.cpp +++ b/lib/rdlivewire.cpp @@ -45,6 +45,8 @@ RDLiveWire::RDLiveWire(unsigned id,QObject *parent,const char *name) live_ptr=0; live_connected=false; live_load_ver_count=0; + live_gpi_initialized=false; + live_gpo_initialized=false; // // Connection Socket @@ -466,6 +468,9 @@ void RDLiveWire::watchdogData() void RDLiveWire::watchdogTimeoutData() { live_watchdog_state=true; + live_connected=false; + live_gpi_initialized=false; + live_gpo_initialized=false; int holdoff=GetHoldoff(); emit watchdogStateChanged(live_id,QString().sprintf( "Connection to LiveWire node at %s:%d lost, attempting reconnect, holdoff = %d mS", @@ -584,8 +589,9 @@ void RDLiveWire::ReadVersion(const QString &cmd) connect(live_gpi_timers.back(),SIGNAL(timeout()),mapper,SLOT(map())); } } - if(live_gpis>0) { + if(!live_gpi_initialized) { live_socket->writeBlock("ADD GPI\r\n",9); + live_gpi_initialized=true; } } if(tag=="NGPO") { @@ -605,9 +611,10 @@ void RDLiveWire::ReadVersion(const QString &cmd) connect(live_gpo_timers.back(),SIGNAL(timeout()),mapper,SLOT(map())); } } - if(live_gpos>0) { + if(!live_gpo_initialized) { live_socket->writeBlock("CFG GPO\r\n",9); live_socket->writeBlock("ADD GPO\r\n",9); + live_gpo_initialized=true; } } } diff --git a/lib/rdlivewire.h b/lib/rdlivewire.h index 7fc6f3e6..16b7b995 100644 --- a/lib/rdlivewire.h +++ b/lib/rdlivewire.h @@ -131,6 +131,8 @@ class RDLiveWire : public QObject QTimer *live_watchdog_timeout_timer; QTimer *live_holdoff_timer; int live_load_ver_count; + bool live_gpi_initialized; + bool live_gpo_initialized; };