dvb_bbframe/lib.rs
1//! ETSI DVB-S2 / S2X / T2 BBFrame parser + builder.
2//!
3//! Supports both Normal Mode (NM) and High Efficiency Mode (HEM)
4//! per EN 302 755 v1.4.1 §5.1.7.
5//!
6//! Entry points:
7//! - [`header::Bbheader`] — the 10-byte BBHEADER with parse + serialize.
8//! - [`packet::up_iter`] — user packet extraction from the data field.
9//! - [`crc::crc8`] — CRC-8 encoder (EN 302 307-1 §5.1.4 / EN 302 755 Annex F).
10//! - [`issy`] — ISSY field parser (EN 302 755 Annex C).
11//!
12//! # Quick start
13//! ```
14//! use dvb_bbframe::header::{Bbheader, Matype, Mode, TsGs, BBHEADER_LEN};
15//!
16//! let hdr = Bbheader {
17//! matype: Matype { ts_gs: TsGs::Ts, sis: true, ccm: true, issyi: false, npd: false, ext: 0, isi: 0 },
18//! upl: 1504, sync: 0x47, dfl: 1504, syncd: 0, mode: Mode::Normal, issy_in_header: None,
19//! };
20//! let bytes = hdr.serialize(); // 10-byte BBHEADER
21//! assert_eq!(bytes.len(), BBHEADER_LEN);
22//! assert_eq!(Bbheader::parse(&bytes).unwrap(), hdr); // byte-identical round-trip
23//! ```
24//! For recovering the inner TS carried in a T2-MI stream, see
25//! `dvb_t2mi::inner_ts::InnerTsRecovery`, which drives this header + the
26//! [`packet`] extractor for you.
27//!
28//! # RFU policy
29//!
30//! BBFrame `reserved_future_use` bits are **emitted as 1** and
31//! `reserved_zero_future_use` bits as **0**, following the DVB convention.
32//! Parsers accept any value (no rejection on non-zero RFU) for forward
33//! compatibility.
34
35#![warn(missing_docs)]
36
37pub mod crc;
38pub mod error;
39pub mod header;
40pub mod issy;
41pub mod packet;
42
43pub use error::{Error, Result};