pub struct ResourceMode(/* private fields */);Expand description
Bit set of XCP resources: which feature groups a slave offers (CONNECT response / GET_STATUS protection status) and which access is requested in the CONNECT mode byte.
Bit assignment per XCP part 1 (RESOURCE byte):
bit 0 CAL/PAG, bit 2 DAQ, bit 3 STIM, bit 4 PGM, bit 5 DBG (XCP ≥ 1.5);
bits 1, 6, 7 are reserved.
The CONNECT command’s mode byte is 0x00 (normal) or 0x01
(user-defined) per the spec; connect(mode) passes the bit set through
so user-defined modes can be modeled. Use
ResourceMode::CONNECT_NORMAL / ResourceMode::CONNECT_USER_DEFINED
for the standard modes.
Implementations§
Source§impl ResourceMode
impl ResourceMode
Sourcepub const CAL_PAGE: ResourceMode
pub const CAL_PAGE: ResourceMode
Calibration and page switching (CAL/PAG) — bit 0.
Sourcepub const DAQ: ResourceMode
pub const DAQ: ResourceMode
Data acquisition (DAQ) — bit 2.
Sourcepub const STIM: ResourceMode
pub const STIM: ResourceMode
Data stimulation (STIM) — bit 3.
Sourcepub const PGM: ResourceMode
pub const PGM: ResourceMode
Flash programming (PGM) — bit 4.
Sourcepub const DBG: ResourceMode
pub const DBG: ResourceMode
Debugging (DBG, XCP ≥ 1.5) — bit 5.
Sourcepub const CAL_PAGE_OR_DAQ: ResourceMode
pub const CAL_PAGE_OR_DAQ: ResourceMode
Composite: calibration or DAQ access (CAL/PAG | DAQ) — the
common “measure or calibrate” session.
Sourcepub const CONNECT_NORMAL: ResourceMode
pub const CONNECT_NORMAL: ResourceMode
CONNECT mode 0x00 — normal mode.
Sourcepub const CONNECT_USER_DEFINED: ResourceMode
pub const CONNECT_USER_DEFINED: ResourceMode
CONNECT mode 0x01 — user-defined mode.
Sourcepub const fn from_raw(bits: u8) -> ResourceMode
pub const fn from_raw(bits: u8) -> ResourceMode
Build from a raw resource byte. Total: unknown/reserved bits are preserved (slaves may set vendor bits).
Sourcepub const fn is_empty(self) -> bool
pub const fn is_empty(self) -> bool
true when no bit is set (e.g. the slave reports no protected
resources).
Sourcepub const fn contains(self, other: ResourceMode) -> bool
pub const fn contains(self, other: ResourceMode) -> bool
true when every bit in other is also set in self.
Trait Implementations§
Source§impl BitAnd for ResourceMode
impl BitAnd for ResourceMode
Source§type Output = ResourceMode
type Output = ResourceMode
& operator.Source§fn bitand(self, rhs: ResourceMode) -> ResourceMode
fn bitand(self, rhs: ResourceMode) -> ResourceMode
& operation. Read moreSource§impl BitOr for ResourceMode
impl BitOr for ResourceMode
Source§type Output = ResourceMode
type Output = ResourceMode
| operator.Source§fn bitor(self, rhs: ResourceMode) -> ResourceMode
fn bitor(self, rhs: ResourceMode) -> ResourceMode
| operation. Read moreSource§impl Clone for ResourceMode
impl Clone for ResourceMode
Source§fn clone(&self) -> ResourceMode
fn clone(&self) -> ResourceMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResourceMode
Source§impl Debug for ResourceMode
impl Debug for ResourceMode
Source§impl Default for ResourceMode
impl Default for ResourceMode
Source§fn default() -> ResourceMode
fn default() -> ResourceMode
Source§impl Display for ResourceMode
impl Display for ResourceMode
impl Eq for ResourceMode
Source§impl Hash for ResourceMode
impl Hash for ResourceMode
Source§impl Not for ResourceMode
impl Not for ResourceMode
Source§type Output = ResourceMode
type Output = ResourceMode
! operator.Source§fn not(self) -> ResourceMode
fn not(self) -> ResourceMode
! operation using logical or bitwise negation. Read more