mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-23 08:45:48 +08:00
Merge branch 'master' into mqtt
This commit is contained in:
16
CRC.cpp
16
CRC.cpp
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015,2016,2023 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2023,2025 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -127,7 +127,7 @@ const uint16_t CCITT16_TABLE2[] = {
|
||||
#if defined(USE_DMR)
|
||||
bool CCRC::checkFiveBit(bool* in, unsigned int tcrc)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
|
||||
unsigned int crc;
|
||||
encodeFiveBit(in, crc);
|
||||
@@ -137,7 +137,7 @@ bool CCRC::checkFiveBit(bool* in, unsigned int tcrc)
|
||||
|
||||
void CCRC::encodeFiveBit(const bool* in, unsigned int& tcrc)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
|
||||
unsigned short total = 0U;
|
||||
for (unsigned int i = 0U; i < 72U; i += 8U) {
|
||||
@@ -155,7 +155,7 @@ void CCRC::encodeFiveBit(const bool* in, unsigned int& tcrc)
|
||||
#if defined(USE_DMR) || defined(USE_YSF) || defined(USE_P25)
|
||||
void CCRC::addCCITT162(unsigned char *in, unsigned int length)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
assert(length > 2U);
|
||||
|
||||
union {
|
||||
@@ -176,7 +176,7 @@ void CCRC::addCCITT162(unsigned char *in, unsigned int length)
|
||||
|
||||
bool CCRC::checkCCITT162(const unsigned char *in, unsigned int length)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
assert(length > 2U);
|
||||
|
||||
union {
|
||||
@@ -198,7 +198,7 @@ bool CCRC::checkCCITT162(const unsigned char *in, unsigned int length)
|
||||
#if defined(USE_DSTAR)
|
||||
void CCRC::addCCITT161(unsigned char *in, unsigned int length)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
assert(length > 2U);
|
||||
|
||||
union {
|
||||
@@ -219,7 +219,7 @@ void CCRC::addCCITT161(unsigned char *in, unsigned int length)
|
||||
|
||||
bool CCRC::checkCCITT161(const unsigned char *in, unsigned int length)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
assert(length > 2U);
|
||||
|
||||
union {
|
||||
@@ -241,7 +241,7 @@ bool CCRC::checkCCITT161(const unsigned char *in, unsigned int length)
|
||||
#if defined(USE_DMR)
|
||||
unsigned char CCRC::crc8(const unsigned char *in, unsigned int length)
|
||||
{
|
||||
assert(in != NULL);
|
||||
assert(in != nullptr);
|
||||
|
||||
uint8_t crc = 0U;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user