Changeset 498 for vtcross/trunk/src/cross-examples
- Timestamp:
- 10/03/09 18:48:33 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/cross-examples/python/gnuradio-examples/benchmark_dsa.py
r493 r498 66 66 def main(): 67 67 68 global stats_array, count_array, time_array, n_rcvd, n_right,sync_status,mode,ch,traffic_flag,n_attempts,return_flag 68 global stats_array, count_array, time_array, n_rcvd 69 global n_right, sync_status, mode, ch, traffic_flag, 70 global n_attempts, return_flag, crossShellHost, crossShellPort 71 69 72 n_rcvd = 0 70 73 n_right = 0 … … 137 140 UpdateParameterPerformance(currentParameters,1,o,1) 138 141 except: 139 print "fail"140 142 else: 141 143 # Get the average communication time … … 170 172 if ok: 171 173 (pktno,) = struct.unpack('!H', payload[0:2]) 172 174 (sync_signal,) = struct.unpack('!s', payload[2]) 173 175 (data_channel,) = struct.unpack('!H', payload[3:5]) 174 176 … … 198 200 ############################################################## 199 201 200 n_rcvd += 1201 if ok:202 n_right += 1202 n_rcvd += 1 203 if ok: 204 n_right += 1 203 205 204 206 mods = modulation_utils.type_1_mods() 205 207 demods = modulation_utils.type_1_demods() 208 209 # Set default values for the CROSS shell location. These can be overridden 210 # via command-line parameters 211 crossShellHost = "localhost" 212 crossShellPort = "40000" 206 213 207 214 #setting up the tx options parser … … 220 227 parser_tx.add_option("","--from-file", default=None, 221 228 help="use file for packet contents") 229 parser_tx.add_option("-h", "--hostname", action="store", type="string", dest="crossShellHost", 230 default="localhost", help="Set the hostname/IP for the VTCROSS shell"); 231 parser_tx.add_option("-p", "--port", action="store", type="string", dest="crossShellPort", 232 default="40000", help="Set the port for the VTCROSS shell"); 222 233 223 234 expert_grp_tx = parser_tx.add_option_group("Expert_tx") … … 268 279 parser_rx.add_option("-T", "--threshold", type="eng_float", default=1.5e8, 269 280 help="set primary user sensing energy threshold [default=%default]") 270 281 parser_rx.add_option("-h", "--hostname", action="store", type="string", dest="crossShellHost", 282 default="localhost", help="Set the hostname/IP for the VTCROSS shell"); 283 parser_rx.add_option("-p", "--port", action="store", type="string", dest="crossShellPort", 284 default="40000", help="Set the port for the VTCROSS shell"); 285 271 286 272 287 … … 290 305 else: 291 306 print "[[ Using the CROSS DSA Cognitive Engine ]]" 307 print "[[ VTCROSS shell located at " + crossShellHost + ":" + crossShellPort + " ]]" 308 SetCrossShellLocation(crossShellHost, crossShellPort) 292 309 else: 293 310 print "[[ Using the RANDOM channel selection algorithm ]]\n\n"