pub struct CommandPacket<'a> {
pub header: CommandHeader,
pub tag: CommandTag<'a>,
}Expand description
McuBoot command packet structure
Represents a complete command packet that can be sent to a McuBoot device. This structure combines the command header with the specific command tag and parameters. Commands can be used for various operations like reading memory, writing flash, getting device properties, etc.
Fields§
§header: CommandHeaderCommand header containing flags and metadata
tag: CommandTag<'a>Specific command tag with associated parameters
Implementations§
Source§impl<'a> CommandPacket<'a>
impl<'a> CommandPacket<'a>
Sourcepub fn new_none_flag(tag: CommandTag<'a>) -> Self
pub fn new_none_flag(tag: CommandTag<'a>) -> Self
Creates a new command packet without data phase
Used for commands that don’t require additional data to be sent after the command packet.
Examples include CommandTag::GetProperty, CommandTag::Reset, CommandTag::Execute commands.
§Arguments
tag- The command tag specifying the operation and parameters
§Returns
A new CommandPacket with CommandFlag::NoData flag set
Sourcepub fn new_data_phase(tag: CommandTag<'a>) -> Self
pub fn new_data_phase(tag: CommandTag<'a>) -> Self
Creates a new command packet with data phase
Used for commands that require additional data to be sent after the command packet.
Examples include CommandTag::WriteMemory, CommandTag::ReceiveSBFile commands where the actual data follows
the command packet.
§Arguments
tag- The command tag specifying the operation and parameters
§Returns
A new CommandPacket with CommandFlag::HasDataPhase flag set
Trait Implementations§
Source§impl<'a> Clone for CommandPacket<'a>
impl<'a> Clone for CommandPacket<'a>
Source§fn clone(&self) -> CommandPacket<'a>
fn clone(&self) -> CommandPacket<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more