Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Services use a variety of async IPC mechanisms from `embassy-sync` and `embedded
- **`embassy_sync::signal::Signal`** — single-value async notifications
- **`embedded_services::ipc::deferred`** — request/response channels where the caller awaits a reply
- **`embedded_services::broadcaster`** — publish/subscribe pattern for event fan-out
- **`embedded_services::relay`** — relay service pattern for MCTP-based request/response dispatch with direct async calls
- **`odp_client::server`** — relay service pattern for MCTP-based request/response dispatch with direct async calls

### Composition

Expand Down
22 changes: 19 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ members = [
"debug-service-messages",
"keyboard-service",
"power-policy-interface",
"odp-client",
"odp-service-common",
"type-c-interface",
"fw-update-interface",
Expand Down Expand Up @@ -79,6 +80,7 @@ debug-service-messages = { path = "./debug-service-messages" }
embassy-executor = "0.10.0"
cfu-service = { path = "./cfu-service" }
embedded-hal-nb = "1.0"
embedded-io = "0.7"
embedded-io-async = "0.7.0"
embedded-mcu-hal = "0.2.0"
embassy-futures = "0.1.2"
Expand All @@ -97,6 +99,7 @@ fw-update-interface = { path = "./fw-update-interface" }
fw-update-interface-mocks = { path = "./fw-update-interface-mocks" }
mctp-rs = { path = "./mctp-rs" }
num_enum = { version = "0.7.5", default-features = false }
odp-client = { path = "./odp-client" }
portable-atomic = { version = "1.11", default-features = false }
power-policy-interface = { path = "./power-policy-interface" }
paste = "1.0.15"
Expand Down
2 changes: 2 additions & 0 deletions battery-service-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ignored = ["log"]
defmt = { workspace = true, optional = true }
log = { workspace = true, optional = true }
embedded-services.workspace = true
odp-client.workspace = true
num_enum.workspace = true

battery-service-interface.workspace = true
Expand All @@ -21,6 +22,7 @@ defmt = [
"dep:defmt",
"embedded-services/defmt",
"battery-service-interface/defmt",
"odp-client/defmt",
]
log = ["dep:log", "embedded-services/log", "battery-service-interface/log"]

Expand Down
4 changes: 2 additions & 2 deletions battery-service-relay/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ impl<S: battery_service_interface::BatteryService> BatteryServiceRelayHandler<S>
}
}

impl<S: battery_service_interface::BatteryService> embedded_services::relay::mctp::RelayServiceHandlerTypes
impl<S: battery_service_interface::BatteryService> odp_client::server::RelayServiceHandlerTypes
for BatteryServiceRelayHandler<S>
{
type RequestType = serialization::AcpiBatteryRequest;
type ResultType = serialization::AcpiBatteryResult;
}

impl<S: battery_service_interface::BatteryService> embedded_services::relay::mctp::RelayServiceHandler
impl<S: battery_service_interface::BatteryService> odp_client::server::RelayServiceHandler
for BatteryServiceRelayHandler<S>
{
async fn process_request(&self, request: Self::RequestType) -> Self::ResultType {
Expand Down
2 changes: 1 addition & 1 deletion battery-service-relay/src/serialization.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use battery_service_interface::*;
use embedded_services::relay::{MessageSerializationError, SerializableMessage};
use odp_client::{MessageSerializationError, SerializableMessage};

#[derive(num_enum::IntoPrimitive, num_enum::TryFromPrimitive, Copy, Clone, Debug, PartialEq)]
#[repr(u16)]
Expand Down
3 changes: 2 additions & 1 deletion debug-service-messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ repository.workspace = true
defmt = { workspace = true, optional = true }
embedded-services.workspace = true
num_enum.workspace = true
odp-client.workspace = true

[lints]
workspace = true

[features]
defmt = ["dep:defmt"]
defmt = ["dep:defmt", "odp-client/defmt"]
2 changes: 1 addition & 1 deletion debug-service-messages/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![no_std]
use embedded_services::relay::{MessageSerializationError, SerializableMessage};
use odp_client::{MessageSerializationError, SerializableMessage};

/// Standard Debug Service Log Buffer Size
pub const STD_DEBUG_BUF_SIZE: usize = 128;
Expand Down
3 changes: 2 additions & 1 deletion debug-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ debug-service-messages.workspace = true
embassy-sync.workspace = true
embedded-services.workspace = true
log.workspace = true
odp-client.workspace = true
rtt-target = "0.6.1"

[features]
defmt = ["debug-service-messages/defmt"]
defmt = ["debug-service-messages/defmt", "odp-client/defmt"]

[lints]
workspace = true
4 changes: 2 additions & 2 deletions debug-service/src/debug_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ impl Service {
}
}

impl embedded_services::relay::mctp::RelayServiceHandlerTypes for Service {
impl odp_client::server::RelayServiceHandlerTypes for Service {
type RequestType = DebugRequest;
type ResultType = DebugResult;
}

impl embedded_services::relay::mctp::RelayServiceHandler for Service {
impl odp_client::server::RelayServiceHandler for Service {
async fn process_request(&self, _request: Self::RequestType) -> Self::ResultType {
// Host sent an ACPI/MCTP request (e.g. GetDebugBuffer). Treat this as the
// trigger to send the staged debug buffer back to the host.
Expand Down
8 changes: 1 addition & 7 deletions embedded-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@ rust-version.workspace = true
workspace = true

[dependencies]
bitfield.workspace = true
critical-section.workspace = true
defmt = { workspace = true, optional = true }
embassy-sync.workspace = true
embassy-futures.workspace = true
log = { workspace = true, optional = true }
paste.workspace = true

[dependencies.mctp-rs]
workspace = true
features = ["espi"]

[dependencies.serde]
workspace = true
Expand All @@ -41,5 +35,5 @@ tokio = { workspace = true, features = ["rt", "macros", "time"] }

[features]
default = []
defmt = ["dep:defmt", "embassy-sync/defmt", "mctp-rs/defmt"]
defmt = ["dep:defmt", "embassy-sync/defmt"]
log = ["dep:log", "embassy-sync/log"]
10 changes: 0 additions & 10 deletions embedded-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@ pub mod init;
pub mod ipc;
pub mod keyboard;
pub mod named;
pub mod relay;
pub mod sync;

/// Hidden re-exports used by macros defined in this crate.
/// Not part of the public API — do not depend on these directly.
#[doc(hidden)]
pub mod _macro_internal {
pub use bitfield;
pub use mctp_rs;
pub use paste;
}

/// Global Mutex type, ThreadModeRawMutex is used in a microcontroller context, whereas CriticalSectionRawMutex is used
/// in a standard context for unit testing.
///
Expand Down
Loading
Loading