private void ParseLength(IndividualEndianessBinaryReader br) { _infoLength = br.ReadByte(); if (br.Available < _infoLength) { throw BufferSizeException.TooSmall("AdditionalFieldInfo"); } }
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); }
private void ParseType(IndividualEndianessBinaryReader br) { var infotype = br.ReadByte(); if (Enum.IsDefined(typeof(AdditionalInfoType), infotype)) { _infoType = (AdditionalInfoType)infotype; } else { throw BufferFieldException.TypeUnknown("AdditionalInfoType", infotype); } }
protected void ParseControlField2(IndividualEndianessBinaryReader br) { var ctrl = br.ReadByte(); _controlField2 = new ControlField2(ctrl); }
protected void ParseControlField1(IndividualEndianessBinaryReader br) { var ctrl1 = br.ReadByte(); _controlField1 = new ControlField1(_messageCode, ctrl1); }