projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stall when a descriptor is requested for which we have no data
[goodfet]
/
client
/
USBDevice.py
diff --git
a/client/USBDevice.py
b/client/USBDevice.py
index
49ba0a4
..
4a2ba13
100644
(file)
--- a/
client/USBDevice.py
+++ b/
client/USBDevice.py
@@
-223,8
+223,7
@@
class USBDevice:
+ "language 0x%04x, length %d") \
% (dtype, dindex, lang, n))
+ "language 0x%04x, length %d") \
% (dtype, dindex, lang, n))
- # TODO: handle KeyError
- response = self.descriptors[dtype]
+ response = self.descriptors.get(dtype, None)
if callable(response):
response = response(dindex)
if callable(response):
response = response(dindex)
@@
-236,6
+235,8
@@
class USBDevice:
if self.verbose > 5:
print(self.name, "sent", n, "bytes in response")
if self.verbose > 5:
print(self.name, "sent", n, "bytes in response")
+ else:
+ self.maxusb_app.stall_ep0()
def handle_get_configuration_descriptor_request(self, num):
return self.configurations[num].get_descriptor()
def handle_get_configuration_descriptor_request(self, num):
return self.configurations[num].get_descriptor()