Skip to content

Instantly share code, notes, and snippets.

@endes0
Last active June 23, 2024 17:08
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