Hallo liebe SVXlink Gemeinde,
nachdem unser Relais, DB0HHW nun einiggermassen läuft habe ich angefangen an Softwaremässigen Erweiterungen zu Basteln.
Leider hab ich noch nicht so richtig eine Idee bekommen wie SVXlink die TCLroutinen handhabt.
Zum Testen habe ich mir eine 1:1 Kopie unsers Relais (Archlinux) unter VirtualBox erstellt damit der laufende Betrieb nicht gestört wird und ich auch "offline" testen kann.
Die aktuelle Aufgabenstellung ist eine vorhandene WAV Datei durch DTMF Komando abrufbar auszugeben.
Das tcl Modul/den Event handler habe ich Broadcast genannt.
Svxlink macht das auch, aber noch nicht 100% wie ich will
Die Ausgabe der WAV-Datei bricht ab sobald svxlink die eigene Kennung ausgibt:
Loading module "ModuleTclVoiceMail" into logic "SimplexLogic" Module Tcl v1.0.0 starting...Loading module "ModuleBroadcast" into logic "SimplexLogic" Module Tcl v1.0.0 starting...SimplexLogic: Event handler script successfully loaded.EchoLink directory status changed to ON--- EchoLink directory server message: ---EchoLink Server v2.5.9997....SimplexLogic: digit=9SimplexLogic: digit=#SimplexLogic: Activating module Broadcast...*** ERROR: Unable to handle event: Broadcast::activating_module in logic SimplexLogic (can't read "module_name": no such variable)Broadcast: Module activatedTx1: Turning the transmitter ONBroadcast: allMsgsWritten called...Tx1: Turning the transmitter OFF
Was kann ich tun, damit die Ausgabe der WAV datei nicht durch andere Events wie z.b die Ausgabe der ID unterbrochen wird?
Wieso meckert svxlink über 'can't read "module_name": no such variable' ?
Die beiden TCL Scripts basierend auf den default:
../event.d/Broadcast.tcl
namespace eval Broadcast {## Check if this module is loaded in the current logic core#if {![info exists CFG_ID]} { return}## Extract the module name from the current namespace#set module_name [namespace tail [namespace current]]## An "overloaded" playMsg that eliminates the need to write the module name# as the first argument.## msg - The message to play#proc playMsg {msg} { variable module_name ::playMsg $module_name $msg}## A convenience function for printing out information prefixed by the# module name.## msg - The message to print#proc printInfo {msg} { variable module_name puts "$module_name: $msg"}## Executed when this module is being activated#proc activating_module {} { Module::activating_module $module_name}## Executed when this module is being deactivated.#proc deactivating_module {} { Module::deactivating_module $module_name}## Executed when the inactivity timeout for this module has expired.#proc timeout {} { Module::timeout $module_name}## Executed when playing of the help message for this module has been requested.#proc play_help {} { Module::play_help $module_name}## Executed when the state of this module should be reported on the radio# channel. The rules for when this function is called are:## When a module is active:# * At manual identification the status_report function for the active module is# called.# * At periodic identification no status_report function is called.## When no module is active:# * At both manual and periodic (long variant) identification the status_report# function is called for all modules.#proc status_report {} { printInfo "status_report called..."}## Called when an illegal command has been entered## cmd - The received command#proc unknown_command {cmd} { playNumber $cmd playMsg "unknown_command"}# end of namespace}
../module.d/ModuleBroadcast.tcl
namespace eval Broadcast {
#
# Check if this module is loaded in the current logic core
#
if {![info exists CFG_ID]} {
return;
}
#
# Extract the module name from the current namespace
#
set module_name [namespace tail [namespace current]]
#
# A convenience function for printing out information prefixed by the
# module name
#
# msg - The message to print
#
proc printInfo {msg} {
variable module_name
puts "$module_name: $msg"
}
#
# A convenience function for calling an event handler
#
# ev - The event string to execute
#
proc processEvent {ev} {
variable module_name
::processEvent "$module_name" "$ev"
}
#
# Executed when this module is being activated
#
proc activateInit {} {
printInfo "Module activated"
play_broadcast
}
#
# Executed when this module is being deactivated.
#
proc deactivateCleanup {} {
printInfo "Module deactivated"
}
#
# Executed when a DTMF digit (0-9, A-F, *, #) is received
#
# char - The received DTMF digit
# duration - The duration of the received DTMF digit
#
proc dtmfDigitReceived {char duration} {
printInfo "DTMF digit $char received with duration $duration milliseconds"
}
#
# Executed when a DTMF command is received
#
# cmd - The received DTMF command
#
proc dtmfCmdReceived {cmd} {
printInfo "DTMF command received: $cmd"
if {$cmd == "0"} {
processEvent "play_help"
} elseif {$cmd == "1"} {
deactivateModule
} elseif {$cmd == ""} {
deactivateModule
} else {
processEvent "unknown_command $cmd"
}
}
#
# Executed when a DTMF command is received in idle mode. That is, a command is
# received when this module has not been activated first.
#
# cmd - The received DTMF command
#
proc dtmfCmdReceivedWhenIdle {cmd} {
printInfo "DTMF command received when idle: $cmd"
}
#
# Executed when the squelch open or close.
#
# is_open - Set to 1 if the squelch is open otherwise it's set to 0
#
proc squelchOpen {is_open} {
if {$is_open} {set str "OPEN"} else { set str "CLOSED"}
printInfo "The squelch is $str"
}
#
# Executed when all announcement messages has been played.
# Note that this function also may be called even if it wasn't this module
# that initiated the message playing.
#
proc allMsgsWritten {} {
printInfo "allMsgsWritten called..."
}
#
# Start Broadcasting message
#
proc play_broadcast {} {
global langdir; # aus der Hauptebene in events.tcl
if {[file exists "$langdir/Broadcast/dlrs.wav"]} {
set broadcast_stat "PLAY"
playSilence 250
playFile "$langdir/Broadcast/test.wav"
set broadcast_stat "IDLE"
#deactivateModule
} else {
playSilence 1000
#playMsg "greeting";
}
}
# end of namespace
}
#
# This file has not been truncated
#
Display More
73' Gerald
- dk7xe -