Beispiel #1
0
        public void Add(byte data)
        {
            switch (data)
            {
            case (byte)Protocol.ProtocolEnd:
                var dataArray = mBuffer.DequeueAll();
                var blockData = RawDataToBlockData(dataArray);
                OnRead.Invoke(blockData);
                break;

            default:
                mBuffer.Enqueue(data);
                break;
            }
        }
Beispiel #2
0
        private void MClient_OnRead(string address, MiraeLockedBuffer buffer)
        {
            if (!mAddressMapper.ContainsKey(address))
            {
                return;
            }
            var color = mAddressMapper[address];

            var data = buffer.DequeueAll();

            foreach (var a in data)
            {
                mNetworkBlocks[color].RawBuffer.Add(a);
            }
        }