public static RXFrequency fromRaw(byte[] rawData) { RXFrequency rxf = new RXFrequency(); byte[] bcdBytes = new byte[4]; Array.Copy(rawData, offset, bcdBytes, 0, 4); if ((bcdBytes[0] ^ 0xff) > 0 && (bcdBytes[1] ^ 0xff) > 0 && (bcdBytes[2] ^ 0xff) > 0 && (bcdBytes[3] ^ 0xff) > 0) { rxf.fromBCD(bcdBytes); } else { rxf.Value = -1; } return(rxf); }