Skip to content

Commit

Permalink
Merge pull request #30 from akumaigorodski/rc
Browse files Browse the repository at this point in the history
Add RC-specific 0xEE sync byte
  • Loading branch information
tact1m4n3 authored Jan 11, 2025
2 parents 571b328 + 75d0e6d commit b94bc9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub use parser::*;
mod util;

pub const SYNC_BYTE: u8 = 0xC8;
pub const SYNC_RC_BYTE: u8 = 0xEE;
pub const MAX_PACKET_LEN: usize = 64;

pub(crate) const CRC8: crc::Crc<u8> = crc::Crc::<u8>::new(&crc::CRC_8_DVB_S2);
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{util::BytesReader, Packet, PacketType, RawPacket, CRC8, MAX_PACKET_LEN, SYNC_BYTE};
use crate::{util::BytesReader, Packet, PacketType, RawPacket, CRC8, MAX_PACKET_LEN, SYNC_BYTE, SYNC_RC_BYTE};
use snafu::Snafu;

/// Struct for configuring a `Parser`.
Expand All @@ -10,7 +10,7 @@ pub struct ParserConfig {

impl ParserConfig {
pub const fn default() -> Self {
Self { sync: &[SYNC_BYTE] }
Self { sync: &[SYNC_RC_BYTE, SYNC_BYTE] }
}
}

Expand Down

0 comments on commit b94bc9d

Please sign in to comment.