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