diff --git a/src/svxlink/svxlink/LogicBase.h b/src/svxlink/svxlink/LogicBase.h index a7ef8e3d..0584256d 100644 --- a/src/svxlink/svxlink/LogicBase.h +++ b/src/svxlink/svxlink/LogicBase.h @@ -318,7 +318,7 @@ class LogicBase : public sigc::trackable * This function is used by a logic implementation to set which talk group * that local traffic is received on. */ - void setReceivedTg(uint32_t tg) + virtual void setReceivedTg(uint32_t tg) { m_received_tg = tg; receivedTgUpdated(tg); diff --git a/src/svxlink/svxlink/ReflectorLogic.cpp b/src/svxlink/svxlink/ReflectorLogic.cpp index dc87f5af..02c5e6c6 100644 --- a/src/svxlink/svxlink/ReflectorLogic.cpp +++ b/src/svxlink/svxlink/ReflectorLogic.cpp @@ -1559,10 +1559,6 @@ void ReflectorLogic::onLogicConInStreamStateChanged(bool is_active, // << is_active << " is_idle=" << is_idle << endl; if (is_idle) { - if ((m_logic_con_in_valve != 0) && (m_selected_tg > 0)) - { - m_logic_con_in_valve->setOpen(true); - } if (m_qsy_pending_timer.isEnabled()) { std::ostringstream os; @@ -1576,6 +1572,10 @@ void ReflectorLogic::onLogicConInStreamStateChanged(bool is_active, } else { + if ((m_logic_con_in_valve != 0) && (m_selected_tg > 0)) + { + m_logic_con_in_valve->setOpen(true); + } if (m_tg_select_timeout_cnt == 0) // No TG currently selected { if (m_default_tg > 0) diff --git a/src/svxlink/svxlink/RepeaterLogic.cpp b/src/svxlink/svxlink/RepeaterLogic.cpp index 903c43b0..6dde6c26 100644 --- a/src/svxlink/svxlink/RepeaterLogic.cpp +++ b/src/svxlink/svxlink/RepeaterLogic.cpp @@ -134,7 +134,7 @@ RepeaterLogic::RepeaterLogic(Async::Config& cfg, const std::string& name) open_sql_flank(SQL_FLANK_CLOSE), short_sql_open_cnt(0), sql_flap_sup_min_time(1000), sql_flap_sup_max_cnt(0), rgr_enable(true), open_reason("?"), - ident_nag_min_time(2000), ident_nag_timer(-1) + ident_nag_min_time(2000), ident_nag_timer(-1), delayed_tg_activation(0) { up_timer.expired.connect(mem_fun(*this, &RepeaterLogic::idleTimeout)); open_on_sql_timer.expired.connect( @@ -450,6 +450,19 @@ void RepeaterLogic::dtmfCtrlPtyCmdReceived(const void *buf, size_t count) } /* RepeaterLogic::dtmfCtrlPtyCmdReceived */ +void RepeaterLogic::setReceivedTg(uint32_t tg) +{ + if (repeater_is_up || !activate_on_sql_close) + { + Logic::setReceivedTg(tg); + } + else + { + delayed_tg_activation = tg; + } +} /* RepeaterLogic::setReceivedTg */ + + #if 0 bool RepeaterLogic::getIdleState(void) const { @@ -642,6 +655,8 @@ void RepeaterLogic::squelchOpen(bool is_open) { activate_on_sql_close = false; setUp(true, open_reason); + Logic::setReceivedTg(delayed_tg_activation); + delayed_tg_activation = 0; } } } diff --git a/src/svxlink/svxlink/RepeaterLogic.h b/src/svxlink/svxlink/RepeaterLogic.h index 11996dd4..f8e1f1fb 100644 --- a/src/svxlink/svxlink/RepeaterLogic.h +++ b/src/svxlink/svxlink/RepeaterLogic.h @@ -176,7 +176,7 @@ class RepeaterLogic : public Logic virtual void allMsgsWritten(void); virtual void audioStreamStateChange(bool is_active, bool is_idle); virtual void dtmfCtrlPtyCmdReceived(const void *buf, size_t count); - + virtual void setReceivedTg(uint32_t tg); private: typedef enum @@ -204,7 +204,8 @@ class RepeaterLogic : public Logic std::string open_reason; int ident_nag_min_time; Async::Timer ident_nag_timer; - + uint32_t delayed_tg_activation; + void idleTimeout(Async::Timer *t); void setIdle(bool idle); void setUp(bool up, std::string reason);