示例#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);
        }