public CommandResponse PerformCommand(ICommand command)
        {
            command.Dump();

            byte[] rawCommand = command.ToByteArray();
            byte[] rawCommandWithLength = new byte[rawCommand.Length + 1];
            rawCommandWithLength[0] = (byte)(rawCommand.Length + 1);
            Buffer.BlockCopy(rawCommand, 0, rawCommandWithLength, 1, rawCommand.Length);
            byte[] response = PerformRawCommand(rawCommandWithLength);
            CommandResponse commandResponse = new CommandResponse(response);

            commandResponse.Dump();

            return commandResponse;
        }
Example #2
0
        public CommandResponse PerformCommand(ICommand command)
        {
            command.Dump();

            byte[] rawCommand           = command.ToByteArray();
            byte[] rawCommandWithLength = new byte[rawCommand.Length + 1];
            rawCommandWithLength[0] = (byte)(rawCommand.Length + 1);
            Buffer.BlockCopy(rawCommand, 0, rawCommandWithLength, 1, rawCommand.Length);
            byte[]          response        = PerformRawCommand(rawCommandWithLength);
            CommandResponse commandResponse = new CommandResponse(response);

            commandResponse.Dump();

            return(commandResponse);
        }