pub fn from_byte(value: u8) -> Result<Self> {
        match value {
            0x00 => Ok(Self::OK),
            0x01 => Ok(Self::errTARGET),
            0x02 => Ok(Self::errFILE),
            0x03 => Ok(Self::errWRITE),
            0x04 => Ok(Self::errERASE),
            0x05 => Ok(Self::errCHECK_ERASED),
            0x06 => Ok(Self::errPROG),
            0x07 => Ok(Self::errVERIFY),
            0x08 => Ok(Self::errADDRESS),
            0x09 => Ok(Self::errNOTDONE),
            0x0A => Ok(Self::errFIRMWARE),
            0x0B => Ok(Self::errVENDOR),
            0x0C => Ok(Self::errUSBR),
            0x0D => Ok(Self::errPOR),
            0x0E => Ok(Self::errUNKNOWN),
            0x0F => Ok(Self::errSTALLEDPKT),
            _ => Err(Box::new(Error::InvalidStatusCode)),
        }
    }
/// Returns a status code from a byte value
Returns a status code from a byte value
Returns a status code from a byte value
pub fn from_byte(value: u8) -> Result<Self> {
        match value {
            0x00 => Ok(Self::OK),
            0x01 => Ok(Self::errTARGET),
            0x02 => Ok(Self::errFILE),
            0x03 => Ok(Self::errWRITE),
            0x04 => Ok(Self::errERASE),
            0x05 => Ok(Self::errCHECK_ERASED),
            0x06 => Ok(Self::errPROG),
            0x07 => Ok(Self::errVERIFY),
            0x08 => Ok(Self::errADDRESS),
            0x09 => Ok(Self::errNOTDONE),
            0x0A => Ok(Self::errFIRMWARE),
            0x0B => Ok(Self::errVENDOR),
            0x0C => Ok(Self::errUSBR),
            0x0D => Ok(Self::errPOR),
            0x0E => Ok(Self::errUNKNOWN),
            0x0F => Ok(Self::errSTALLEDPKT),
            _ => Err(Box::new(Error::InvalidStatusCode)),
        }
    }
pub fn from_byte ( value : u8 ) -> Result < Self > { match value { 0x00 => Ok ( Self :: OK ) , 0x01 => Ok ( Self :: errTARGET ) , 0x02 => Ok ( Self :: errFILE ) , 0x03 => Ok ( Self :: errWRITE ) , 0x04 => Ok ( Self :: errERASE ) , 0x05 => Ok ( Self :: errCHECK_ERASED ) , 0x06 => Ok ( Self :: errPROG ) , 0x07 => Ok ( Self :: errVERIFY ) , 0x08 => Ok ( Self :: errADDRESS ) , 0x09 => Ok ( Self :: errNOTDONE ) , 0x0A => Ok ( Self :: errFIRMWARE ) , 0x0B => Ok ( Self :: errVENDOR ) , 0x0C => Ok ( Self :: errUSBR ) , 0x0D => Ok ( Self :: errPOR ) , 0x0E => Ok ( Self :: errUNKNOWN ) , 0x0F => Ok ( Self :: errSTALLEDPKT ) , _ => Err ( Box :: new ( Error :: InvalidStatusCode ) ) , } }
Returns a status code from a byte value
Returns a status code from a byte value
value
u8