Struct sbp::messages::flash::msg_flash_read_req::MsgFlashReadReq
source · pub struct MsgFlashReadReq {
pub sender_id: Option<u16>,
pub target: u8,
pub addr_start: [u8; 3],
pub addr_len: u8,
}
Expand description
Read STM or M25 flash address request (host => device)
The flash read message reads a set of addresses of either the STM or M25 onboard flash. The device replies with a MSG_FLASH_READ_RESP message containing either the read data on success or a MSG_FLASH_DONE message containing the return code FLASH_INVALID_LEN (2) if the maximum read size is exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed range.
Fields§
§sender_id: Option<u16>
The message sender_id
target: u8
Target flags
addr_start: [u8; 3]
Starting address offset to read from
addr_len: u8
Length of set of addresses to read, counting up from starting address
Implementations§
source§impl MsgFlashReadReq
impl MsgFlashReadReq
sourcepub fn flash_target_to_read(&self) -> Result<FlashTargetToRead, u8>
pub fn flash_target_to_read(&self) -> Result<FlashTargetToRead, u8>
Gets the FlashTargetToRead stored in the target
bitfield.
Returns Ok
if the bitrange contains a known FlashTargetToRead
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of FlashTargetToRead
were added.
sourcepub fn set_flash_target_to_read(
&mut self,
flash_target_to_read: FlashTargetToRead
)
pub fn set_flash_target_to_read( &mut self, flash_target_to_read: FlashTargetToRead )
Set the bitrange corresponding to the FlashTargetToRead of the target
bitfield.
Trait Implementations§
source§impl Clone for MsgFlashReadReq
impl Clone for MsgFlashReadReq
source§fn clone(&self) -> MsgFlashReadReq
fn clone(&self) -> MsgFlashReadReq
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConcreteMessage for MsgFlashReadReq
impl ConcreteMessage for MsgFlashReadReq
source§const MESSAGE_TYPE: u16 = 231u16
const MESSAGE_TYPE: u16 = 231u16
source§const MESSAGE_NAME: &'static str = "MSG_FLASH_READ_REQ"
const MESSAGE_NAME: &'static str = "MSG_FLASH_READ_REQ"
source§impl Debug for MsgFlashReadReq
impl Debug for MsgFlashReadReq
source§impl<'de> Deserialize<'de> for MsgFlashReadReq
impl<'de> Deserialize<'de> for MsgFlashReadReq
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl FriendlyName for MsgFlashReadReq
impl FriendlyName for MsgFlashReadReq
fn friendly_name() -> &'static str
source§impl From<MsgFlashReadReq> for Sbp
impl From<MsgFlashReadReq> for Sbp
source§fn from(msg: MsgFlashReadReq) -> Self
fn from(msg: MsgFlashReadReq) -> Self
source§impl PartialEq for MsgFlashReadReq
impl PartialEq for MsgFlashReadReq
source§fn eq(&self, other: &MsgFlashReadReq) -> bool
fn eq(&self, other: &MsgFlashReadReq) -> bool
self
and other
values to be equal, and is used
by ==
.