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

mSlotNumber #88

Open
chumikov2005 opened this issue Oct 31, 2021 · 4 comments
Open

mSlotNumber #88

chumikov2005 opened this issue Oct 31, 2021 · 4 comments
Assignees

Comments

@chumikov2005
Copy link

Hello Peter!

Thanks a lot for your project! This is very interesting to me and I'm trying to figure out in detail how it all works. Please tell me how to calculate the slot number in this line of code:

// To keep things simple, we only start the AIS slot timer if we're on an even second (it has a 37.5 Hz frequency)

mSlotNumber = (mTime.tm_sec % 60) * 2250; // We know what AIS slot number we're in

For example, if the current second is valid 10, then the slot number should be 10 * 37.5 = 375.

But if you substitute the value 10 in your formula (mSlotNumber = (mTime.tm_sec % 60) * 2250), then we get the value of the slot 22500, but this value should not be as the slot numbers are from 0 to 2249. Please help me figure it out.

Thanks!

@peterantypas
Copy link
Owner

This is indeed a bug but it doesn't have real world consequences, that's why it stayed under the radar for so long. The slot number isn't really used anywhere. Nevertheless it is still a bug.

@peterantypas
Copy link
Owner

@chumikov2005 do you want to fix and send a PR?

@peterantypas peterantypas self-assigned this Oct 31, 2021
@chumikov2005
Copy link
Author

chumikov2005 commented Oct 31, 2021 via email

@peterantypas
Copy link
Owner

Correct, but only if the second is even. Do nothing for odd seconds.

peterantypas added a commit that referenced this issue Nov 3, 2021
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

2 participants