pub struct DeckMemorySection { /* private fields */ }Expand description
Represents a memory section for a deck in the Crazyflie system.
This structure contains information about a deck’s memory configuration, including its capabilities (read, write, upgrade) and memory layout (addresses for base, command, and info).
Implementations§
Source§impl DeckMemorySection
impl DeckMemorySection
Sourcepub async fn is_started(&self) -> Result<bool>
pub async fn is_started(&self) -> Result<bool>
Returns whether the deck has been started.
Sourcepub fn supports_read(&self) -> bool
pub fn supports_read(&self) -> bool
Returns whether this deck supports read operations.
Sourcepub fn supports_write(&self) -> bool
pub fn supports_write(&self) -> bool
Returns whether this deck supports write operations.
Sourcepub fn supports_upgrade(&self) -> bool
pub fn supports_upgrade(&self) -> bool
Returns whether this deck supports firmware upgrades.
Sourcepub async fn upgrade_required(&self) -> Result<bool>
pub async fn upgrade_required(&self) -> Result<bool>
Returns whether a firmware upgrade is required for this deck.
Sourcepub async fn bootloader_active(&self) -> Result<bool>
pub async fn bootloader_active(&self) -> Result<bool>
Returns whether the bootloader is currently active on this deck.
Sourcepub fn can_reset_to_firmware(&self) -> bool
pub fn can_reset_to_firmware(&self) -> bool
Returns whether this deck can be reset to firmware mode.
Sourcepub fn can_reset_to_bootloader(&self) -> bool
pub fn can_reset_to_bootloader(&self) -> bool
Returns whether this deck can be reset to bootloader mode.
Sourcepub fn required_hash(&self) -> Option<u32>
pub fn required_hash(&self) -> Option<u32>
Returns the required hash for firmware verification, if any.
Sourcepub fn required_length(&self) -> Option<u32>
pub fn required_length(&self) -> Option<u32>
Returns the required firmware length, if any.
Sourcepub async fn reset_to_bootloader(&self) -> Result<()>
pub async fn reset_to_bootloader(&self) -> Result<()>
Sourcepub async fn reset_to_firmware(&self) -> Result<()>
pub async fn reset_to_firmware(&self) -> Result<()>
Sourcepub async fn write(&self, address: usize, data: &[u8]) -> Result<()>
pub async fn write(&self, address: usize, data: &[u8]) -> Result<()>
Write data to the memory section at the specified address.
§Arguments
address- The address within the memory section to write to.data- The data to write.
§Returns
A Result indicating success or failure of the write operation.
§Errors
Returns an Error if the section does not support writing or if the write operation fails.
Sourcepub async fn write_with_progress<F>(
&self,
address: usize,
data: &[u8],
progress_callback: F,
) -> Result<()>
pub async fn write_with_progress<F>( &self, address: usize, data: &[u8], progress_callback: F, ) -> Result<()>
Write data to the memory section at the specified address with progress reporting.
§Arguments
address- The address within the memory section to write to.data- The data to write.progress_callback- A callback function that takes two usize arguments: the number of bytes written so far and the total number of bytes to write.
§Returns
A Result indicating success or failure of the write operation.
§Errors
Returns an Error if the section does not support writing or if the write operation fails.
Sourcepub async fn read_with_progress<F>(
&self,
address: usize,
length: usize,
progress_callback: F,
) -> Result<Vec<u8>>
pub async fn read_with_progress<F>( &self, address: usize, length: usize, progress_callback: F, ) -> Result<Vec<u8>>
Read data from the memory section at the specified address with progress reporting.
§Arguments
address- The address within the memory section to read from.length- The number of bytes to read.progress_callback- A callback function that takes two usize arguments: the number of bytes read so far and the total number of bytes to read.
§Returns
A Result containing a vector of bytes read from the memory section or an Error if the operation fails.