Skip to content

Conversation

@williampMSFT
Copy link
Contributor

This change factors out the boilerplate associated with generating relay types from the information about the set of types that are to be relayed. This should enable easier bringup of additional message relay services (e.g. UART).

In the course of this work, I noticed that some of the nomenclature around results vs responses was a bit conflicting in the relay code, so also standardized that on Result meaning 'a specific generic type of the Result enum' and Response meaning 'the success case of a Result'.

@williampMSFT williampMSFT requested a review from a team as a code owner January 12, 2026 23:19
Copilot AI review requested due to automatic review settings January 12, 2026 23:19
@williampMSFT williampMSFT requested a review from a team as a code owner January 12, 2026 23:19
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 MCTP relay boilerplate into a reusable macro and standardizes nomenclature to distinguish "Result" (the generic Result enum type) from "Response" (the success case of a Result). The macro consolidates repetitive code for generating relay types across different message services.

Changes:

  • Introduced impl_odp_mctp_relay_types! macro to generate ODP MCTP relay boilerplate from service specifications
  • Renamed SerializableResponse to SerializableResult throughout the codebase
  • Renamed HostResponse to HostResult and related types/functions
  • Added type aliases (AcpiBatteryResult, ThermalResult, DebugResult) for service result types

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.

File Description
embedded-service/src/relay/mod.rs Added impl_odp_mctp_relay_types! macro to generate MCTP relay types; renamed SerializableResponse to SerializableResult
espi-service/src/mctp.rs Replaced manual type definitions with macro invocation for Battery, Thermal, and Debug services
espi-service/src/espi_service.rs Updated type names from HostResponse to HostResult and HostResponseMessage to HostResultMessage; renamed function try_route_request_to_comms to send_to_comms
battery-service-messages/src/lib.rs Added AcpiBatteryResult type alias for Result<AcpiBatteryResponse, AcpiBatteryError>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 12, 2026 23:24
@williampMSFT williampMSFT mentioned this pull request Jan 12, 2026
@williampMSFT williampMSFT enabled auto-merge (squash) January 12, 2026 23:39
@williampMSFT williampMSFT merged commit 07d89d1 into OpenDevicePartnership:v0.2.0 Jan 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants