gatttool.py 文件源码

python
阅读 94 收藏 0 点赞 0 评论 0

项目:nukiPyBridge 作者: jandebeule 项目源码 文件源码
def clear_bond(self, address=None):
        """Use the 'bluetoothctl' program to erase a stored BLE bond.
        """
        con = pexpect.spawn('sudo bluetoothctl')
        con.expect("bluetooth", timeout=1)

        log.info("Clearing bond for %s", address)
        con.sendline("remove " + address.upper())
        try:
            con.expect(
                ["Device has been removed", "# "],
                timeout=.5
            )
        except pexpect.TIMEOUT:
            log.error("Unable to remove bonds for %s: %s",
                      address, con.before)
        log.info("Removed bonds for %s", address)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号