예제 #1
0
        public Apdu(TLV tlv)
            : this()
        {
            base.Identifier = BerIdentifier.Encode(BerIdentifier.Application, BerIdentifier.Constructed, 1);
            base.Bytes      = tlv.Bytes;
            ByteArraySegment pdu = tlv.Value.Bytes;

            pdu.Length = 0;
            TLV tmp = new TLV(pdu.EncapsulatedBytes());

            gocbRef = new VisibleString(tmp);

            pdu.Length       += tmp.Bytes.Length;
            tmp               = new TLV(pdu.EncapsulatedBytes());
            timeAllowedtoLive = new Integer(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            datSet      = new VisibleString(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            if (IsGoIDTag(tmp.Tag.RawBytes))
            {
                goID = new VisibleString(tmp);
            }

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            t           = new UtcTime(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            stNum       = new Integer(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            sqNum       = new Integer(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            test        = new TAsn1.Boolean(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            confRev     = new Integer(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            ndsCom      = new TAsn1.Boolean(tmp);

            pdu.Length      += tmp.Bytes.Length;
            tmp              = new TLV(pdu.EncapsulatedBytes());
            numDatSetEntries = new Integer(tmp);

            pdu.Length += tmp.Bytes.Length;
            tmp         = new TLV(pdu.EncapsulatedBytes());
            int cnt = 0;
            //    int len = tmp.Value.Bytes.Length;

            TLV data = new TLV(tmp.Value.Bytes);

            allData.Add(new Data(data));
            cnt++;

            while (cnt < numDatSetEntries.Value)
            {
                data = new TLV(tmp.Value.Bytes.EncapsulatedBytes());
                tmp.Value.Bytes.Length += data.Bytes.Length;
                //TLV data = new TLV(tmp.Value.Bytes);
                allData.Add(new Data(data));
                cnt++;
                //tmp.Value.Bytes.Length += data.Bytes.Length;
            }
        }
예제 #2
0
 public OctetString()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.Universal, BerIdentifier.Primitive, BerIdentifier.OctetString);
 }
예제 #3
0
 private static bool IsGoIDTag(byte[] tag)
 {
     return(tag.IsSame(BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Primitive, 3)));
 }
예제 #4
0
 public Structure()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Constructed, 2);
     Values          = new List <object>();
     Types           = new List <VariableType>();
 }
 public InformationReport()
 {
     // According to MMS defination
     this.Identifier           = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Constructed, 0);
     this.ListOfAccessResultId = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Constructed, 0);
 }
예제 #6
0
 public Integer()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.Universal, BerIdentifier.Primitive, BerIdentifier.Integer);
 }
예제 #7
0
 public FloatPoint()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Primitive, 12);
 }
예제 #8
0
 public VisibleString()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.Universal, BerIdentifier.Primitive, BerIdentifier.VisibleString);
 }
예제 #9
0
 public UnconfirmedPdu()
 {
     // According to the MMS standard's defination.
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Constructed, 3);
 }
예제 #10
0
 public UtcTime()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Primitive, 17);
 }
예제 #11
0
 public ListOfAccessResult()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Constructed, 0);
 }
예제 #12
0
 public TimeOfDay()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Primitive, 12);
 }
예제 #13
0
 public Boolean()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.Universal, BerIdentifier.Primitive, BerIdentifier.Boolean);
 }
예제 #14
0
 public VariableListName()
 {
     this.Identifier = BerIdentifier.Encode(BerIdentifier.ContextSpecific, BerIdentifier.Primitive, 0);
     //this.Bytes=
 }