Improve response of t0_chopper_id command by working around the chopsel IO

Box communications problems.
This commit is contained in:
Ferdi Franceschini
2015-02-26 10:49:39 +11:00
parent 243dddc9a3
commit e0626f4b6a

View File

@ -5,15 +5,19 @@ namespace eval chopper {
} }
if {$::chopper::sim_mode == false} { if {$::chopper::sim_mode == false} {
MakeAsyncProtocol std MakeAsyncProtocol chopsel_ap
std sendterminator "0x0D0x0A0" chopsel_ap sendterminator "0x0D0x0A0"
std replyterminator "0x0D0x0A00x20" # Append space to reply terminator to match terminator from the 'get master chopper' reply
MakeAsyncQueue chopsel std chopsel1-bilby 30000 chopsel_ap replyterminator "0x0D0x0A00x20"
MakeAsyncQueue chopsel chopsel_ap chopsel1-bilby 30000
# Set timeout to 100ms to improve response for all the other replies that just end with crlf
chopsel timeout 100
# Send something to get the dopey welcome and help messages out of the way
chopsel send x
} }
::utility::macro::getset int t0_chopper_id {args} { ::utility::macro::getset int t0_chopper_id {args} {
if {$::chopper::sim_mode == false} { if {$::chopper::sim_mode == false} {
if {$args == ""} { if {$args == ""} {
chopsel send {get master chopper}
return "t0_chopper_id = [SplitReply [chopsel send {get master chopper}]]" return "t0_chopper_id = [SplitReply [chopsel send {get master chopper}]]"
} else { } else {
chopsel send "get master chopper" chopsel send "get master chopper"