@@ -169,9 +169,15 @@ def disconnect(self):
169
169
self .ser .close ()
170
170
171
171
172
- def tinySA_serial (self , writebyte , printBool = False ):
172
+ def tinySA_serial (self , writebyte , printBool = False , pts = None ):
173
173
# write out to serial, get message back, clean up, return
174
174
175
+ # clear INPUT buffer
176
+ self .ser .reset_input_buffer ()
177
+ # clear OUTPUT buffer
178
+ self .ser .reset_output_buffer ()
179
+
180
+
175
181
self .ser .write (bytes (writebyte , 'utf-8' ))
176
182
msgbytes = self .get_serial_return ()
177
183
msgbytes = self .clean_return (msgbytes )
@@ -208,8 +214,11 @@ def get_serial_return(self):
208
214
209
215
return bytearray (complete )
210
216
217
+ def scan_raw_get_serial (self , pts ):
218
+ pass
211
219
212
- def read_until_end_marker (self , end_marker = b'}' , timeout = 5.0 ):
220
+
221
+ def read_until_end_marker (self , end_marker = b'}' , timeout = 10.0 ):
213
222
# scan and scan raw might return early with tinySA_serial
214
223
# so this is written to
215
224
import time
@@ -1462,7 +1471,7 @@ def scan_raw(self, start, stop, pts=250, unbuf=1):
1462
1471
1463
1472
# write out to serial, get message back, clean up, return
1464
1473
self .print_message ("scanning..." )
1465
- msgbytes = self .tinySA_serial (writebyte , printBool = False )
1474
+ msgbytes = self .tinySA_serial (writebyte , printBool = False , pts = pts ) #pts added for error checking
1466
1475
return msgbytes
1467
1476
else :
1468
1477
self .print_message ("ERROR: unrecognized UBUF for scanraw" )
0 commit comments