diff --git a/pyModeS/decoder/allcall.py b/pyModeS/decoder/allcall.py index 5f352f4..05ef31c 100644 --- a/pyModeS/decoder/allcall.py +++ b/pyModeS/decoder/allcall.py @@ -42,8 +42,15 @@ def interrogator(msg): int: interrogator identifier code """ - # simply the CRC reminder - return common.crc(msg) + # the CRC remainder contains the CL and IC field. top three bits are CL field and last four bits are IC field. + 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