def channel_hop2(mon_iface):
 global monchannel, first_pass, args, jamming_daemon_running
 channelNum = 0
 if args.channel:
  with lock:
   monchannel = args.channel
 while jamming_daemon_running:
  if (not args.channel):
   channelNum += 1
   if (channelNum > 11):
    channelNum = 1
    with lock:
     first_pass = 0
   with lock:
    monchannel = channelNum
   mon_iface.set_channel(monchannel)
  output(monchannel)
  if args.channel:
   time.sleep(0.05)
  elif (first_pass == 1):
   time.sleep(1)
   continue
  deauth(monchannel)

def channel_hop2 ( mon_iface ) : global monchannel , first_pass , args , jamming_daemon_running channelNum = 0 if args . channel : with lock : monchannel = args . channel while jamming_daemon_running : if ( not args . channel ) : channelNum += 1 if ( channelNum > 11 ) : channelNum = 1 with lock : first_pass = 0 with lock : monchannel = channelNum mon_iface . set_channel ( monchannel ) output ( monchannel ) if args . channel : time . sleep ( 0.05 ) elif ( first_pass == 1 ) : time . sleep ( 1 ) continue deauth ( monchannel )
first time it runs through the channels it stays on each channel for 5 seconds in order to populate the deauth list nicely .