Changeset 358 for vtcross/branches/sriram/benchmark_txrxnode1.py
- Timestamp:
- 07/21/09 17:34:55 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/branches/sriram/benchmark_txrxnode1.py
r356 r358 62 62 #temp = struct.unpack('!s', payload[3:10]) 63 63 #print "printing the elements of packet",temp,"!!!!!!!!!!!\n" 64 if mode == "sync":65 #####################################################64 ##################################################### 65 if mode == "sync": 66 66 (sync_signal,) = struct.unpack('!s', payload[2]) 67 67 (sync_signal_red,) = struct.unpack('!s', payload[3]) #redundant sync bit … … 92 92 ##################################################### 93 93 94 ######################### traffic ############################ 95 if mode == "traffic": 96 if ok == True: 97 comm = struct.unpack('!14s', data) 98 print("received this ", comm) 99 100 ############################################################## 101 102 103 94 104 n_rcvd += 1 95 105 if ok: … … 227 237 ch = int(random.choice('17')) 228 238 while running: 239 ################################################sync mode#################################### 229 240 if mode == "sync": 230 241 #nbytes = int(1e6 * .0003) … … 298 309 #myfile.close() 299 310 #tb.wait() 300 311 ################################################end of sync mode#################################### 312 313 ################################################Communications mode#################################### 301 314 if mode == "traffic": 302 315 nbytes = 16 … … 315 328 break; 316 329 317 payload = struct.pack('!H', data_pktno & 0xffff) + data 330 331 payload = struct.pack('!14s', data) 318 332 #print "printing payload",payload,"**\n" 319 333 … … 333 347 mode = "sync" 334 348 335 349 ################################################ end of Communications mode#################################### 336 350 337 351