Struct sbp::messages::flash::msg_flash_read_resp::MsgFlashReadResp
source · [−]pub struct MsgFlashReadResp {
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 response (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
sourceimpl MsgFlashReadResp
impl MsgFlashReadResp
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
sourceimpl Clone for MsgFlashReadResp
impl Clone for MsgFlashReadResp
sourcefn clone(&self) -> MsgFlashReadResp
fn clone(&self) -> MsgFlashReadResp
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ConcreteMessage for MsgFlashReadResp
impl ConcreteMessage for MsgFlashReadResp
sourceconst MESSAGE_TYPE: u16 = 225u16
const MESSAGE_TYPE: u16 = 225u16
The message type.
sourceconst MESSAGE_NAME: &'static str = "MSG_FLASH_READ_RESP"
const MESSAGE_NAME: &'static str = "MSG_FLASH_READ_RESP"
The message name.
sourceimpl Debug for MsgFlashReadResp
impl Debug for MsgFlashReadResp
sourceimpl From<MsgFlashReadResp> for Sbp
impl From<MsgFlashReadResp> for Sbp
sourcefn from(msg: MsgFlashReadResp) -> Self
fn from(msg: MsgFlashReadResp) -> Self
Converts to this type from the input type.
sourceimpl SbpMessage for MsgFlashReadResp
impl SbpMessage for MsgFlashReadResp
sourcefn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
sourcefn message_type(&self) -> u16
fn message_type(&self) -> u16
Get the message type.
sourcefn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
Auto Trait Implementations
impl RefUnwindSafe for MsgFlashReadResp
impl Send for MsgFlashReadResp
impl Sync for MsgFlashReadResp
impl Unpin for MsgFlashReadResp
impl UnwindSafe for MsgFlashReadResp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more