Exemplo n.º 1
0
        public void DetectBitErrors(BitData transmittedData)
        {
            var payloadBytes = transmittedData.TramsmittedBytes;
            var crc          = ComputeChecksum(payloadBytes);

            transmittedData.IncorrectTransmission = crc != 0;
        }
Exemplo n.º 2
0
        public void DetectBitErrors(BitData transmittedData)
        {
            //var parityBit = transmittedData.TransmittedBits.Last();
            var onesCount = CountOnes(transmittedData.TransmittedBits);

            transmittedData.IncorrectTransmission = onesCount % 2 == 1;
        }
Exemplo n.º 3
0
        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;
            }
        }