Hey folks,
Is the Roku ECP protocol flaky or am I just doing something wrong? Half the time my commands are never processed by the Roku. This leads to key presses on my remote doing nothing and other times my keyup command is never received the Roku to scroll forever. The keyboard functionality is horrendous, over half the keys are never processed by the roku. I get no indication that the commands were not processed, there are no exceptions being thrown.
My code looks something like this, any thoughts? the message string is obviously altered for the specific command that i am trying to invoke.
try {
String message = "POST /keydown/" + keyCode + " HTTP/1.1\r\n\r\n";
Socket socket = new Socket(activeIP, 8060);
DataOutputStream dataout = new DataOutputStream(socket.getOutputStream());
dataout.flush();
byte bdata[] = message.getBytes();
dataout.write(bdata, 0, bdata.length);
dataout.flush();
} catch (IOException e) {
Log.e(tag, "Failed to send command", e);
} catch (Exception e) {
Log.e(tag, "Failed to send command", e);
}
Thanks!