fix(liveSpectrumScan.py): Add encoding fail logic
This commit is contained in:
parent
00cf0936a5
commit
52031b9c36
1 changed files with 9 additions and 2 deletions
|
@ -168,8 +168,9 @@ class SpectrumScan:
|
|||
continue
|
||||
self.__data_dissector(bytestream)
|
||||
except serial.SerialException as e:
|
||||
LOG_ERROR(e)
|
||||
break
|
||||
LOG_WARNING(e)
|
||||
continue
|
||||
|
||||
com.reset_input_buffer()
|
||||
com.reset_output_buffer()
|
||||
com.close()
|
||||
|
@ -233,6 +234,12 @@ class SpectrumScan:
|
|||
self.start_freq = args.freqStart
|
||||
self.end_freq = args.freqEnd
|
||||
|
||||
try:
|
||||
self.device_uart.open()
|
||||
except serial.SerialException as e:
|
||||
LOG_ERROR(e)
|
||||
return
|
||||
|
||||
# Update the initial values with the args values
|
||||
self.delta_freq = int((self.end_freq - self.start_freq) / DEFAULT_STEP_PER_FREQ)
|
||||
self.data_matrix = np.zeros((SCAN_WIDTH, self.delta_freq))
|
||||
|
|
Loading…
Add table
Reference in a new issue