+proc apduDump {} {
+ global debugMode
+
+ set w .apdu
+
+ if {$debugMode == 0} return
+ set x [z39 apduInfo]
+
+ set offset [lindex $x 1]
+ set length [lindex $x 0]
+
+ if {![winfo exists $w]} {
+ catch {destroy $w}
+ toplevelG $w
+
+ wm title $w "APDU information"
+
+ wm minsize $w 0 0
+
+ top-down-window $w
+
+ text $w.top.t -width 60 -height 12 -wrap word -relief flat \
+ -borderwidth 0 \
+ -yscrollcommand [list $w.top.s set]
+ scrollbar $w.top.s -command [list $w.top.t yview]
+
+ pack $w.top.s -side right -fill y
+ pack $w.top.t -expand yes -fill both
+
+ bottom-buttons $w [list {Close} [list destroy $w]] 0
+ }
+ $w.top.t insert end "Length: ${length}\n"
+ if {$offset != -1} {
+ $w.top.t insert end "Offset: ${offset}\n"
+ }
+ $w.top.t insert end [lindex $x 2]
+ $w.top.t insert end "---------------------------------\n"
+
+}
+
+