Last active
June 23, 2024 17:08
-
-
Save endes0/e802a8a35fdf1fc27abf5db21e3a396b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hid | |
d = hid.Device(0x046d, 0x0acb) | |
# Enter bootloader | |
d.send_feature_report(bytes([6,1,3,0,0,0,0,0,0])) | |
assert d.read(8) == bytes([6,90,0,0,0,0,0,0,0]) # check ack | |
# Start scanning | |
d.send_feature_report(bytes([6,4,3,7,80,65,14,4,2,240,1])) | |
assert d.read(8) == bytes([6,90,0,0,0,0,0,0,0]) # check ack | |
# Get results | |
while True: | |
data = d.get_feature_report(6, 64) | |
#TODO: process data | |
# Stop scanning | |
d.send_feature_report(bytes([6,4,3,7,80,65,14,4,2,240,0])) | |
assert d.read(8) == bytes([6,90,0,0,0,0,0,0,0]) # check ack | |
# Exit Bootloader | |
d.send_feature_report(bytes([6,8,3,0,0,0,0,0,0])) | |
assert d.read(8) == bytes([6,90,0,0,0,0,0,0,0]) # check ack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment