wacom: make sure we only return the data packet size we want
If we have more data than our packet [1], let's not return the whole data array. Slice it to size instead. [1] this never happens with the current code, we don't work asynchronously Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
eacc03b6ea
commit
96df9fc416
|
@ -492,7 +492,7 @@ class WacomProtocolLowLevelComm(GObject.Object):
|
|||
if length > len(args):
|
||||
raise WacomException(f'Invalid answer message length: expected {length}, got {len(args)}')
|
||||
self.nordic_answer = self.nordic_answer[length + 2:] # opcode + len
|
||||
return NordicData(answer)
|
||||
return NordicData(answer[:length + 2])
|
||||
|
||||
def wait_nordic_data(self, expected_opcode, timeout=None):
|
||||
if not self.nordic_event.acquire(timeout=timeout):
|
||||
|
|
Loading…
Reference in New Issue