Skip to content

Timestamp not decoded ("\\c:1628097600") #235

@andyvan-trabus

Description

@andyvan-trabus

I'm seeing quite a few lines that have the timestamp ("\c:") present, but with an extra backslash. I'm not familiar enough with the standard to know whether this is valid or not, but I'm seeing thousands of them in a 10-minute capture.

This is the original line:
\s:r1ACE0JVF*27\\c:1628097600,s:AS-SAM-BWBANK,n:27493*24\!ANVDM,1,1,,B,15N7R>d000qh6tJC94n=7oJ00D02,0*3F

Here's a test case:

from ais import tag_block

TEST_MESSAGES = ['\\s:r1ACE0JVF*27\\\\c:1628097600,s:AS-SAM-BWBANK,n:27493*24\\!ANVDM,1,1,,B,15N7R>d000qh6tJC94n=7oJ00D02,0*3F']

queue = tag_block.TagQueue()

for line_no, line in enumerate(TEST_MESSAGES):
    queue.put(line, line_no)

msg = queue.get()
if msg['times'][0] is None:
    print('No timestamp deciphered')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions