public readonly void Assert() { if (ConnectionConfirmAndCredit != 0b1101_0000) { CotpProtocolException.ThrowSpecConnectionConfirmDoesNotMatch(); } //if (DestinationReference != 46) throw new Exception("Destination reference mismatch."); //if (SourceReference != 0) throw new Exception("Source reference mismatch."); if (ClassAndOption != 0) { CotpProtocolException.ThrowOnlyClass0SupportedForTPKT(); } }
public readonly void Assert() { if (Length != 2) { CotpProtocolException.ThrowInvalidLength(Length); } if (DataIdentifier != 0b1111_0000) { CotpProtocolException.ThrowInvalidDTIdentifier(DataIdentifier); } if ((PduNumberAndEot & 0b1_000_0000) == 0) { CotpProtocolException.ThrowNotASinglePDUReturn(); } }