M0r13n / pyais

AIS message decoding and encoding in Python (AIVDM/AIVDO)
MIT License
176 stars 61 forks source link

Message Type 26 Logic may be incorrect #116

Closed bgercken closed 1 year ago

bgercken commented 1 year ago

Working on some code with Message Type 26 and noticed the logic in pyais/messages.py create method around lines 1620 and 1623 and in the from_bitarray method around lines 1636 and 1639 may be incorrect.

       if addressed:
            if structured:
                return MessageType26AddressedStructured.create(**kwargs) 
            else:
                return MessageType26BroadcastStructured.create(**kwargs)    # << Should be AddressedUnstructured
        else:
            if structured:
                return MessageType26AddressedUnstructured.create(**kwargs)  # << Should be BroadcastStructured 
            else:
                return MessageType26BroadcastUnstructured.create(**kwargs)

Thanks.

M0r13n commented 1 year ago

@bgercken Hey,

thanks for your report. I think, that you are right. I will fix this as soon as time allows!

Have a great day!

M0r13n commented 1 year ago

@bgercken I fixed this bug. Will be available in version 2.5.5 in the next couple of minutes.

Have a great day!