Add implementation of http negotiation, handshake, control, and input packets

This commit is contained in:
Cameron Gutman
2013-09-21 18:51:48 -04:00
parent b263367528
commit fcdc23eeb7
16 changed files with 1012 additions and 35 deletions
+49 -2
View File
@@ -12,20 +12,67 @@ public class NvConnection {
this.host = host;
}
private void delay(int ms)
{
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
return;
}
}
public void doShit() throws XmlPullParserException, IOException
{
NvHttp h = new NvHttp(host, "b0:ee:45:57:5d:5f");
System.out.println("Shield Shit");
System.out.println("Begin Shield Action");
System.out.println(h.getAppVersion());
System.out.println(h.getPairState());
int sessionId = h.getSessionId();
System.out.println("Session ID: "+sessionId);
int appId = h.getSteamAppId(sessionId);
System.out.println("Steam app ID: "+appId);
int gameSession = h.launchApp(sessionId, appId);
System.out.println("Started game session: "+gameSession);
System.out.println("Starting handshake");
NvHandshake.performHandshake(host);
System.out.println("Handshake complete");
NvControl nvC = new NvControl(host);
System.out.println("Starting control");
nvC.beginControl();
System.out.println("Startup controller");
NvController controller = new NvController(host);
// Wait 3 seconds to start input
delay(3000);
System.out.println("Beginning controller input");
controller.sendLeftButton();
delay(100);
controller.clearButtons();
delay(250);
controller.sendRightButton();
delay(100);
controller.clearButtons();
delay(250);
controller.sendRightButton();
delay(100);
controller.clearButtons();
delay(250);
controller.sendRightButton();
delay(100);
controller.clearButtons();
delay(250);
controller.sendLeftButton();
delay(100);
controller.clearButtons();
new NvAudioStream().start();
new NvVideoStream().start(host);
}
}