python - pywinusb send a LED OFF_HOOK (0x17) on HID -


I have the following definitions: Telephony device page: 0x0B, telephony headset: 0x05, LED Page: 0x08, LED OFHOK: 0x17

I would like to send "LED OFF_HOOK = 0x17" using the example "Send Simple" example below pywinusb-0.3, but this error "target device was found, but the requested use is not present! " I will appriciate any help thank you

  import pywinusb Hid def as click_signal (target_usage, target_vendor_id): all_devices = hid.HidDeviceFilter (vendor_id = target_vendor_id) .get_devices () if not all_devices: print ("Can not find target device (vendor_id = 0x% 04x)!"% Target_vendor_id ) Other: All_devices for the device: Try: device.open () DD = device.find_output_reports () report in DD: C = target_usage report in the target_usage report: Report [target_usage] = 1 # Yes, changing value That is the easy report.send () report [target_usage] = 0 report.send () print ("\ nUGUSE CLICKED! \ N") Finally return: device.close () ("Target device was found, but requested access is not! \ N") # If __name__ == '__main__': target_vendor_id = 0x1395 # Just one example, this is the actual vendor_id target_usage = hid.get_full_usage_id (0x0B, 0x17) # Generic Vendor Page, use_id = 2 click_signal (target_usage, target_vendor_id)    

LED off_hO OK The host is expected to 'back' the signal for the host.

To change the state, you will need to issue a change in the HOOK_SWITCH usage on the telephony page.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -