Show
Ignore:
Timestamp:
07/21/09 17:34:55 (15 years ago)
Author:
sriram
Message:

Adding more changes to incorporate communication signal and spectrum sense

Files:
1 modified

Legend:

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

    r356 r358  
    6262        #temp = struct.unpack('!s', payload[3:10]) 
    6363        #print "printing the elements of packet",temp,"!!!!!!!!!!!\n" 
    64         if mode == "sync": 
    65         ##################################################### 
     64        ##################################################### 
     65        if mode == "sync": 
    6666                (sync_signal,) = struct.unpack('!s', payload[2])  
    6767                (sync_signal_red,) = struct.unpack('!s', payload[3])  #redundant sync bit 
     
    9292        ##################################################### 
    9393         
     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 
    94104        n_rcvd += 1 
    95105        if ok: 
     
    227237    ch = int(random.choice('17')) 
    228238    while running: 
     239        ################################################sync mode#################################### 
    229240        if mode == "sync": 
    230241                #nbytes = int(1e6 * .0003) 
     
    298309                #myfile.close() 
    299310                #tb.wait() 
    300  
     311        ################################################end of sync mode#################################### 
     312 
     313        ################################################Communications mode#################################### 
    301314        if mode == "traffic": 
    302315                nbytes = 16 
     
    315328                                        break; 
    316329         
    317                         payload = struct.pack('!H', data_pktno & 0xffff) + data 
     330                         
     331                        payload = struct.pack('!14s', data) 
    318332                        #print "printing payload",payload,"**\n" 
    319333                                 
     
    333347                                mode = "sync" 
    334348                                 
    335                                  
     349        ################################################ end of Communications mode####################################          
    336350 
    337351