Skip to content

Commit 7fcaad3

Browse files
committed
add doc comments
1 parent 346d5b0 commit 7fcaad3

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

espflash/src/command.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ impl CommandType {
215215
}
216216
}
217217

218+
/// Return an assumed maximum response length for the [`CommandType`]
219+
/// variant.
220+
///
221+
/// Default length is assumed 5MiB.
218222
pub fn max_respose_len(&self) -> u64 {
219223
match self {
220224
CommandType::Sync => SYNC_MAX_LEN,

espflash/src/connection/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ impl Connection {
542542
Ok(Some(header))
543543
}
544544

545-
/// Reads the response from a serial port.
545+
/// Reads the response from a serial port, bounded by `max_len` bytes.
546546
pub fn read_response(&mut self, max_len: u64) -> Result<Option<CommandResponse>, Error> {
547547
match self.read_bounded(10, max_len)? {
548548
None => Ok(None),
@@ -598,7 +598,7 @@ impl Connection {
598598
}
599599
}
600600

601-
/// Reads the response from a serial port.
601+
/// Reads the response from a serial port for a given [`CommandType`].
602602
pub fn read_response_for_command(
603603
&mut self,
604604
ty: CommandType,

0 commit comments

Comments
 (0)