forked from Hamlib/Hamlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtcltest.tcl.in
67 lines (48 loc) · 1.73 KB
/
tcltest.tcl.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
# Edit the path below to reflect installed Hamlib extension
lappend ::auto_path @tcldir@
## Brute force loading
#load "@tcldir@/hamlibtcl.so" Hamlib
## Preferred package loading
package require hamlib
set tclver [info tclversion]
puts "Tcl $tclver test, $hamlib_version\n"
#rig_set_debug $RIG_DEBUG_TRACE
rig_set_debug $RIG_DEBUG_NONE
# Init RIG_MODEL_DUMMY
Rig my_rig $RIG_MODEL_DUMMY
my_rig open
my_rig set_freq $RIG_VFO_A 145550000
puts "status:\t\t[my_rig cget -error_status]"
# get_mode returns a tuple
set moderes [my_rig get_mode]
set mode [rig_strrmode [lindex $moderes 0]]
puts "mode:\t\t$mode\nbandwidth:\t[lindex $moderes 1]Hz"
set state [my_rig cget -state]
# The following works well also
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]"
puts "getinfo:\t[my_rig get_info]"
my_rig set_level "VOXDELAY" 1
puts "status:\t\t[my_rig cget -error_status]"
puts "VOX delay:\t[my_rig get_level_i 'VOXDELAY']"
puts "status:\t\t[my_rig cget -error_status]"
my_rig set_level $RIG_LEVEL_VOXDELAY 5
puts "status:\t\t[my_rig cget -error_status]"
puts "VOX delay:\t[my_rig get_level_i $RIG_LEVEL_VOXDELAY]"
puts "status:\t\t[my_rig cget -error_status]"
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]]"
puts "\nSending Morse, '73'"
my_rig send_morse $RIG_VFO_A "73"
my_rig close
#my_rig cleanup
exit 0