Changeset 359

Show
Ignore:
Timestamp:
07/21/09 18:53:43 (15 years ago)
Author:
sriram
Message:

More changes for getting the sync and data going one after the other

Location:
vtcross/branches/sriram
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/sriram/benchmark_txrxnode1.py

    r358 r359  
    9494        ######################### traffic ############################ 
    9595        if mode == "traffic": 
    96                 if ok == True: 
     96                (data_header,) = struct.unpack('!s', payload[0]) 
     97                if ok and data_header == 'd': 
    9798                        comm = struct.unpack('!14s', data) 
    9899                        print("received this ", comm)  
     
    313314        ################################################Communications mode#################################### 
    314315        if mode == "traffic": 
    315                 nbytes = 16 
    316                 pkt_size = 16 
     316                print "inside traffic mode \n" 
     317                nbytes = 15 
     318                pkt_size = 15 
    317319                sync_pktno = 0 
    318320                while n < nbytes: 
     
    320322                        if options_tx.from_file is None: 
    321323                                #data = (pkt_size - 2) * chr(data_pktno & 0xff) #0xff is 255 
    322                                 data = 'Hi how are you' #Sending this message 
     324                                data = 'dHi how are you' #Sending this message 
    323325                                #print >> myfile, data 
    324326                                #print "printing data",data,"****\n" 
     
    329331         
    330332                         
    331                         payload = struct.pack('!14s', data) 
     333                        payload = struct.pack('!15s', data) 
    332334                        #print "printing payload",payload,"**\n" 
    333335                                 
  • vtcross/branches/sriram/benchmark_txrxnode2.py

    r358 r359  
    1414global sync_status,mode 
    1515sync_status=False 
    16  
     16mode = "sync" #default mode of operation... 
    1717class my_top_block(gr.top_block): 
    1818 
     
    7676        ######################### traffic ############################ 
    7777        if mode == "traffic": 
    78                 if ok == True: 
     78                (data_header,) = struct.unpack('!s', payload[0]) 
     79                if ok and data_header == 'd': 
    7980                        traffic_flag = True 
    8081                        comm = struct.unpack('!14s', data) 
     
    193194        ################################################sync mode#################################### 
    194195        if mode == "sync": 
     196                 
    195197                if sync_status != True: 
    196198                        #print "inside while" 
     
    209211                else: 
    210212                        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" 
    211216                        #tb.stop() 
    212                         break 
    213                 temp_variable = 2 
    214                 if temp_variable == 2: 
    215                         print "success" 
     217                        #break 
     218                #temp_variable = 2 
     219                #if temp_variable == 2: 
     220                #       print "success" 
    216221     
    217                 print "sync channel is found! and it is channel ",ch," \n"   
    218                 mode = "traffic" 
     222                 
    219223         
    220224        ################################################end of sync mode#################################### 
     
    222226        ################################################Communications mode####################################  
    223227        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 
    229238                sync_pktno = 0 
    230239                while n < nbytes: 
     
    232241                        if options_tx.from_file is None: 
    233242                                #data = (pkt_size - 2) * chr(data_pktno & 0xff) #0xff is 255 
    234                                 data = 'I am fine.....' #Sending this message 
     243                                data = 'dI am fine.....' #Sending this message 
    235244                                #print >> myfile, data 
    236245                                #print "printing data",data,"****\n" 
     
    241250         
    242251                         
    243                         payload = struct.pack('!14s', data) 
     252                        payload = struct.pack('!15s', data) 
    244253                        #print "printing payload",payload,"**\n" 
    245254