2018-03-08 11:34:58 -08:00
|
|
|
<!DOCTYPE html>
|
2022-04-01 15:49:18 -07:00
|
|
|
<html lang="en">
|
2018-03-08 11:34:58 -08:00
|
|
|
<head>
|
2018-05-25 13:56:11 -07:00
|
|
|
<title>Scratch Link Test Client Fun Stuff Yay</title>
|
2019-01-15 10:22:41 -08:00
|
|
|
<style>
|
|
|
|
button, input {
|
|
|
|
margin: 0.125rem auto;
|
|
|
|
}
|
|
|
|
</style>
|
2018-03-08 11:34:58 -08:00
|
|
|
</head>
|
|
|
|
<body>
|
2018-05-16 13:55:32 -07:00
|
|
|
<div><label for="log">Log</label></div>
|
|
|
|
<textarea id="log" title="log" readonly style="width: 40rem; height: 10rem;"></textarea>
|
|
|
|
<div>
|
|
|
|
<input id="follow" type="checkbox" title="Follow" checked>
|
|
|
|
<label for="follow">Follow</label>
|
|
|
|
</div>
|
2022-02-16 09:40:13 -08:00
|
|
|
<fieldset>
|
|
|
|
<legend>Host</legend>
|
|
|
|
<div>
|
|
|
|
<input id="linkSecure" type="checkbox" title="WSS" />
|
|
|
|
<label for="linkSecure">WSS?</label>
|
|
|
|
<input id="linkHost" value="127.0.0.1" type="text" placeholder="Scratch Link host" style="width: 30rem;" />
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2018-05-16 13:55:32 -07:00
|
|
|
<fieldset>
|
2018-10-04 14:29:47 -07:00
|
|
|
<legend>BLE</legend>
|
2018-05-16 13:55:32 -07:00
|
|
|
<div>
|
|
|
|
<button id="initBLE">Connect to app</button>
|
2019-08-06 16:09:23 -07:00
|
|
|
<button id="getVersionBLE">Get Version</button>
|
2018-05-16 13:55:32 -07:00
|
|
|
<button id="pingBLE">Request ping</button>
|
|
|
|
</div>
|
2018-10-04 14:29:47 -07:00
|
|
|
<div>
|
|
|
|
<button id="discoverBLE">Discover peripherals</button>
|
|
|
|
<button id="connectBLE">Connect to discovered peripheral</button>
|
2019-02-18 17:40:18 -05:00
|
|
|
<button id="getServicesBLE">Get services of connected peripheral</button>
|
2018-10-04 14:29:47 -07:00
|
|
|
</div>
|
2022-11-07 15:52:08 -08:00
|
|
|
<fieldset>
|
|
|
|
<legend>Stress Test</legend>
|
|
|
|
<button id="stressBLE">Go</button>
|
|
|
|
<input id="stressPingBLE" type="checkbox" title="Ping?" />
|
|
|
|
<label for="stressPingBLE">Ping?</label>
|
|
|
|
<input id="stressGetVersionBLE" type="checkbox" title="Get version?" />
|
|
|
|
<label for="stressGetVersionBLE">Get version?</label>
|
|
|
|
<input id="stressDiscoverBLE" type="checkbox" title="Discover?" />
|
|
|
|
<label for="stressDiscoverBLE">Discover?</label>
|
|
|
|
<input id="stressConnectBLE" type="checkbox" title="Connect?" />
|
|
|
|
<label for="stressConnectBLE">Connect?</label>
|
|
|
|
</fieldset>
|
2019-01-15 10:22:41 -08:00
|
|
|
<fieldset>
|
|
|
|
<legend>Optional Services</legend>
|
|
|
|
<textarea id="optionalServicesBLE" placeholder="Optional services, if any, separated by whitespace" style="width:20rem;height:3rem;"></textarea>
|
|
|
|
</fieldset>
|
|
|
|
<div id="filtersBLE">
|
|
|
|
<button id="addFilterBLE">Add a filter</button>
|
|
|
|
Discovery filters:
|
|
|
|
</div>
|
2018-10-04 14:29:47 -07:00
|
|
|
<fieldset>
|
|
|
|
<legend>micro:bit</legend>
|
|
|
|
<button id="setServiceMicroBit">Set service ID</button>
|
|
|
|
<button id="readMicroBit">Read and monitor data</button>
|
|
|
|
<button id="writeMicroBit">Change the LEDs</button>
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
<legend>WeDo 2.0</legend>
|
|
|
|
<button id="setServiceWeDo2">Set service ID</button>
|
|
|
|
</fieldset>
|
2019-01-15 10:22:41 -08:00
|
|
|
<fieldset>
|
|
|
|
<legend>GDX-FOR</legend>
|
|
|
|
<button id="setGDXFOR">Set discovery parameters</button>
|
|
|
|
</fieldset>
|
2018-05-16 13:55:32 -07:00
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
<legend>BT / EV3</legend>
|
|
|
|
<div>
|
|
|
|
<button id="initBT">Connect to app (BT)</button>
|
2019-08-06 16:09:23 -07:00
|
|
|
<button id="getVersionBT">Get Version</button>
|
2018-05-21 08:34:37 -05:00
|
|
|
<button id="discoverBT">Find BT devices</button>
|
2018-05-16 13:55:32 -07:00
|
|
|
<button id="closeBT">Goodbye</button>
|
|
|
|
</div>
|
2022-11-07 15:52:08 -08:00
|
|
|
<fieldset>
|
|
|
|
<legend>Stress Test</legend>
|
|
|
|
<button id="stressBT">Go</button>
|
|
|
|
<input id="stressPingBT" type="checkbox" title="Ping?" />
|
|
|
|
<label for="stressPingBT">Ping?</label>
|
|
|
|
<input id="stressGetVersionBT" type="checkbox" title="Get version?" />
|
|
|
|
<label for="stressGetVersionBT">Get version?</label>
|
|
|
|
<input id="stressDiscoverBT" type="checkbox" title="Discover?" />
|
|
|
|
<label for="stressDiscoverBT">Discover?</label>
|
|
|
|
<input id="stressConnectBT" type="checkbox" title="Connect?" />
|
|
|
|
<label for="stressConnectBT">Connect?</label>
|
|
|
|
</fieldset>
|
2018-05-16 13:55:32 -07:00
|
|
|
<div>
|
2018-05-21 07:57:27 -05:00
|
|
|
<input id="peripheralId" value="0016533d0504" type="text" placeholder="Peripheral id">
|
2018-05-21 08:34:37 -05:00
|
|
|
<button id="connectBT">Make friends</button>
|
2018-05-16 13:55:32 -07:00
|
|
|
</div>
|
|
|
|
<div>
|
2018-05-21 08:34:37 -05:00
|
|
|
<input id="messageBody" style="width:20em;" value="DQAAAAAEAJkdAAAAAgFg" type="text" placeholder="data">
|
2018-05-16 13:55:32 -07:00
|
|
|
<button id="send">Converse!</button>
|
2018-05-21 08:34:37 -05:00
|
|
|
<button id="beep">Yell</button>
|
2018-05-16 13:55:32 -07:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
<script>
|
2022-11-04 19:49:55 -07:00
|
|
|
self.module = { exports: {} }; // Hack to allow `module.exports` in the scripts from scratch-vm
|
|
|
|
self.Scratch = self.Scratch || {}; // Container for semi-global objects in this playground
|
2022-04-01 15:49:18 -07:00
|
|
|
</script>
|
|
|
|
<!-- Non-Safari WebSocket support, borrowed from scratch-vm -->
|
|
|
|
<script src="./node_modules/scratch-vm/src/util/jsonrpc.js"></script>
|
|
|
|
<script src="./node_modules/scratch-vm/src/util/scratch-link-websocket.js"></script>
|
2022-08-10 09:45:52 -07:00
|
|
|
<!-- Safari WebExtension support: this script is injected by the Safari extension if it's active -->
|
|
|
|
<script id="scratch-link-extension-script"></script>
|
2022-04-01 15:49:18 -07:00
|
|
|
<!-- Playground-specific code -->
|
2022-11-04 19:49:55 -07:00
|
|
|
<script src="./playground.js"></script>
|
2018-05-16 13:55:32 -07:00
|
|
|
</body>
|
2018-03-08 11:34:58 -08:00
|
|
|
</html>
|