pub fn handle_serial(
    state: &mut SerialState<'_>,
    buf: &[u8],
    output: &mut dyn Write
) -> Result<()>