code: def cancel_inquiry (self):
          
          self.names_to_find = {}
  
          if self.is_inquiring:
              try:
                  _bt.hci_send_cmd (self.sock, _bt.OGF_LINK_CTL, \
                          _bt.OCF_INQUIRY_CANCEL)
              except _bt.error as e:
                  self.sock.close ()
                  self.sock = None
                  raise BluetoothError (e.args[0],
                                        "error canceling inquiry: " +
                                        e.args[1])
              self.is_inquiring = False
docs: Call this method to cancel an inquiry in process.  inquiry_complete
          will still be called.