コード例 #1
0
        public void Read(RawPDU raw)
        {
            uint len  = raw.Length;
            uint read = 0;

            while (read < len)
            {
                PDV pdv = new PDV();
                read += pdv.Read(raw);
                _pdvs.Add(pdv);
            }
        }
コード例 #2
0
        private bool CreatePDV(bool isLast)
        {
            uint len = Math.Min(GetBufferLength(), _max - (CurrentPduSize() + 6));

            //Platform.Log(LogLevel.Info, "Created PDV of length: {0}",len);
            if (_bytes == null || _bytes.Length != len || _pdu.PDVs.Count > 0)
            {
                _bytes = new byte[len];
            }
            _buffer.Read(_bytes, 0, (int)len);

            PDV pdv = new PDV(_pcid, _bytes, _command, isLast);

            _pdu.PDVs.Add(pdv);

            return(pdv.IsLastFragment);
        }