Skip to content

Time-alarm service: Split interface and relay handling - #776

Merged
williampMSFT merged 2 commits into
OpenDevicePartnership:feature/relay-splitfrom
williampMSFT:user/williamp/tad-relay-split
Apr 8, 2026
Merged

williampMSFT merged 2 commits into
OpenDevicePartnership:feature/relay-splitfrom
williampMSFT:user/williamp/tad-relay-split

Conversation

@williampMSFT

Copy link
Copy Markdown
Collaborator

This change splits the interface for the time-alarm service into two crates - an 'interface' crate that contains traits and support types for the public interface for the time-alarm service, and a 'relay' crate that's written against the 'interface' crate and handles relaying messages to and from a time-alarm service implementation over MCTP.

This split should allow OEMs to substitute their own service implementations if they want to and still reuse our relay code (or write their own relay against the stock service implementation). Additionally, splitting the relay handling from the service implementation should also allow us to add support for different kinds of relay handlers (e.g. HID) without needing to pay the code size cost of having that code on platforms that aren't using it since it's no longer invasive on the service type.

@williampMSFT
williampMSFT requested a review from a team as a code owner April 6, 2026 16:58
@williampMSFT
williampMSFT requested review from RobertZ2011, Copilot, felipebalbi, jerrysxie, kurtjd and tullom and removed request for Copilot April 6, 2026 16:58
@williampMSFT

Copy link
Copy Markdown
Collaborator Author

@kurtjd FYI - spun up this feature/relay-split branch for the interface/relay split stuff. Once this goes in, we can send out PRs for the other services (battery/thermal) into this branch, and when they're all in we can do a merge back to v0.2.0.

kurtjd
kurtjd previously approved these changes Apr 6, 2026

@kurtjd kurtjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, though minor nit: Some pub items are missing doc strings

@williampMSFT

Copy link
Copy Markdown
Collaborator Author

Looks good, though minor nit: Some pub items are missing doc strings

Good catch, thanks! for some reason I thought clippy caught this so I thought I must've already done it, but I guess not. Will fix

Copilot AI review requested due to automatic review settings April 6, 2026 18:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Splits the time-alarm service public API into a standalone time-alarm-service-interface crate and moves MCTP relay handling into a new time-alarm-service-relay crate, so service implementations can be swapped independently of transport relaying.

Changes:

  • Introduce time-alarm-service-interface crate for shared traits and ACPI types.
  • Introduce time-alarm-service-relay crate implementing MCTP relay handler + serialization against the interface crate.
  • Update existing service, examples, and workspace manifests/locks to use the new crates and remove old message-crate dependencies where no longer needed.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uart-service/Cargo.toml Drops temporary dependencies on service message-type crates and their defmt feature wiring.
time-alarm-service/tests/tad_test.rs Switches tests from old message crate types to interface crate types/trait import.
time-alarm-service/src/lib.rs Consumes interface crate types and implements the new TimeAlarmService trait; removes in-crate MCTP relay handler impl.
time-alarm-service/Cargo.toml Replaces dependency on old messages crate with time-alarm-service-interface.
time-alarm-service-relay/src/serialization.rs Defines request/response serialization using interface crate shared types.
time-alarm-service-relay/src/lib.rs Adds a TimeAlarmServiceRelayHandler<T: TimeAlarmService> implementing the relay traits.
time-alarm-service-relay/Cargo.toml New crate manifest for relay crate with defmt/log features.
time-alarm-service-interface/src/lib.rs New interface crate root: exports ACPI timestamp types and defines TimeAlarmService trait + shared structs/enums.
time-alarm-service-interface/src/acpi_timestamp.rs Adds/updates API docs for ACPI timestamp/timezone/DST types and helpers.
time-alarm-service-interface/Cargo.toml Renames crate and trims deps/features to match “interface-only” role.
examples/rt685s-evk/src/bin/time_alarm.rs Updates example to use interface crate types and new relay handler crate.
examples/rt685s-evk/Cargo.toml Switches example deps from old messages crate to interface + relay crates.
examples/rt685s-evk/Cargo.lock Lockfile updates for renamed/new crates.
embedded-service/src/relay/mod.rs Adjusts relay traits/macro to remove Send future requirement and to store handler values; updates docs/example (but see comments).
Cargo.toml Workspace membership + workspace dependency aliases updated for interface/relay crates.
Cargo.lock Lockfile updates for renamed/new crates and removed deps.

Comment thread embedded-service/src/relay/mod.rs Resolved
@williampMSFT
williampMSFT merged commit 3f3ca6a into OpenDevicePartnership:feature/relay-split Apr 8, 2026
19 checks passed
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.

4 participants