pub(super) fn find_packet_size(&mut self) -> Result<usize, CmsisDapError> {
        for repeat in 0..16 {
            log::debug!("Attempt {} to find packet size", repeat + 1);
            match send_command(self, Command::PacketSize) {
                Ok(PacketSize(size)) => {
                    log::debug!("Success: packet size is {}", size);
                    self.set_packet_size(size as usize);
                    return Ok(size as usize);
                }

                // Ignore timeouts and retry.
                Err(SendError::Timeout) => (),

                // Raise other errors.
                Err(e) => return Err(e.into()),
            }
        }

        // If we didn't return early, no sizes worked, report an error.
        Err(CmsisDapError::NoPacketSize)
    }
/// Attempt to determine the correct packet size for this device.
///
/// Tries to request the CMSIS-DAP maximum packet size, allowing several
/// failures to accommodate some buggy probes which must receive a full
/// packet worth of data before responding, but we don't know how much
/// data that is before we get a response.
///
/// The device is then configured to use the detected size, which is returned.
Attempt to determine the correct packet size for this device.
Tries to request the CMSIS-DAP maximum packet size, allowing several
failures to accommodate some buggy probes which must receive a full
packet worth of data before responding, but we don't know how much
data that is before we get a response.

The device is then configured to use the detected size, which is returned.
Attempt to determine the correct packet size for this device . Tries to request the CMSIS - DAP maximum packet size allowing several failures to accommodate some buggy probes which must receive a full packet worth of data before responding but we don ' t know how much data that is before we get a response . The device is then configured to use the detected size which is returned .
pub(super) fn find_packet_size(&mut self) -> Result<usize, CmsisDapError> {
        for repeat in 0..16 {
            log::debug!("Attempt {} to find packet size", repeat + 1);
            match send_command(self, Command::PacketSize) {
                Ok(PacketSize(size)) => {
                    log::debug!("Success: packet size is {}", size);
                    self.set_packet_size(size as usize);
                    return Ok(size as usize);
                }
                // Ignore timeouts and retry.
                Err(SendError::Timeout) => (),
                // Raise other errors.
                Err(e) => return Err(e.into()),
            }
        }
        // If we didn't return early, no sizes worked, report an error.
        Err(CmsisDapError::NoPacketSize)
    }
pub ( super ) fn find_packet_size ( & mut self ) -> Result < usize , CmsisDapError > { for repeat in 0 .. 16 { log :: debug ! ( " " repeat 1 ) ; match send_command ( self , Command :: PacketSize ) { Ok ( PacketSize ( size ) ) => { log :: debug ! ( " " size ) ; self . set_packet_size ( size as usize ) ; return Ok ( size as usize ) ; } // Ignore timeouts and retry. Err ( SendError :: Timeout ) => ( ) , // Raise other errors. Err ( e ) => return Err ( e . into ( ) ) , } } // If we didn't return early, no sizes worked, report an error. Err ( CmsisDapError :: NoPacketSize ) }
Attempt to determine the correct packet size for this device.
Attempt to determine the correct packet size for this device .
&mut self
&mut self