diff --git a/app/assets/javascripts/testBridge.js b/app/assets/javascripts/testBridge.js index 2be2db69a..c1bb607aa 100644 --- a/app/assets/javascripts/testBridge.js +++ b/app/assets/javascripts/testBridge.js @@ -13,7 +13,8 @@ jSession: '#testBridge-joinSession', testLatency: '#testBridge-TestLatency', testLatencyResponse: '#testBridge-TestLatencyResponse', - getDevices: '#testBridge-GetDevices' + getDevices: '#testBridge-GetDevices', + ftue: '#testBridge-GetSetFTUE' }; function afterShow(data) {} @@ -88,14 +89,22 @@ } function getDevicesHandler(evt) { - var jsFunction = "JK.GetASIODevicesResponse"; - logger.debug("About to try and call jamClient.GetASIODevices. Here's full jamClient:"); - logger.debug(context.jamClient); - context.jamClient.GetASIODevices(jsFunction); + var response = context.jamClient.GetASIODevices(); + logger.debug(response); + $(selectors.getDevices + ' textarea').val(JSON.stringify(response)); } - function GetASIODevicesResponse(response) { - $(selectors.getDevices + ' textarea').val(JSON.stringify(response)); + function getFTUEHandler(evt) { + var response = context.jamClient.GetFTUE(); + logger.debug(response); + $(selectors.ftue + ' textarea[data-what="GetFTUE"]').val(JSON.stringify(response)); + } + + function setFTUEHandler(evt) { + var val = Boolean($(selectors.ftue + ' form input[name="ftue"]:checked').val()); + logger.debug('ftue:' + val); + logger.debug(typeof(val)); + context.jamClient.SetFTUE(val); } function events() { @@ -103,6 +112,8 @@ $(selectors.jSession + ' input[type="button"]').click(joinSessionHandler); $(selectors.testLatency + ' input[type="button"]').click(testLatencyHandler); $(selectors.getDevices + ' input[type="button"]').click(getDevicesHandler); + $(selectors.ftue + ' input[type="button"][value="Get"]').click(getFTUEHandler); + $(selectors.ftue + ' input[type="button"][value="Set"]').click(setFTUEHandler); } function initialize() { @@ -116,7 +127,6 @@ this.initialize = initialize; context.JK.TestBridgeLatencyResponse = latencyResponse; - context.JK.GetASIODevicesResponse = GetASIODevicesResponse; }; diff --git a/app/views/clients/_testBridge.html.erb b/app/views/clients/_testBridge.html.erb index 48f646fef..6b6d51ada 100644 --- a/app/views/clients/_testBridge.html.erb +++ b/app/views/clients/_testBridge.html.erb @@ -34,6 +34,21 @@
+
+
+

GetFTUE

+ + +
+
SetFTUE +
+ + + +
+
+

GetASIODevices