pub fn bootloader_info(&mut self) -> Result<BootloaderInfo> {
        use std::ffi::CString;

        let mut info_packet = [0u8; 64];
        let (_, packet_length) =
            self.send_command(Command::BootloaderInfo, &[0; 0], &mut info_packet)?;

        let mut info_packet = &info_packet[..packet_length];
        let build_date = read_ne_u32(&mut info_packet);
        let build_number = read_ne_u32(&mut info_packet);
        let application_base = read_ne_u32(&mut info_packet);
        let application_size = read_ne_u32(&mut info_packet) as usize;

        // Convert raw date integer to legible representation
        let mut build_date = build_date.to_string();
        build_date.insert(6, '-');
        build_date.insert(4, '-');

        let version = read_version(&mut info_packet);

        // Convert the remainder of the packet to a String
        let identifier = CString::new(info_packet)
            .map_err(|_| Error::MalformedResponse)?
            .into_string()
            .map_err(|_| Error::MalformedResponse)?;

        Ok(BootloaderInfo {
            build_number,
            build_date,
            application_base,
            application_size,
            version,
            identifier,
        })
    }
/// Queries bootloader information from the target.
Queries bootloader information from the target.
Queries bootloader information from the target .
pub fn bootloader_info(&mut self) -> Result<BootloaderInfo> {
        use std::ffi::CString;
        let mut info_packet = [0u8; 64];
        let (_, packet_length) =
            self.send_command(Command::BootloaderInfo, &[0; 0], &mut info_packet)?;
        let mut info_packet = &info_packet[..packet_length];
        let build_date = read_ne_u32(&mut info_packet);
        let build_number = read_ne_u32(&mut info_packet);
        let application_base = read_ne_u32(&mut info_packet);
        let application_size = read_ne_u32(&mut info_packet) as usize;
        // Convert raw date integer to legible representation
        let mut build_date = build_date.to_string();
        build_date.insert(6, '-');
        build_date.insert(4, '-');
        let version = read_version(&mut info_packet);
        // Convert the remainder of the packet to a String
        let identifier = CString::new(info_packet)
            .map_err(|_| Error::MalformedResponse)?
            .into_string()
            .map_err(|_| Error::MalformedResponse)?;
        Ok(BootloaderInfo {
            build_number,
            build_date,
            application_base,
            application_size,
            version,
            identifier,
        })
    }
pub fn bootloader_info ( & mut self ) -> Result < BootloaderInfo > { use std :: ffi :: CString ; let mut info_packet = [ 0u8 ; 64 ] ; let ( _ , packet_length ) = self . send_command ( Command :: BootloaderInfo , & [ 0 ; 0 ] , & mut info_packet ) ? ; let mut info_packet = & info_packet [ .. packet_length ] ; let build_date = read_ne_u32 ( & mut info_packet ) ; let build_number = read_ne_u32 ( & mut info_packet ) ; let application_base = read_ne_u32 ( & mut info_packet ) ; let application_size = read_ne_u32 ( & mut info_packet ) as usize ; // Convert raw date integer to legible representation let mut build_date = build_date . to_string ( ) ; build_date . insert ( 6 , '-' ) ; build_date . insert ( 4 , '-' ) ; let version = read_version ( & mut info_packet ) ; // Convert the remainder of the packet to a String let identifier = CString :: new ( info_packet ) . map_err ( | _ | Error :: MalformedResponse ) ? . into_string ( ) . map_err ( | _ | Error :: MalformedResponse ) ? ; Ok ( BootloaderInfo { build_number , build_date , application_base , application_size , version , identifier , } ) }
Queries bootloader information from the target.
Queries bootloader information from the target .
&mut self
&mut self