Dave Marples
e7f740afe3
Minimal change to allow support of HID descriptors
3 years ago
Mike Walters
10b2b79b0a
descriptors: pass descriptor collection to ConfigurationDescriptorEmitter
This allows for downstream descriptor emitters to add indexed strings.
fixes #15
3 years ago
Hans Baier
87eb88c6c7
add MIDI Streaming Descriptors
3 years ago
Hans Baier
b38334f69b
implement useable subset of USB Audio Class 2.0
4 years ago
Mikaela Szekely
429c9107f2
rename construct.py to fix unittest imports
4 years ago
Katherine Temkin
c10346f2ce
usb3: add some SuperSpeed BOS device capability descriptors
4 years ago
Mikaela Szekely
bb33d2d73a
descriptors: add types.descriptors.partial for parsing potentially incomplete data
This re-allows parsing partial descriptors, which had previously been allowed until
7672fb5221
.
4 years ago
Katherine Temkin
928e5db008
descriptors: extend to include some SuperSpeed content
4 years ago
Katherine Temkin
0f73adcf84
types.usb3: fix flipped LUP/LDN (never trust a book)
4 years ago
Katherine Temkin
01eda94156
types: add basic SuperSpeed types
4 years ago
Mikaela Szekely
59759a3af2
emitters: restore default bLength for endpoint descriptors
a0ceb18c89
broke this.
4 years ago
Mikaela Szekely
d054152893
types.descriptors: handle Audio 1.0 endpoint descriptors
4 years ago
Mikaela Szekely
874f1dc892
emitters: allow endpoint-less configurations
4 years ago
Josh Koike
4a660f83ce
Change descriptor_type default check
4 years ago
Josh Koike
45b7a894fa
Move descriptor_type argument to avoid API breakage
4 years ago
Josh Koike
f292dc9f86
Fix typo in `add_report_raw`
4 years ago
Josh Koike
bbc5f67a73
Fix some missed refactoring
4 years ago
Josh Koike
9e10dbddde
Add documentation to HID descriptor emitter
4 years ago
Josh Koike
8417f3684c
Add add_report_raw method to append raw items/bytes-likes to HID descriptor
4 years ago
Josh Koike
cbe13dd19b
Change report_enum -> report_prefix to clarify purpose
Change report_enum argument to report_prefix to clarify that it should
be a usb_protocol.types.descriptors.hid.HIDPrefix enum element.
4 years ago
Josh Koike
2db2205324
Change HIDPrefixes -> HIDPrefix
De-plural-ify HIDPrefixes to match common Enum naming conventions
4 years ago
Josh Koike
2e7f95f858
Rename to clarify HIDDescriptor report item methods
Renamed to clarify that the HIDDescriptor convenience functions add
report items, not full reports.
4 years ago
Josh Koike
cef2b8b83a
Add HID descriptors
4 years ago
Katherine Temkin
26c9cf0e01
types,emitters: add basic CDC-ACM descriptors and emitters
4 years ago
dokthar
1d1408cb49
fix BCD fields encoding
For some case the encode function was raising AssertionError despite
the BCD value beeing correct (in this case it was 1.11).
There is two main modification in the version I propose:
First the added rounding before converting the "percent" to an integer.
This may seems odd but it is actually to "correct" the error introduce
by the multiplication.
Second the comparison is done "after" conversion by recreating the
floating point value from the integer and percent variables. This is to
make sure that the value in the descriptor is the same as intended.
I've made sure that all correct values (that can be stored in bcd fields)
doesn't raise an error when passed to the encode function.
I've used the following program to test the new implementation:
```
for obj in [float(f"{i:02}.{p:02}") for i in range(100) for p in range(100)]:
integer = int(obj) % 100
percent = int(round(obj * 100)) % 100
if float(f"{integer:02}.{percent:02}") != obj:
print (f"BCD conversion error: {integer:02}.{percent:02} != {obj}")
```
4 years ago
dokthar
a922fe07f9
emitters: add test for automatic language descriptor
4 years ago
dokthar
5b9c2e6656
emitters: fix for automatic language descriptors
4 years ago
Kate Temkin
9634fc940b
emitters: add support for language string descriptors
4 years ago
Kate Temkin
21ba0397f7
fix issues with descriptor length field & make emitters easier to access
4 years ago
Kate Temkin
4f26131509
add examples
4 years ago
Kate Temkin
7672fb5221
add complex emitters for building USB descriptors
4 years ago
Kate Temkin
708f838dc1
commit first working code, with descriptor parsers/emitters
4 years ago