public static string SendKeyCommand(Commands.CommandCodeList commandCode) { //Send command var command = new KeyInputClass { session = SessionId, type = "HandleKeyInput", value = commandCode.GetHashCode() }; return(SendCommand(command, CommandType.Keyinput)); }
static void Main() { Console.WriteLine("Starting"); var deviceIp = SearchForDevice("47LM6700"); deviceIp.Wait(); if (deviceIp.Result != "") { Console.WriteLine("TV Found and IP is {0}", deviceIp.Result); } //Determine if session ID exists //If not do Auth Method while (true) { Console.WriteLine("What Command do you want to send? Type exit to exit"); var commandRead = Console.ReadLine(); if (commandRead != null && commandRead.ToLowerInvariant() == "exit") { return; } //Send command var command = new KeyInputClass { session = SessionId, type = "HandleKeyInput", value = int.Parse(commandRead) }; var response = SendCommand(command, CommandType.Keyinput); Console.WriteLine(response); } }