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()
评论列表
文章目录