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: u8Target flags
addr_start: [u8; 3]Starting address offset to read from
addr_len: u8Length 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 (const: unstable) · 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 = 231
const MESSAGE_TYPE: u16 = 231
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 ==.