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); }
public CemiLData(CemiMessageCode messageCode, IndividualAddress srcAddress, IAddress dstAddress, byte[] tpdu, Priority priority, bool repeat = true, BroadcastType broadcast = BroadcastType.Normal, bool ack = false, int hopCount = 6) : base(messageCode) { VerifyPayload(tpdu); _additionalInfoLength = 0; _sourceAddress = srcAddress; _destinationAddress = dstAddress; _payload = (byte[])tpdu.Clone(); _apci = new Apci(_payload); _controlField1 = new ControlField1(_messageCode, false, priority, repeat, broadcast, ack); _controlField2 = new ControlField2(_destinationAddress.IsGroupAddress(), hopCount, 0); _size = MESSAGEMINLENGTH + _payload.Length; }