asterix_parser 0.1.1

Playground do Protocolo ASTERIX
Documentation
use bitvec::prelude::*;

#[test]
pub fn test_string_icao() {
    let characters_in_u8: Vec<u8> = vec![
                                            0b000100,
                                            0b001100,
                                            0b001000,
                                            0b110110,
                                            0b110101,
                                            0b000001,
                                            0b100000,
                                            0b100000
                                        ];
    
    
    let map_icao_characters = [   
                '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
                'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#', '#', '#',
                '#', '#', ' ', '#', '#', '#', '#', '#', '#', '#',
                '#', '#', '#', '#', '#', '#', '#', '#', '0', '1',
                '2', '3', '4', '5', '6', '7', '8', '9', '#', '#',
                '#', '#', '#', '#'];
 
    let mut string_icao= String::new();
    for char_in_u8 in characters_in_u8 {
        let _y = format!("{}", char_in_u8.view_bits::<Msb0>().to_bitvec());
        string_icao.push(map_icao_characters[char_in_u8 as usize]);

        println!("{}",char_in_u8);
        println!("{}",string_icao);
    }
 
    println!("StringICAO: {}", string_icao);
}