rfkill.py 文件源码

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

项目:PyRIC 作者: wraith-wireless 项目源码 文件源码
def rfkill_unblock(idx):
    """
     unblocks the device at index
     :param idx: rkill index
    """
    if not os.path.exists(os.path.join(spath, "rfkill{0}".format(idx))):
        raise pyric.error(errno.ENODEV, "No device at {0}".format(idx))
    fout = None
    try:
        rfke = rfkh.rfkill_event(idx,rfkh.RFKILL_TYPE_ALL,rfkh.RFKILL_OP_CHANGE,0,0)
        fout = open(dpath, 'w')
        fout.write(rfke)
    except struct.error as e:
        raise pyric.error(pyric.EUNDEF,"Error packing rfkill event {0}".format(e))
    except IOError as e:
        raise pyric.error(e.errno,e.message)
    finally:
        if fout: fout.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号