diff --git a/CHANGELOG.md b/CHANGELOG.md index a6000e6..9b93cd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how Security -- in case of vulnerabilities. --> +## [0.18.1] + +### Fixed +- Fix issue where versatest instrument fw flash would be aborted by drop + ## [0.18.0] ### Added diff --git a/Cargo.lock b/Cargo.lock index 5078b4c..cf6c4a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1431,7 +1431,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tsp-toolkit-kic-lib" -version = "0.18.0" +version = "0.18.1" dependencies = [ "anyhow", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 5f66400..75ffe15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tsp-toolkit-kic-lib" description = "A library specifically enabling communication to the Keithley product-line of instruments" -version = "0.18.0" +version = "0.18.1" authors = ["Keithley Instruments, LLC"] edition = "2021" repository = "https://github.com/tektronix/tsp-toolkit-kic-lib" diff --git a/src/model/versatest.rs b/src/model/versatest.rs index 3d1cc06..2070d0f 100644 --- a/src/model/versatest.rs +++ b/src/model/versatest.rs @@ -22,6 +22,7 @@ pub struct Instrument { info: Option, protocol: Protocol, auth: Box, + fw_flash_in_progress: bool, } impl Instrument { @@ -36,6 +37,7 @@ impl Instrument { info: None, protocol, auth, + fw_flash_in_progress: false, } } @@ -144,6 +146,7 @@ impl Flash for Instrument { image: &[u8], firmware_info: Option, ) -> crate::error::Result<()> { + self.fw_flash_in_progress = true; let mut is_module = false; let slot_number: u16 = firmware_info.unwrap_or(0); if slot_number > 0 { @@ -207,6 +210,10 @@ impl Drop for Instrument { #[tracing::instrument(skip(self))] fn drop(&mut self) { trace!("calling versatest drop..."); + if self.fw_flash_in_progress { + trace!("FW flash in progress. Skipping instrument reset."); + return; + } let _ = self.reset(); } } @@ -221,6 +228,7 @@ impl Reset for Instrument { Ok(()) } } + #[cfg(test)] mod unit { use crate::protocol;