File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def get_data(self):
53
53
Gets the raw data from the PTC and returns it in a usable format.
54
54
"""
55
55
self .send (self .buildRegistersQuery ())
56
- data = self .recv ()
56
+ data = self .recv (1024 )
57
57
data_flag , brd = self .breakdownReplyData (data )
58
58
59
59
return data_flag , brd
Original file line number Diff line number Diff line change @@ -123,13 +123,18 @@ def _check_ready(self):
123
123
if not sel .select (self .timeout ):
124
124
raise ConnectionError ("Socket not ready to read. Possible timeout." )
125
125
126
- def recv (self ):
126
+ def recv (self , bufsize = 4096 ):
127
127
"""Receive response from the device.
128
128
129
129
This method will check if the socket is ready to be read from before
130
130
performing the recv. If there is no data to read, or the socket is
131
131
otherwise unready an exception is raised.
132
132
133
+ Parameters
134
+ ----------
135
+ bufsize : int
136
+ Amount of data to be recieved in bytes. Defaults to 4096.
137
+
133
138
Returns
134
139
-------
135
140
``str`` or ``bytes``
@@ -143,7 +148,7 @@ def recv(self):
143
148
144
149
"""
145
150
self ._check_ready ()
146
- data = self .comm .recv (1024 )
151
+ data = self .comm .recv (bufsize )
147
152
return data
148
153
149
154
def __del__ (self ):
You can’t perform that action at this time.
0 commit comments