pySerial no longer has a flushInput() function

It is now called reset_input_buffer()

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2016-01-20 13:10:10 -05:00
parent 645a89bb09
commit ff381ba87c
2 changed files with 2 additions and 2 deletions

View File

@ -152,8 +152,8 @@ import serial
RFID_SERIAL = serial.Serial(RFID_PATH, 2400, timeout=1)
def read_key():
RFID_SERIAL.reset_input_buffer() # Clear input buffer before reading
string = RFID_SERIAL.read(12)
RFID_SERIAL.flushInput() # ignore errors, no data
if len(string) > 0:
key = string[1:11].decode() #exclude start x0A and stop x0D bytes
if key.isalnum():

View File

@ -36,5 +36,5 @@ class Serial:
return "".encode()
raise Exception("Test Serial Exception")
def flushInput(self):
def reset_input_buffer():
pass