0
에 LED OFF_HOOK (는 0x17)를 보내 pywinusb 아래에 pywinusb-0.3 예제 "simple send"를 사용하여 "LED OFF_HOOK = 0x17"을 보내십시오. 그러나 "대상 장치를 찾았지만 요청한 사용법이 없습니다!"라는 오류 메시지가 나타납니다. 나는 어떤 도움을 appriciate 것이다. 감사합니다나는 다음과 같은 정의가 한 HID
import pywinusb.hid as hid
def click_signal(target_usage, target_vendor_id):
all_devices = hid.HidDeviceFilter(vendor_id = target_vendor_id).get_devices()
if not all_devices:
print("Can't find target device (vendor_id = 0x%04x)!" % target_vendor_id)
else:
for device in all_devices:
try:
device.open()
DD = device.find_output_reports()
for report in DD:
c = target_usage in report
if target_usage in report:
report[target_usage] = 1 # yes, changing values is that easy
report.send()
report[target_usage] = 0
report.send()
print("\nUsage clicked!\n")
return
finally:
device.close()
print("The target device was found, but the requested usage does not exist!\n")
#
if __name__ == '__main__':
target_vendor_id = 0x1395 # just an example, change it to the actual vendor_id
target_usage = hid.get_full_usage_id(0x0B, 0x17) # generic vendor page, usage_id = 2
click_signal(target_usage, target_vendor_id)