Ejemplo n.º 1
0
        /// <summary>
        /// Sends a command to the bus.
        /// </summary>
        /// <param name="address">Address of the device this command is for.</param>
        /// <param name="command">Command of this address</param>
        /// <param name="data">Data to include in this command.</param>
        public void SendCommand(byte address, EosBusCommands command, byte[] data = null)
        {
            EosPacket packet = new EosPacket();

            packet.Destination = address;
            packet.Command     = (byte)command;
            packet.Add(data);
        }
Ejemplo n.º 2
0
        // Helper function to construct LED packets
        private void LedPacket(EosBusCommands command, byte data1, byte?data2 = null)
        {
            EosPacket packet = new EosPacket();

            packet.Destination = _address;
            packet.Command     = (byte)command;
            packet.Add(data1);
            if (data2 != null)
            {
                packet.Add((byte)data2);
            }
            _bus.SendPacket(packet);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a command packet
 /// </summary>
 /// <param name="address">Address of the device to send this command to.</param>
 /// <param name="command">Command to send the device.</param>
 public EosPacket(byte address, EosBusCommands command)
     : this()
 {
     Destination = address;
     Command     = (byte)command;
 }