Skip to main content

Crate dvb_common

Crate dvb_common 

Source
Expand description

Shared primitives for the dvb_si / dvb_t2mi / dvb_bbframe family.

See individual modules for documentation: the Parse / Serialize traits every wire type implements, the MPEG-2 crc32_mpeg2 CRC, and the bcd / time codecs.

§Quick start

use dvb_common::{bcd, crc32_mpeg2};

// Binary-coded decimal (as used in MJD/BCD time fields):
assert_eq!(bcd::from_bcd_byte(0x42), Some(42));
assert_eq!(bcd::to_bcd_byte(42), Some(0x42));

// MPEG-2 CRC-32 over a section body (deterministic):
let crc = crc32_mpeg2::compute(&[0xDE, 0xAD, 0xBE, 0xEF]);
assert_eq!(crc, crc32_mpeg2::compute(&[0xDE, 0xAD, 0xBE, 0xEF]));

Re-exports§

pub use traits::Parse;
pub use traits::Serialize;

Modules§

bcd
Binary-coded decimal (BCD) codec for DVB wire fields.
crc32_mpeg2
CRC-32 MPEG-2 — Annex C of ETSI EN 300 468, Annex A of ETSI TS 102 773.
time
UTC time and duration codecs for DVB wire fields.
traits
Canonical Parse and Serialize traits for the DVB crate family.