Expand description

This module can be used to parse HDLC frames.

Example

use hdlcparse::type3::{HdlcAddress, HdlcFrame};

let frame: [u8; 33] = [
   0x7E, 0xA0, 0x20, 0x76, 0x54, 0xAE, 0x1B, 0x46, 0xA9, 0x13, 0x2F, 0x2F, /*HCS*/
   0xE6, 0xE6, 0x00, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA,
   0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x4E, 0x66, /*FCS*/
];
// parse the frame
let hdlc_frame = HdlcFrame::parse(&frame).unwrap();
// check the destination address
assert_eq!(
    hdlc_frame.1.dest_addr,
    HdlcAddress {
        upper: 0x1DAA,
        lower: Some(0x2B8D),
    }
);

Modules

Type3 parser

Enums

Error used to indicate failed parse attempt