public void DetectBitErrors(BitData transmittedData) { var payloadBytes = transmittedData.TramsmittedBytes; var crc = ComputeChecksum(payloadBytes); transmittedData.IncorrectTransmission = crc != 0; }
public void DetectBitErrors(BitData transmittedData) { //var parityBit = transmittedData.TransmittedBits.Last(); var onesCount = CountOnes(transmittedData.TransmittedBits); transmittedData.IncorrectTransmission = onesCount % 2 == 1; }
public void DetectBitErrors(BitData transmittedData) { var transmitted = transmittedData.TransmittedBits; var syndrome = ErrorSyndrome(transmitted); if (syndrome == 0) { transmittedData.IncorrectTransmission = false; } else if (syndrome <= transmitted.Length) { transmittedData.FixedBitErrorIndexes = new int[] { syndrome - 1 }; } else { transmittedData.IncorrectTransmission = true; } }