fn write(&self, buf: &[u8]) -> Result<usize, SendError> {
        match self {
            CmsisDapDevice::V1 { handle, .. } => Ok(handle.write(buf)?),
            CmsisDapDevice::V2 { handle, out_ep, .. } => {
                let timeout = Duration::from_millis(100);
                // Skip first byte as it's set to 0 for HID transfers
                Ok(handle.write_bulk(*out_ep, &buf[1..], timeout)?)
            }
        }
    }
/// Write `buf` to the probe, returning the number of bytes written on success.
Write `buf` to the probe, returning the number of bytes written on success.
Write ` buf ` to the probe returning the number of bytes written on success .
fn write(&self, buf: &[u8]) -> Result<usize, SendError> {
        match self {
            CmsisDapDevice::V1 { handle, .. } => Ok(handle.write(buf)?),
            CmsisDapDevice::V2 { handle, out_ep, .. } => {
                let timeout = Duration::from_millis(100);
                // Skip first byte as it's set to 0 for HID transfers
                Ok(handle.write_bulk(*out_ep, &buf[1..], timeout)?)
            }
        }
    }
fn write ( & self , buf : & [ u8 ] ) -> Result < usize , SendError > { match self { CmsisDapDevice :: V1 { handle , .. } => Ok ( handle . write ( buf ) ? ) , CmsisDapDevice :: V2 { handle , out_ep , .. } => { let timeout = Duration :: from_millis ( 100 ) ; // Skip first byte as it's set to 0 for HID transfers Ok ( handle . write_bulk ( * out_ep , & buf [ 1 .. ] , timeout ) ? ) } } }
Write `buf` to the probe, returning the number of bytes written on success.
Write ` buf ` to the probe returning the number of bytes written on success .
&self
buf
&[u8]
&self
buf
&[u8]