<s> """<STR_LIT>""" <EOL> import sys <EOL> from smartbits import * <EOL> hub1 = <NUM_LIT:0> <EOL> slot1 = <NUM_LIT:0> <EOL> port1 = <NUM_LIT:0> <EOL> hub2 = <NUM_LIT:0> <EOL> slot2 = <NUM_LIT:1> <EOL> port2 = <NUM_LIT:0> <EOL> numPackets = <NUM_LIT> <EOL> try : <EOL> if len ( sys . argv ) > <NUM_LIT:1> : <EOL> linkToSmartBits ( sys . argv [ <NUM_LIT:1> ] ) <EOL> else : <EOL> linkToSmartBits ( ) <EOL> except SmartlibError , err : <EOL> print_error_desc ( err ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> print "<STR_LIT>" <EOL> HTResetPort ( RESET_FULL , hub1 , slot1 , port1 ) <EOL> HTResetPort ( RESET_FULL , hub2 , slot2 , port2 ) <EOL> HTClearPort ( hub1 , slot1 , port1 ) <EOL> HTClearPort ( hub2 , slot2 , port2 ) <EOL> HTTransmitMode ( SINGLE_BURST_MODE , hub1 , slot1 , port1 ) <EOL> HTBurstCount ( numPackets , hub1 , slot1 , port1 ) <EOL> HTRun ( HTRUN , hub1 , slot1 , port1 ) <EOL> raw_input ( "<STR_LIT>" ) <EOL> cs = HTCountStructure ( ) <EOL> HTGetCounters ( cs , hub1 , slot1 , port1 ) <EOL> txPackets = cs . TmtPkt <EOL> HTGetCounters ( cs , hub2 , slot2 , port2 ) <EOL> rxPackets = cs . RcvPkt <EOL> if txPackets == rxPackets : <EOL> print "<STR_LIT>" % ( txPackets , rxPackets ) <EOL> else : <EOL> print "<STR_LIT>" % ( txPackets , rxPackets ) <EOL> ETUnLink ( ) </s>
