Esempio n. 1
0
        public void AddMultiHandler(PumpStateHistoryReadInfoResponse response)
        {
            MultiPacketHandler handler = new MultiPacketHandler(_session);

            handler.ReadInfoResponse = response;
            MultiPacketHandlers.Add(handler);
            _session.SessionVariables.GetNextMultiPacketIndex();
            //CurrentMultiPacketHandler = handler;
        }
Esempio n. 2
0
        public Segment(byte[] block, MultiPacketHandler handler)
        {
            _handler = handler;

            Block.AddRange(block);

            Datasize = block.GetUInt16BigE(block.Length - 4);
            if (Datasize > 0 && Datasize <= block.Length)
            {
                BlockData     = Block.GetRange(0, Datasize);
                BlockCheckSum = Block.ToArray().GetUInt16BigE(block.Length - 2);
                //maybe not the 0xffff.... test
                CalculateCheckSum       = BlockData.ToArray().GetCrc16citt() & 0xffff;
                this.IsBlockDataCorrect = BlockCheckSum == CalculateCheckSum;
            }
        }
Esempio n. 3
0
 public SegementHandler(MultiPacketHandler handler, InitiateMultiPacketTransferResponse response)
 {
     _handler = handler;
     Init     = response;
 }