I have created the following procedure in expect to work with an Agilent Base Station Simulator:
proc get_bss_parameter_value {bss parameter_string} {
global bss_array
set bss_str "$parameter_string?"
puts "String 1"
set bss_str "oa;$bss_array(gpib):$bss_str\r"
send "$bss_str"
expect {nopattern^}
puts "String 2"
set bss_str "en;$bss_array(gpib)"
puts "Sending bss_str: $bss_str"
send "$bss_str\r"
expect .*
set receive_buffer $expect_out(buffer)
puts "receive_buffer START: $receive_buffer"
puts "END"
return $receive_buffer
}
======================================================== OUTPUT:
String 1
>
oa;05:SYST:APPL? String 2 Sending bss_str: en;05 "CDMA 2000 Lab App T"
can't read "expect_out(buffer)": no such variable while executing "set receive_buffer $expect_out(buffer)" (procedure "get_bss_parameter_value" line 20)
======================================================== If "." is replaced by "" in the above code, this is the OUTPUT:
String 1
>
oa;05:SYST:APPL? String 2 Sending bss_str: en;05 receive_buffer START:
oa;05:SYST:APPL?
END Current application is
oa;05:SYST:APPL?
Problem:
1) I am not able to get the value "CDMA 2000 Lab App T" in the expect_out(buffer) variable which should match (due to .*) the output from the Agilent device. Is there something wrong with the code?
2) In both the cases, the command "en;05" is send but not displayed on stdout. Though we can see the expected output in the first case.