|
@@ -6,8 +6,8 @@ import { clearCache, upload, pythonupload, pythonuploadfile, pythonreset, getmcn
|
|
|
import errHandler from './error_handle';
|
|
|
import SerialPort from 'serialport';
|
|
|
|
|
|
-//var request = require('request');
|
|
|
-//var querystring = require('querystring');
|
|
|
+var request = require('request');
|
|
|
+var querystring = require('querystring');
|
|
|
|
|
|
/* ************ Functions ************ */
|
|
|
|
|
@@ -423,7 +423,7 @@ app.post('/pythonuploadfilebyfile', (req, res) => {
|
|
|
// res.status(401).send('disconnection');
|
|
|
});
|
|
|
|
|
|
-//获取参数使用
|
|
|
+// //获取参数使用
|
|
|
// us.getParm = function (req, cb) {
|
|
|
|
|
|
// }
|
|
@@ -528,37 +528,37 @@ app.post('/testSerialPort', (req, res) => {
|
|
|
|
|
|
});
|
|
|
|
|
|
-//clearCache();
|
|
|
+clearCache();
|
|
|
|
|
|
//codingagent
|
|
|
-function CodingAlive() {
|
|
|
- // setInterval(function () {
|
|
|
- // netRequest('/plugin/alive', { "PluginID": "CocoRoboX" })
|
|
|
- // }, 1500)
|
|
|
- // netRequest('/plugin/alive', { "PluginID": "CocoRoboX" });
|
|
|
-}
|
|
|
-
|
|
|
-//CodingAlive();
|
|
|
-
|
|
|
-function netRequest(p, j) {
|
|
|
- // var contents = querystring.stringify(j);
|
|
|
- // var contents = JSON.stringify(j)
|
|
|
- // var options = {
|
|
|
- // url: "http://127.0.0.1:8991" + p,
|
|
|
- // method: 'POST',
|
|
|
- // headers: {
|
|
|
- // 'Content-Type': 'text/plain'
|
|
|
- // },
|
|
|
- // body: contents
|
|
|
- // }
|
|
|
- // try {
|
|
|
- // request(options, function (error, response) {
|
|
|
- // if (error) throw new Error(error);
|
|
|
- // });
|
|
|
- // }
|
|
|
- // catch (e) {
|
|
|
+// function CodingAlive() {
|
|
|
+// setInterval(function () {
|
|
|
+// netRequest('/plugin/alive', { "PluginID": "CocoRoboX" })
|
|
|
+// }, 1500)
|
|
|
+// netRequest('/plugin/alive', { "PluginID": "CocoRoboX" });
|
|
|
+// }
|
|
|
|
|
|
- // }
|
|
|
-}
|
|
|
+// CodingAlive();
|
|
|
+
|
|
|
+// function netRequest(p, j) {
|
|
|
+// var contents = querystring.stringify(j);
|
|
|
+// var contents = JSON.stringify(j)
|
|
|
+// var options = {
|
|
|
+// url: "http://127.0.0.1:8991" + p,
|
|
|
+// method: 'POST',
|
|
|
+// headers: {
|
|
|
+// 'Content-Type': 'text/plain'
|
|
|
+// },
|
|
|
+// body: contents
|
|
|
+// }
|
|
|
+// try {
|
|
|
+// request(options, function (error, response) {
|
|
|
+// if (error) throw new Error(error);
|
|
|
+// });
|
|
|
+// }
|
|
|
+// catch (e) {
|
|
|
+
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
window.serial = debugTool();
|