Skip to content

Commit

Permalink
handle structured and unstructured type 26 messages correctly (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
M0r13n authored Jun 17, 2023
1 parent e9f7834 commit fad9823
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
====================
pyais CHANGELOG
====================
-------------------------------------------------------------------------------
Version 2.5.5 16 Jun 2023
-------------------------------------------------------------------------------
* bug fix: incorrect logic for type 26 messages
* closes https://github.com/M0r13n/pyais/issues/116

-------------------------------------------------------------------------------
Version 2.5.4 30 May 2023
-------------------------------------------------------------------------------
* bug fix: the streaming classes previously prepended partial lines to subsequent lines

-------------------------------------------------------------------------------
Version 2.5.3 27 May 2023
-------------------------------------------------------------------------------
* bug fix: the streaming classes now handle universal line breaks
* user reported issues while receiving AIS messages through a socket
* pyais assumed that lines are always terminated with CRLF
* now pyais supports both CRLF as well as LF as line breaks

-------------------------------------------------------------------------------
Version 2.5.2 04 Mar 2023
-------------------------------------------------------------------------------
* closes https://github.com/M0r13n/pyais/issues/100
* updated Aid to Navigation dict (NavAid)

-------------------------------------------------------------------------------
Version 2.5.1 26 Feb 2023
-------------------------------------------------------------------------------
* closes https://github.com/M0r13n/pyais/issues/107
* fixes a rounding error for lat/lon values

-------------------------------------------------------------------------------
Version 2.5.0 14 Jan 2023
-------------------------------------------------------------------------------
* introduce `AISracker` class
* adds the ability to collect and maintain the state of individual vessels over time
* closes https://github.com/M0r13n/pyais/pull/103
* allows tag blocks to contain multiple : in field data

-------------------------------------------------------------------------------
Version 2.4.0 21 Dec 2022
-------------------------------------------------------------------------------
* supports optional tag blocks for NMEA messages

-------------------------------------------------------------------------------
Version 2.3.1 17 Dec 2022
-------------------------------------------------------------------------------
Expand All @@ -42,34 +54,40 @@
* boolean value that defaults to `False`
* marks fields as variable in length (width)
* used by the encoder to decide whether to add trailing `@`s as padding

-------------------------------------------------------------------------------
Version 2.3.0 11 Dec 2022
-------------------------------------------------------------------------------
* closes https://github.com/M0r13n/pyais/issues/91
* supports Gatehouse wrappers used to add extra information
* renames `NMEAMessage` to `NMEASentence`

-------------------------------------------------------------------------------
Version 2.2.4 11 Nov 2022
-------------------------------------------------------------------------------
* ignores `NonPrintableCharacterException` exceptions when using stream readers
* such messages are simply skipped

-------------------------------------------------------------------------------
Version 2.2.3 04 Nov 2022
-------------------------------------------------------------------------------
* Closes https://github.com/M0r13n/pyais/issues/88
* make the decoder more liberal by not raising an exception when the payload contains special characters
* replace the `ValueError` with a `NonPrintableCharacterException` in case that non printable characters are passed to the decode funtion
* replace the `ValueError` with a `NonPrintableCharacterException` in case that non printable characters are passed to the decode function

-------------------------------------------------------------------------------
Version 2.2.2 13 Oct 2022
-------------------------------------------------------------------------------
* Closes https://github.com/M0r13n/pyais/issues/86
* ensure that the payload is always identical - even for multiple encode/decode roundtrips
* the `turn` field can now never be `None` and is instead an instance of the newly created `TurnRate` enum

-------------------------------------------------------------------------------
Version 2.2.1 03 Oct 2022
-------------------------------------------------------------------------------
* Closes https://github.com/M0r13n/pyais/issues/81
* ensure that the NMEA sentence length does not exceed 82 characters

-------------------------------------------------------------------------------
Version 2.2.0 02 Oct 2022
-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyais/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pyais.tracker import AISTracker, AISTrack

__license__ = 'MIT'
__version__ = '2.5.4'
__version__ = '2.5.5'
__author__ = 'Leon Morten Richter'

__all__ = (
Expand Down
4 changes: 2 additions & 2 deletions pyais/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1617,10 +1617,10 @@ def create(cls, **kwargs: typing.Union[str, float, int, bool, bytes]) -> "ANY_ME
if structured:
return MessageType26AddressedStructured.create(**kwargs)
else:
return MessageType26BroadcastStructured.create(**kwargs)
return MessageType26AddressedUnstructured.create(**kwargs)
else:
if structured:
return MessageType26AddressedUnstructured.create(**kwargs)
return MessageType26AddressedStructured.create(**kwargs)
else:
return MessageType26BroadcastUnstructured.create(**kwargs)

Expand Down

0 comments on commit fad9823

Please sign in to comment.