fn checksum_for_payload(
        payload: &[u8],
        _dump_ck: bool,
    ) -> [u8; UBX_CKSUM_LEN] {
        let mut checksum = [0u8; UBX_CKSUM_LEN];
        for word in payload {
            checksum[0] = checksum[0].wrapping_add(*word);
            checksum[1] = checksum[1].wrapping_add(checksum[0]);
        }
        checksum
    }
/// generate a 16 bit checksum for a payload
generate a 16 bit checksum for a payload
generate a 16 bit checksum for a payload
fn checksum_for_payload(
        payload: &[u8],
        _dump_ck: bool,
    ) -> [u8; UBX_CKSUM_LEN] {
        let mut checksum = [0u8; UBX_CKSUM_LEN];
        for word in payload {
            checksum[0] = checksum[0].wrapping_add(*word);
            checksum[1] = checksum[1].wrapping_add(checksum[0]);
        }
        checksum
    }
fn checksum_for_payload ( payload : & [ u8 ] , _dump_ck : bool , ) -> [ u8 ; UBX_CKSUM_LEN ] { let mut checksum = [ 0u8 ; UBX_CKSUM_LEN ] ; for word in payload { checksum [ 0 ] = checksum [ 0 ] . wrapping_add ( * word ) ; checksum [ 1 ] = checksum [ 1 ] . wrapping_add ( checksum [ 0 ] ) ; } checksum }
generate a 16 bit checksum for a payload
generate a 16 bit checksum for a payload
payload
&[u8]
_dump_ck
bool
payload
&[u8]
_dump_ck
bool