Skip to content

Commit

Permalink
Allow supported_languages = None
Browse files Browse the repository at this point in the history
This replies to LANGID (string descriptor zero) requests with a stall
which is appropriate for devices that do not implement string
descriptors.

The spec specifically says "USB devices that omit all string descriptors
must not return an array of LANGID codes." Whether that is a stall or an
empty LANGID array appears to be open to interpretation. With this
change we can either stall (with None) or return an empty array (with an
empty tuple).
  • Loading branch information
mossmann committed Aug 25, 2024
1 parent 6d1b1d1 commit f4be389
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion facedancer/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,10 @@ def get_configuration_descriptor(self, index: int) -> bytes:


def handle_get_supported_languages_descriptor(self) -> bytes:
""" Returns the special string-descriptor-zero that indicates which languages are supported. """
"""Return the special string-descriptor-zero that indicates which languages are supported."""

if self.supported_languages is None:
return None

# Our string descriptor is going to have two header bytes, plus two bytes
# for each language.
Expand Down

0 comments on commit f4be389

Please sign in to comment.