Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andyvan-trabus opened this issue Sep 23, 2021 · 1 comment
Open

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

andyvan-trabus opened this issue Sep 23, 2021 · 1 comment

Comments

@andyvan-trabus
Copy link
Contributor

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')
@andyvan-trabus
Copy link
Contributor Author

Hmm, this is probably NOT an error, the message TAG block looks invalid to me. It looks like "\c:" should be ",\c:". There's no comma at all. The backslash is allowed, but two of them are not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant