Exemplo n.º 1
0
		internal void ClearCommand()
		{
			currentCommand = null;
		}
Exemplo n.º 2
0
		internal async Task<string> SendCommand(Command command, int timeout)
		{
			var result = string.Empty;

			await transmitRunner.InvokeAsync(() =>
			{
				SetCommand(command);

				if (DebugMode)
				{
					console.WriteLine("[Sending] " + command.Encode());
				}

				input.WriteLine(command.Encode());
				input.Flush();

				result = WaitForResponse(timeout);

				ClearCommand();
			});

			return result;
		}
Exemplo n.º 3
0
		internal Command SetCommand(Command command)
		{
			if (currentCommand != null)
			{
				console.WriteLine("Serious error.");
			}

			currentCommand = command;
			return command;
		}