예제 #1
0
        private void ButtonEnviar_OnClick(object sender, RoutedEventArgs e)
        {
            byte[] values = { 0, 2, 3, 4 };
            CommandExecEventArgs evArgs = new CommandExecEventArgs(this.CommandHeader, this.CommandByteCount, this.CommandCommand, this.CommandAdress, this.CommandValueCount, values);

            EnviarClicked?.Invoke(this, evArgs);
            MessageBox.Show("enviado");
        }
        private void OnCommandSended(object sender, CommandExecEventArgs e)
        {
            Byte[] message = convertToList(e);

            var dataOutPayload = new DataOutPayloadBase
            {
                Bytes = message
            };

            CommandCompleteEventArgs evArgs = new CommandCompleteEventArgs(dataOutPayload);

            MessageBox.Show("enviado 2" + e._header);
            completeEvent?.Invoke(this, evArgs);
            // Console.WriteLine("\nThe book '" + e._command + "' has been read by Reader A");
        }
 private Byte[] convertToList(CommandExecEventArgs e)
 {
     Byte[] Bytes = new Byte[] { e._header, e._bytecount, e._command, e._address, e._valueCount };
     return(Bytes);
 }