Skip to content

Commit

Permalink
Pass fake_timestamp as argument to readSerialData()
Browse files Browse the repository at this point in the history
  • Loading branch information
rzbrk committed Aug 10, 2021
1 parent 8b56d0d commit 802d513
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CalliopEO.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def readSerialUntilEnd(ser):

#waits for SERIAL_START and collects the data received from mini until SERIAL_END is received
#if a timeout is received the return value is False
def readSerialData(ser):
def readSerialData(ser, fake_timestamp=False):
lines = []
#ans = waitSerialStart(ser)
scriptStartTime = datetime.now()
Expand All @@ -164,7 +164,7 @@ def readSerialData(ser):
# Add time stamp to beginning of line (Github issue #45).
# If --fake-timestamp is set, then set the time stamp to
# constant value 2000/01/01-00:00:00.000000
if args.fake_timestamp:
if fake_timestamp == True:
ts = "2000/01/01-00:00:00.000000"
else:
ts = datetime.now().strftime("%Y/%m/%d-%H:%M:%S.%f")
Expand Down Expand Up @@ -366,7 +366,7 @@ def main(args):
sys.exit(13)

print("reading data")
data = readSerialData(ser)
data = readSerialData(ser, args.fake_timestamp)

if data == False:
if count_try_flashing >= MAX_RETRY_FLASHING:
Expand Down

0 comments on commit 802d513

Please sign in to comment.