[DRAFT] [Time/Alarm] Split interface and relay logic#748
Draft
williampMSFT wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
Draft
[DRAFT] [Time/Alarm] Split interface and relay logic#748williampMSFT wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
williampMSFT wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Time/Alarm subsystem by separating the public service interface/types from the MCTP relay message/serialization logic, turning the time-alarm service into a pure implementation of the interface while introducing a dedicated relay crate.
Changes:
- Introduce
time-alarm-service-interface(public types +TimeAlarmServicetrait) andtime-alarm-service-relay(MCTP relay request/response + handler wrapper). - Update
time-alarm-serviceto depend on the new interface crate and remove its embedded relay handler implementation. - Relax
Sendrequirements on relay handler futures inembedded-services, and remove UART service’s temporary dependencies on service message crates.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uart-service/Cargo.toml | Removes temporary *-service-messages deps and related feature flags. |
| time-alarm-service/src/lib.rs | Switches to implementing TimeAlarmService and drops in-crate relay handler impl. |
| time-alarm-service/Cargo.toml | Replaces messages dependency with time-alarm-service-interface. |
| time-alarm-service-relay/src/lib.rs | New relay message types + serialization + relay handler wrapper. |
| time-alarm-service-relay/Cargo.toml | New crate manifest for relay layer. |
| time-alarm-service-interface/src/lib.rs | New interface crate defining shared types + TimeAlarmService trait. |
| time-alarm-service-interface/src/acpi_timestamp.rs | Moves ACPI timestamp parsing/encoding into interface crate. |
| time-alarm-service-interface/Cargo.toml | Renames messages crate into interface crate; trims deps/features. |
| embedded-service/src/relay/mod.rs | Removes Send bound from relay handler future return types. |
| Cargo.toml | Adds new workspace members and updates workspace dependency paths. |
| Cargo.lock | Reflects crate rename/additions and dependency removals. |
Comments suppressed due to low confidence (1)
time-alarm-service-relay/src/lib.rs:314
TimeAlarmServiceRelayHandlerstores the service by value (service: T), which forces consumers to move the control handle into the relay handler even if they also need to keep using it elsewhere. Consider storing a reference (e.g.&'a T/&'a dyn TimeAlarmService) and/or adding a blanketimpl<T: TimeAlarmService + ?Sized> TimeAlarmService for &TsoT = &Servicecan satisfy the bound cleanly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+322
to
326
| impl<'hw> TimeAlarmService for Service<'hw> { | ||
| fn get_capabilities(&self) -> TimeAlarmDeviceCapabilities { | ||
| self.inner.get_capabilities() | ||
| } | ||
|
|
Comment on lines
17
to
21
| embedded-mcu-hal.workspace = true | ||
| embedded-services.workspace = true | ||
| odp-service-common.workspace = true | ||
| time-alarm-service-messages.workspace = true | ||
| time-alarm-service-interface.workspace = true | ||
| zerocopy.workspace = true |
| time-alarm-service-interface.workspace = true | ||
|
|
||
| [features] | ||
| defmt = ["dep:defmt", "embedded-mcu-hal/defmt"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.