Пример #1
0
 private void ParseLength(IndividualEndianessBinaryReader br)
 {
     _infoLength = br.ReadByte();
     if (br.Available < _infoLength)
     {
         throw BufferSizeException.TooSmall("AdditionalFieldInfo");
     }
 }
Пример #2
0
        protected void ParseAPDU(IndividualEndianessBinaryReader br)
        {
            // read length information and increase lenght by one due to TPCI/APCI encoding
            var len = br.ReadByte() + 1;

            if (br.Available < len)
            {
                throw BufferSizeException.TooBig("Cemi Frame - TCPI Data");
            }
            _payload = br.ReadBytes(len);
            _apci    = new Apci(_payload);
        }
Пример #3
0
        private void ParseType(IndividualEndianessBinaryReader br)
        {
            var infotype = br.ReadByte();

            if (Enum.IsDefined(typeof(AdditionalInfoType), infotype))
            {
                _infoType = (AdditionalInfoType)infotype;
            }
            else
            {
                throw BufferFieldException.TypeUnknown("AdditionalInfoType", infotype);
            }
        }
Пример #4
0
        protected void ParseControlField2(IndividualEndianessBinaryReader br)
        {
            var ctrl = br.ReadByte();

            _controlField2 = new ControlField2(ctrl);
        }
Пример #5
0
        protected void ParseControlField1(IndividualEndianessBinaryReader br)
        {
            var ctrl1 = br.ReadByte();

            _controlField1 = new ControlField1(_messageCode, ctrl1);
        }