Skip to content

Commit

Permalink
Added example for E2SM codec test
Browse files Browse the repository at this point in the history
Initially we were simply parsing E2SM specificiation, Now also added
codec example.
  • Loading branch information
gabhijit committed Oct 31, 2023
1 parent d8b529e commit 09a1801
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/tests/18-e2sm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,18 @@ mod e2sm {
}

fn main() {
use asn1_codecs::{aper::AperCodec, PerCodecData};
eprintln!("E2SM");

// This will break: Fixed
let decode_str = "080000000100000000002043514901200000";

// This one works if it is uncommented
//let decode_str = "08000000010000000000204351490120000000";

let decode_hex = hex::decode(decode_str).unwrap();
let mut codec_data = PerCodecData::from_slice_aper(&decode_hex);
let e2sm_kpmv3_pdu = e2sm::E2SM_KPM_IndicationMessage::aper_decode(&mut codec_data);

eprintln!("e2sm_kpmv3_pdu: {:#?}", e2sm_kpmv3_pdu.unwrap());
}

0 comments on commit 09a1801

Please sign in to comment.