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

Add nrx (Navtex) sentence #54

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

apidemy
Copy link

@apidemy apidemy commented Apr 7, 2023

NRX (Navtex) sentence added

@mariokonrad
Copy link
Owner

Thanks for the PR. I'm currently quite busy, I will have a look as soon as time allows.

@apidemy
Copy link
Author

apidemy commented May 7, 2023

Hello Mario,

Were you able to set free time to take a look at my pull request?

@mariokonrad
Copy link
Owner

Next week I will be able to.

Copy link
Owner

@mariokonrad mariokonrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First things first, thank you for the PR. In general it looks nice, you kept consistence mostly to existing code.

Besides the findings in the review (code suggestions), which are mostly about consistency, there are some issues I'd like to address:

  • In general, members are do not have a prefix m_, but a suffix of _, please honor consistency.
  • Generally, the library tries to prevent misuse. However, the member function nrx:::set_message() does not . It allows the user to set an arbitrary string to be set, which can cause the sentence to be more than maximum sentence characters long. This should be prevented.
  • The individual parsing tests should be done in one test, looping over a container of sentences.
  • Looking around the internet, there seems to be that the same NRX sentence to be passed around, sometimes even with wrong checksums, caused by the hex number encodings. This seems to be an quite small sample.
  • Since this is a multi-sentence message, similar to VDO/VDM messages, what are you're thoughts about handling the overall message? Similar to examples/parse_ais.cpp? This would also be the best place to decode escapes within the message.

include/marnav/nmea/constants.hpp Outdated Show resolved Hide resolved
src/marnav/nmea/string.cpp Outdated Show resolved Hide resolved
test/CMakeLists.txt Outdated Show resolved Hide resolved
include/marnav/nmea/nrx.hpp Outdated Show resolved Hide resolved
include/marnav/nmea/nrx.hpp Outdated Show resolved Hide resolved
include/marnav/nmea/nrx.hpp Outdated Show resolved Hide resolved
src/marnav/nmea/nrx.cpp Outdated Show resolved Hide resolved
include/marnav/nmea/nrx.hpp Outdated Show resolved Hide resolved
include/marnav/nmea/nrx.hpp Outdated Show resolved Hide resolved
void set_total_characters(uint32_t t) noexcept { m_total_characters = t; }
void set_total_bad_characters(uint32_t t) noexcept { m_total_bad_characters = t; }
void set_status(status s) noexcept { m_status = s; }
void set_message(const std::string & m) noexcept { m_message = m; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks incomplete.
The implementation should be in the cpp file. It should not be noexcept, because it should check for max string length.

@apidemy
Copy link
Author

apidemy commented May 25, 2023

Hello Mario,

Thank you for your response. Most of the issues you realized are resolved and pushed. I'll fix the set_message() function by handling special characters. Also, I'll try to make an example usage for NRX like the one in examples/parse_ais.cpp as soon.

Best,

@apidemy
Copy link
Author

apidemy commented Jun 5, 2023

It's been completed I suppose. Would you mind checking it out.
Thanks.

@mariokonrad
Copy link
Owner

Will have a look this week. Thanks!

@apidemy
Copy link
Author

apidemy commented Jun 30, 2023

Hello Mario,

Were you able to set free time to take a look at my pull request?

@apidemy
Copy link
Author

apidemy commented May 2, 2024

Hi there.

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

Successfully merging this pull request may close these issues.

2 participants