Update interrogator() in allcall.py (#86)

This commit is contained in:
Flyer350 2020-11-26 10:35:16 +01:00 committed by GitHub
parent 436e9ce2c8
commit d16484bf72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,8 +42,15 @@ def interrogator(msg):
int: interrogator identifier code int: interrogator identifier code
""" """
# simply the CRC reminder # the CRC remainder contains the CL and IC field. top three bits are CL field and last four bits are IC field.
return common.crc(msg) remainder = common.crc(msg)
if remainder > 79:
IC = "corrupt IC"
elif remainder < 16:
IC="II"+str(remainder)
else:
IC="SI"+str(remainder-16)
return IC
@_checkdf @_checkdf