public override void SetValueCommunication(int channel, ValueType value)
            {
                CheckChannelRange(channel);
                var buf = new WriteBuffer();

                buf.Add((byte)channel, sizeof(byte));
                buf.Add(Convert.ToBoolean(value), sizeof(bool));
                Write(30, buf);
            }
            protected void SetupOutletCommunication(int outlet, bool fallback)
            {
                byte valueToSend = 0x00;

                if (fallback)
                {
                    valueToSend = 0xFF;
                }
                var buf = new WriteBuffer();

                buf.Add((byte)outlet, sizeof(byte));
                buf.Add(valueToSend, sizeof(byte));
                Write(2, buf, true);
            }
Beispiel #3
0
            public override void SetAllValuesCommunication(ValueType[] values)
            {
                if (values.Length < channelCount)
                {
                    throw new ArgumentOutOfRangeException(nameof(values), "values length");
                }

                var valuesToSend = new float[channelCount];

                for (int i = 0; i < 4; ++i)
                {
                    valuesToSend[i] = Convert.ToSingle(values[i]);
                }

                var buf = new WriteBuffer();

                foreach (var val in valuesToSend)
                {
                    buf.Add(val, sizeof(float));
                }
                Write(30, buf);
            }
Beispiel #4
0
 public void Write(ByteBuffer byteBuffer)
 {
     WriteBuffer.Add(byteBuffer);
 }