Beispiel #1
0
        public Tlv(ushort tlvCommand, TlvBody tlvBody, byte[] cryptKey)
            : base()
        {
            _tlvCommand = tlvCommand;
            _tlvBody    = tlvBody;

            PutUshortBE(tlvCommand);
            EnterBarrierEncrypted(Prefix.Uint16, Endian.Big, TeaCryptor.Instance, cryptKey);
            {
                PutPacket(tlvBody);
            }
            LeaveBarrier();
        }
Beispiel #2
0
        public Tlv(ushort tlvCommand, TlvBody tlvBody)
            : base()
        {
            _tlvCommand = tlvCommand;
            _tlvBody    = tlvBody;

            PutUshortBE(tlvCommand);
            EnterBarrier(Prefix.Uint16, Endian.Big);
            {
                PutPacket(tlvBody);
            }
            LeaveBarrier();
        }
Beispiel #3
0
 public Tlv(ushort tlvCommand, byte[] data) : base(null)
 {
     _tlvCommand    = tlvCommand;
     _tlvBodyLength = (ushort)data.Length;
     _tlvBody       = TlvBody.FromBuffer(tlvCommand, data);
 }