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

Added configurable minor version number. #546

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidv1992
Copy link
Member

No description provided.

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 99.23664% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.46%. Comparing base (6d7cf64) to head (127013a).

Files with missing lines Patch % Lines
statime-linux/src/config/mod.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #546      +/-   ##
==========================================
+ Coverage   62.20%   62.46%   +0.26%     
==========================================
  Files          63       63              
  Lines        8225     8288      +63     
==========================================
+ Hits         5116     5177      +61     
- Misses       3109     3111       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// Notes:
// Fields specific for delay mechanism are kept as part of [DelayMechanism].
// Version is always 2.1, so not stored (versionNumber, minorVersionNumber)
// Major version is always 2.1, so not stored (versionNumber)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Major version is always 2.1, so not stored (versionNumber)
// Major version is always 2, so not stored (versionNumber)

@@ -64,6 +64,8 @@ pub struct PortConfig {
pub delay_mechanism: DelayType,
#[serde(default = "default_delay_interval")]
pub delay_interval: i8,
#[serde(default = "default_minor_ptp_version")]
pub minor_ptp_version: u8,
Copy link
Member

Choose a reason for hiding this comment

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

I guess this technically right now allows you to specify version 2.255, which feels like something we really shouldn't allow. Maybe use an enum MinorVersion { Zero, One } with a From<MinorVersion> for u8, TryFrom<u8> for MinorVersion and equivalent serde implementations?

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