title: Python scapy prn send rcv error
body: <p>I am following this book called violent python and in CH5 it goes over making a script to find the mac address of an iphone wifi side. And check if bluetooth is on by incrementing the last bytes by one. Basically find an iphone that has bluetooth in hidden mode.</p>
  
  <p>I am confused why the script errors out like that. What can I do to prevent this error in the future?</p>
  
  <p>Here is the script below:</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf-8 -*-
  
  from scapy.all import *
  from bluetooth import *
  
  
  def retBtAddr(addr):
      btAddr=str(hex(int(addr.replace(':', ''), 16) + 1))[2:]
      btAddr=btAddr[0:2]+":"+btAddr[2:4]+":"+btAddr[4:6]+":"+\
      btAddr[6:8]+":"+btAddr[8:10]+":"+btAddr[10:12]
      return btAddr
  
  def checkBluetooth(btAddr):
      btName = lookup_name(btAddr)
      if btName:
          print '[+] Detected Bluetooth Device: ' + btName
      else:
          print '[-] Failed to Detect Bluetooth Device.'
  
  
  def wifiPrint(pkt):
      iPhone_OUI = 'd0:23:db'
      if pkt.haslayer(Dot11):
          wifiMAC = pkt.getlayer(Dot11).addr2
          if iPhone_OUI == wifiMAC[:8]:
              print '[*] Detected iPhone MAC: ' + wifiMAC
              btAddr = retBtAddr(wifiMAC)
              print '[+] Testing Bluetooth MAC: ' + btAddr
              checkBluetooth(btAddr)
  
  
  conf.iface = 'wlan1mon'
  sniff(prn=wifiPrint)
  </code></pre>
  
  <p>Error message i receive:</p>
  
  <pre><code>sudo python 10-iphoneFinder.py
  Traceback (most recent call last):
    File "10-iphoneFinder.py", line 34, in &lt;module&gt;
      sniff(prn=wifiPrint)
    File "/home/rb/.local/lib/python2.7/site-packages/scapy/sendrecv.py", line 620, in sniff
      r = prn(p)
    File "10-iphoneFinder.py", line 26, in wifiPrint
      if iPhone_OUI == wifiMAC[:8]:
  TypeError: 'NoneType' object has no attribute '__getitem__'
  </code></pre>