|
@@ -99,47 +99,46 @@ var cUrl = "ws://192.168.198.82:9100/card?cardIp=" + data.ip
|
|
|
// data.port + "&sn=" + data.sn
|
|
|
// }
|
|
|
console.log(cUrl, 'curl')
|
|
|
-// var cUrl = Number(data.clientType) === 3? "ws://"+urlss+"/authControlWebSocket?"+"clientType="+data.clientType+"&username="+data.username+"&userCardId="+data.userCardId : "ws://"+urlss+"/controlWebSocket?"+"clientType="+data.clientType+"&cardIp="+data.cardIp+"&port="+data.port+"&sn="+data.sn
|
|
|
-var wsss = new WebSocket(cUrl);
|
|
|
-console.log('wsssss==============', wsss)
|
|
|
-wsss.binaryType = 'arraybuffer';
|
|
|
-////
|
|
|
-// wsss = new WebSocket(
|
|
|
-// "ws://14.215.128.96/authControlWebSocket?clientType=3&username=WqXTc1593762177&userCardId=377");
|
|
|
-
|
|
|
-wsss.onopen = function() {
|
|
|
- console.log("onopen==============");
|
|
|
- var pings = {
|
|
|
- "event": "getScreenStatus"
|
|
|
- }
|
|
|
- wsss.send(JSON.stringify(pings));
|
|
|
- var bitRate = {
|
|
|
- "data": {
|
|
|
- "bitRate": 2243000
|
|
|
- },
|
|
|
- "event": "bitRate"
|
|
|
- }
|
|
|
- console.log('打开安卓卡wsss.onopen========', data.sn)
|
|
|
- // wsss.send(JSON.stringify(bitRate));
|
|
|
- wsss.send(ExexuteMove(JSON.stringify(bitRate), data.sn))
|
|
|
-};
|
|
|
-wsss.onmessage = function(event) {
|
|
|
- // console.log("onMessage==============", event);
|
|
|
- // var resets = JSON.parse(event.data)
|
|
|
- // var resets = event.data;
|
|
|
- // resets.errorMsg && alert(resets.errorMsg)
|
|
|
- // resolving = resets.data.orientation
|
|
|
- // if (resolving == 1) {} else {}
|
|
|
- // console.log('>>>resolvingresolvingresolving', resolving)
|
|
|
-
|
|
|
-};
|
|
|
-wsss.onclose = function(event) {
|
|
|
- alert("websocket连接断开");
|
|
|
- console.log("onclose==============");
|
|
|
-};
|
|
|
-wsss.onerror = function(event) {
|
|
|
- console.log("onerror==============");
|
|
|
-};
|
|
|
+
|
|
|
+doConnect();
|
|
|
+
|
|
|
+function doConnect() {
|
|
|
+ var wsss = new WebSocket(cUrl);
|
|
|
+ wsss.binaryType = 'arraybuffer';
|
|
|
+
|
|
|
+ wsss.onopen = function() {
|
|
|
+ var pings = {
|
|
|
+ "event": "getScreenStatus"
|
|
|
+ }
|
|
|
+ wsss.send(JSON.stringify(pings));
|
|
|
+ var bitRate = {
|
|
|
+ "data": {
|
|
|
+ "bitRate": 2243000
|
|
|
+ },
|
|
|
+ "event": "bitRate"
|
|
|
+ }
|
|
|
+ console.log('打开安卓卡wsss.onopen========', data.sn)
|
|
|
+ // wsss.send(JSON.stringify(bitRate));
|
|
|
+ wsss.send(ExexuteMove(JSON.stringify(bitRate), data.sn))
|
|
|
+ };
|
|
|
+ wsss.onmessage = function(event) {
|
|
|
+ // console.log("onMessage==============", event);
|
|
|
+ // var resets = JSON.parse(event.data)
|
|
|
+ // var resets = event.data;
|
|
|
+ // resets.errorMsg && alert(resets.errorMsg)
|
|
|
+ // resolving = resets.data.orientation
|
|
|
+ // if (resolving == 1) {} else {}
|
|
|
+ // console.log('>>>resolvingresolvingresolving', resolving)
|
|
|
+
|
|
|
+ };
|
|
|
+ wsss.onclose = function(event) {
|
|
|
+ alert("websocket连接断开");
|
|
|
+ doConnect();
|
|
|
+ };
|
|
|
+ wsss.onerror = function(event) {
|
|
|
+ console.log("onerror==============");
|
|
|
+ };
|
|
|
+}
|
|
|
$('#box').on("click", function() {
|
|
|
|
|
|
draw_graph('pencil', this)
|