Skip to content

Commit d952897

Browse files
committed
Increase read buffer to 512 as suggested by @maresb
1 parent 2e6f712 commit d952897

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/labelle/lib/devices/dymo_labeler.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@ def _send_command(self):
9898
# Send a status request
9999
cmdBin = array.array("B", [ESC, ord("A")])
100100
cmdBin.tofile(self._devout)
101-
# Increase buffer size to 16 bytes to prevent overflow
102-
# on LabelManager 280
103-
# https://libusb.sourceforge.io/api-1.0/libusb_packetoverflow.html
104-
rspBin = self._devin.read(16)
101+
rspBin = self._devin.read(512)
105102
_ = array.array("B", rspBin).tolist()
106103
# Ok, we got a response. Now we can send a chunk of data
107104

@@ -132,7 +129,7 @@ def _send_command(self):
132129
if not self._response:
133130
return None
134131
self._response = False
135-
responseBin = self._devin.read(16)
132+
responseBin = self._devin.read(512)
136133
response = array.array("B", responseBin).tolist()
137134
return response
138135

0 commit comments

Comments
 (0)