I am trying to copy the behaviour of a software which control a device using HID interface, the work flow is send an idle request then send a bunch of data to the device, I can send the data, but I don't know how to send the idle request. I found the HID document online and saw this and I can find similar question using Pyusb, but I can't use Pyusb due to the driver issue.
import pywinusb.hid as HID
import time
import datetime
v_id = 0x047a
p_id = 0x1004
i=0
count_line=0
data_2_list=[]
all_devices = HID.HidDeviceFilter(vendor_id = v_id).get_devices()
target_usage = HID.get_full_usage_id(0xFF00, 0x01)
print(all_devices)
device = all_devices[0]
device.open()
data=[0]*64
# print(data)
my_file=open("demofile2.txt","r")
data_lines=my_file.readlines()
for data_line in data_lines:
count_line+=1
data=data_line.replace("\n","")
data_2_str_list=data.split(",")
while i<len(data_2_str_list):
data_2_list.append(int(data_2_str_list[i],16))
i+=1
print(data_2_list)
device.send_output_report(data_2_list)
time.sleep(0.05)
print(count_line)
Is there a way to send Idle request using pywinusb?