Changeset 373
- Timestamp:
- 07/26/09 21:16:23 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/branches/sriram/benchmark_txrxnode2.py
r369 r373 184 184 ################################################sync mode#################################### 185 185 if mode == "sync": 186 if sync_status != "True": 186 #sync_status="False" 187 if sync_status != "True": 187 188 #print "inside while" 188 189 ch = int(random.choice([1,7,8,14])) … … 191 192 else: 192 193 hop_freq = float(1e6 * (467.5625+(ch-8)*0.025))#setting the centre freq frequency for sending packets 193 print "hop freq is",hop_freq,"@@@@\n"194 #print "hop freq is",hop_freq,"@@@@\n" 194 195 195 196 tb.txpath.set_freq(hop_freq) 196 197 tb.rxpath.set_freq(hop_freq) 197 198 ch_energy = tb.rxpath.probe.level() #check if primary user is present 198 print "channel energy is ",ch_energy,"\n" 199 if int(ch_energy) > 1.50e8: #if primary user is there then dont transmit on this channel 199 #if int(ch_energy) > 1.0e7: 200 print "hop freq is ",hop_freq," and channel energy is ",ch_energy,"\n" 201 if int(ch_energy) > 2e7: #if primary user is there then dont transmit on this channel 200 202 continue 201 time.sleep(0. 05)203 time.sleep(0.1) 202 204 else: 203 205 print "sync channel is found...channel ",ch,"\n" … … 250 252 time.sleep(0.2) 251 253 ch_energy = tb.rxpath.probe.level() #check if primary user is present 252 if int(ch_energy) > 1.50e8: #if primary user is there then dont transmit on this channel 254 print "channel energy is ",ch_energy,"\n" 255 if int(ch_energy) > 2e7: #if primary user is there then dont transmit on this channel 253 256 mode = "sync" 254 257 continue