Skip to content

Commit a76777f

Browse files
authored
Added doc comments for the edc module (#33)
1 parent 9e503b3 commit a76777f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/edc.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
//! Error detection code
2+
13
use crate::c_bindings;
24

5+
/// Calculate Qualcomm 24-bit Cyclical Redundancy Check (CRC-24Q).
6+
///
7+
/// This CRC is used with the RTCM protocol
8+
///
9+
/// The CRC polynomial used is:
10+
/// x^{24} + x^{23} + x^{18} + x^{17} + x^{14} + x^{11} + x^{10} +
11+
/// x^7 + x^6 + x^5 + x^4 + x^3 + x+1
12+
///
13+
/// Mask 0x1864CFB, not reversed, not XOR'd
314
pub fn compute_crc24q(buf: &[u8], initial_value: u32) -> u32 {
415
unsafe { c_bindings::crc24q(buf.as_ptr(), buf.len() as u32, initial_value) }
516
}

0 commit comments

Comments
 (0)