fn read(&self, buf: &mut [u8]) -> Result<usize, SendError> {
        match self {
            CmsisDapDevice::V1 { handle, .. } => match handle.read_timeout(buf, 100)? {
                // Timeout is not indicated by error, but by returning 0 read bytes
                0 => Err(SendError::Timeout),
                n => Ok(n),
            },
            CmsisDapDevice::V2 { handle, in_ep, .. } => {
                let timeout = Duration::from_millis(100);
                Ok(handle.read_bulk(*in_ep, buf, timeout)?)
            }
        }
    }
/// Read from the probe into `buf`, returning the number of bytes read on success.
Read from the probe into `buf`, returning the number of bytes read on success.
Read from the probe into ` buf ` returning the number of bytes read on success .
fn read(&self, buf: &mut [u8]) -> Result<usize, SendError> {
        match self {
            CmsisDapDevice::V1 { handle, .. } => match handle.read_timeout(buf, 100)? {
                // Timeout is not indicated by error, but by returning 0 read bytes
                0 => Err(SendError::Timeout),
                n => Ok(n),
            },
            CmsisDapDevice::V2 { handle, in_ep, .. } => {
                let timeout = Duration::from_millis(100);
                Ok(handle.read_bulk(*in_ep, buf, timeout)?)
            }
        }
    }
fn read ( & self , buf : & mut [ u8 ] ) -> Result < usize , SendError > { match self { CmsisDapDevice :: V1 { handle , .. } => match handle . read_timeout ( buf , 100 ) ? { // Timeout is not indicated by error, but by returning 0 read bytes 0 => Err ( SendError :: Timeout ) , n => Ok ( n ) , } , CmsisDapDevice :: V2 { handle , in_ep , .. } => { let timeout = Duration :: from_millis ( 100 ) ; Ok ( handle . read_bulk ( * in_ep , buf , timeout ) ? ) } } }
Read from the probe into `buf`, returning the number of bytes read on success.
Read from the probe into ` buf ` returning the number of bytes read on success .
&self
buf
&mut [u8]
&self
buf
&mut [u8]