Repository navigation
Time-alarm service: Split interface and relay handling - #776
Conversation
|
@kurtjd FYI - spun up this |
kurtjd
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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-interfacecrate for shared traits and ACPI types. - Introduce
time-alarm-service-relaycrate 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. |
3f3ca6a
into
OpenDevicePartnership:feature/relay-split
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.