diff --git a/src/svxlink/svxlink/ReflectorLogic.cpp b/src/svxlink/svxlink/ReflectorLogic.cpp index 624ce9a4..12e74a7b 100644 --- a/src/svxlink/svxlink/ReflectorLogic.cpp +++ b/src/svxlink/svxlink/ReflectorLogic.cpp @@ -759,6 +759,7 @@ void ReflectorLogic::onConnected(void) timerclear(&m_last_talker_timestamp); m_con_state = STATE_EXPECT_AUTH_CHALLENGE; m_con.setMaxFrameSize(ReflectorMsg::MAX_PREAUTH_FRAME_SIZE); + processEvent("reflector_connection_status_update 1"); } /* ReflectorLogic::onConnected */ @@ -786,6 +787,7 @@ void ReflectorLogic::onDisconnected(TcpConnection *con, timerclear(&m_last_talker_timestamp); } m_con_state = STATE_DISCONNECTED; + processEvent("reflector_connection_status_update 0"); } /* ReflectorLogic::onDisconnected */ diff --git a/src/svxlink/svxlink/ReflectorLogic.tcl b/src/svxlink/svxlink/ReflectorLogic.tcl index 38d0dd2a..b86356de 100644 --- a/src/svxlink/svxlink/ReflectorLogic.tcl +++ b/src/svxlink/svxlink/ReflectorLogic.tcl @@ -31,6 +31,10 @@ variable announce_remote_min_interval 0 # activity") is active. See configuration variable QSY_PENDING_TIMEOUT. variable qsy_pending_active 0 +# This variable will be set to 1 if the connection to the reflector is +# established and to 0 if disconnected. +variable reflector_connection_established 0 + # # Checking to see if this is the correct logic core # @@ -72,6 +76,25 @@ proc command_failed {cmd} { } +# +# Executed when the reflector connection status is updated +# +# is_established - 0=disconnected, 1=established +# +proc reflector_connection_status_update {is_established} { + variable reflector_connection_established + if {$is_established != $reflector_connection_established} { + set reflector_connection_established $is_established + #playMsg "Core" "reflector" + #if {$is_established} { + # playMsg "Core" "connected" + #} else { + # playMsg "Core" "disconnected" + #} + } +} + + # # Executed when manual TG announcement is triggered # @@ -80,7 +103,15 @@ proc report_tg_status {} { variable previous_tg variable prev_announce_time variable prev_announce_tg + variable reflector_connection_established playSilence 100 + playMsg "Core" "reflector" + if {$reflector_connection_established} { + playMsg "Core" "connected" + } else { + playMsg "Core" "disconnected" + } + playSilence 200 if {$selected_tg > 0} { set prev_announce_time [clock seconds] set prev_announce_tg $selected_tg @@ -125,12 +156,18 @@ proc tg_local_activation {new_tg old_tg} { variable prev_announce_time variable prev_announce_tg variable selected_tg + variable reflector_connection_established #puts "### tg_local_activation" if {$new_tg != $old_tg} { set prev_announce_time [clock seconds] set prev_announce_tg $new_tg playSilence 100 + if {!$reflector_connection_established} { + playMsg "Core" "reflector" + playMsg "Core" "disconnected" + playSilence 200 + } playMsg "Core" "talk_group" say_talkgroup $new_tg } @@ -185,11 +222,17 @@ proc tg_remote_prio_activation {new_tg old_tg} { proc tg_command_activation {new_tg old_tg} { variable prev_announce_time variable prev_announce_tg + variable reflector_connection_established #puts "### tg_command_activation" set prev_announce_time [clock seconds] set prev_announce_tg $new_tg playSilence 100 + if {!$reflector_connection_established} { + playMsg "Core" "reflector" + playMsg "Core" "disconnected" + playSilence 200 + } playMsg "Core" "talk_group" say_talkgroup $new_tg } @@ -205,11 +248,17 @@ proc tg_default_activation {new_tg old_tg} { #variable prev_announce_time #variable prev_announce_tg #variable selected_tg + #variable reflector_connection_established #puts "### tg_default_activation" #if {$new_tg != $old_tg} { # set prev_announce_time [clock seconds] # set prev_announce_tg $new_tg # playSilence 100 + # if {!$reflector_connection_established} { + # playMsg "Core" "reflector" + # playMsg "Core" "disconnected" + # playSilence 200 + # } # playMsg "Core" "talk_group" # say_talkgroup $new_tg #} diff --git a/src/versions b/src/versions index 8b1c6b65..eb4cce5d 100644 --- a/src/versions +++ b/src/versions @@ -11,7 +11,7 @@ LIBECHOLIB=1.3.3.99.2 LIBASYNC=1.6.99.23 # SvxLink versions -SVXLINK=1.7.99.71 +SVXLINK=1.7.99.72 MODULE_HELP=1.0.0 MODULE_PARROT=1.1.1 MODULE_ECHO_LINK=1.5.99.3