File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def get_data(self):
5353 Gets the raw data from the PTC and returns it in a usable format.
5454 """
5555 self .send (self .buildRegistersQuery ())
56- data = self .recv ()
56+ data = self .recv (1024 )
5757 data_flag , brd = self .breakdownReplyData (data )
5858
5959 return data_flag , brd
Original file line number Diff line number Diff line change @@ -123,13 +123,18 @@ def _check_ready(self):
123123 if not sel .select (self .timeout ):
124124 raise ConnectionError ("Socket not ready to read. Possible timeout." )
125125
126- def recv (self ):
126+ def recv (self , bufsize = 4096 ):
127127 """Receive response from the device.
128128
129129 This method will check if the socket is ready to be read from before
130130 performing the recv. If there is no data to read, or the socket is
131131 otherwise unready an exception is raised.
132132
133+ Parameters
134+ ----------
135+ bufsize : int
136+ Amount of data to be recieved in bytes. Defaults to 4096.
137+
133138 Returns
134139 -------
135140 ``str`` or ``bytes``
@@ -143,7 +148,7 @@ def recv(self):
143148
144149 """
145150 self ._check_ready ()
146- data = self .comm .recv (1024 )
151+ data = self .comm .recv (bufsize )
147152 return data
148153
149154 def __del__ (self ):
You can’t perform that action at this time.
0 commit comments