Changeset 359
- Timestamp:
- 07/21/09 18:53:43 (15 years ago)
- Location:
- vtcross/branches/sriram
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/branches/sriram/benchmark_txrxnode1.py
r358 r359 94 94 ######################### traffic ############################ 95 95 if mode == "traffic": 96 if ok == True: 96 (data_header,) = struct.unpack('!s', payload[0]) 97 if ok and data_header == 'd': 97 98 comm = struct.unpack('!14s', data) 98 99 print("received this ", comm) … … 313 314 ################################################Communications mode#################################### 314 315 if mode == "traffic": 315 nbytes = 16 316 pkt_size = 16 316 print "inside traffic mode \n" 317 nbytes = 15 318 pkt_size = 15 317 319 sync_pktno = 0 318 320 while n < nbytes: … … 320 322 if options_tx.from_file is None: 321 323 #data = (pkt_size - 2) * chr(data_pktno & 0xff) #0xff is 255 322 data = ' Hi how are you' #Sending this message324 data = 'dHi how are you' #Sending this message 323 325 #print >> myfile, data 324 326 #print "printing data",data,"****\n" … … 329 331 330 332 331 payload = struct.pack('!1 4s', data)333 payload = struct.pack('!15s', data) 332 334 #print "printing payload",payload,"**\n" 333 335 -
vtcross/branches/sriram/benchmark_txrxnode2.py
r358 r359 14 14 global sync_status,mode 15 15 sync_status=False 16 16 mode = "sync" #default mode of operation... 17 17 class my_top_block(gr.top_block): 18 18 … … 76 76 ######################### traffic ############################ 77 77 if mode == "traffic": 78 if ok == True: 78 (data_header,) = struct.unpack('!s', payload[0]) 79 if ok and data_header == 'd': 79 80 traffic_flag = True 80 81 comm = struct.unpack('!14s', data) … … 193 194 ################################################sync mode#################################### 194 195 if mode == "sync": 196 195 197 if sync_status != True: 196 198 #print "inside while" … … 209 211 else: 210 212 print "inside lese of while check" 213 check_sync == 0 214 print "sync channel is found! and it is channel ",ch," \n" 215 mode = "traffic" 211 216 #tb.stop() 212 break213 temp_variable = 2214 if temp_variable == 2:215 print "success"217 #break 218 #temp_variable = 2 219 #if temp_variable == 2: 220 # print "success" 216 221 217 print "sync channel is found! and it is channel ",ch," \n" 218 mode = "traffic" 222 219 223 220 224 ################################################end of sync mode#################################### … … 222 226 ################################################Communications mode#################################### 223 227 if mode == "traffic": 224 time.sleep(0.4) 225 if traffic_flag != True 226 mode = "sync" 227 nbytes = 14 228 pkt_size = 14 228 print "Inside traffic mode" 229 if check_sync == 0 230 time.sleep(0.4) 231 if traffic_flag != True: 232 mode = "sync" 233 continue 234 else: 235 check_sync == 1 236 nbytes = 15 237 pkt_size = 15 229 238 sync_pktno = 0 230 239 while n < nbytes: … … 232 241 if options_tx.from_file is None: 233 242 #data = (pkt_size - 2) * chr(data_pktno & 0xff) #0xff is 255 234 data = ' I am fine.....' #Sending this message243 data = 'dI am fine.....' #Sending this message 235 244 #print >> myfile, data 236 245 #print "printing data",data,"****\n" … … 241 250 242 251 243 payload = struct.pack('!1 4s', data)252 payload = struct.pack('!15s', data) 244 253 #print "printing payload",payload,"**\n" 245 254