Esempio n. 1
0
        public byte[] GetBytes()
        {
            AtrWriteStream AtrStream = new AtrWriteStream();

            AtrStream.WriteBytes(this.Preamble.Bytes);
            this.InterfaceByteGroups.ForEach(_ => AtrStream.WriteBytes(_.Bytes));
            AtrStream.WriteBytes(this.HistoricalCharacters.Bytes);
            if (this.ChecksumRequired)
            {
                AtrStream.WriteBytes(this.AtrChecksum.Bytes);
            }

            return(AtrStream.ToByteArray());
        }
Esempio n. 2
0
        internal void NotifyChanged()
        {
            if (this.ChecksumRequired)
            {
                AtrWriteStream AtrStream = new AtrWriteStream();

                AtrStream.WriteBytes(this.Preamble.Bytes);
                this.InterfaceByteGroups.ForEach(_ => AtrStream.WriteBytes(_.Bytes));
                AtrStream.WriteBytes(this.HistoricalCharacters.Bytes);

                this.AtrChecksum = new AtrChecksumToken(AtrStream.ToByteArray());
            }
            else
            {
                this.AtrChecksum = null;
            }
            this.owner.NotifyChanged();
        }