Sending exit command on closing configurator.

10.3.x-maintenance
Roeland Lutters 2015-01-10 22:01:02 +01:00
parent 91a63e05cf
commit 71008b6aad
2 changed files with 19 additions and 6 deletions

View File

@ -27,10 +27,23 @@ function startApplication() {
if (connectionId && valid_connection) {
// code below is handmade MSP message (without pretty JS wrapper), it behaves exactly like MSP.send_message
// sending exit command just in case the cli tab was open.
// reset motors to default (mincommand)
var bufferOut = new ArrayBuffer(22),
bufView = new Uint8Array(bufferOut),
checksum = 0;
var bufferOut = new ArrayBuffer(5);
var bufView = new Uint8Array(bufferOut);
bufView[0] = 0x65; // e
bufView[1] = 0x78; // x
bufView[2] = 0x69; // i
bufView[3] = 0x74; // t
bufView[4] = 0x0D; // enter
chrome.serial.send(connectionId, bufferOut, function () { console.log('Send exit') });
bufferOut = new ArrayBuffer(29);
bufView = new Uint8Array(bufferOut);
var checksum = 0;
bufView[0] = 36; // $
bufView[1] = 77; // M

6
main.html Normal file → Executable file
View File

@ -1,12 +1,12 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="cTn" />
<link type="text/css" rel="stylesheet" href="./main.css" media="all" />
<link type="text/css" rel="stylesheet" href="./js/libraries/jquery.nouislider.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="./js/libraries/jquery.nouislider.pips.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="./js/libraries/jquery.nouislider.min.css">
<link type="text/css" rel="stylesheet" href="./js/libraries/jquery.nouislider.pips.min.css">
<link type="text/css" rel="stylesheet" href="./tabs/landing.css" media="all" />
<link type="text/css" rel="stylesheet" href="./tabs/setup.css" media="all" />