2002-09-08 22:31:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# the next line restarts using tclsh \
|
|
|
|
exec tclsh "$0" "$@"
|
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
# Edit the path below to reflect installed Hamlib extension
|
2017-07-26 11:33:42 +00:00
|
|
|
lappend ::auto_path @tcldir@
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
## Brute force loading
|
2017-07-26 11:33:42 +00:00
|
|
|
#load "@tcldir@/hamlibtcl.so" Hamlib
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
## Preferred package loading
|
|
|
|
package require hamlib
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2008-05-04 21:47:06 +00:00
|
|
|
set tclver [info tclversion]
|
|
|
|
puts "Tcl $tclver test, $hamlib_version\n"
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2008-05-04 21:47:06 +00:00
|
|
|
#rig_set_debug $RIG_DEBUG_TRACE
|
|
|
|
rig_set_debug $RIG_DEBUG_NONE
|
2002-10-07 21:44:51 +00:00
|
|
|
|
2002-09-08 22:31:01 +00:00
|
|
|
# Init RIG_MODEL_DUMMY
|
|
|
|
Rig my_rig $RIG_MODEL_DUMMY
|
|
|
|
|
|
|
|
my_rig open
|
2013-02-13 00:39:47 +00:00
|
|
|
my_rig set_freq $RIG_VFO_A 145550000
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "status:\t\t[my_rig cget -error_status]"
|
2002-10-07 21:44:51 +00:00
|
|
|
|
2008-05-04 21:47:06 +00:00
|
|
|
# get_mode returns a tuple
|
|
|
|
set moderes [my_rig get_mode]
|
|
|
|
set mode [rig_strrmode [lindex $moderes 0]]
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "mode:\t\t$mode\nbandwidth:\t[lindex $moderes 1]Hz"
|
2002-10-07 21:44:51 +00:00
|
|
|
|
|
|
|
set state [my_rig cget -state]
|
|
|
|
|
|
|
|
# The following works well also
|
|
|
|
|
2016-08-27 19:24:17 +00:00
|
|
|
set rigcaps [my_rig cget -caps]
|
|
|
|
#set model [$rigcaps cget -model_name]
|
|
|
|
puts "Model:\t\t[$rigcaps cget -model_name]"
|
|
|
|
puts "Manufacturer:\t\t[$rigcaps cget -mfg_name]"
|
|
|
|
puts "Backend version:\t[$rigcaps cget -version]"
|
|
|
|
puts "Backend license:\t[$rigcaps cget -copyright]"
|
|
|
|
puts "Attenuators:\t[$rigcaps cget -attenuator]"
|
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "getinfo:\t[my_rig get_info]"
|
2002-10-07 21:44:51 +00:00
|
|
|
|
2020-03-30 04:57:28 +00:00
|
|
|
my_rig set_level "VOXDELAY" 1
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "status:\t\t[my_rig cget -error_status]"
|
2020-03-30 04:57:28 +00:00
|
|
|
puts "VOX delay:\t[my_rig get_level_i 'VOXDELAY']"
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "status:\t\t[my_rig cget -error_status]"
|
2020-03-30 04:57:28 +00:00
|
|
|
my_rig set_level $RIG_LEVEL_VOXDELAY 5
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "status:\t\t[my_rig cget -error_status]"
|
2020-03-30 04:57:28 +00:00
|
|
|
puts "VOX delay:\t[my_rig get_level_i $RIG_LEVEL_VOXDELAY]"
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "status:\t\t[my_rig cget -error_status]"
|
2002-10-07 21:44:51 +00:00
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
puts "strength:\t[my_rig get_level_i $RIG_LEVEL_STRENGTH]"
|
|
|
|
puts "status:\t\t[my_rig cget -error_status]"
|
|
|
|
puts "status(str):\t[rigerror [my_rig cget -error_status]]"
|
2002-10-07 21:44:51 +00:00
|
|
|
|
2013-02-13 00:39:47 +00:00
|
|
|
puts "\nSending Morse, '73'"
|
|
|
|
my_rig send_morse $RIG_VFO_A "73"
|
|
|
|
|
2002-09-08 22:31:01 +00:00
|
|
|
my_rig close
|
2002-10-07 21:44:51 +00:00
|
|
|
#my_rig cleanup
|
2002-09-08 22:31:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
exit 0
|