(self, address=None)
Use the 'bluetoothctl' program to erase a stored BLE bond.
Use the 'bluetoothctl' program to erase a stored BLE bond.
Use the bluetoothctl program to erase a stored BLE bond .
def clear_bond(self, address=None):
        """Use the 'bluetoothctl' program to erase a stored BLE bond.
        """
        con = pexpect.spawn('bluetoothctl')

        try:
            con.expect("bluetooth", timeout=1)
            log.info("Clearing bond for %s", address)
            con.sendline("remove " + address.upper())
            con.expect(
                ["Device has been removed", "# "],
                timeout=.5
            )
        except pexpect.TIMEOUT:
            log.error("Unable to remove bonds for %s: %s",
                      address, con.before)
        finally:
            con.close(True)
        log.info("Removed bonds for %s", address)
def clear_bond ( self , address = None ) : con = pexpect . spawn ( 'bluetoothctl' ) try : con . expect ( "bluetooth" , timeout = 1 ) log . info ( "Clearing bond for %s" , address ) con . sendline ( "remove " + address . upper ( ) ) con . expect ( [ "Device has been removed" , "# " ] , timeout = .5 ) except pexpect . TIMEOUT : log . error ( "Unable to remove bonds for %s: %s" , address , con . before ) finally : con . close ( True ) log . info ( "Removed bonds for %s" , address )