Skip to content

Commit 6fd46cc

Browse files
committed
Update UBX_Integrity_Checker.py
1 parent 128465e commit 6fd46cc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Utils/UBX_Integrity_Checker.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,13 @@ def crc24q(byte, sum):
270270
if (c == 0xB5): # Have we found Sync Char 1 (0xB5) if we were expecting one?
271271
if (ubx_nmea_state == sync_lost):
272272
print("UBX Sync Char 1 (0xB5) found at byte "+str(processed))
273+
print()
273274
ubx_nmea_state = looking_for_62 # Now look for Sync Char 2 (0x62)
274275
message_start_byte = processed # Record the message start byte for resync reporting
275276
elif (c == 0x24) and (containsNMEA == True): # Have we found an NMEA '$' if we were expecting one?
276277
if (ubx_nmea_state == sync_lost):
277278
print("NMEA $ found at byte "+str(processed))
279+
print()
278280
ubx_nmea_state = looking_for_asterix # Now keep going until we receive an asterix
279281
nmea_length = 0 # Reset nmea_length then use it to check for excessive message length
280282
nmea_csum = 0 # Reset the nmea_csum. Update it as each character arrives
@@ -290,6 +292,7 @@ def crc24q(byte, sum):
290292
elif (c == 0xD3) and (containsRTCM == True): # Have we found 0xD3 if we were expecting one?
291293
if (ubx_nmea_state == sync_lost):
292294
print("RTCM 0xD3 found at byte "+str(processed))
295+
print()
293296
ubx_nmea_state = looking_for_RTCM_len1 # Now keep going until we receive the checksum
294297
rtcm_expected_csum = 0 # Reset the RTCM csum with a seed of 0. Update it as each character arrives
295298
rtcm_expected_csum = crc24q(c, rtcm_expected_csum) # Update expected checksum
@@ -298,8 +301,10 @@ def crc24q(byte, sum):
298301
#print("Was expecting Sync Char 0xB5, NMEA $ or RTCM 0xD3 but did not receive one!")
299302
if (c == 0x24):
300303
print("Warning: * found at byte "+str(processed)+"! Are you sure this file does not contain NMEA messages?")
304+
print()
301305
if (c == 0xD3):
302306
print("Warning: 0xD3 found at byte "+str(processed)+"! Are you sure this file does not contain RTCM messages?")
307+
print()
303308
sync_lost_at = processed
304309
ubx_nmea_state = sync_lost
305310

@@ -312,6 +317,7 @@ def crc24q(byte, sum):
312317
else:
313318
print("Panic!! Was expecting Sync Char 2 (0x62) but did not receive one!")
314319
print("Sync lost at byte "+str(processed)+". Attemting to re-sync")
320+
print()
315321
sync_lost_at = processed
316322
resync_in_progress = True
317323
ubx_nmea_state = sync_lost
@@ -355,6 +361,7 @@ def crc24q(byte, sum):
355361
if ((ubx_expected_checksum_A != ubx_checksum_A) or (ubx_expected_checksum_B != ubx_checksum_B)):
356362
print("Panic!! UBX checksum error!")
357363
print("Sync lost at byte "+str(processed)+". Attemting to re-sync.")
364+
print()
358365
sync_lost_at = processed
359366
resync_in_progress = True
360367
ubx_nmea_state = sync_lost
@@ -393,6 +400,7 @@ def crc24q(byte, sum):
393400
if (nmea_length > max_nmea_len): # If the length is greater than max_nmea_len, something bad must have happened (sync_lost)
394401
print("Panic!! Excessive NMEA message length!")
395402
print("Sync lost at byte "+str(processed)+". Attemting to re-sync")
403+
print()
396404
sync_lost_at = processed
397405
resync_in_progress = True
398406
ubx_nmea_state = sync_lost
@@ -447,6 +455,7 @@ def crc24q(byte, sum):
447455
# The checksum does not match so sync_lost
448456
print("Panic!! NMEA checksum error!")
449457
print("Sync lost at byte "+str(processed)+". Attemting to re-sync")
458+
print()
450459
sync_lost_at = processed
451460
resync_in_progress = True
452461
ubx_nmea_state = sync_lost
@@ -461,6 +470,7 @@ def crc24q(byte, sum):
461470
if (c != 0x0D):
462471
print("Panic!! NMEA CR not found!")
463472
print("Sync lost at byte "+str(processed)+". Attemting to re-sync")
473+
print()
464474
sync_lost_at = processed
465475
resync_in_progress = True
466476
ubx_nmea_state = sync_lost
@@ -474,6 +484,7 @@ def crc24q(byte, sum):
474484
if (c != 0x0A):
475485
print("Panic!! NMEA LF not found!")
476486
print("Sync lost at byte "+str(processed)+". Attemting to re-sync")
487+
print()
477488
sync_lost_at = processed
478489
resync_in_progress = True
479490
ubx_nmea_state = sync_lost
@@ -572,6 +583,7 @@ def crc24q(byte, sum):
572583
if (rtcm_expected_csum != rtcm_actual_csum):
573584
print("Panic!! RTCM checksum error!")
574585
print("Sync lost at byte "+str(processed)+". Attemting to re-sync.")
586+
print()
575587
sync_lost_at = processed
576588
resync_in_progress = True
577589
ubx_nmea_state = sync_lost
@@ -617,6 +629,7 @@ def crc24q(byte, sum):
617629
keepGoing = False
618630
else:
619631
print("Sync has been lost. Currently processing byte "+str(processed)+". Rewinding to byte "+str(rewind_to))
632+
print()
620633
fi.seek(rewind_to) # Rewind the file
621634
processed = rewind_to - 1 # Rewind processed too! (-1 is needed as processed is incremented at the start of the loop)
622635
rewind_in_progress = True # Flag that a rewind is in progress

0 commit comments

Comments
 (0)