pub fn from_byte(value: u8) -> Result<Self> {
        match value {
            0 => Ok(Self::appIDLE),
            1 => Ok(Self::appDETACH),
            2 => Ok(Self::dfuIDLE),
            3 => Ok(Self::dfuDNLOAD_SYNC),
            4 => Ok(Self::dfuDNBUSY),
            5 => Ok(Self::dfuDNLOAD_IDLE),
            6 => Ok(Self::dfuMANIFEST_SYNC),
            7 => Ok(Self::dfuMANIFEST),
            8 => Ok(Self::dfuMANIFEST_WAIT_RESET),
            9 => Ok(Self::dfuUPLOAD_IDLE),
            10 => Ok(Self::dfuERROR),
            _ => Err(Box::new(Error::InvalidStateCode)),
        }
    }
/// Returns a state code from a byte value
Returns a state code from a byte value
Returns a state code from a byte value
pub fn from_byte(value: u8) -> Result<Self> {
        match value {
            0 => Ok(Self::appIDLE),
            1 => Ok(Self::appDETACH),
            2 => Ok(Self::dfuIDLE),
            3 => Ok(Self::dfuDNLOAD_SYNC),
            4 => Ok(Self::dfuDNBUSY),
            5 => Ok(Self::dfuDNLOAD_IDLE),
            6 => Ok(Self::dfuMANIFEST_SYNC),
            7 => Ok(Self::dfuMANIFEST),
            8 => Ok(Self::dfuMANIFEST_WAIT_RESET),
            9 => Ok(Self::dfuUPLOAD_IDLE),
            10 => Ok(Self::dfuERROR),
            _ => Err(Box::new(Error::InvalidStateCode)),
        }
    }
pub fn from_byte ( value : u8 ) -> Result < Self > { match value { 0 => Ok ( Self :: appIDLE ) , 1 => Ok ( Self :: appDETACH ) , 2 => Ok ( Self :: dfuIDLE ) , 3 => Ok ( Self :: dfuDNLOAD_SYNC ) , 4 => Ok ( Self :: dfuDNBUSY ) , 5 => Ok ( Self :: dfuDNLOAD_IDLE ) , 6 => Ok ( Self :: dfuMANIFEST_SYNC ) , 7 => Ok ( Self :: dfuMANIFEST ) , 8 => Ok ( Self :: dfuMANIFEST_WAIT_RESET ) , 9 => Ok ( Self :: dfuUPLOAD_IDLE ) , 10 => Ok ( Self :: dfuERROR ) , _ => Err ( Box :: new ( Error :: InvalidStateCode ) ) , } }
Returns a state code from a byte value
Returns a state code from a byte value
value
u8