(&mut self)
| 284 | } |
| 285 | |
| 286 | pub fn get_established_flag(&mut self) -> bool { |
| 287 | let mut est: PtmEst = PtmEst::new(); |
| 288 | |
| 289 | if self.established_flag_cached { |
| 290 | return self.established_flag; |
| 291 | } |
| 292 | |
| 293 | if let Err(e) = self.run_control_cmd( |
| 294 | Commands::CmdGetTpmEstablished, |
| 295 | &mut est, |
| 296 | 0, |
| 297 | 2 * mem::size_of::<u32>(), |
| 298 | ) { |
| 299 | error!("Failed to run CmdGetTpmEstablished Control Cmd. Error: {e:?}"); |
| 300 | return false; |
| 301 | } |
| 302 | |
| 303 | self.established_flag_cached = true; |
| 304 | self.established_flag = est.resp.bit == 0; |
| 305 | |
| 306 | self.established_flag |
| 307 | } |
| 308 | |
| 309 | /// Function to write to data socket and read the response from it |
| 310 | pub fn deliver_request(&mut self, cmd: &mut BackendCmd) -> Result<()> { |
no test coverage detected