Ejemplo n.º 1
0
        public bool Read(I2CDevice.Configuration config, byte[] readBuffer, int timeoutMilliseconds)
        {
            DeviceBuffers device = GetDevice(config.Address);

            device.Input.ReadInto(readBuffer, 0, readBuffer.Length);
            return(true);
        }
Ejemplo n.º 2
0
        public bool Write(I2CDevice.Configuration config, byte[] writeBuffer, int timeoutMilliseconds)
        {
            DeviceBuffers device = GetDevice(config.Address);

            device.Output.Append(writeBuffer);
            return(true);
        }
Ejemplo n.º 3
0
        private DeviceBuffers GetDevice(ushort address)
        {
            Ring.IndexedLink indexedLink = _devices.Find(obj => ((DeviceBuffers)obj).Address == address);
            if (indexedLink != null)
            {
                return((DeviceBuffers)indexedLink.Value);
            }
            var temp = new DeviceBuffers(address);

            _devices.InsertTail(temp);
            return(temp);
        }
Ejemplo n.º 4
0
        public void BufferInputFor(ushort address, params byte[] input)
        {
            DeviceBuffers deviceBuffers = GetDevice(address);

            deviceBuffers.Input.Append(input);
        }