Skip to content

[DRAFT] [Time/Alarm] Split interface and relay logic#748

Draft
williampMSFT wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
williampMSFT:user/williamp/tad-interface
Draft

[DRAFT] [Time/Alarm] Split interface and relay logic#748
williampMSFT wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
williampMSFT:user/williamp/tad-interface

Conversation

@williampMSFT
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 13, 2026 00:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 + TimeAlarmService trait) and time-alarm-service-relay (MCTP relay request/response + handler wrapper).
  • Update time-alarm-service to depend on the new interface crate and remove its embedded relay handler implementation.
  • Relax Send requirements on relay handler futures in embedded-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

  • TimeAlarmServiceRelayHandler stores 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 blanket impl<T: TimeAlarmService + ?Sized> TimeAlarmService for &T so T = &Service can 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"]
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