pub struct AnalysisData {
pub data_frame: Vec<u8>,
pub too_short_frame: Vec<u8>,
pub too_long_byte: Option<u8>,
pub next_verify_frame: Vec<u8>,
}
impl AnalysisData {
pub fn success(data_frame: Vec<u8>, next_verify_frame: Vec<u8>) -> Self {
Self::new(data_frame, Vec::new(), None, next_verify_frame)
}
pub fn too_short(too_short_frame: Vec<u8>) -> Self {
Self::new(Vec::new(), too_short_frame, None, Vec::new())
}
pub fn too_long(too_long_byte: u8, next_verify_frame: Vec<u8>) -> Self {
Self::new(Vec::new(), Vec::new(), Some(too_long_byte), next_verify_frame)
}
pub fn next_verify(next_verify_frame: Vec<u8>) -> Self {
Self::success(Vec::new(), next_verify_frame)
}
pub fn new(data_frame: Vec<u8>, too_short_frame: Vec<u8>, too_long_byte: Option<u8>, next_verify_frame: Vec<u8>) -> Self {
Self { data_frame, too_short_frame, too_long_byte, next_verify_frame }
}
}