Skip to content
Merged
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
7 changes: 6 additions & 1 deletion mctp-estack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub use heapless::Vec;

use heapless::{Entry, FnvIndexMap};

use mctp::{Eid, Error, MsgIC, MsgType, Result, Tag, TagValue};
use mctp::{Eid, Error, MsgIC, MsgType, Result, Tag, TagValue, MCTP_ADDR_NULL};

#[cfg(not(any(feature = "log", feature = "defmt")))]
compile_error!("Either log or defmt feature must be enabled");
Expand Down Expand Up @@ -490,6 +490,11 @@ impl Stack {
Ok(())
}

/// Clears the local Endpoint ID.
pub fn clear_eid(&mut self) {
self.own_eid = MCTP_ADDR_NULL;
}

/// Retrieves the local Endpoint ID.
pub fn eid(&self) -> Eid {
self.own_eid
Expand Down
6 changes: 6 additions & 0 deletions mctp-estack/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,12 @@ impl<'r> Router<'r> {
let mut inner = self.inner.lock().await;
inner.stack.set_eid(eid.0)
}

/// Clears the EID assigned to the local stack
pub async fn clear_eid(&self) {
let mut inner = self.inner.lock().await;
inner.stack.clear_eid();
}
}

impl core::fmt::Debug for Router<'_> {
Expand Down