forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix sending WinUSB Extended Properties Feature Descriptor
- Loading branch information
1 parent
d70f43b
commit 8580773
Showing
2 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
from panda import Panda | ||
from hexdump import hexdump | ||
|
||
DEBUG = False | ||
|
||
if __name__ == "__main__": | ||
p = Panda() | ||
|
||
len = p._handle.controlRead(Panda.REQUEST_IN, 0x06, 3 << 8 | 238, 0, 1) | ||
print 'Microsoft OS String Descriptor' | ||
dat = p._handle.controlRead(Panda.REQUEST_IN, 0x06, 3 << 8 | 238, 0, len[0]) | ||
if DEBUG: print 'LEN: {}'.format(hex(len[0])) | ||
hexdump("".join(map(chr, dat))) | ||
|
||
ms_vendor_code = dat[16] | ||
if DEBUG: print 'MS_VENDOR_CODE: {}'.format(hex(len[0])) | ||
|
||
print '\nMicrosoft Compatible ID Feature Descriptor' | ||
len = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 4, 1) | ||
if DEBUG: print 'LEN: {}'.format(hex(len[0])) | ||
dat = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 4, len[0]) | ||
hexdump("".join(map(chr, dat))) | ||
|
||
print '\nMicrosoft Extended Properties Feature Descriptor' | ||
len = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 5, 1) | ||
if DEBUG: print 'LEN: {}'.format(hex(len[0])) | ||
dat = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 5, len[0]) | ||
hexdump("".join(map(chr, dat))) |